thank you very much, ivan, works as expected! wkr http://www.turnguard.com/turnguard
----- Original Message ----- From: "Ivan Mikhailov" <[email protected]> To: "Jürgen Jakobitsch" <[email protected]> Cc: [email protected] Sent: Friday, December 2, 2011 9:53:25 AM Subject: Re: [Virtuoso-users] construct + aggregate function 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 > > -- | Jürgen Jakobitsch, | Software Developer | Semantic Web Company GmbH | Mariahilfer Straße 70 / Neubaugasse 1, Top 8 | A - 1070 Wien, Austria | Mob +43 676 62 12 710 | Fax +43.1.402 12 35 - 22 COMPANY INFORMATION | http://www.semantic-web.at/ PERSONAL INFORMATION | web : http://www.turnguard.com | foaf : http://www.turnguard.com/turnguard | skype : jakobitsch-punkt
