Skip to content

Commit

Permalink
Update getTerritoireByCodeDateNomcommune.ftlh
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMBourgeois committed Feb 3, 2022
1 parent f80cfac commit 2d6a89c
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ FROM <http://rdf.insee.fr/graphes/geo/cog>

?uri a igeo:${territoire} ;
igeo:codeArticle ?typeArticle ;
<#if com != "true">
(igeo:subdivisionDirecteDe/a) ?parent;
</#if>
igeo:nom ?intitule ;
igeo:nomSansArticle ?intituleSansArticle .



<#if code != "none">
?uri igeo:codeINSEE '${code}' .
BIND('${code}' as ?code)
<#else>
?uri igeo:codeINSEE ?code .
</#if>

<#if com != "true">
filter(substr(?code,1,2) !='98') filter(substr(?code,1,3) != "975"||"977"||"978")
</#if>
OPTIONAL {
?evenementCreation igeo:creation ?uri ;
Expand Down Expand Up @@ -55,13 +51,14 @@ filter(substr(?code,1,2) !='98') filter(substr(?code,1,3) != "975"||"977"||"978
BIND (CONCAT("^", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(LCASE(?query), "[àáâãäåaaa]", "a"), "ç", "c"), "[èééêë]", "e"), "[ìíîïì]", "i"), "[óôõö]", "o"), "[ùúûü]", "u"), "ÿ", "y"), "[œ]", "oe"), "([^/]+)[/]", "$1-sur-"),"([^\\\\]+)[\\\\]", "$1-sous-"), "[-_']", " "),"[^a-z0-9() ]", ""), "[ ]{2,}", " "), "^st(e)? ", "saint$1 "), "") AS ?formattedQuery) .
FILTER (REGEX(?formattedNom, ?formattedQuery) || REGEX(?formattedNomSansArticle, ?formattedQuery))
</#if>

<#if com != "true">
FILTER(REGEX(STR(?parent), "(Departement|Arrondissement)$"))
</#if>
<#if date != "*">
FILTER(!BOUND(?dateCreation) || ?dateCreation <= '${date}'^^xsd:date)
FILTER(!BOUND(?dateSuppression) || ?dateSuppression > '${date}'^^xsd:date)
</#if>


}
ORDER BY ?code

0 comments on commit 2d6a89c

Please sign in to comment.