Skip to content

Commit

Permalink
fix: add series properies as linked data
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen committed Sep 26, 2023
1 parent 240cc52 commit 4a9d906
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFDatasetUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
12 changes: 6 additions & 6 deletions src/test/resources/getAll.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@
<http://localhost:5000/catalogs/123123123/datasets/series0>
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 <http://localhost:5000/catalogs/123123123/datasets/series1> ;
dcat:last <http://localhost:5000/catalogs/123123123/datasets/series5> .

<http://localhost:5000/catalogs/123123123/datasets/series1>
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 <http://localhost:5000/catalogs/123123123/datasets/series5> ;
dcat:inSeries <http://localhost:5000/catalogs/123123123/datasets/series0> .

<http://localhost:5000/catalogs/123123123/datasets/series5>
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 <http://localhost:5000/catalogs/123123123/datasets/series1> ;
dcat:inSeries <http://localhost:5000/catalogs/123123123/datasets/series0> .

0 comments on commit 4a9d906

Please sign in to comment.