Hello Jürgen,

Put the "select distinct" into construct's WHERE clause as a subquery,
something like

CONSTRUCT {
  ?category a <http://www.w3.org/2004/02/skos/core#Concept> .
  ?category <http://www.turnguard.com/virtuoso/aggregates#count> ?count
}
where {
  { SELECT DISTINCT 
    ?category count(?category) AS ?count 
     WHERE 
     { 
       ?s <http://purl.org/dc/terms/subject> ?category 
       FILTER(?s = <http://dbpedia.org/resource/Higgs_boson> || ?s = 
<http://dbpedia.org/resource/Gluon>) 
     } } }

Best Regards,

Ivan Mikhailov
OpenLink Virtuoso
http://virtuoso.openlinksw.com


On Thu, 2011-12-01 at 12:42 +0100, Jürgen Jakobitsch wrote:
> hi,
> 
> i've been struggling a little bit with a construct query with a statement 
> where the object
> is value from an aggregate function.
> 
> is this at all possible?
> 
> i'd like to have the following query as a construct query :
> 
> SELECT DISTINCT 
>   ?category count(?category) AS ?count 
>    WHERE 
>    { 
>      ?s <http://purl.org/dc/terms/subject> ?category 
>      FILTER(?s = <http://dbpedia.org/resource/Higgs_boson> || ?s = 
> <http://dbpedia.org/resource/Gluon>) 
>    }
> 
> 
> the construct part of the query should be something like this (but i can't 
> get it to work)
> 
> CONSTRUCT {
>   ?category a <http://www.w3.org/2004/02/skos/core#Concept .
>   ?category <http://www.turnguard.com/virtuoso/aggregates#count> 
> count(?category)
> }
> 
> any pointer really appreciated.
> 
> wkr www.turnguard.com/turnguard
> 
> 



Reply via email to