AKSW / Erfurt

PHP5 / Zend based Semantic Web API for Social Semantic Software
41 stars 27 forks source link

Query including count() does not work #105

Open shinobu opened 8 years ago

shinobu commented 8 years ago

While trying to count the triples in my knowledge base , I tried to use

Select (COUNT(*) as ?count) where { ?p ?s ?x.}

this throws the error:

SPARQL Error: [unixODBC][OpenLink][Virtuoso iODBC Driver][Virtuoso Server]SQ074: Line 10: SP030: SPARQL compiler, line 8: syntax error at 'FROM' before '<http://localhost/OntoWiki/index.php/issue75/>' () on querying graph <NULL> with query:
PREFIX ns1: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/>
PREFIX ns0: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

Select
FROM <http://localhost/OntoWiki/index.php/issue75/>
where { ?p ?s ?x.} LIMIT 20

the query does work in Virtuoso.

shinobu commented 8 years ago

update: the error actually comes from the extra parentheses around the Count, i'm not sure if the parentheses are actually allowed their or not though.