Closed Robert-Muil closed 3 years ago
That's a good question. I get the same result. I also tried it on an AllegroGraph repo and it also did not work. Not sure why.
In Protege's SPARQL interface I even get a syntax error which completely befuddles me:
Caused by: org.openrdf.query.MalformedQueryException: Encountered " "count" "count "" at line 5, column 11.
Was expecting one of:
"(" ...
"{" ...
"from" ...
"where" ...
<VAR1> ...
<VAR2> ...
Got it working... in Protege at least It seems that brackets are necessary around the count, as is the as
clause:
select ?p (count(?i) as ?count)
WHERE {
?p a owl:ObjectProperty .
?i ?p ?o .
}
GROUP BY ?p
EDIT: Still empty result set in DBpedia.
The query works fine on other repos I have, don't know why not working on DBPedia. Try ordering the results putting the most often used first, like this:
select ?p (count(?i) as ?count)
WHERE {
?p a owl:ObjectProperty .
?i ?p ?o .
}
GROUP BY ?p
ORDER BY desc(?count)
Apologies for these lagging questions, but I can't get the query for instances of object properties to work in DBpedia. The query is in section 3.1.12:
When I execute that against the DBpedia endpoint I get no results:
I've tried it with and without the GROUP BY clause.
Any ideas?