dbpedia

sparql using wikiPageRedirects

半腔热情 提交于 2019-12-10 16:37:56
问题 I am using sparql to find a location of entity. I have urls from dbpedia-spootlight and want to find location for them. So the query I am using is: PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX dbo: <http://dbpedia.org/ontology/> SELECT DISTINCT * WHERE { ?uri rdfs:label ?label . OPTIONAL { ?uri geo:lat ?lat . ?uri geo:long ?long } . OPTIONAL { ?uri dbpedia-owl:country ?dbpediaContry . ?dbpediaContry dbpprop:cctld ?ccTLD } . FILTER (?uri = <URL> && lang(?label) = "en" ) } and

Ask if SPARQL resource exists

こ雲淡風輕ζ 提交于 2019-12-10 15:44:14
问题 What is a good way to check if a SPARQL resource exists? I'm searching for the equivalent of firing a HTTP GET request to e.g. http://dbpedia.org/resource/Game_of_Thrones and check the HTTP status code but I'd like to do it with a SPARQL query. I thought about something like this: ASK {<http://dbpedia.org/resource/Game_of_Thrones> a <http://dbpedia.org/resource/>} I'm sure there is a good way to do this but I can't find it. Note: I don't want to check for the existance of a specific triple. I

how to remove duplicates in sparql query

▼魔方 西西 提交于 2019-12-10 13:32:48
问题 I wrote this query and return list of couples and particular condition. ( in http://live.dbpedia.org/sparql) SELECT DISTINCT ?actor ?person2 ?cnt WHERE { { select DISTINCT ?actor ?person2 (count (?film) as ?cnt) where { ?film dbo:starring ?actor . ?actor dbo:spouse ?person2. ?film dbo:starring ?person2. } order by ?actor } FILTER (?cnt >9) } Problem is that some rows is duplicate. example: http://dbpedia.org/resource/George_Burns http://dbpedia.org/resource/Gracie_Allen 12 http://dbpedia.org

How to query a particular DBpedia Resource/Page for multiple entities?

别说谁变了你拦得住时间么 提交于 2019-12-10 12:17:03
问题 I have links to a number of DBpedia pages like: http://dbpedia.org/resource/Harry_Potter http://dbpedia.org/resource/Twilight_(series) http://dbpedia.org/resource/Bible http://dbpedia.org/resource/Manga I would like to get the Abstract and Thumbnail entities for each one of them. I can get them individually using: For Abstract: PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX res: <http://dbpedia.org/resource/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http:/

How to parameterize a SPARQL query in SWI Prolog?

偶尔善良 提交于 2019-12-10 11:42:10
问题 I am having difficulty making the following SPARQL query parametric. First I load the request library: ?- use_module(library(semweb/sparql_client)). % library(uri) compiled into uri 0.02 sec, 290,256 bytes % library(readutil) compiled into read_util 0.00 sec, 17,464 bytes % library(socket) compiled into socket 0.00 sec, 11,936 bytes % library(option) compiled into swi_option 0.00 sec, 14,288 bytes % library(base64) compiled into base64 0.00 sec, 17,912 bytes % library(debug) compiled into

Query dbpedia sparql endpoint using dotnetRDF - RDFParseException

≯℡__Kan透↙ 提交于 2019-12-10 10:03:29
问题 When I execute the following query on http://dbpedia.org/sparql using (dotnetRDF) VDS.RDF.Query.SparqlRemoteEndpoint.QueryWithResultSet() everything works fine. SELECT ?film ?p ?o WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Japanese_films> . ?film ?p ?o } limit 500 But when I try this query using SparqlRemoteEndpoint.QueryWithResultGraph() CONSTRUCT { ?film ?p ?o} WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category

Query for best match to a string with SPARQL?

你。 提交于 2019-12-09 18:22:38
问题 I have a list with movie titles and want to look these up in DBpedia for meta information like "director". But I have trouble to identify the correct movie with SPARQL, because the titles sometimes don't exactly match. How can I get the best match for a movie title from DBpedia using SPARQL? Some problematic examples: My List: "Die Hard: with a Vengeance" vs. DBpedia: "Die Hard with a Vengeance" My List: "Hachi" vs. DBpedia: "Hachi: A Dog's Tale" My current approach is to query the DBpedia

DBPedia: What's the meaning of '__1' (double underscores) in URIs?

痴心易碎 提交于 2019-12-08 19:36:32
问题 On DBPedia you can find a lot of URIs that containing double underscores and a number at the end, eg.: http://dbpedia.org/resource/Eric_Cheney__1 http://dbpedia.org/resource/Eli_Wallach__1 http://dbpedia.org/resource/Ed_Wood__1 http://dbpedia.org/resource/Francis_Ford_Coppola__1 Mostly these items are of the type PersonFunction, but I can't find any documentation on why these objects exist (and a person's function isn't an ObjectProperty?)... So why are these created? 回答1: After reading this

Unexpected NullPointerException while accessing results of a query [duplicate]

偶尔善良 提交于 2019-12-08 11:03:37
问题 This question already has an answer here : DBpedia Jena Query returning null (1 answer) Closed 6 years ago . I have this code and I don't understand why I'm getting a NullPointerException: public static ArrayList<String> retrieveObject(String istance,String property){ String sparqlQueryString= "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf- syntax-ns#> "+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "+ "PREFIX dbpedia: <http://dbpedia.org/resource/> "+ "PREFIX o: <http://dbpedia.org

How to form SPARQL queries that refers to multiple resources

▼魔方 西西 提交于 2019-12-08 09:27:09
问题 My question is a followup with my first question about SPARQL here. My SPARQL query results for Mountain objects are here. From those results I picked a certain object resource. Now I want to get values of " is dbpedia-owl:highestPlace of " records for this chosen Mountain object. That is, names of mountain ranges for which this mountain is highest place of . This is, as I figure, complex. Not only because I do not know the required syntax, but also I get two objects here. One of them is Mont