Skip to content

Commit

Permalink
Merge pull request #61 from InseeFr/acceptance
Browse files Browse the repository at this point in the history
Acceptance
  • Loading branch information
alicela authored May 19, 2022
2 parents 956be73 + c5675ac commit 82aa444
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 133 deletions.
2 changes: 2 additions & 0 deletions metadataapi-changeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
3.3.0 : Passage à Java 11 + Correctif sur les chef lieu
3.2.1 : Passage à Java 11 pour les tests de charge (non mis en production
3.2.0 : Ajout des services pour les circonscriptions territoriales (Geo)
3.1.0 : Ajout des services des collectivités d'Outre-mer (Geo)
3.0.5 : Montée de version log4J
Expand Down
19 changes: 13 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<packaging>war</packaging>
<name>Implementation of the RMéS metadata API</name>

<version>3.2.0</version>
<version>3.3.0</version>

<properties>
<title>API RM\u00e9S</title>
<description>API sur les m\u00e9tadonn\u00e9es de l'Insee</description>

<!-- Dependencies' version -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<jersey.version>2.29.1</jersey.version>
<jackson.version>2.10.1</jackson.version>
<jakarta.version>4.0.3</jakarta.version>
Expand All @@ -30,7 +30,9 @@

<!-- Configuration Sonar -->
<sonar.exclusions>src/main/java/fr/insee/rmes/queries/**/*,
src/main/java/fr/insee/rmes/modeles/**/*</sonar.exclusions>
src/main/java/fr/insee/rmes/modeles/**/*,
src/main/java/fr/insee/rmes/utils/XmlUtils.java
</sonar.exclusions>
<sonar.projectKey>${project.groupId}:${project.artifactId}</sonar.projectKey>
<sonar.projectName>Metadata-API</sonar.projectName>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
Expand All @@ -39,7 +41,7 @@
<sonar.language>java</sonar.language>
<version.maven-jacoco>0.8.5</version.maven-jacoco>
<version.maven-sonar>3.7.0.1746</version.maven-sonar>
<argLine>-Xms256m -Xmx512m -XX:MaxPermSize=128m -ea -Dfile.encoding=UTF-8</argLine>
<argLine>-Xms256m -Xmx512m -ea -Dfile.encoding=UTF-8</argLine>

</properties>

Expand Down Expand Up @@ -80,7 +82,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j18-impl</artifactId>
<version>${log.version}</version>
</dependency>

Expand Down Expand Up @@ -208,6 +210,11 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

import fr.insee.rmes.modeles.geo.EnumTypeGeographie;
Expand Down
11 changes: 1 addition & 10 deletions src/main/java/fr/insee/rmes/queries/geo/GeoQueries.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,8 @@ private static String getAscendantOrDescendantsQuery(
params.put(FILTRE, filtreNom);
params.put(COM,com);
params.put(ASCENDANT, String.valueOf(ascendant));
//
// if (EnumTypeGeographie.DISTRICT.equals(typeOrigine)) {
// return buildRequest(QUERIES_FOLDER, "getAscendantsOrDescendantsByCodeTypeDateDistrict.ftlh", params);
// }
// else {
return buildRequest(QUERIES_FOLDER, "getAscendantsOrDescendantsByCodeTypeDate.ftlh", params);
// }

}

private static String getPreviousOrNextQuery(
Expand Down Expand Up @@ -351,11 +346,7 @@ private static String getTerritoireFiltre(String code, String date, String filtr
Map<String, Object> params = buildCodeAndDateAndFilterParams(code, date, filtreNom,com);
params.put("territoire", typeGeo.getTypeObjetGeo());
params.put("chefLieu", typeGeo.getChefLieuPredicate());
// if (EnumTypeGeographie.DISTRICT.equals(typeGeo)) {
// return buildRequest(QUERIES_FOLDER, "getTerritoireByCodeAndDateDistrict.ftlh", params);
// } else {
return buildRequest(QUERIES_FOLDER, "getTerritoireByCodeDateNomcommune.ftlh", params);
// }
}

private static Map<String, Object> buildCodeAndDateAndFilterParams(String code, String date, String filtreNom, boolean com) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ WHERE {


OPTIONAL {
?origine ((igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion)/igeo:codeINSEE) ?chefLieuOrigine .
?uri (igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion) ?chefLieuRDF .
?chefLieuRDF igeo:codeINSEE ?chefLieuOrigine .

OPTIONAL {
?evenementCreationChefLieu igeo:creation ?chefLieuRDF ;
igeo:date ?dateCreationChefLieu .
}
OPTIONAL {
?evenementSuppressionChefLieu igeo:suppression ?chefLieuRDF ;
igeo:date ?dateSuppressionChefLieu.
}

<#if date != "*">
FILTER(!BOUND(?dateCreationChefLieu) || ?dateCreationChefLieu <= '${date}'^^xsd:date)
FILTER(!BOUND(?dateSuppressionChefLieu) || ?dateSuppressionChefLieu > '${date}'^^xsd:date)
</#if>
}


Expand Down Expand Up @@ -56,7 +71,22 @@ WHERE {
}

OPTIONAL {
?uri ((igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion)/igeo:codeINSEE) ?chefLieu.
?uri (igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion) ?chefLieuRDF .
?chefLieuRDF igeo:codeINSEE ?chefLieu .

OPTIONAL {
?evenementCreationChefLieu igeo:creation ?chefLieuRDF ;
igeo:date ?dateCreationChefLieu .
}
OPTIONAL {
?evenementSuppressionChefLieu igeo:suppression ?chefLieuRDF ;
igeo:date ?dateSuppressionChefLieu.
}

<#if date != "*">
FILTER(!BOUND(?dateCreationChefLieu) || ?dateCreationChefLieu <= '${date}'^^xsd:date)
FILTER(!BOUND(?dateSuppressionChefLieu) || ?dateSuppressionChefLieu > '${date}'^^xsd:date)
</#if>
}

FILTER(!BOUND(?dateCreation) || ?dateCreation <= '${dateProjection}'^^xsd:date)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,22 @@ FROM <http://rdf.insee.fr/graphes/geo/cog>
</#if>

OPTIONAL {
?uri ((igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion)/igeo:codeINSEE) ?chefLieu.
?uri (igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion) ?chefLieuRDF .
?chefLieuRDF igeo:codeINSEE ?chefLieu .

OPTIONAL {
?evenementCreationChefLieu igeo:creation ?chefLieuRDF ;
igeo:date ?dateCreationChefLieu .
}
OPTIONAL {
?evenementSuppressionChefLieu igeo:suppression ?chefLieuRDF ;
igeo:date ?dateSuppressionChefLieu.
}

<#if date != "*">
FILTER(!BOUND(?dateCreationChefLieu) || ?dateCreationChefLieu <= '${date}'^^xsd:date)
FILTER(!BOUND(?dateSuppressionChefLieu) || ?dateSuppressionChefLieu > '${date}'^^xsd:date)
</#if>
}

OPTIONAL {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,22 @@ WHERE {
}

OPTIONAL {
?uri ((igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion)/igeo:codeINSEE) ?chefLieu.
?uri (igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion) ?chefLieuRDF .
?chefLieuRDF igeo:codeINSEE ?chefLieu .

OPTIONAL {
?evenementCreationChefLieu igeo:creation ?chefLieuRDF ;
igeo:date ?dateCreationChefLieu .
}
OPTIONAL {
?evenementSuppressionChefLieu igeo:suppression ?chefLieuRDF ;
igeo:date ?dateSuppressionChefLieu.
}

<#if date != "*">
FILTER(!BOUND(?dateCreationChefLieu) || ?dateCreationChefLieu <= '${date}'^^xsd:date)
FILTER(!BOUND(?dateSuppressionChefLieu) || ?dateSuppressionChefLieu > '${date}'^^xsd:date)
</#if>
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,22 @@ WHERE {
}

OPTIONAL {
?uri ((igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion)/igeo:codeINSEE) ?chefLieu.
?uri (igeo:sousPrefecture|igeo:prefecture|igeo:prefectureDeRegion) ?chefLieuRDF .
?chefLieuRDF igeo:codeINSEE ?chefLieu .

OPTIONAL {
?evenementCreationChefLieu igeo:creation ?chefLieuRDF ;
igeo:date ?dateCreationChefLieu .
}
OPTIONAL {
?evenementSuppressionChefLieu igeo:suppression ?chefLieuRDF ;
igeo:date ?dateSuppressionChefLieu.
}

<#if date != "*">
FILTER(!BOUND(?dateCreationChefLieu) || ?dateCreationChefLieu <= '${date}'^^xsd:date)
FILTER(!BOUND(?dateSuppressionChefLieu) || ?dateSuppressionChefLieu > '${date}'^^xsd:date)
</#if>
}

FILTER(!BOUND(?dateCreation) || ?dateCreation <= '${dateProjection}'^^xsd:date)
Expand Down

This file was deleted.

0 comments on commit 82aa444

Please sign in to comment.