sparql query sparql.query().convert() sometime throw exception while give output on Virtuoso SPARQL Query Editor
Date : March 29 2020, 07:55 AM
this will help The problem is with Distinct. When using Distinct query shortcut / optimization is limited and if you have many results your query could timeout (depending on server load)
|
How can I build SPARQL query?
Date : March 29 2020, 07:55 AM
it fixes the issue I am currently working on a project that is based on SPARQL and Protege (version 4.2). , You can just do: PREFIX dbpprop: <http://dbpedia.org/property/>
PREFIX yago: <http://dbpedia.org/class/yago/>
SELECT ?h
WHERE {
?h a yago:AirlinerHijackings .
?h dbpprop:date ?date .
FILTER(?date >= "1980-01-01"^^xsd:date && ?date < "2001-01-01"^^xsd:date)
}
|
What is the correct SPARQL version for this query?
Date : March 29 2020, 07:55 AM
it fixes the issue You almost had it, the only problem is that property values in DBPedia use language tags and your query looks for names with plain literal values. This query works for me: SELECT DISTINCT ?s
WHERE {
{
?s <http://xmlns.com/foaf/0.1/name> "Google Inc."@en .
} UNION {
?s <http://dbpedia.org/property/companyName> "Google Inc."@en .
} UNION {
?s <http://dbpedia.org/property/name> "Google Inc."@en .
}
{
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Company> .
} UNION {
?s <http://dbpedia.org/ontology/type> <http://dbpedia.org/resource/Public_company> .
}
}
|
I'm using Jena to launch a SPARQL query. The query works in DBpedia SPARQL endpoint! I verified the query at query valid
Tag : java , By : vdavidovski
Date : March 29 2020, 07:55 AM
wish help you to fix your issue It looks like this got resolved in the comments. Here's a community wiki answer for the sake of visitors (in case the comments get deleted): Put some newlines in the query and see exactly where parser referes to. It will be the place the parse error starts. HAVING clause needs () for legal SPARQL 1.1 having (count(?p) > 35). – AndyS { dbpedia:Lagaan } isn't right either – AndyS yesterday i got it.It needed a space after the angular bracket in the prefix. – Kulsum Fatima
|
SPARQL query gets error from SPARQL Query Validator, but works in Virtuoso SPARQL Query Editor
Date : March 29 2020, 07:55 AM
should help you out The comma after SELECT ?distractor, is allowed in Virtuoso, but is non-standard. After removing the comma (and adding appropriate prefix declarations), the query validates.
|