Re: [Virtuoso-users] Issue concatenating an array into one result cell

2017-04-12 Thread Jerven Tjalling Bolleman
Hi,

GROUP_CONCAT is the feature you are looking for.
https://www.w3.org/TR/sparql11-query/#defn_aggGroupConcat


It does mean you need to do a GROUP_BY

Regards,
Jerven

On 04/12/2017 06:05 PM, Legault, Phillip [GTSUS] wrote:
> I was wondering if anyone knows how to get an array of results from a
> single property to end up into one result cell.
>
>
>
> PREFIX
> property:
>
> PREFIX swivt:
>
> PREFIX rdfs:
>
> PREFIX xsd: 
>
> SELECT ?Name ?Category ?Decision_By ?Topic ?Publication_Status
> ?Publication_Date
>
> WHERE
>
> {
>
> ?s ?p ?cat .
>
> ?cat rdfs:label ?Category .
>
> ?cat rdfs:label "LADR" .
>
> FILTER(CONTAINS(STR(?cat), "Category")) .
>
> ?s property:Has_Name ?Name .
>
> FILTER regex(?Name, "{{{LADR|}}}", "i") .
>
>  OPTIONAL {  ?s property:Decision_By ?Decision_By. }
>
>   OPTIONAL {  ?s property:Has_Topic ?Topic. }
>
>   OPTIONAL {  ?s property:PublicationStatus ?Publication_Status. }
>
>   OPTIONAL {  ?s property:PublicationDate ?Publication_Date. }
>
>
>
>
>
> }
>
>
>
> I end up with multiple lines of results for the same page
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
>
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>

-- 
---
Jerven BollemanJerven.Bolleman@sib.swiss
SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
CMU, rue Michel Servet 1   Fax: +41 (0)22 379 58 58
1211 Geneve 4,
Switzerland www.sib.swiss - www.uniprot.org
Follow us at https://twitter.com/#!/uniprot
---

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Issue concatenating an array into one result cell

2017-04-12 Thread Legault, Phillip [GTSUS]
I was wondering if anyone knows how to get an array of results from a single 
property to end up into one result cell.

PREFIX property:
PREFIX swivt:
PREFIX rdfs:
PREFIX xsd: 
SELECT ?Name ?Category ?Decision_By ?Topic ?Publication_Status ?Publication_Date
WHERE
{
?s ?p ?cat .
?cat rdfs:label ?Category .
?cat rdfs:label "LADR" .
FILTER(CONTAINS(STR(?cat), "Category")) .
?s property:Has_Name ?Name .
FILTER regex(?Name, "{{{LADR|}}}", "i") .
 OPTIONAL {  ?s property:Decision_By ?Decision_By. }
  OPTIONAL {  ?s property:Has_Topic ?Topic. }
  OPTIONAL {  ?s property:PublicationStatus ?Publication_Status. }
  OPTIONAL {  ?s property:PublicationDate ?Publication_Date. }


}

I end up with multiple lines of results for the same page
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users