Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add conformsTo as blank node if missing uri but has valid title #198

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading