sparql

converting freebase MQL to SPARQL

落花浮王杯 提交于 2019-12-06 05:15:03
问题 following freebase MQL finds 5 artists and 50 albums for each artists. [{ "type" : "/music/artist", "name":null, "album" : [{ "name" : null, "count":null, "limit":50 }], "limit":5 }] first try - without a subquery I can write SPARQL like this: SELECT ?artist ?album WHERE { ?artist :type :/music/artist . ?artist :album ?album } LIMIT n but, I don't know how many n should be specified because SPARQL has no hierarchy as far as I know. second try - with a sub-query (not sure this works correctly)

DBpedia Query: SnorQL VS SparQL VS QueryBuilder?

99封情书 提交于 2019-12-06 05:13:57
What are http://dbpedia.org/snorql/ and http://dbpedia.org/sparql/ and http://querybuilder.dbpedia.org/ ? Both SnorQL VS SparQL seems to run the following code similarly : SELECT ?resource ?value WHERE { ?resource a <http://dbpedia.org/class/yago/CitiesAndTownsInDenmark> . ?resource <http://dbpedia.org/property/populationTotal> ?value . FILTER (?value > 100000) } ORDER BY ?resource ?value They are (different) user interfaces that let you build and execute SPARQL queries on the DBpedia SPARQL endpoint http://dbpedia.org/sparql/ . The results should be the same in all three environments, because

How to get abstract and thumbnail of a Wikipedia article from article DBPedia?

半城伤御伤魂 提交于 2019-12-06 05:04:54
问题 I am new to SPARQL. With this query, I can get the birthName of Ernest Hemingway: select distinct ?birthName where { ?person a dbpedia-owl:Person . ?person dbpprop:birthName ?birthName . FILTER (regex(?birthName, "Ernest Miller Hemingway")) } LIMIT 1 Is there a way I can get the wikipedia abstract/introduction and thumbnail of Ernest Hemingway with DBPedia? 回答1: In general, the best way to start querying DBpedia if you already have an idea what you're looking for is to look at the page for

SPARQL query to find all sub classes and a super class of a given class

爷,独闯天下 提交于 2019-12-06 04:30:50
问题 I need to write a SPARQL query to find a superclass/subclasses of a given class. For example, given http://139.91.183.30:9090/RDF/VRP/Examples/Phenomenon.rdf RDFS vocabulary file, I want to find the superclass of 'AcousticWave' (which is 'Wave'). Similarly if user enters 'Wave', I want to get all sub classes of 'Wave' (which are 'AcousticWave', 'GravityWave', 'InternalWave' and Tide'). How would I write such SPARQL query? 回答1: The predicate used in rdfs for state sub/super class relationships

How to find cities with more than X population in a certain country

混江龙づ霸主 提交于 2019-12-06 04:26:49
问题 I'm trying to find cities in Denmark with more than 100 000 in population. I can find all the cities in Denmark with this code: SELECT ?s ?o WHERE { ?s a <http://dbpedia.org/class/yago/CitiesAndTownsInDenmark> } And with this code I can find cities with more than 100 000 in population: SELECT ?resource ?value WHERE { ?resource <http://dbpedia.org/property/populationTotal> ?value FILTER (?value > 100000) } ORDER BY ?resource ?value I would appreciate help about how to combine these queries.

dbpedia SPARQL query to get certain value's for a given city

落花浮王杯 提交于 2019-12-06 03:48:05
I am sure what I want to do is very easy, yet I cannot seem to get the query right. I have records in dataset which have values such as city name e.g. 'New York' and it's corresponding country code e.g 'US'. I also have access to the full country name and country ISO codes. I would like to get the population and abstract value's for these cities off dbpedia, by using a where clause such as: Get population where name = "New York" and isoCountryCode = "US" I've searched for help on this to no avail. so far I have been kindly helped by @rohk with this query, which does not fully work for all

Meaning of square brackets “[]” when querying RDF with SPARQL?

风格不统一 提交于 2019-12-06 02:46:45
问题 I am pretty new to SPARQL and RDF and I was wondering what exactly does the below mean in SPARQL? [] vc:n ?vcard . The complete query is PREFIX vc: <http://www.w3.org/2006/vcard/ns#> SELECT ?given ?family WHERE{ [] vc:n ?vcard . OPTIONAL {?vcard vc:given-name ?given .} OPTIONAL {?vcard vc:family-name ?family .} } 回答1: This is cannibalized from my answer to What are brackets in SPARQL and why is the linked movie database limited to 2500 records?, of which this question may be a duplicate,

Generate Graph with sub-Graphs using sparql

跟風遠走 提交于 2019-12-06 02:05:49
I have the following situation in my RDF-store: Named Graph: A S1 P1 O1 Named Graph: B S2 P2 O1 Named Graph: C S3 P3 O1 I now want to define a SPARQL Query which finds all Graphs where O1 is in the tripples, and stores those 3 Graphs + the tripples in a new Graph with the name A+B+C NEW Named Graph: A+B+C Named Graph: A S1 P1 O1 Named Graph: B S2 P2 O1 Named Graph: C S3 P3 O1 With Construct or insert Into i only found out how to build a graph out of tripples, bzw not how to build a graph which contains graphs? Is this possible, if yes how? Tank you You can't do exactly what you want because

Can I combine local and remote dataset within SPARQL query?

a 夏天 提交于 2019-12-06 02:01:00
问题 I've been reading about SPARQL and RDF and please correct me if my reasoning about these technologies is wrong here. Assuming that we have a local SPARQL database called LOCAL.. and url to remote RDF file called URL_RDF. Can I write a script lets say in PHP which will do a SPARQL query like this ? Pseudo code. SELECT * FROM LOCAL,URL_RDF WHERE LOCAL.id=URL_RDF.id In other words can I combine sources within SPARQL query like this (remote file + local db) ? 回答1: You can do this using the

Sparql query running forever

…衆ロ難τιáo~ 提交于 2019-12-06 01:52:26
问题 I'm struggling with the execution of a SPARQL query in Jena, with a resulting behaviour that I don't understand... I'm trying to query the Esco ontology (https://ec.europa.eu/esco/download), and I'm using TDB to load the ontology and create the model (sorry if the terms I use are not accurate, I'm not very experienced). My goal is to find a job position uri in the ontology that matches with the text I have previously extracted: ex: extracted term : " acuponcteur " -> label in ontology: