Commit 07c79224 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix empty rico:Concept creation

parent 2c22b6ca
Pipeline #11565 passed with stages
in 5 minutes and 5 seconds
......@@ -255,11 +255,11 @@ class MappingConfig(directory: String) {
SKOS.acceptedPropertiesList
)
} catch (ex: ClassCastException) {
throw InvalidMappingException("Expected a map inside of the list entry in the ${key} section.")
throw InvalidMappingException("Expected a map inside of the list entry in the $key section.")
}
}
}
else -> throw InvalidMappingException("Expected a mapping or a list inside of the ${key} section!")
else -> throw InvalidMappingException("Expected a mapping or a list inside of the $key section!")
}
}
......
......@@ -58,11 +58,8 @@ class ExpandedRuleFieldMapper(private val type: String, private val configField:
}
}
}
if (properties.isNotEmpty()) {
subject.addRule(type, properties)
}
}
}
\ No newline at end of file
......@@ -36,10 +36,18 @@ class RicoConceptMapper(private val rdfType: String, private val field: Annotati
}
is ConstantField ->
subject.addRicoConcept(rdfType, field.key, listOf(field.toLiteral()))
is LanguageField ->
subject.addRicoConcept(rdfType, field.key, field.toLangLiterals(source))
is ListField ->
is LanguageField -> {
val fields = field.toLangLiterals(source)
if (fields.isNotEmpty()) {
subject.addRicoConcept(rdfType, field.key, fields)
}
}
is ListField -> {
val fields = field.toLiterals(source)
if (fields.isNotEmpty()) {
subject.addRicoConcept(rdfType, field.key, field.toLiterals(source))
}
}
}
}
}
\ No newline at end of file
......@@ -38,10 +38,18 @@ class RuleFieldMapper(private val configField: ConfigField) : IFieldMapper {
}
is ConstantField ->
subject.addRule(configField.key, listOf(Pair(KEYS.name, listOf(configField.toLiteral()))))
is LanguageField ->
subject.addRule(configField.key, listOf(Pair(KEYS.name, configField.toLangLiterals(source))))
is ListField ->
subject.addRule(configField.key, listOf(Pair(KEYS.name, configField.toLiterals(source))))
is LanguageField -> {
val literals = configField.toLangLiterals(source)
if (literals.isNotEmpty()) {
subject.addRule(configField.key, listOf(Pair(KEYS.name, literals)))
}
}
is ListField -> {
val literals = configField.toLiterals(source)
if (literals.isNotEmpty()) {
subject.addRule(configField.key, listOf(Pair(KEYS.name, literals)))
}
}
}
}
}
\ No newline at end of file
......@@ -6,7 +6,6 @@
<https://memobase.ch/record/BAZ-MEI_49884> <http://rdaregistry.info/Elements/u/P60451> <https://memobase.ch/institution/Memoriav> .
<https://memobase.ch/record/BAZ-MEI_49884> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Record> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#hasInstantiation> <https://memobase.ch/instantiation/physical/BAZ-MEI_49884-0> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#hasTitle> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#heldBy> <https://memobase.ch/institution/BAZ> .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/record/BAZ-MEI_49884> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
......@@ -16,7 +15,6 @@ _:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/stand
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Title> .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "MEI_49884" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "MEI_49884" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/instantiation/physical/BAZ-MEI_49884-0" .
......@@ -24,5 +22,4 @@ _:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch
_:B <https://www.ica.org/standards/RiC/ontology#type> "callNumber" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "original" .
\ No newline at end of file
{
"id": "ID_1",
"content1": "franz",
"content2": "deutsch",
"caption1": "english"
"content2": "deutsch"
}
\ No newline at end of file
<https://memobase.ch/record/TEST-ID_1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Record> .
<https://memobase.ch/record/TEST-ID_1> <https://www.ica.org/standards/RiC/ontology#hasLanguage> _:B .
<https://memobase.ch/record/TEST-ID_1> <https://www.ica.org/standards/RiC/ontology#hasLanguage> _:B .
<https://memobase.ch/record/TEST-ID_1> <https://www.ica.org/standards/RiC/ontology#hasLanguage> _:B .
<https://memobase.ch/record/TEST-ID_1> <https://www.ica.org/standards/RiC/ontology#heldBy> <https://memobase.ch/institution/TEST> .
<https://memobase.ch/record/TEST-ID_1> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/record/TEST-ID_1> <https://www.ica.org/standards/RiC/ontology#isPartOf> <https://memobase.ch/recordSet/TEST_RECORD_SET> .
......@@ -9,12 +8,9 @@
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Language> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Language> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Language> .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "deutsch"@fr .
_:B <https://www.ica.org/standards/RiC/ontology#name> "english"@fr .
_:B <https://www.ica.org/standards/RiC/ontology#name> "franz"@fr .
_:B <https://www.ica.org/standards/RiC/ontology#type> "caption" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "content" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "content" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment