Skip to content

Commit

Permalink
feat: separate association to informationModels from fdk to separate …
Browse files Browse the repository at this point in the history
…list
  • Loading branch information
hegeaal committed Oct 25, 2024
1 parent a712b86 commit ae361c4
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/no/fdk/dataset_catalog/model/Dataset.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ data class Dataset(
// Norwegian: informasjonsmodell
// a: SkosConcept
val informationModel: List<SkosConcept>? = null,
val informationModelsFromFDK: List<String>? = null,

// prov:qualifiedAttribution
// Norwegian: innholdsleverandører
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fun Model.addDatasetResource(dataset: Dataset, seriesData: SeriesData): Resource
.safeAddLinkListProperty(ADMS.identifier, dataset.admsIdentifier)
.addConformsTo(dataset.conformsTo)
.addConformsTo(dataset.informationModel)
.addConformsToFromListOfUris(dataset.informationModelsFromFDK)
.addQualifiedAttributions(dataset.qualifiedAttributions)
.addDatasetType(dataset.type)
.addPublisher(dataset.publisher)
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ fun Resource.addConformsTo(conformsTo: Collection<SkosConcept>?): Resource {
return this
}

fun Resource.addConformsToFromListOfUris(conformsTo: Collection<String>?): Resource {
conformsTo?.forEach {
addProperty(DCTerms.conformsTo,
model.safeCreateResource(it)
.addProperty(RDF.type, DCTerms.Standard)
.safeAddLinkedProperty(DCTerms.source, it)
)
}
return this
}

fun Resource.addDistribution(property: Property, distributions: Collection<Distribution>?): Resource {
distributions?.forEach {
if (it.hasNonNullOrEmptyProperty()) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/specification/specification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ components:
items:
$ref: "#/components/schemas/SkosConcept"
description: List of associated information models mapped as SkosConcept
informationModelFDK:
type: array
items:
type: string
description: List of uris to associated information models in FDK
qualifiedAttributions:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ val TEST_DATASET_1 = Dataset(
),
publisher = PUBLISHER,
informationModel = listOf(SkosConcept(uri="",prefLabel=mapOf(Pair("nb","SKOS")),extraType = null)),
informationModelsFromFDK = listOf(
"https://raw.githubusercontent.com/Informasjonsforvaltning/model-publisher/master/src/model/catalog-of-models-for-specifications.ttl#dqv-ap-no-model",
"https://raw.githubusercontent.com/Informasjonsforvaltning/fdk-testdata/master/testdata/SkatvalModellkatalog.ttl#AdresseModell"),
temporal = listOf(PeriodOfTime(startDate = LocalDate.of(2017,1,1),endDate = LocalDate.of(2017,12,31)), PeriodOfTime(endDate=LocalDate.of(2018,10,20))),
concepts = listOf(CONCEPT),
accrualPeriodicity=SkosCode(uri="http://publications.europa.eu/resource/authority/frequency/ANNUAL", code="ANNUAL", prefLabel=mapOf(Pair("nb", "årlig"))),
Expand Down Expand Up @@ -169,4 +172,3 @@ val TEST_CATALOG_1 = Catalog(
)



17 changes: 15 additions & 2 deletions src/test/resources/catalog_2.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@
dct:accessRights <http://publications.europa.eu/resource/authority/access-right/RESTRICTED> ;
dct:accrualPeriodicity <http://publications.europa.eu/resource/authority/frequency/ANNUAL> ;
dct:conformsTo <https://www.kartverket.no/geodataarbeid/standarder/sosi/> ;
dct:conformsTo [ a dct:Standard ;
dct:title "SKOS"@nb ] ;
dct:conformsTo [ a dct:Standard ;
dct:title "SKOS"@nb
] ;
dct:conformsTo <https://raw.githubusercontent.com/Informasjonsforvaltning/fdk-testdata/master/testdata/SkatvalModellkatalog.ttl#AdresseModell> ,
<https://raw.githubusercontent.com/Informasjonsforvaltning/model-publisher/master/src/model/catalog-of-models-for-specifications.ttl#dqv-ap-no-model> ;
dct:description "Datasettet avgrenser område for virkeområdet til lov 6. juni 2009 nr. 35 om naturområder i Oslo og nærliggende kommuner (markaloven) som trådte i kraft 1. september 2009. Markalovens virkeområde er fastsatt i forskrift 4. september 2015 nr. 1032 om justering av markagrensen fastlegger markalovens geografiske virkeområde med tilhørende kart."@nb ;
dct:issued "2012-01-01"^^xsd:date ;
dct:language <http://publications.europa.eu/resource/authority/language/ENG> , <http://publications.europa.eu/resource/authority/language/NOR> ;
Expand Down Expand Up @@ -189,6 +192,16 @@
] ;
foaf:page <http://uri1> .

<https://raw.githubusercontent.com/Informasjonsforvaltning/fdk-testdata/master/testdata/SkatvalModellkatalog.ttl#AdresseModell>
a dct:Standard ;
dct:source <https://raw.githubusercontent.com/Informasjonsforvaltning/fdk-testdata/master/testdata/SkatvalModellkatalog.ttl#AdresseModell> ;
.

<https://raw.githubusercontent.com/Informasjonsforvaltning/model-publisher/master/src/model/catalog-of-models-for-specifications.ttl#dqv-ap-no-model>
a dct:Standard ;
dct:source <https://raw.githubusercontent.com/Informasjonsforvaltning/model-publisher/master/src/model/catalog-of-models-for-specifications.ttl#dqv-ap-no-model> ;
.

<https://www.kartverket.no/geodataarbeid/standarder/sosi/>
a dct:Standard ;
rdfs:seeAlso <https://www.kartverket.no/geodataarbeid/standarder/sosi/> ;
Expand Down

0 comments on commit ae361c4

Please sign in to comment.