sparql

SPARQL query to retrieve countries population from DBpedia

僤鯓⒐⒋嵵緔 提交于 2020-01-04 09:17:14
问题 I have developed the following SPARQL query to get a list of countries with its population from DBpedia. I use the union clauses to identify which resources are current countries because the information is inconsistent between the different countries, for example there are different standards for country codes and some of them don't even have one. Now the problem that I have is that some of the countries have a dbpprop:populationEstimate property but others have dbpprop:populationCensus and I

SPARQL query to retrieve countries population from DBpedia

早过忘川 提交于 2020-01-04 09:17:05
问题 I have developed the following SPARQL query to get a list of countries with its population from DBpedia. I use the union clauses to identify which resources are current countries because the information is inconsistent between the different countries, for example there are different standards for country codes and some of them don't even have one. Now the problem that I have is that some of the countries have a dbpprop:populationEstimate property but others have dbpprop:populationCensus and I

SPARQL query returns different results depending on the order of statements

笑着哭i 提交于 2020-01-04 07:38:07
问题 I have a SPARQL query which returns the most specific common classes of two resources. When I try to run it on https://dbpedia.org/sparql, sometimes it returns nothing, and other times it returns the classes I want. I have noticed it is related to the order of the statements in the query. This is not a desirable behavior because, when I execute the query, I expect it to have the same results regardless of the order in which I input the URIs of the resources. Has anyone experienced this

Can't get INSERT to work in SPARQLWrapper

别说谁变了你拦得住时间么 提交于 2020-01-04 06:58:14
问题 I've been trying to get SPARQLWrapper to insert a simple triple into GraphDB with no success. I have no trouble with select queries. Here's Python test code that fails: db = sparqlw.SPARQLWrapper(endpoint) query = ''' INSERT {<http://example.com/123456789876> a owl:Thing .} WHERE {} ''' db.setQuery(query) db.method = sparqlw.POST db.setReturnFormat(sparqlw.JSON) db.queryType= sparqlw.INSERT result = db.query() It returns these errors: "urllib.error.HTTPError: HTTP Error 400: Bad Request" and

Getting list of persons using SPARQL dbpedia

廉价感情. 提交于 2020-01-04 02:42:07
问题 I am using live-dbpedia to retrieve the list of persons. I am executing a sparql query on live-dbpedia endpoints to get the result.I have fixed the offset and limit value in the query and getting the records after each 10000 attempt . But when I was trying to execute at 580000 offset value , 504 Gateway Time-out error happens. Not Working SPARQL Query: SELECT DISTINCT ?dbpedia_link str(?name) as ?label str(?label1) as ?label1 ?freebase_link WHERE { ?dbpedia_link rdfs:label ?label1 . ?dbpedia

Datatype format exception for xsd:dateTime in SPARQL query with Jena?

你离开我真会死。 提交于 2020-01-04 01:58:17
问题 I am trying to apply a range query on a property of the RDF which is of xsd:dateTime format. This is my query: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?x WHERE { ?y <DATE:> ?x . FILTER(?x>"2014-06-05T10:10:10+0530"^^xsd:dateTime) } It gives warning and nothing as result: WARN [main] (Log.java:78) - Datatype format exception: "2014-06-11T12:44:22+0530"^^xsd:dateTime I don't understand what the problem is? I have stored the property in xsd:dateTime format only. 回答1: I have stored

How to perform arithmetic operations in Sparql with python?

一笑奈何 提交于 2020-01-03 18:53:34
问题 I am writting a public domain calculator, whose code is available at: https://github.com/okfn/pdcalc/blob/master/pd/map.rdf The code is currently unable to properly determine the public domain status of a work because of an issue that has been encountered with sparql 1.0: it does not appear to be possible to perform arithmetic operation on dates, which means that the calculator cannot determine e.g. whether or not the work has been published 70 years after the death of the author.

dbpedia SPARQL query for finding artist properties

房东的猫 提交于 2020-01-03 15:55:22
问题 I'm trying to get details about an artist via DBPedia and the SPARQL query language, however, it seems almost impossible (with my understanding) of how to get certain pieces of information. I'm trying to get an Artist and pull information such as their Hometown. I'm guessing the query should be something similar to that of: SELECT ?c WHERE { ?b <http://dbpedia.org/property/Artist> <http://dbpedia.org/resource/Arctic_Monkeys>. ?b <http://www.w3.org/2002/07/owl#ObjectProperty> <http://dbpedia

Use Jena to query wikidata

前提是你 提交于 2020-01-03 08:56:12
问题 Currently, Wikidata has a SPARQL endpoint "https://query.wikidata.org/", I would like to query this site using Jena (3.0.1), I use the following code but I got an error message " Endpoint returned Content-Type: text/html which is not currently supported for SELECT queries ". Is there a way to solve it? the same code works fine with dbpedia. Thanks queryString = "PREFIX bd: <http://www.bigdata.com/rdf#>\n" + "PREFIX wikibase: <http://wikiba.se/ontology#>\n" + "PREFIX wdt: <http://www.wikidata

DBpedia Sparql by page template

混江龙づ霸主 提交于 2020-01-03 04:42:06
问题 I am trying to run a query on dbpedia using SPARQL syntax, to look for all pages of a certain template. Doesn't seem to be work, I am looking for all pages with dbpprop:wikiPageUsesTemplate. Does anyone know how to correct this to properly look for templates? SELECT ?name ?member_Of ?country ?lat ?lng ?link WHERE { ?x dbpprop:wikiPageUsesTemplate "dbpedia:Template:Infobox_settlement" . ?x a <http://dbpedia.org/ontology/Settlement> . ?x foaf:name ?name . ?x dbpedia-owl:isPartOf ?member_Of. ?x