sparql

Comparing two SPARQL queries in Jena

天大地大妈咪最大 提交于 2019-12-12 02:08:23
问题 I want to know whether two SPARQL queries are logically equivalent, for e.g. suppose I have two queries as follows, how can I know if they are equivalent ? String query1= "SELECT ?name where { <http://www.example.com/P500> a <http://www.example.com/Parking>; " + "<http://www.example.com/name> ?name .}"; String query2= "SELECT ?name where { <http://www.example.com/P500> <http://www.example.com/name> ?name;" + " a <http://www.example.com/Parking> .}"; The codes below doesn't perform a logical

SPARQL query RDF ontology

筅森魡賤 提交于 2019-12-12 01:52:59
问题 Im trying this sparql query, but Im having trouble to find out whats wrong. I would like to take all the receipes that has those ingredients or less. ie: receipe 1: Tomato receipe 2: Tomato and salt receipe 3: Tomato, salt, onion. And I have the following query: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rec:<http://www.receta

SPARQL query returning incomplete/inconsistent results

时光怂恿深爱的人放手 提交于 2019-12-12 01:47:12
问题 I am trying to run the following query to get all the properties of a resource: select distinct ?property where { <http://dbpedia.org/resource/Bildøy> ?property ?value } on http://dbpedia.org/snorql/ However, I only get a few results, and not the ones I was expecting. Most of the properties on this page are missing http://dbpedia.org/page/Bild%C3%B8y Could this be because of the ø-letter in the URI? The query seems to be working fine with other resources, but having the same problem with

Obtaining start and end date from a DBPedia CareerStation

天涯浪子 提交于 2019-12-11 23:35:59
问题 I am trying to write a query that will return my all CareerStation objects that are associated with Arsenal FC. Then I want to be able to get the start and end dates of these CareerStations, currently I can only get the start date. It may be that only the start date is in the DB but this doesn't make much sense to me. Also I would like to know if there is a way of formatting the date so to remove the parts that aren't the actual year. Thanks in advance for any pointers. PREFIX p: <http:/

SPARQL functions in CONSTRUCT/WHERE

。_饼干妹妹 提交于 2019-12-11 22:42:27
问题 I mostly use SPARQL SELECT while working on a query for debugging purposes but in the end I want to use the final result it in a CONSTRUCT way; as I want to work with a graph and not key/value query results. What I don't get yet (and can't seem to find with search engines/docs) is if I can use functions as well that way. As an example, I use a property path to concatenate titles I get into a "superstring", which I later use for building a Lucene index to increase plain text search quality:

Sparql Insert Exception : SPARQLWrapper.SPARQLExceptions.QueryBadFormed

房东的猫 提交于 2019-12-11 22:07:46
问题 I have been having this weird issue, I am trying to insert into a virtuoso graph using SPARQLWrapper library in python. I am able to insert a triple via the browser based endpoint at localhost:8890\sparql , but when I try the same query via my python SparqlWrapper it throws the below error: SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: a bad request has been sent to the endpoint, probably the sparql query is bad formed. I feel there is something wrong at configuration end,

Matching optional triples without using OPTIONAL

喜夏-厌秋 提交于 2019-12-11 20:33:52
问题 I want to query records where not all records have all properties. Is it possible to get them with blank values by just using basic graph patterns in the query and without using optional ? 回答1: A variable has to be bound to some value in order for there to be a match. The exception is with optional . There you can get a match where it's optional for a particular pattern to have matched. If you want an optional variable for a match, you'll have to use optional . Technically, you could avoid

HTTP POST Request AngularJS

早过忘川 提交于 2019-12-11 20:21:19
问题 I'm actually working on a SparQL viewer but i got an issue with my POST request, someone can told me what's wrong ? var req = { method: 'POST', url: 'http://dbpedia.org/sparql', headers: { 'Content-type' : 'application/x-www-form-urlencoded', 'Accept' : 'application/sparql-results+json' }, data: { query : "SELECT * WHERE { <http://dbpedia.org/resource/Awolnation> ?pref ?obj } LIMIT 10", format: "sparql-results+json", timeout : 3000 } }; $http(req).success(function(data) { console.log(data); }

Select a property value from dbpedia resource with SPARQL

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 19:49:44
问题 i'm trying to use SPARQL query on DBpedia. I can retrieve all information about a resource with this query: PREFIX db: <http://dbpedia.org/resource/ PREFIX prop: <http://dbpedia.org/property/> PREFIX onto: <http://dbpedia.org/ontology/> SELECT ?property ?value WHERE { db:Luciano_Ligabue ?property ?value }; Now I want to retrieve the value of just one property such as dbpedia-owl: birthDate. I'm trying in different way, but i can't retrieve the information needed. Can someone help me, please?

SPARQL query equivalence

流过昼夜 提交于 2019-12-11 18:21:33
问题 Under the following context: // owl in terms of Java-like syntax Class Person {} Class GraduateStudent extends Person {reference takesCourse [*] : GraduateCourse} Class Student intersect Person {reference takesCourse [*] : Course} Class UndergradStudent extends Student {} Class Course{} Class GraduateCourse extends Course{} Class CsCourse extends Course{} may I ask how should I read the following query? // Q1: SELECT ?x ?y WHERE { { { ?x a :UndergradStudent . ?x :takesCourse ?y } UNION { ?x a