diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/OperationsService.java b/src/main/java/fr/insee/rmes/bauhaus_services/OperationsService.java index 7cfc604c1..50a4e9e74 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/OperationsService.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/OperationsService.java @@ -1,6 +1,5 @@ package fr.insee.rmes.bauhaus_services; -import fr.insee.rmes.config.swagger.model.IdLabelTwoLangs; import fr.insee.rmes.exceptions.RmesException; import fr.insee.rmes.model.operations.Indicator; import fr.insee.rmes.model.operations.Operation; @@ -43,8 +42,6 @@ public interface OperationsService { String getSeriesJsonByID(String id) throws RmesException; - IdLabelTwoLangs getSeriesLabelByID(String id) throws RmesException; - String getSeriesWithSims() throws RmesException; String getSeriesWithStamp(String stamp) throws RmesException; diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetQueries.java b/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetQueries.java index 1466cf0c0..851dbcea1 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetQueries.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetQueries.java @@ -47,6 +47,10 @@ private static String getDatasetArrays(String path, String datasetsGraph, String return FreeMarkerUtils.buildRequest(ROOT_DIRECTORY, path, params); } + public static String getDatasetWasGeneratedIris(String id, String datasetsGraph) throws RmesException { + return getDatasetArrays("getDatasetWasGeneratedIris.ftlh", datasetsGraph, id); + } + public static String getDatasetCreators(String id, String datasetsGraph) throws RmesException { return getDatasetArrays("getDatasetCreators.ftlh", datasetsGraph, id); } diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImpl.java b/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImpl.java index 4ba690b23..24a1322ea 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImpl.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImpl.java @@ -153,7 +153,7 @@ public Dataset getDatasetByID(String id) throws RmesException { dataset.remove(THEME); getMultipleTripletsForObject(dataset, "creators", DatasetQueries.getDatasetCreators(id, getDatasetsGraph()), CREATOR); - + getMultipleTripletsForObject(dataset, "wasGeneratedIRIs", DatasetQueries.getDatasetWasGeneratedIris(id, getDatasetsGraph()), "iri"); IRI catalogRecordIRI = RdfUtils.createIRI(getCatalogRecordBaseUri() + "/" + id); getMultipleTripletsForObject(dataset, "spacialResolutions", DatasetQueries.getDatasetSpacialResolutions(id, getDatasetsGraph()), "spacialResolution"); getMultipleTripletsForObject(dataset, "statisticalUnit", DatasetQueries.getDatasetStatisticalUnits(id, getDatasetsGraph()), "statisticalUnit"); @@ -186,9 +186,6 @@ private String update(String datasetId, Dataset dataset) throws RmesException { if(ValidationStatus.VALIDATED.toString().equalsIgnoreCase(dataset.getValidationState())){ dataset.setValidationState(ValidationStatus.MODIFIED.toString()); } - if(dataset.getIdSerie() != null){ - dataset.setIdSerie(RdfUtils.seriesIRI(dataset.getIdSerie()).toString()); - } if(dataset.getCatalogRecord() == null){ dataset.setCatalogRecord(new CatalogRecord()); @@ -213,10 +210,6 @@ public String create(String body) throws RmesException { dataset.setId(idGenerator.generateNextId()); dataset.setValidationState(ValidationStatus.UNPUBLISHED.toString()); - if(dataset.getIdSerie() != null){ - dataset.setIdSerie(RdfUtils.seriesIRI(dataset.getIdSerie()).toString()); - } - if(dataset.getCatalogRecord() == null){ dataset.setCatalogRecord(new CatalogRecord()); } @@ -472,7 +465,10 @@ private void persistDataset(Dataset dataset) throws RmesException { this.persistStatisticsInformations(datasetIri, dataset, model, graph); RdfUtils.addTripleString(datasetIri, INSEE.VALIDATION_STATE, dataset.getValidationState(), model, graph); - RdfUtils.addTripleUri(datasetIri, PROV.WAS_GENERATED_BY, dataset.getIdSerie(), model, graph); + + if(dataset.getWasGeneratedIRIs() != null) { + dataset.getWasGeneratedIRIs().forEach(iri -> RdfUtils.addTripleUri(datasetIri, PROV.WAS_GENERATED_BY, iri, model, graph)); + } if(dataset.getThemes() != null){ dataset.getThemes().forEach(theme -> RdfUtils.addTripleUri(datasetIri, DCAT.THEME, theme, model, graph)); @@ -517,8 +513,9 @@ private void validate(Dataset dataset) throws RmesException { if (dataset.getAltIdentifier() != null && !ALT_IDENTIFIER_PATTERN.matcher(dataset.getAltIdentifier()).matches()) { throw new RmesBadRequestException("The property altIdentifier contains forbidden characters"); } - if(!this.seriesUtils.isSeriesExist(dataset.getIdSerie())){ - throw new RmesBadRequestException("The series does not exist"); + + if(!this.seriesUtils.isSeriesAndOperationsExist(dataset.getWasGeneratedIRIs())){ + throw new RmesBadRequestException("Some series or operations do not exist"); } } } \ No newline at end of file diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/operations/OperationsImpl.java b/src/main/java/fr/insee/rmes/bauhaus_services/operations/OperationsImpl.java index dcea9592a..e929f6662 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/operations/OperationsImpl.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/operations/OperationsImpl.java @@ -8,7 +8,6 @@ import fr.insee.rmes.bauhaus_services.operations.series.SeriesUtils; import fr.insee.rmes.bauhaus_services.rdf_utils.QueryUtils; import fr.insee.rmes.bauhaus_services.rdf_utils.RdfService; -import fr.insee.rmes.config.swagger.model.IdLabelTwoLangs; import fr.insee.rmes.exceptions.RmesException; import fr.insee.rmes.external.services.export.XDocReport; import fr.insee.rmes.model.operations.Indicator; @@ -127,10 +126,6 @@ public Series getSeriesByID(String id) throws RmesException { return seriesUtils.getSeriesById(id,EncodingType.MARKDOWN); } - @Override - public IdLabelTwoLangs getSeriesLabelByID(String id) throws RmesException { - return seriesUtils.getSeriesLabelById(id); - } /** * Return the series in a JSONObject encoding in markdown diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/operations/series/SeriesUtils.java b/src/main/java/fr/insee/rmes/bauhaus_services/operations/series/SeriesUtils.java index 418cfba96..4d9d3c4d1 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/operations/series/SeriesUtils.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/operations/series/SeriesUtils.java @@ -145,7 +145,7 @@ public JSONObject getSeriesJsonById(String id, EncodingType encode) throws RmesE if (EncodingType.MARKDOWN.equals(encode)) { XhtmlToMarkdownUtils.convertJSONObject(series); } - series.put(Constants.ID, id); + addSeriesOperations(id, series); addSeriesFamily(id, series); addSeriesLinks(id, series); @@ -508,8 +508,9 @@ public String setSeriesValidation(String id) throws RmesException { return id; } - public boolean isSeriesExist(String iri) throws RmesException { - return repositoryGestion.getResponseAsBoolean(OpSeriesQueries.checkIfSeriesExists(iri)); + public boolean isSeriesAndOperationsExist(List iris) throws RmesException { + var length = repositoryGestion.getResponseAsArray(OpSeriesQueries.checkIfSeriesExists(iris)).length(); + return length == iris.size(); } } diff --git a/src/main/java/fr/insee/rmes/model/dataset/Dataset.java b/src/main/java/fr/insee/rmes/model/dataset/Dataset.java index 38ac904e4..3f33d7e83 100644 --- a/src/main/java/fr/insee/rmes/model/dataset/Dataset.java +++ b/src/main/java/fr/insee/rmes/model/dataset/Dataset.java @@ -280,7 +280,7 @@ public void setSpacialResolutions(List spacialResolutions) { private String cautionLg1; private String cautionLg2; private String disseminationStatus; - private String idSerie; + private List wasGeneratedIRIs; private List themes; private String validationState; @@ -351,12 +351,12 @@ public void setDisseminationStatus(String disseminationStatus) { this.disseminationStatus = disseminationStatus; } - public String getIdSerie() { - return idSerie; + public List getWasGeneratedIRIs() { + return wasGeneratedIRIs; } - public void setIdSerie(String idSerie) { - this.idSerie = idSerie; + public void setWasGeneratedIRIs(List wasGeneratedIds) { + this.wasGeneratedIRIs = wasGeneratedIds; } public List getThemes() { diff --git a/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/operations/OperationsQueries.java b/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/operations/OperationsQueries.java index cfb109dce..900281151 100644 --- a/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/operations/OperationsQueries.java +++ b/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/operations/OperationsQueries.java @@ -33,18 +33,12 @@ public static String checkPrefLabelUnicity(String id, String label, String lang) return FreeMarkerUtils.buildRequest("operations/", "checkFamilyPrefLabelUnicity.ftlh", params); } - public static String operationsQuery() { - return "SELECT DISTINCT ?id ?label (group_concat(?altLabelLg1;separator=' || ') as ?altLabel) \n" - + "WHERE { GRAPH <"+config.getOperationsGraph()+"> { \n" - + "?operation a insee:StatisticalOperation . \n" - + "?operation skos:prefLabel ?label . \n" - + "FILTER (lang(?label) = '" + config.getLg1() + "') \n" - + "BIND(STRAFTER(STR(?operation),'/operations/operation/') AS ?id) . \n" - + "OPTIONAL{?operation skos:altLabel ?altLabelLg1 . " - + "FILTER (lang(?altLabelLg1) = '" + config.getLg1() + "')}\n" - + "}} \n" - + "GROUP BY ?id ?label \n" - + "ORDER BY ?label "; + public static String operationsQuery() throws RmesException { + HashMap params = new HashMap<>(); + params.put("OPERATIONS_GRAPH", config.getOperationsGraph()); + params.put("LG1", config.getLg1()); + params.put("LG2", config.getLg2()); + return FreeMarkerUtils.buildRequest("operations/", "getOperations.ftlh", params); } public static String operationQuery(String id){ diff --git a/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/series/OpSeriesQueries.java b/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/series/OpSeriesQueries.java index 8557a05f2..9e63aa7ed 100644 --- a/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/series/OpSeriesQueries.java +++ b/src/main/java/fr/insee/rmes/persistance/sparql_queries/operations/series/OpSeriesQueries.java @@ -7,8 +7,10 @@ import org.eclipse.rdf4j.model.IRI; import java.util.HashMap; +import java.util.List; import java.util.Map; + public class OpSeriesQueries extends GenericQueries{ private OpSeriesQueries() { @@ -191,11 +193,9 @@ public static String seriesQuery() throws RmesException { return buildSeriesRequest("getSeriesQuery.ftlh", params); } - public static String checkIfSeriesExists(String iri) throws RmesException { + public static String checkIfSeriesExists(List iris) throws RmesException { if (params==null) {initParams();} - params.put(URI_SERIES, iri); + params.put(URI_SERIES, iris); return buildSeriesRequest("checkIfSeriesExists.ftlh", params); } - - } diff --git a/src/main/java/fr/insee/rmes/webservice/dataset/DatasetResources.java b/src/main/java/fr/insee/rmes/webservice/dataset/DatasetResources.java index e0d7613c4..bfb531e04 100644 --- a/src/main/java/fr/insee/rmes/webservice/dataset/DatasetResources.java +++ b/src/main/java/fr/insee/rmes/webservice/dataset/DatasetResources.java @@ -21,7 +21,6 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; - import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; @RestController @@ -34,7 +33,6 @@ public class DatasetResources { final DatasetService datasetService; public DatasetResources(DatasetService datasetService) { - this.datasetService = datasetService; } diff --git a/src/main/resources/request/dataset/getDataset.ftlh b/src/main/resources/request/dataset/getDataset.ftlh index b33e93e2e..c0e82f08e 100644 --- a/src/main/resources/request/dataset/getDataset.ftlh +++ b/src/main/resources/request/dataset/getDataset.ftlh @@ -3,7 +3,7 @@ SELECT ?id ?altIdentifier ?labelLg1 ?labelLg2 ?subTitleLg1 ?subTitleLg2 ?accrual ?disseminationStatus ?processStep ?archiveUnit ?type ?dataStructure ?timeSeriesNumber ?observationNumber ?spacialCoverage ?spacialTemporal ?temporalResolution ?temporalCoverageStartDate ?temporalCoverageEndDate (datatype(?temporalCoverageEndDate) AS ?temporalCoverageDataType) -?descriptionLg1 ?descriptionLg2 ?idSerie ?theme +?descriptionLg1 ?descriptionLg2 ?theme ?validationState ?abstractLg1 ?abstractLg2 ?cautionLg1 ?cautionLg2 ?catalogRecordCreated ?catalogRecordUpdated ?catalogRecordCreator ?catalogRecordContributor @@ -81,11 +81,6 @@ WHERE { <#include "getDatasetIncludes/generalManagment.ftlh"> <#include "getDatasetIncludes/statisticsInformations.ftlh"> - OPTIONAL { - ?uri prov:wasGeneratedBy ?wasGeneratedBy . - BIND(STRAFTER(STR(?wasGeneratedBy),'/operations/serie/') AS ?idSerie) . - } - OPTIONAL { ?uri dcat:theme ?theme . } diff --git a/src/main/resources/request/dataset/getDatasetWasGeneratedIris.ftlh b/src/main/resources/request/dataset/getDatasetWasGeneratedIris.ftlh new file mode 100644 index 000000000..ee9869c48 --- /dev/null +++ b/src/main/resources/request/dataset/getDatasetWasGeneratedIris.ftlh @@ -0,0 +1,6 @@ +SELECT ?iri +FROM <${DATASET_GRAPH}> +WHERE { + ?dataset dcterms:identifier '${ID}' ; + prov:wasGeneratedBy ?iri . +} diff --git a/src/main/resources/request/operations/famOpeSer/getFamily.ftlh b/src/main/resources/request/operations/famOpeSer/getFamily.ftlh index e7fd02615..675b8deb9 100644 --- a/src/main/resources/request/operations/famOpeSer/getFamily.ftlh +++ b/src/main/resources/request/operations/famOpeSer/getFamily.ftlh @@ -1,9 +1,8 @@ -SELECT ?id ?prefLabelLg1 ?prefLabelLg2 ?abstractLg1 ?abstractLg2 ?validationState ?created ?modified +SELECT ('${ID}' AS ?id) ?prefLabelLg1 ?prefLabelLg2 ?abstractLg1 ?abstractLg2 ?validationState ?created ?modified WHERE { GRAPH <${OPERATIONS_GRAPH}> { ?family skos:prefLabel ?prefLabelLg1 . FILTER(STRENDS(STR(?family),'/operations/famille/${ID}')) . - BIND(STRAFTER(STR(?family),'/famille/') AS ?id) . FILTER (lang(?prefLabelLg1) = '${LG1}') . diff --git a/src/main/resources/request/operations/getOperations.ftlh b/src/main/resources/request/operations/getOperations.ftlh new file mode 100644 index 000000000..f9d0ad962 --- /dev/null +++ b/src/main/resources/request/operations/getOperations.ftlh @@ -0,0 +1,17 @@ +SELECT DISTINCT ?iri ?seriesIri ?id ?label (group_concat(?altLabelLg1;separator=' || ') as ?altLabel) +WHERE { + GRAPH <${OPERATIONS_GRAPH}> { + ?iri a insee:StatisticalOperation . + ?iri skos:prefLabel ?label . + FILTER (lang(?label) = '${LG1}') + BIND(STRAFTER(STR(?iri),'/operations/operation/') AS ?id) . + + ?seriesIri dcterms:hasPart ?iri . + OPTIONAL{ + ?iri skos:altLabel ?altLabelLg1 . + FILTER (lang(?altLabelLg1) = '${LG2}') + } + } +} +GROUP BY ?iri ?seriesIri ?id ?label +ORDER BY ?label \ No newline at end of file diff --git a/src/main/resources/request/operations/series/checkIfSeriesExists.ftlh b/src/main/resources/request/operations/series/checkIfSeriesExists.ftlh index 9376fb431..f35fede58 100644 --- a/src/main/resources/request/operations/series/checkIfSeriesExists.ftlh +++ b/src/main/resources/request/operations/series/checkIfSeriesExists.ftlh @@ -1,5 +1,12 @@ -ASK +SELECT ?uri FROM <${OPERATIONS_GRAPH}> WHERE { -<${URI_SERIES}> rdf:type ?type . + +<#list URI_SERIES as URI_SERIE> + { + <${URI_SERIE}> rdf:type ?type . + BIND('${URI_SERIE}' AS ?uri) . + } + <#sep> UNION + } \ No newline at end of file diff --git a/src/main/resources/request/operations/series/getSeriesById.ftlh b/src/main/resources/request/operations/series/getSeriesById.ftlh index 81e16f089..4435397c4 100644 --- a/src/main/resources/request/operations/series/getSeriesById.ftlh +++ b/src/main/resources/request/operations/series/getSeriesById.ftlh @@ -1,4 +1,4 @@ -SELECT ?id ?prefLabelLg1 ?prefLabelLg2 ?created ?modified ?altLabelLg1 ?altLabelLg2 ?abstractLg1 ?abstractLg2 +SELECT ('${ID}' AS ?id) ?prefLabelLg1 ?prefLabelLg2 ?created ?modified ?altLabelLg1 ?altLabelLg2 ?abstractLg1 ?abstractLg2 ?historyNoteLg1 ?historyNoteLg2 ?idSims ?typeCode ?typeList ?accrualPeriodicityCode ?accrualPeriodicityList ?validationState WHERE { FILTER(STRENDS(STR(?series),'/operations/serie/${ID}')) . diff --git a/src/main/resources/request/operations/series/getSeriesQuery.ftlh b/src/main/resources/request/operations/series/getSeriesQuery.ftlh index 3ac609bdd..860174f72 100644 --- a/src/main/resources/request/operations/series/getSeriesQuery.ftlh +++ b/src/main/resources/request/operations/series/getSeriesQuery.ftlh @@ -1,25 +1,25 @@ -SELECT DISTINCT ?id ?label (group_concat(?altLabelLg1;separator=' || ') as ?altLabel) +SELECT DISTINCT ?iri ?id ?label (group_concat(?altLabelLg1;separator=' || ') as ?altLabel) <#if withSims = "true"> ?idSims WHERE { GRAPH <${OPERATIONS_GRAPH}> { - ?series a insee:StatisticalOperationSeries . - ?series skos:prefLabel ?label . + ?iri a insee:StatisticalOperationSeries . + ?iri skos:prefLabel ?label . FILTER (lang(?label) = '${LG1}') - BIND(STRAFTER(STR(?series),'/operations/serie/') AS ?id) . + BIND(STRAFTER(STR(?iri),'/operations/serie/') AS ?id) . OPTIONAL{ - ?series skos:altLabel ?altLabelLg1 . + ?iri skos:altLabel ?altLabelLg1 . FILTER (lang(?altLabelLg1) = '${LG1}') } <#if withSims = "true"> OPTIONAL{ ?report rdf:type sdmx-mm:MetadataReport . - ?report sdmx-mm:target ?series + ?report sdmx-mm:target ?iri BIND(STRAFTER(STR(?report),'/rapport/') AS ?idSims) . } } } - GROUP BY ?id ?label <#if withSims = "true"> ?idSims + GROUP BY ?iri ?id ?label <#if withSims = "true"> ?idSims ORDER BY ?label \ No newline at end of file diff --git a/src/test/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImplTest.java b/src/test/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImplTest.java index a332bb3b5..6b760d57a 100644 --- a/src/test/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImplTest.java +++ b/src/test/java/fr/insee/rmes/bauhaus_services/datasets/DatasetServiceImplTest.java @@ -280,7 +280,7 @@ void shouldReturnAnErrorIfUnknownSeriesNotDefinedWhenCreating() throws RmesExcep body.put("altIdentifier", "abc"); body.put("catalogRecord", this.generateCatalogRecord()); - when(seriesUtils.isSeriesExist(any())).thenReturn(false); + when(seriesUtils.isSeriesAndOperationsExist(any())).thenReturn(false); when(repositoryGestion.getResponseAsObject(anyString())).then(invocationOnMock -> { JSONObject lastId = new JSONObject(); @@ -288,7 +288,7 @@ void shouldReturnAnErrorIfUnknownSeriesNotDefinedWhenCreating() throws RmesExcep return lastId; }); RmesException exception = assertThrows(RmesBadRequestException.class, () -> datasetService.create(body.toString())); - Assertions.assertEquals("{\"message\":\"The series does not exist\"}", exception.getDetails()); + Assertions.assertEquals("{\"message\":\"Some series or operations do not exist\"}", exception.getDetails()); } } @@ -302,7 +302,7 @@ void shouldReturnAnErrorIfUnknownSeriesNotDefinedWhenCreatingEvenIfAltIdentifier body.put("disseminationStatus", "disseminationStatus"); body.put("catalogRecord", this.generateCatalogRecord()); - when(seriesUtils.isSeriesExist(any())).thenReturn(false); + when(seriesUtils.isSeriesAndOperationsExist(anyList())).thenReturn(false); when(repositoryGestion.getResponseAsObject(anyString())).then(invocationOnMock -> { JSONObject lastId = new JSONObject(); @@ -310,7 +310,7 @@ void shouldReturnAnErrorIfUnknownSeriesNotDefinedWhenCreatingEvenIfAltIdentifier return lastId; }); RmesException exception = assertThrows(RmesBadRequestException.class, () -> datasetService.create(body.toString())); - Assertions.assertEquals("{\"message\":\"The series does not exist\"}", exception.getDetails()); + Assertions.assertEquals("{\"message\":\"Some series or operations do not exist\"}", exception.getDetails()); } } @@ -339,7 +339,7 @@ void shouldPatchDataset() throws RmesException { when(repositoryGestion.getResponseAsArray(anyString())).thenReturn(distributions); JSONArray array = new JSONArray().put(object); - when(seriesUtils.isSeriesExist(any())).thenReturn(true); + when(seriesUtils.isSeriesAndOperationsExist(any())).thenReturn(true); when(repositoryGestion.getResponseAsArray("query")).thenReturn(array); when(repositoryGestion.getResponseAsArray("query-creators")).thenReturn(new JSONArray().put(new JSONObject().put("creator", "http://creator-1"))); when(repositoryGestion.getResponseAsArray("query-contributor")).thenReturn(new JSONArray().put(new JSONObject().put("contributor", "contributor"))); @@ -444,14 +444,14 @@ private void createANewDataset(String nextId) throws RmesException { body.put("descriptionLg2", "descriptionLg2"); - body.put("idSerie", "2"); + body.put("wasGeneratedIRIs", List.of("http://2")); body.put("themes", new JSONArray().put("https://theme")); JSONArray distributions = new JSONArray(); when(repositoryGestion.getResponseAsArray(anyString())).thenReturn(distributions); - when(seriesUtils.isSeriesExist(anyString())).thenReturn(true); + when(seriesUtils.isSeriesAndOperationsExist(anyList())).thenReturn(true); String id = datasetService.create(body.toString()); @@ -462,7 +462,7 @@ private void createANewDataset(String nextId) throws RmesException { ArgumentCaptor model2 = ArgumentCaptor.forClass(Model.class); verify(repositoryGestion, times(1)).loadSimpleObject(eq(catalogRecordIri), model2.capture(), any()); - Assertions.assertEquals("[(http://datasetIRI/jd1001, http://purl.org/dc/terms/identifier, \"jd1001\", http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/dcat#Dataset, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accrualPeriodicity, https://accrualPeriodicity, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accessRights, https://accessRights, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#confidentialityStatus, https://confidentialityStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c1, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/publisher, http://c3, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/modified, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/issued, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#disseminationStatus, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#processStep, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#archiveUnit, https://archiveUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/description, \"descriptionLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/type, http://type, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#statisticalUnit, https://statisticalUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#structure, https://dataStructure, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#numObservations, \"2\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/spatial, https://spacialCoverage, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#temporalResolution, https://temporalResolution, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#spatialResolution, http://spacialResolutions, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#validationState, \"Unpublished\", http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/prov#wasGeneratedBy, http://seriesIRI/2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#theme, https://theme, http://datasetGraph/) [http://datasetGraph/]]".replaceAll("jd1001", nextId), model.getValue().toString()); + Assertions.assertEquals("[(http://datasetIRI/jd1001, http://purl.org/dc/terms/identifier, \"jd1001\", http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/dcat#Dataset, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accrualPeriodicity, https://accrualPeriodicity, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accessRights, https://accessRights, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#confidentialityStatus, https://confidentialityStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c1, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/publisher, http://c3, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/modified, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/issued, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#disseminationStatus, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#processStep, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#archiveUnit, https://archiveUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/description, \"descriptionLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/type, http://type, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#statisticalUnit, https://statisticalUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#structure, https://dataStructure, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#numObservations, \"2\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/spatial, https://spacialCoverage, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#temporalResolution, https://temporalResolution, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#spatialResolution, http://spacialResolutions, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#validationState, \"Unpublished\", http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/prov#wasGeneratedBy, http://2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#theme, https://theme, http://datasetGraph/) [http://datasetGraph/]]".replaceAll("jd1001", nextId), model.getValue().toString()); Assertions.assertEquals("[(http://recordIRI/jd1000, http://xmlns.com/foaf/0.1/primaryTopic, http://datasetIRI/jd1000, http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1000, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/dcat#CatalogRecord, http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1000, http://purl.org/dc/elements/1.1/creator, \"creator\", http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1000, http://purl.org/dc/elements/1.1/contributor, \"contributor\", http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1000, http://purl.org/dc/terms/created, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1000, http://purl.org/dc/terms/modified, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/]]".replaceAll("jd1000", nextId), model2.getValue().toString()); Assertions.assertEquals(id, nextId); } @@ -512,7 +512,7 @@ void shouldPersistExistingDataset() throws RmesException { body.put("descriptionLg1", "descriptionLg1"); body.put("descriptionLg2", "descriptionLg2"); - body.put("idSerie", "2"); + body.put("wasGeneratedIRIs", List.of("http://2")); body.put("themes", new JSONArray().put("http://theme")); body.put("altIdentifier", "1"); @@ -529,7 +529,7 @@ void shouldPersistExistingDataset() throws RmesException { distributions.put(d); when(repositoryGestion.getResponseAsArray(anyString())).thenReturn(distributions); - when(seriesUtils.isSeriesExist(anyString())).thenReturn(true); + when(seriesUtils.isSeriesAndOperationsExist(any())).thenReturn(true); String id = datasetService.update("jd1001", body.toString()); @@ -539,7 +539,8 @@ void shouldPersistExistingDataset() throws RmesException { ArgumentCaptor model2 = ArgumentCaptor.forClass(Model.class); verify(repositoryGestion, times(1)).loadSimpleObject(eq(catalogRecordIri), model2.capture(), any()); - Assertions.assertEquals("[(http://datasetIRI/jd1001, http://purl.org/dc/terms/identifier, \"jd1001\", http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/dcat#Dataset, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accrualPeriodicity, https://accrualPeriodicity, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accessRights, https://accessRights, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#confidentialityStatus, https://confidentialityStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c1, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/publisher, http://c3, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/modified, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/issued, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#disseminationStatus, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#processStep, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#archiveUnit, https://archiveUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/adms#identifier, http://identifiantsAlternatifs/jeuDeDonnees/jd1001, http://datasetGraph/) [http://datasetGraph/], (http://identifiantsAlternatifs/jeuDeDonnees/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/adms#Identifier, http://adms) [http://adms], (http://identifiantsAlternatifs/jeuDeDonnees/jd1001, http://www.w3.org/2004/02/skos/core#notation, \"1\", http://adms) [http://adms], (http://datasetIRI/jd1001, http://purl.org/dc/terms/description, \"descriptionLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/description, \"descriptionLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/type, http://type, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#statisticalUnit, https://statisticalUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#structure, https://dataStructure, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#numObservations, \"2\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/spatial, https://spacialCoverage, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#temporalResolution, https://temporalResolution, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#spatialResolution, http://spacialResolutions, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/prov#wasGeneratedBy, http://seriesIRI/2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#theme, http://theme, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#distribution, http://distributionIRI/d1000, http://datasetGraph/) [http://datasetGraph/]]", model.getValue().toString()); + + Assertions.assertEquals("[(http://datasetIRI/jd1001, http://purl.org/dc/terms/identifier, \"jd1001\", http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/dcat#Dataset, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/title, \"labelLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#subtitle, \"subTitleLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accrualPeriodicity, https://accrualPeriodicity, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/accessRights, https://accessRights, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#confidentialityStatus, https://confidentialityStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c1, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/creator, http://c2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/publisher, http://c3, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#landingPage, \"landingPageLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/modified, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/issued, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#disseminationStatus, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#processStep, https://disseminationStatus, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#archiveUnit, https://archiveUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/adms#identifier, http://identifiantsAlternatifs/jeuDeDonnees/jd1001, http://datasetGraph/) [http://datasetGraph/], (http://identifiantsAlternatifs/jeuDeDonnees/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/adms#Identifier, http://adms) [http://adms], (http://identifiantsAlternatifs/jeuDeDonnees/jd1001, http://www.w3.org/2004/02/skos/core#notation, \"1\", http://adms) [http://adms], (http://datasetIRI/jd1001, http://purl.org/dc/terms/description, \"descriptionLg1\"@fr, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/description, \"descriptionLg2\"@en, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/type, http://type, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#statisticalUnit, https://statisticalUnit, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#structure, https://dataStructure, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#numObservations, \"2\"^^, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://purl.org/dc/terms/spatial, https://spacialCoverage, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#temporalResolution, https://temporalResolution, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://rdf.insee.fr/def/base#spatialResolution, http://spacialResolutions, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/prov#wasGeneratedBy, http://2, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#theme, http://theme, http://datasetGraph/) [http://datasetGraph/], (http://datasetIRI/jd1001, http://www.w3.org/ns/dcat#distribution, http://distributionIRI/d1000, http://datasetGraph/) [http://datasetGraph/]]", model.getValue().toString()); Assertions.assertEquals("[(http://recordIRI/jd1001, http://xmlns.com/foaf/0.1/primaryTopic, http://datasetIRI/jd1001, http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1001, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/ns/dcat#CatalogRecord, http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1001, http://purl.org/dc/elements/1.1/creator, \"creator\", http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1001, http://purl.org/dc/elements/1.1/contributor, \"contributor\", http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1001, http://purl.org/dc/terms/created, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/], (http://recordIRI/jd1001, http://purl.org/dc/terms/modified, \"2023-10-19T11:44:23.33559\"^^, http://datasetGraph/) [http://datasetGraph/]]", model2.getValue().toString()); Assertions.assertEquals("jd1001", id); } diff --git a/src/test/java/fr/insee/rmes/testcontainers/queries/DatasetQueriesTest.java b/src/test/java/fr/insee/rmes/testcontainers/queries/DatasetQueriesTest.java new file mode 100644 index 000000000..9a1033ebb --- /dev/null +++ b/src/test/java/fr/insee/rmes/testcontainers/queries/DatasetQueriesTest.java @@ -0,0 +1,68 @@ +package fr.insee.rmes.testcontainers.queries; + +import fr.insee.rmes.bauhaus_services.datasets.DatasetQueries; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryGestion; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryInitiator; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryUtils; +import fr.insee.rmes.config.ConfigStub; +import org.json.JSONArray; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class DatasetQueriesTest extends WithGraphDBContainer { + RepositoryGestion repositoryGestion = new RepositoryGestion(getRdfGestionConnectionDetails(), new RepositoryUtils(null, RepositoryInitiator.Type.DISABLED)); + + @BeforeAll + static void initData(){ + container.withTrigFiles("jeuxDeDonnees-pour-tests.trig"); + } + + @Test + void should_return_all_datasets() throws Exception { + DatasetQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(DatasetQueries.getDatasets("http://rdf.insee.fr/graphes/catalogue", null)); + assertEquals(3, result.length()); + } + + @Test + void should_return_all_datasets_based_on_stamp() throws Exception { + DatasetQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(DatasetQueries.getDatasets("http://rdf.insee.fr/graphes/catalogue", "DG75-L001")); + assertEquals(1, result.length()); + } + + @Test + void should_return_all_archival_units() throws Exception { + DatasetQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(DatasetQueries.getArchivageUnits()); + assertEquals("diffusion Insee.fr", result.getJSONObject(0).getString("label")); + assertEquals("http://bauhaus/identifierSchemes/uniteArchivageNamingScheme/identifier/UA1", result.getJSONObject(0).getString("value")); + assertEquals(1, result.length()); + } + @Test + void should_return_all_was_generated_if_multiple_values() throws Exception { + JSONArray result = repositoryGestion.getResponseAsArray(DatasetQueries.getDatasetWasGeneratedIris("jeuDeDonneesTousChampsEtMultiValeurs", "http://rdf.insee.fr/graphes/catalogue")); + assertEquals("http://bauhaus/operations/operation/s2159", result.getJSONObject(0).getString("iri")); + assertEquals("http://bauhaus/operations/operation/s2160", result.getJSONObject(1).getString("iri")); + assertEquals(2, result.length()); + } + + @Test + void should_return_all_creators_if_multiple_values() throws Exception { + JSONArray result = repositoryGestion.getResponseAsArray(DatasetQueries.getDatasetCreators("jeuDeDonneesTousChampsEtMultiValeurs", "http://rdf.insee.fr/graphes/catalogue")); + assertEquals("http://bauhaus/organisations/ined", result.getJSONObject(0).getString("creator")); + assertEquals("http://bauhaus/organisations/insee", result.getJSONObject(1).getString("creator")); + assertEquals(2, result.length()); + } + + @Test + void should_return_all_spacial_resolutions_if_multiple_values() throws Exception { + JSONArray result = repositoryGestion.getResponseAsArray(DatasetQueries.getDatasetSpacialResolutions("jeuDeDonneesTousChampsEtMultiValeurs", "http://rdf.insee.fr/graphes/catalogue")); + assertEquals("http://bauhaus/codes/typeTerritoireGeographique/COM", result.getJSONObject(0).getString("spacialResolution")); + assertEquals("http://bauhaus/codes/typeTerritoireGeographique/DEP", result.getJSONObject(1).getString("spacialResolution")); + assertEquals("http://bauhaus/codes/typeTerritoireGeographique/REG", result.getJSONObject(2).getString("spacialResolution")); + assertEquals(3, result.length()); + } +} diff --git a/src/test/java/fr/insee/rmes/testcontainers/queries/sparql_queries/operations/operations/OperationsQueriesTest.java b/src/test/java/fr/insee/rmes/testcontainers/queries/sparql_queries/operations/operations/OperationsQueriesTest.java new file mode 100644 index 000000000..6974b060e --- /dev/null +++ b/src/test/java/fr/insee/rmes/testcontainers/queries/sparql_queries/operations/operations/OperationsQueriesTest.java @@ -0,0 +1,35 @@ +package fr.insee.rmes.testcontainers.queries.sparql_queries.operations.operations; + +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryGestion; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryInitiator; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryUtils; +import fr.insee.rmes.config.ConfigStub; +import fr.insee.rmes.persistance.sparql_queries.operations.operations.OperationsQueries; +import fr.insee.rmes.persistance.sparql_queries.operations.series.OpSeriesQueries; +import fr.insee.rmes.testcontainers.queries.WithGraphDBContainer; +import org.json.JSONArray; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class OperationsQueriesTest extends WithGraphDBContainer { + RepositoryGestion repositoryGestion = new RepositoryGestion(getRdfGestionConnectionDetails(), new RepositoryUtils(null, RepositoryInitiator.Type.DISABLED)); + + @BeforeAll + static void initData(){ + container.withTrigFiles("all-operations-and-indicators.trig"); + } + + @Test + void should_return_all_operations() throws Exception { + OpSeriesQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(OperationsQueries.operationsQuery()); + assertEquals(390, result.length()); + + for (var i = 0; i < result.length(); i++){ + assertNotNull(result.getJSONObject(i).getString("iri")); + } + } +} diff --git a/src/test/java/fr/insee/rmes/testcontainers/queries/sparql_queries/operations/series/OpSeriesQueriesTest.java b/src/test/java/fr/insee/rmes/testcontainers/queries/sparql_queries/operations/series/OpSeriesQueriesTest.java new file mode 100644 index 000000000..3c8037924 --- /dev/null +++ b/src/test/java/fr/insee/rmes/testcontainers/queries/sparql_queries/operations/series/OpSeriesQueriesTest.java @@ -0,0 +1,51 @@ +package fr.insee.rmes.testcontainers.queries.sparql_queries.operations.series; + +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryGestion; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryInitiator; +import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryUtils; +import fr.insee.rmes.config.ConfigStub; +import fr.insee.rmes.persistance.sparql_queries.operations.series.OpSeriesQueries; +import fr.insee.rmes.testcontainers.queries.WithGraphDBContainer; +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class OpSeriesQueriesTest extends WithGraphDBContainer { + RepositoryGestion repositoryGestion = new RepositoryGestion(getRdfGestionConnectionDetails(), new RepositoryUtils(null, RepositoryInitiator.Type.DISABLED)); + + @BeforeAll + static void initData(){ + container.withTrigFiles("all-operations-and-indicators.trig"); + } + + @Test + void should_return_all_series() throws Exception { + OpSeriesQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(OpSeriesQueries.seriesWithSimsQuery()); + assertEquals(174, result.length()); + + for (var i = 0; i < result.length(); i++){ + assertNotNull(result.getJSONObject(i).getString("iri")); + } + } + + @Test + void should_return_all_series_and_operators() throws Exception { + OpSeriesQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(OpSeriesQueries.checkIfSeriesExists(List.of("http://bauhaus/operations/serie/s1028", "http://bauhaus/operations/operation/s1489"))); + assertEquals(2, result.length()); + } + + @Test + void should_return_filter_missing_objects() throws Exception { + OpSeriesQueries.setConfig(new ConfigStub()); + JSONArray result = repositoryGestion.getResponseAsArray(OpSeriesQueries.checkIfSeriesExists(List.of("http://bauhaus/operations/serie/unknown", "http://bauhaus/operations/operation/s1489"))); + assertEquals(1, result.length()); + } +} diff --git a/src/test/resources/testcontainers/jeuxDeDonnees-pour-tests.trig b/src/test/resources/testcontainers/jeuxDeDonnees-pour-tests.trig new file mode 100644 index 000000000..791daec44 --- /dev/null +++ b/src/test/resources/testcontainers/jeuxDeDonnees-pour-tests.trig @@ -0,0 +1,493 @@ +@prefix adms: . +@prefix dc: . +@prefix dcat: . +@prefix dct: . +@prefix foaf: . +@prefix insee: . +@prefix org: . +@prefix owl: . +@prefix pav: . +@prefix prov: . +@prefix rdf: . +@prefix rdfs: . +@prefix skos: . +@prefix stat-dcat-ap: . +@prefix xsd: . + + { + a dcat:CatalogRecord; + dc:creator "DG75-L001"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + foaf:primaryTopic ; + . + + rdf:type dcat:Dataset; + dct:identifier "jeuDeDonneesChampsObligatoires"; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + dct:title "Jeu de données avec seulement les champs obligatoires à l'IHM renseignés"@fr, "Dataset with only mandatory properties"@en; + prov:wasGeneratedBy ; + . + + a dcat:CatalogRecord; + dc:creator "DG75-L001"; + dc:contributor "DG75-L201"; + dct:created "2020-02-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-02-01T00:00:00.000"^^xsd:dateTime; + foaf:primaryTopic ; + . + + rdf:type dcat:Dataset; + dct:identifier "jeuDeDonneesTousChamps"; + adms:identifier ; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + dct:title "Jeu de données l'ensemble des champs IHM renseignés"@fr, "Dataset with all properties"@en; + insee:subtitle "une seule valeur par propriétés"@fr, "only one value par property"@en; + dct:creator ; + dct:publisher ; + prov:wasGeneratedBy ; + dct:issued "2023-02-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2024-02-01T00:00:00.000"^^xsd:dateTime; + dct:abstract "résumé fr"@fr, "abstract en"@en; + dct:description "description fr"@fr, "description en"@en; + skos:scopeNote "avertissement fr"@fr, "caution en"@en; + dcat:theme ; + dcat:keyword "Statistiques"@fr; + dcat:landingPage "https://www.insee.fr/fr/accueil"@fr, "https://www.insee.fr/en/accueil"@en; + dct:relation ; + dct:accessRights ; + insee:confidentialityStatus ; + insee:processStep ; + insee:archiveUnit ; + dct:accrualPeriodicity ; + dct:type ; + insee:structure ; + insee:statisticalUnit ; + dct:temporal [a dcterms:PeriodOfTime; dcat:startDate "2000-01-01"^^xsd:date; dcat:endDate "2023-01-01"^^xsd:date;]; + dcat:temporalResolution ; + dct:spatial ; + insee:spatialResolution ; + insee:spatialTemporal "2023-01-01"^^xsd:date; + stat-dcat-ap:numSeries "10"^^xsd:int; + insee:numObservations "2400"^^xsd:int; + . + + a dcat:CatalogRecord; + dc:creator "DG75-L001"; + dc:contributor "DG75-L201", "DG75-L001"; + dct:created "2020-01-01T10:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T10:00:00.000"^^xsd:dateTime; + foaf:primaryTopic ; + . + + rdf:type dcat:Dataset; + dct:identifier "jeuDeDonneesTousChampsEtMultiValeurs"; + adms:identifier ; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + dct:title "Jeu de données l'ensemble des champs IHM renseignés"@fr, "Dataset with all properties"@en; + insee:subtitle "une seule valeur par propriétés"@fr, "only one value par property"@en; + dct:creator , ; + dct:publisher ; + prov:wasGeneratedBy , ; + dct:issued "2023-01-01T10:00:00.000"^^xsd:dateTime; + dct:modified "2024-01-01T10:00:00.000"^^xsd:dateTime; + dct:abstract "résumé fr"@fr, "abstract en"@en; + dct:description "description fr"@fr, "description en"@en; + skos:scopeNote "avertissement fr"@fr, "caution en"@en; + dcat:theme , , ; + dcat:keyword "Statistiques"@fr, "Statistics"@en, "Jeux de données HVD"@fr, "High value dataset"@en, "HVD"@en; + dcat:landingPage "https://www.insee.fr/fr/accueil"@fr, "https://www.insee.fr/en/accueil"@en; + dct:relation , , ; + dct:accessRights ; + insee:confidentialityStatus ; + insee:processStep ; + insee:archiveUnit ; + dct:accrualPeriodicity ; + dct:type ; + insee:structure ; + insee:statisticalUnit , , ; + dct:temporal [a dcterms:PeriodOfTime; dcat:startDate "2000-01-01"^^xsd:date; dcat:endDate "2020-01-01"^^xsd:date;]; + dcat:temporalResolution ; + dct:spatial ; + insee:spatialResolution , , ; + insee:spatialTemporal "2020-01-01"^^xsd:date; + stat-dcat-ap:numSeries "10"^^xsd:int; + insee:numObservations "1320"^^xsd:int; + . +} + + { + a adms:Identifier; + skos:notation "DATASET_ALL_PROPERTIES"; + . + + a adms:Identifier; + skos:notation "DATASET_ALL_PROPERTIES_WITH_MULTIPLE_VALUES"; + . + + a adms:Identifier; + skos:notation "UA1"; + skos:prefLabel "diffusion Insee.fr"@fr, "Insee.fr dissemination"@en; + skos:inScheme ; + . +} + + { + rdf:type insee:StatisticalOperationFamily; + skos:prefLabel "Voir également"@fr, "See also"@en; + dct:hasPart ; + . + + rdf:type insee:StatisticalOperationSeries; + skos:prefLabel "Autres indicateurs"@fr, "Ohter indexes"@en; + dct:isPartOf ; + . + + rdf:type insee:StatisticalOperationFamily; + skos:prefLabel "Recensement des équipements"@fr, "Facilities census"@en; + dct:hasPart , ; + . + + rdf:type insee:StatisticalOperationSeries; + skos:prefLabel "Base permanente des équipements"@fr, "Permanent database of facilities"@en; + dct:isPartOf ; + dct:hasPart , ; + . + + rdf:type insee:StatisticalOperation; + skos:prefLabel "BPE 2023"@fr, "BPE 2023"@en; + dct:isPartOf ; + . + + rdf:type insee:StatisticalOperation; + skos:prefLabel "BPE 2024"@fr, "BPE 2024"@en; + dct:isPartOf ; + . + + rdf:type insee:StatisticalOperationSeries; + skos:prefLabel "Inventaire communal"@fr, "Municipality Inventory"@en; + dct:isPartOf ; + . +} + + { + rdf:type org:Organization, org:OrganizationalUnit; + dct:identifier "Ined"; + skos:prefLabel "Institut national d’études démographiques"@fr, "National institute of demographic studies"@en; + . + + rdf:type org:Organization, org:OrganizationalUnit, insee:NationalStatisticalInstitute; + dct:identifier "Insee"; + skos:prefLabel "Institut national de la statistique et des études économiques"@fr, "National Institute of Statistics and Economic Studies"@en; + . +} + + { + rdf:type org:Organization; + dct:identifier "Insee"; + skos:prefLabel "Institut national de la statistique et des études économiques"@fr, "National Institute of Statistics and Economic Studies"@en; + org:hasUnit ; + . + + rdf:type org:Organization, org:OrganizationalUnit; + dct:identifier "DG75-A001"; + skos:prefLabel "Direction générale (DG)"@fr; + org:unitOf ; + . +} + + { + rdf:type skos:ConceptScheme; + skos:notation "inseeTheme"; + skos:prefLabel "Thèmes statistiques"@fr, "Statistical themes"@en; + skos:hasTopConcept , ; + . + + rdf:type rdfs:Class ; + rdfs:label "Thème statistique"@fr, "Statistical theme"@en; + . + + rdf:type skos:Concept, ; + skos:notation "POP"; + skos:prefLabel "Démographie"@fr, "Demography"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:Concept, ; + skos:notation "ECO"; + skos:prefLabel "Économie – Conjoncture – Comptes nationaux"@fr, "Economy – Economic outlook – National accounts"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "classificationOfStatisticalDomain"; + skos:prefLabel "Domaines statistiques"@fr, "Statistical Domains"@en; + skos:hasTopConcept , ; + . + + rdf:type rdfs:Class ; + rdfs:label "Domaines statistiques"@fr, "Statistical Domains"@en; + . + + rdf:type skos:Concept, ; + skos:notation "1"; + skos:prefLabel "1 Statistiques démographiques et sociales"@fr, "1 Demographic and social statistics"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:Concept, ; + skos:notation "ECO"; + skos:prefLabel "Économie – Conjoncture – Comptes nationaux"@fr, "Economy – Economic outlook – National accounts"@en; + skos:inScheme ; + skos:topConceptOf ; + . +} + + { + rdf:type skos:ConceptScheme; + skos:notation "CL_ACCESS_RIGHTS"; + skos:prefLabel "Droits d'accès"@fr, "Access rights"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept ; + . + + rdf:type owl:Class; + rdfs:label "Droit d'accès"@fr, "Access right"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "L"; + skos:prefLabel "Libre"@fr, "Free"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_CONF_STATUS"; + skos:prefLabel "Statuts de confidentialité"@fr, "Confidentiality statuses"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept ; + . + + rdf:type owl:Class; + rdfs:label "Statut de confidentialité"@fr, "Confidentiality status"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "L"; + skos:prefLabel "Libre"@fr, "Free"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_PROCESS_STEP"; + skos:prefLabel "Etapes du processus utilisant les données"@fr, "Process steps using the data"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept ; + . + + rdf:type owl:Class; + rdfs:label "Etape du processus utilisant les données"@fr, "Process step using the data"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "IA"; + skos:prefLabel "inseeApi"@fr, "inseeApi"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_FREQ"; + skos:prefLabel "Fréquences"@fr, "Frequencies"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept ; + . + + rdf:type owl:Class; + rdfs:label "Fréquence"@fr, "Frequency"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "A"; + skos:prefLabel "Annuelle"@fr, "Annual"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_DATA_TYPES"; + skos:prefLabel "Types de données"@fr, "Data types"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept ; + . + + rdf:type owl:Class; + rdfs:label "Type de données"@fr, "Data type"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "A"; + skos:prefLabel "Données agrégées"@fr, "Agregated data"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_STAT_UNIT"; + skos:prefLabel "Unités statistiques"@fr, "Statistical units"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept , , ; + . + + rdf:type owl:Class; + rdfs:label "Unité statistique"@fr, "Statistical unit"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "P"; + skos:prefLabel "Entreprise"@fr, "Enterprise"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:Concept, ; + skos:notation "L"; + skos:prefLabel "Etablissement"@fr, "Locat unit (of an entreprise)"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:Concept, ; + skos:notation "E"; + skos:prefLabel "Unité légale"@fr, "Legal unit"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_GEO"; + skos:prefLabel "Zones géographiques"@fr, "Geographic Areas"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept ; + . + + rdf:type owl:Class; + rdfs:label "Zone géographique"@fr, "Geographic Area"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "F"; + skos:prefLabel "France"@fr, "France"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:ConceptScheme; + skos:notation "CL_TYPE_GEO"; + skos:prefLabel "Types de territoire géographique"@fr, "Types of geographic area"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" ; + rdfs:seeAlso ; + skos:hasTopConcept , , ; + . + + rdf:type owl:Class; + rdfs:label "Type de territoire géographique"@fr, "Type of geographic area"@en; + rdfs:seeAlso ; + . + + rdf:type skos:Concept, ; + skos:notation "COM"; + skos:prefLabel "Commune"@fr, "Township"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:Concept, ; + skos:notation "DEP"; + skos:prefLabel "Département"@fr, "Commune"@en; + skos:inScheme ; + skos:topConceptOf ; + . + + rdf:type skos:Concept, ; + skos:notation "REG"; + skos:prefLabel "Région"@fr, "Region"@en; + skos:inScheme ; + skos:topConceptOf ; + . +} + + { + a qb:DataStructureDefinition; + dcterms:identifier "dsd1000"; + rdfs:label "Structure pour jeuDeDonneesChampsObligatoires"@fr, "DSD for jeuDeDonneesChampsObligatoires"@en; + dc:creator "DG75-L201"; + dc:contributor "DG75-L201"; + dct:created "2020-01-01T00:00:00.000"^^xsd:dateTime; + dct:modified "2021-01-01T00:00:00.000"^^xsd:dateTime; + insee:disseminationStatus ; + insee:validationState "Unpublished" . +} \ No newline at end of file