A variable in SPARQL is only ever bound to a single value. So the set of results as a whole will be the totality of the collection but an individual row in those results is a single item of that collection.
So essentially your construct clause create a new collection for each element of the list which is clearly not what you want. In the context of a construct query you can only reconstruct a collection if you are able to structure your where clause such that you selected the entire collection as a single row and then provided a construct template to export it. Your use case may be better served with a describe query e.g. DESCRIBE <http://resources.semaworx.eu/activity/user/BNNuserPAR> Rob On 18/05/2017 14:15, "Bardo Nelgen" <[email protected]> wrote: Hi Lorenz, thanks for the clarification – but isn’t the Collection as a whole meant to be the query result, rather than its various elements !?? Best, Bardo On 18.05.17 13.45 Uhr, Lorenz Buehmann wrote: > Because in SPARQL there is always only a single resource bound to a > variable, in your case ?member and not the whole list > > > On 18.05.2017 12:18, Bardo Nelgen wrote: >> Hi all, >> >> why does the CONSTRUCT SPARQL of >> >>> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> >>> PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> >>> PREFIX as:<https://www.w3.org/ns/activitystreams#> >>> PREFIX list: <http://jena.hpl.hp.com/ARQ/list#> >>> >>> CONSTRUCT {<http://resources.semaworx.eu/activity/user/BNNuserPAR> >>> as:items ( ?members ) .} >>> >>> WHERE{<http://resources.semaworx.eu/activity/user/BNNuserPAR> >>> as:items [ list:member ?members ] .} >> produce >> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR"> >>> <as:items rdf:parseType="Collection"> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID004"/> >>> </as:items> >>> <as:items rdf:parseType="Collection"> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID003"/> >>> </as:items> >>> <as:items rdf:parseType="Collection"> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID002"/> >>> </as:items> >>> <as:items rdf:parseType="Collection"> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID001"/> >>> </as:items> >>> </rdf:Description> >> rather than >> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR"> >>> <as:items rdf:parseType="Collection"> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID004"/> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID003"/> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID002"/> >>> <rdf:Description >>> rdf:about="http://resources.semaworx.eu/activity/user/BNNuserPAR/SHA512UIDdateUID001"/> >>> </as:items> >>> </rdf:Description> >> ?? >> >> It’s obviously not the same and caused by the iteration over the query >> results. >> >> But how could I prevent it from happening without having to create a >> separate query for the construction ? >> >> As always, input and references are highly appreciated. >> >> Regards, >> >> Bardo >> >> >
