Skip to content

Commit

Permalink
fix: add all valueRange values to RDF
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen authored and hegeaal committed Jun 27, 2024
1 parent 5afa84d commit 6918211
Showing 1 changed file with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,15 @@ class SkosApNoModelService(
definitionResource
}

private fun Resource.addScopeToConcept(concept: Begrep) {
concept.omfang
?.takeIf { !it.tekst.isNullOrBlank() || it.uri.isValidURI() }
?.let { source -> addURIOrText(SKOSNO.valueRange, source) }
}
private fun Resource.addScopeToConcept(concept: Begrep) =
concept.omfang?.let { valueRange ->
if (valueRange.uri.isValidURI()) {
addProperty(SKOSNO.valueRange, model.safeCreateResource(valueRange.uri))
}
if (!valueRange.tekst.isNullOrBlank()) {
addProperty(SKOSNO.valueRange, valueRange.tekst, NB)
}
}

private fun Resource.addStatusToConcept(concept: Begrep) {
concept.statusURI
Expand Down Expand Up @@ -251,16 +255,6 @@ class SkosApNoModelService(
}
}

private fun Resource.addURIOrText(predicate: Property, uriText: URITekst) {
if (uriText.uri.isValidURI()) {
addProperty(predicate, model.safeCreateResource(uriText.uri))
}
else if (!uriText.tekst.isNullOrBlank()) {
addProperty(predicate, uriText.tekst, NB)
}
}


private fun Resource.addAltLabelToConcept(concept: Begrep) {
concept.tillattTerm
?.filterValues { it.isNotEmpty() }
Expand Down

0 comments on commit 6918211

Please sign in to comment.