semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

Problem with count and distinct #92

Closed moissinac closed 4 years ago

moissinac commented 7 years ago

I'm trying the following request

select (count(distinct ?serie) as ?c) where {
graph <http://givingsense.eu/onto/sembib/channels> { 
?s <http://givingsense.eu/onto/sembib/inConf> ?o .
?o ?p ?serie
}
}

and I get No result bindings specified. in ARC2_SPARQLPlusParser

I see nothing in the doc which say that such construct in unsupported. Am I wrong?

EDIT by @k00ni: added syntax highlighting to query.

johanneshahn commented 7 years ago

Sehr geehrte Damen und Herren,

bitte beachten Sie, dass ich bis 04.09.2017 nicht zu erreichen bin. Ihre Anfrage wird nach meiner Rückkehr schnellstmöglich bearbeitet. Vielen Dank.


Thank you for your email.

I will be out of the office until 04.09.2017. Your email will not be forwarded but I will deal with it on my return.

Johannes Hahn Geschäftsführer - Mediadevelopment

eccence Weimarstrasse 1 • D-70176 Stuttgart

fon +49(0)711.4 77 88 77 9

email j.hahn@eccence.de
web www.eccence.de

Geschäftsführer: Gerd Freiwald & Johannes Hahn Umsatzsteuer-Identifikationsnummer gemäß § 27 a Umsatzsteuergesetz: DE259976593

k00ni commented 6 years ago

Hi @moissinac, here is a COUNT example: https://github.com/semsol/arc2/wiki/SPARQL-#aggregate-example

Also using GRAPH in your WHERE clause is not supported by ARC2. Its also required when using URIs to have < and > around.

This query may get the job done:

SELECT count(?serie) as ?c
FROM <http://givingsense.eu/onto/sembib/channels>
WHERE {
    ?s <http://givingsense.eu/onto/sembib/inConf> ?o .
    ?o ?p ?serie
}
GROUP BY ?serie
k00ni commented 4 years ago

Closed, because no response. Please reopen, if problem persists.