sparql

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

RDF file not uploaded in virtuoso

余生颓废 提交于 2019-12-24 18:22:36
问题 I am trying to single upload an .rdf file to virtuoso with the ld_dir command, as follows: ld_dir('/home', 'filename.rdf', 'http://domain.example/TEST'); The operation seems to be done, although it takes 1 msec; which is not logical.. however when I try to view the content of the grapgh using: SELECT * FROM <http://domain.example/TEST> WHERE {?p ?o ?s} it just does not display any results. Performing the same query on another graph brings out results. 回答1: ld_dir command will only bring RDF

SPARQL INSERT not working with PUT method. why?

久未见 提交于 2019-12-24 16:35:26
问题 I am trying to create a new object with PUT method and to add some of my own prefixes with SPARQL query. But, the object is being created without the added prefixes. It works with POST and PATCH though. Why and is there alternative way for SPARQL to use with PUT method and add using user-defined prefixes? PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX indexing: <http://fedora.info/definitions/v4/indexing#> DELETE { } INSERT { <>

Finding the relative position of elements in a list using SPARQL

我与影子孤独终老i 提交于 2019-12-24 16:25:07
问题 I'm trying to return subjects based on the relative position of their subjects in an ordered list. A subject can be associated with multiple objects (via a single predicate) and all objects are in an ordered list. Given a reference object in this list I'd like to return the subjects in order of relative distance of their objects from the reference object. :a : :x :b : :v :b : :z :c : :v :c : :y :ls :list (:v :w :x :y :z) Taking x as our starting object in the list, the code below returns :a

Compare average - SPARQL

爱⌒轻易说出口 提交于 2019-12-24 15:05:12
问题 There is a dataset of users ranking movies. Need to find the users with similar taste to user1. Similar taste defined as follows: consider the average rank for genre from user1 as avgr1 and for the same genre from user2 as avgr2 , then user1 and user2 have similar taste is abs(avgr1-avgr2)<1 . So far I was able to get the names, the genre and the absolute value between averages, but the filtering for comparison is not working. SELECT ?p ?p1 ?genre (abs (AVG(?rating)-AVG(?ratingp1)) AS ?RDiff)

Summer in Greece, vol.2

早过忘川 提交于 2019-12-24 14:28:43
问题 Following this qeustion: Summer in Greece with SPARQL, since my memory runs out when executing this query, I would like to constrain the query between two regional units, but I can't group them: SELECT * #?municipality (?bwCount1+?bwCount2 as ?bwCount) WHERE { { SELECT (COUNT(?bw) as ?bwCount1) WHERE { ?regional_unit geo:έχει_επίσημο_όνομα "ΠΕΡΙΦΕΡΕΙΑΚΗ ΕΝΟΤΗΤΑ ΗΡΑΚΛΕΙΟΥ" . ?municipality1 geo:ανήκει_σε ?regional_unit . ?municipality1 geo:έχει_γεωμετρία ?geometry . ?bw geos:hasGeometry ?bw_geo

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 } ""

Sparql multi lang data compression to one row

我是研究僧i 提交于 2019-12-24 12:04:40
问题 I'd like to select data property values using sparql with some restrictions on their languages: I have an ordered set of preferred languages ("ru", "en", ... etc ) If an item have more than one language for value, I'd like to have only one value restricted by my set of languages (if ru is available - I want to see ru value, else if en available I want to see en else if ... etc if no lang available - no lang value). Current query is: select distinct ?dataProperty ?dpropertyValue where { <http: