dbpedia

Federation query on Dbpedia and Wikidata

江枫思渺然 提交于 2019-12-24 20:44:44
问题 I'm doing federation query exercise. I want the list of films that stars with leonardio di caprio and also the list of directors that worked with him. I have to design federated SPARQL query over Wikidata and Dbpedia. I have to run the query through FEDx. Here's the query. This is done in Eclipse. Also tested on the wikidata endpoint. PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http:/

Querying DBpedia-Live with SPARQL does not give same answer as DBpedia

[亡魂溺海] 提交于 2019-12-24 20:24:56
问题 I want to query DBpedia with DBpedia Live endpoint. I have this query : SELECT * WHERE { ?x a dbo:Person . ?x rdfs:label "Usain Bolt"@en . } This query gives the correct answer with most names I tried (for example “Teddy Riner"@en ) but it fails with Usain Bolt and Rachid Badouri. I don’t get why as their DBpedia pages (Teddy Riner, Usain Bolt) are constructed the same way: they both have a rdfs:label , which is written exactly like I did. It seems to me that there is an incoherence between

Extract Graph from DBpedia, by number of HOPS, Direction

我的梦境 提交于 2019-12-24 18:58:15
问题 In the above graph [which is in dbpedia], I want to extract information about TIM COOK, with hops, IF I put hop as 1, I would need all the first level information about TIM COOK, like Masters, APPLE, Car If hops are 2, I need Masters, APPLE, Car, United States Is there any way I could extract such graph ? I would like to pass direction (Incoming, Outgoing) also to extract graph. Could you please help me with SPARQL query? 来源: https://stackoverflow.com/questions/54774104/extract-graph-from

Select DBpedia resource with at least N occurrences of seleted word in abstract?

我与影子孤独终老i 提交于 2019-12-24 13:55:59
问题 I have this request that results some DBpedia resources and their abstracts. How can I filter the results to get just the resources whose abstracts contain at least a certain number of occurrences of a particular word? PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dbpedia-owl:<http://www.dbpedial.org/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> select distinct ?resource ?url ?resume where { ?resource rdfs:label ?Nom.

Querying DBPedia for entities having a given set of properties

强颜欢笑 提交于 2019-12-24 13:26:14
问题 I have a list of somewhere between 5 and 100 properties and want to query for any entities having these properties (not interested in the values), ranged by most matches. How can this be achieved with a SPARQL query? For instance, say I have the following properties: dbpedia-owl:country dbpedia-owl:elevation dbpedia-owl:leader dbpprop:area dbpprop:flag dbpprop:name … The query should return all resources having values for all of these these properties, as well as resources that match just

Getting dbpedia results with optional properties

↘锁芯ラ 提交于 2019-12-24 13:25:42
问题 I'm building an app which shows information about entities of a given text. I'm using a sparqlwrapper library for Python to query DBpedia. I'm using the following code when I get a Person entity: def get_person_data(einfo): data = {} try: uri = einfo['disambiguated']['dbpedia'] sparql = SPARQLWrapper("http://dbpedia.org/sparql") query = u""" SELECT ?birthDate, ?birthName, ?birthPlace WHERE { <%s> dbpprop:birthDate ?birthDate ; dbpprop:birthName ?birthName ; dbpprop:birthPlace ?birthPlace } ""

Extract statistical information from Wikipedia article

十年热恋 提交于 2019-12-24 09:57:56
问题 I'm currently extracting data from DBpedia articles using a SPARQLWrapper for python, but I can't seem to find how to extract the number of watchers (and other statistical information) for a given article. Is there an easy way to achieve this? I don't mind if it's through DBpedia, or directly through wikipedia (using wget, for example). Thanks for any advice. 回答1: It shell be prohibited to get the number of watchers for every arbitrary article, as it is considered to be a security leak if

SPARQL query returns multiple birth dates for same person

核能气质少年 提交于 2019-12-24 07:25:09
问题 I am learning SPARQL and dbpedia by working through the queries in https://www.joe0.com/2014/09/22/how-to-use-sparql-to-query-dbpedia-and-freebase/ . I am testing a query to return John Lennon's date of birth and I am running my queries in http://dbpedia.org/sparql . The query is: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> SELECT DISTINCT ?x0 ?x1 WHERE { ?x0 rdf:type foaf

constructing graph using rdflib for the outputs from sparql 'SELECT' query with sparqlWrapper

廉价感情. 提交于 2019-12-24 05:59:46
问题 I am trying to construct a graph out of the results from SPARQL query. For the purpose of the query construction, I'm using SparqlWrapper and DBpedia as the knowledge base. from SPARQLWrapper import SPARQLWrapper, JSON from rdflib import Namespace, Graph, URIRef from rdflib.namespace import RDF, FOAF g = Graph() name = "Asturias" #labelName = URIRef("<http://dbpedia.org/resource/" + name +">") sparql = SPARQLWrapper("http://dbpedia.org/sparql") sparql.setQuery(""" PREFIX rdfs: <http://www.w3

constructing graph using rdflib for the outputs from sparql 'SELECT' query with sparqlWrapper

↘锁芯ラ 提交于 2019-12-24 05:59:21
问题 I am trying to construct a graph out of the results from SPARQL query. For the purpose of the query construction, I'm using SparqlWrapper and DBpedia as the knowledge base. from SPARQLWrapper import SPARQLWrapper, JSON from rdflib import Namespace, Graph, URIRef from rdflib.namespace import RDF, FOAF g = Graph() name = "Asturias" #labelName = URIRef("<http://dbpedia.org/resource/" + name +">") sparql = SPARQLWrapper("http://dbpedia.org/sparql") sparql.setQuery(""" PREFIX rdfs: <http://www.w3