Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GROUP BY or GROUP CONCAT does not work #8

Open
ocorcho opened this issue Dec 18, 2022 · 0 comments
Open

GROUP BY or GROUP CONCAT does not work #8

ocorcho opened this issue Dec 18, 2022 · 0 comments

Comments

@ocorcho
Copy link
Contributor

ocorcho commented Dec 18, 2022

When trying to use in a query the GROUP_CONCAT clause, the queries that are produced do not provide any result. As an example, this is a query that we are trying to use for this purpose:

`
PREFIX era: http://data.europa.eu/949/
PREFIX gsp: http://www.opengis.net/ont/geosparql#
PREFIX geo: http://www.w3.org/2003/01/geo/wgs84_pos#
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX skos: http://www.w3.org/2004/02/skos/core#
PREFIX dc: http://purl.org/dc/elements/1.1/

SELECT DISTINCT ?sol ?solID ?solName ?inCountry ?length ?ValidityDateStart ?ValidityDateEnd ?solNature ?LineIdentification ?IMCode ?opStartName ?opStartType ?opStartUOPID ?opEndName ?opEndType ?opEndUOPID (GROUP_CONCAT(DISTINCT ?resultTrack; separator = " , ") AS ?trackInfo)
WHERE {
GRAPH http://data.europa.eu/949/graph/rinf {
?sol a era:SectionOfLine . BIND (REPLACE(STR(?sol), "^./([^/])$", "$1") as ?solID) .
?sol rdfs:label ?solName .
?sol era:inCountry ?inCountryURI . BIND (REPLACE(STR(?inCountryURI), "^./([^/])$", "$1") as ?inCountry) .
?sol era:length ?length .
OPTIONAL{?sol era:validityStartDate ?ValidityDateStart .}
OPTIONAL{?sol era:validityEndDate ?ValidityDateEnd .}
?sol era:solNature ?solNatureURI .
?sol era:lineNationalId ?LineIdentificationURI . BIND (REPLACE(STR(?LineIdentificationURI), "^./([^/])$", "$1") as ?LineIdentification) .
?sol era:imCode ?IMCode .
?sol era:opStart ?opStart .
?opStart rdfs:label ?opStartName .
?opStart era:opType ?opStartTypeURI .
?opStart era:uopid ?opStartUOPID .
?sol era:opEnd ?opEnd .
?opEnd rdfs:label ?opEndName .
?opEnd era:opType ?opEndTypeURI .
?opEnd era:uopid ?opEndUOPID .
OPTIONAL {
?sol era:track ?solTracks . BIND (REPLACE(STR(?solTracks), "^./([^/])$", "$1") as ?solTracksURI) .
?solTracks era:trackId ?SOLTrackIdentification .
OPTIONAL{?solTracks era:validityStartDate ?SOLTrackValidityDateStart .}
OPTIONAL{?solTracks era:validityEndDate ?SOLTrackValidityDateEnd .}
OPTIONAL{?solTracks era:imCode ?SOLTrackIMCode .}
OPTIONAL{?solTracks era:trackDirection ?SOLTrackDirectionURI}
BIND (CONCAT("{"SOLTrack":"",?solTracksURI,"","SOLTrackIdentification":"",?SOLTrackIdentification,"","ValidityDateStart":"",?SOLTrackValidityDateStart,"","ValidityDateEnd":"",?SOLTrackValidityDateEnd,"","SOLTrackDirection":"",?SOLTrackDirection,"","SectionOfLineID":"",?solID,""}") AS ?resultTrack) . }}
GRAPH http://data.europa.eu/949/graph/skos {
?opStartTypeURI skos:prefLabel ?opStartType . FILTER (lang(?opStartType) = 'en') .
?opEndTypeURI skos:prefLabel ?opEndType . FILTER (lang(?opEndType) = 'en') .
?solNatureURI skos:prefLabel ?solNature .
?SOLTrackDirectionURI skos:prefLabel ?SOLTrackDirection}
} GROUP BY ?sol ?solID ?solName ?inCountry ?length ?ValidityDateStart ?ValidityDateEnd ?solNature ?LineIdentification ?IMCode ?opStartName ?opStartType ?opStartUOPID ?opEndName ?opEndType ?opEndUOPID
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant