diff --git a/src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFDatasetUtils.kt b/src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFDatasetUtils.kt index 46020e5..f61ce01 100644 --- a/src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFDatasetUtils.kt +++ b/src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFDatasetUtils.kt @@ -20,8 +20,8 @@ fun Model.addDatasetResource(dataset: Dataset, seriesData: SeriesData): Resource if (dataset.specializedType == SpecializedType.SERIES) { datasetResource .addProperty(RDF.type, ResourceFactory.createProperty("${DCAT.getURI()}DatasetSeries")) - .safeAddProperty(ResourceFactory.createProperty("${DCAT.getURI()}first"), seriesData.first) - .safeAddProperty(ResourceFactory.createProperty("${DCAT.getURI()}last"), seriesData.last) + .safeAddLinkedProperty(ResourceFactory.createProperty("${DCAT.getURI()}first"), seriesData.first) + .safeAddLinkedProperty(ResourceFactory.createProperty("${DCAT.getURI()}last"), seriesData.last) } else { datasetResource .addProperty(RDF.type, DCAT.Dataset) @@ -56,9 +56,9 @@ fun Model.addDatasetResource(dataset: Dataset, seriesData: SeriesData): Resource .addPublisher(dataset.publisher) .addSubjects(dataset.concepts) .addLanguages(dataset.language) - .safeAddProperty(ResourceFactory.createProperty("${DCAT.getURI()}inSeries"), seriesData.inSeries) - .safeAddProperty(ResourceFactory.createProperty("${DCAT.getURI()}next"), seriesData.next) - .safeAddProperty(ResourceFactory.createProperty("${DCAT.getURI()}prev"), seriesData.prev) + .safeAddLinkedProperty(ResourceFactory.createProperty("${DCAT.getURI()}inSeries"), seriesData.inSeries) + .safeAddLinkedProperty(ResourceFactory.createProperty("${DCAT.getURI()}next"), seriesData.next) + .safeAddLinkedProperty(ResourceFactory.createProperty("${DCAT.getURI()}prev"), seriesData.prev) } return datasetResource } diff --git a/src/test/resources/getAll.ttl b/src/test/resources/getAll.ttl index 1cadd4d..01edd66 100644 --- a/src/test/resources/getAll.ttl +++ b/src/test/resources/getAll.ttl @@ -52,17 +52,17 @@ rdf:type dcat:DatasetSeries ; dct:identifier "http://localhost:5000/catalogs/123123123/datasets/series0" ; - dcat:first "http://localhost:5000/catalogs/123123123/datasets/series1" ; - dcat:last "http://localhost:5000/catalogs/123123123/datasets/series5" . + dcat:first ; + dcat:last . rdf:type dcat:Dataset ; dct:identifier "http://localhost:5000/catalogs/123123123/datasets/series1" ; - dcat:next "http://localhost:5000/catalogs/123123123/datasets/series5" ; - dcat:inSeries "http://localhost:5000/catalogs/123123123/datasets/series0" . + dcat:next ; + dcat:inSeries . rdf:type dcat:Dataset ; dct:identifier "http://localhost:5000/catalogs/123123123/datasets/series5" ; - dcat:prev "http://localhost:5000/catalogs/123123123/datasets/series1" ; - dcat:inSeries "http://localhost:5000/catalogs/123123123/datasets/series0" . + dcat:prev ; + dcat:inSeries .