sparql

sparql how to group correctly this data

拈花ヽ惹草 提交于 2019-12-25 06:59:40
问题 First of all, I didn't make a minimum example because i think that my problem can be understood without it. Second, I didn't give you the data because i think that my problem can be solved without it. However, I'm open to give it to you if you ask. This is my query: select distinct (?x as ?likedItem) (?item as ?suggestedItem) ?similarity ?becauseOf ((?similarity * ?importance * ?levelImportance) as ?finalSimilarity) { values ?user {bo:ania} #the variable ?x is bound to the items the user

How to POST SPARQL to Virtuoso?

心已入冬 提交于 2019-12-25 04:11:39
问题 I am using two different HTTP POST utilities (poster out of Firefox as well as Python requests API) to post a simple SPARQL insert to Virtuoso . My URL is: http://localhost:8890/sparql My request parameters are: default-graph-uri: <MY_GRAPH> should-sponge: soft debug: on timeout: format: application/xml save: display fname: I put the actual SPARQL ( INSERT DATA { GRAPH... ) in the content of the message. I tried different content types, none of which worked. I do get 200 but the response is

SPARQL INSERT/DELETE

强颜欢笑 提交于 2019-12-25 03:43:01
问题 I need some help to write my update query. DELETE { ?contactInfo vivo:freeTextValue5 ?o . } INSERT { ?contactInfo vivo:freeTextValue5 "new_url"^^<http://www.w3.org/2001/XMLSchema#string> . } WHERE { ?contactInfo vivo:freeTextValue5 "old_url"^^<http://www.w3.org/2001/XMLSchema#string> . } Can you please let me know what is wrong with this "update" query? 回答1: I'm guessing that your problem is that this update adds a new triple, but does not remove the old one. The reason is that your DELETE

Finding corresponding State for POIs using skos:broader

牧云@^-^@ 提交于 2019-12-25 03:34:04
问题 I am trying to collect POIs per State in the United States. The original query was select distinct ?s ?state where { ?s a dbpedia-owl:Place; dcterms:subject/skos:broader{,9} ?state . ?state skos:broader category:Buildings_and_structures_in_the_United_States_by_state . filter contains(str(?state),'_in_') . filter(!contains(str(?state),'United_States')) } The filter portion was to find the US states(shown below) such that, at the end we know each POI belongs to what state. The approach did not

Querying the shared nodes in a RDF graph

断了今生、忘了曾经 提交于 2019-12-25 03:22:53
问题 I have a graph of RDF data, that is the result of a SPARQL query in rdflib , but this question is valid just on any endpoint too. The graph looks like the picture below. I want to find a way to query the nodes that are shared between two clusters. Those are basically the nodes that are: Subject to two objects Object to two subjects Object to a subject, and, then subject to another object I tried with Graph.subjects() and Graph.objects() on rdflib it seems to me that they are only iterable and

How to write Jena rule to query class and get individuals for a property

久未见 提交于 2019-12-25 01:15:00
问题 How to extract all actuators that are switched off when there are no users at home. I tried to write Jena rule but am unable to get proper output. I have added desired result that I want. Need help with writing rule. [rule1: noValue(:users :hasLocation :home) -> (:actuators :hasLocation :home) (:actuators :state "OFF"^^xsd:boolean)] [rule2: noValue(:users :hasLocation :home) -> (?x rdf:type :actuators) (?x :hasLocation :home) (?x :state "OFF"^^xsd:boolean)] { rulex: [noValue(:subject1

Federated SPARQL query in dbpedia and wikidata: Few questions

让人想犯罪 __ 提交于 2019-12-25 00:28:24
问题 I have following query: # endpoint used: https://query.wikidata.org/ # # PREFIX wd: <http://www.wikidata.org/entity/> # PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbp: <http://dbpedia.org/resource/> SELECT DISTINCT ?musicianLabel WHERE { { # *** dbpedia *** SERVICE <http://dbpedia.org/sparql> { #SERVICE <http://lod.openlinksw.com/sparql> { ?musician a dbo:Person . { # person, who has musical genre xy ?musician dbo:genre ?genre . }

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:/

Some cities aren't instances of city or big city? Odd behaviour of Wikidata

别说谁变了你拦得住时间么 提交于 2019-12-24 20:27:00
问题 While examining the results of the official example query "Continents, countries, regions and capitals" (on https://query.wikidata.org/, limited to Germany for your convenience here: link), I noticed that some capitals of German federal states were missing. For example Wiesbaden as capital of Hesse. I noticed that Wiesbaden is an instance of big city , but not of city (see https://www.wikidata.org/wiki/Q1721), in contrast to some other cities. I was able to alleviate the problem by also

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