Skip to content

Commit

Permalink
Merge pull request #619
Browse files Browse the repository at this point in the history
* feat: organisation return Lg2
  • Loading branch information
EmmanuelDemey authored May 7, 2024
1 parent e52cb25 commit 5abee45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static String organizationsQuery() throws RmesException {
params.put("ORGANIZATIONS_GRAPH", config.getOrganizationsGraph());
params.put("ORGANIZATIONS_INSEE_GRAPH", config.getOrgInseeGraph());
params.put("LG1", config.getLg1());
params.put("LG2", config.getLg2());
return FreeMarkerUtils.buildRequest("organizations/", "getOrganizations.ftlh", params);
}

Expand Down
11 changes: 9 additions & 2 deletions src/main/resources/request/organizations/getOrganizations.ftlh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT DISTINCT ?iri ?id ?label ?altLabel
SELECT DISTINCT ?iri ?id ?label ?altLabel ?labelLg2
FROM <${ORGANIZATIONS_GRAPH}>
FROM <${ORGANIZATIONS_INSEE_GRAPH}>
WHERE {
Expand All @@ -7,6 +7,13 @@ WHERE {
OPTIONAL { ?iri skos:prefLabel ?label .
FILTER (lang(?label) = '${LG1}')}
OPTIONAL {?iri skos:altLabel ?altLabel .}

OPTIONAL {
?iri skos:prefLabel ?label2 .
FILTER (lang(?label2) = '${LG2}')
} .

BIND(if(bound(?label2), ?label2, ?label) AS ?labelLg2)
}
GROUP BY ?iri ?id ?label ?altLabel
GROUP BY ?iri ?id ?label ?altLabel ?labelLg2
ORDER BY ?label

0 comments on commit 5abee45

Please sign in to comment.