AKSW / Erfurt

PHP5 / Zend based Semantic Web API for Social Semantic Software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query including count() does not work

shinobu opened this issue · comments

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.

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.