Skip to content

Commit

Permalink
fix: add conformsTo as blank node if missing uri but has valid title
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen committed Aug 30, 2024
1 parent f33a1b5 commit a712b86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/no/fdk/dataset_catalog/rdf/RDFUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fun Resource.addContactPoints(contactPoints: Collection<Contact>?): Resource {

fun Resource.addConformsTo(conformsTo: Collection<SkosConcept>?): Resource {
conformsTo?.forEach {
if (!it.uri.isNullOrEmpty()) {
if (!it.uri.isNullOrEmpty() || it.prefLabel.isValidLangField()) {
addProperty(DCTerms.conformsTo,
model.safeCreateResource(it.uri)
.addProperty(RDF.type, DCTerms.Standard)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ val TEST_DATASET_1 = Dataset(
prefLabel=mapOf(Pair("nb", "Begrenset"))
),
publisher = PUBLISHER,
informationModel = listOf(SkosConcept(uri="https://www.w3.org/2004/02/skos/",prefLabel=mapOf(Pair("nb","SKOS")),extraType = null)),
informationModel = listOf(SkosConcept(uri="",prefLabel=mapOf(Pair("nb","SKOS")),extraType = null)),
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
9 changes: 3 additions & 6 deletions src/test/resources/catalog_2.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
] ;
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.w3.org/2004/02/skos/> , <https://www.kartverket.no/geodataarbeid/standarder/sosi/> ;
dct:conformsTo <https://www.kartverket.no/geodataarbeid/standarder/sosi/> ;
dct:conformsTo [ a dct:Standard ;
dct:title "SKOS"@nb ] ;
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 @@ -192,11 +194,6 @@
rdfs:seeAlso <https://www.kartverket.no/geodataarbeid/standarder/sosi/> ;
dct:title "SOSI"@nb .

<https://www.w3.org/2004/02/skos/>
a dct:Standard ;
rdfs:seeAlso <https://www.w3.org/2004/02/skos/> ;
dct:title "SKOS"@nb .

<https://data-david.github.io/Begrep/begrep/Enhet>
a skos:Concept ;
skos:altLabel "orgnr"@no , "orgzip"@en ;
Expand Down

0 comments on commit a712b86

Please sign in to comment.