Same query works in DBpedia Endpoint(http://ko.dbpedia.org/sparql), but not in my Java code. I am just trying to extract the frequency using \"COUNT\" function.
This is illegal SPARQL syntax:
SELECT ... count(distinct ?s) as ?count where
It should be
SELECT ... (count(distinct ?s) as ?count) where
The you will have a problem with ?class
in:
SELECT ?class (count(distinct ?s) as ?count) where
because it is not a grouped variable (using count
you have a group of everything). Did you mean to have a GROUP BY ?class
?