Commit 10fcb6a6 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix main id generation

parent a27cab51
Pipeline #12837 passed with stages
in 6 minutes and 57 seconds
......@@ -24,11 +24,12 @@ import org.memobase.mapping.KEYS
import org.memobase.rdf.NS
import org.memobase.rdf.RICO
class DigitalObject(id: String, recordSetId: String, institutionId: String, count: Int) : Instantiation(institutionId) {
override val resource: Resource = model.createResource(NS.mbdo + recordSetId + "-" + StringHelpers.normalizeId(id) + "-" + count)
class DigitalObject(sourceId: String, recordSetId: String, institutionId: String, count: Int) : Instantiation(institutionId) {
private val id = recordSetId + "-" + StringHelpers.normalizeId(sourceId) + "-" + count
override val resource: Resource = model.createResource(NS.mbdo + id)
init {
addRdfType(RICO.Instantiation)
resource.addProperty(RICO.type, "digitalObject")
addRicoConcept(KEYS.identifiers, "main", listOf(literal(resource.uri)))
addRicoConcept(KEYS.identifiers, "main", listOf(literal(id)))
}
}
\ No newline at end of file
......@@ -24,11 +24,12 @@ import org.memobase.mapping.KEYS
import org.memobase.rdf.NS
import org.memobase.rdf.RICO
class PhysicalObject(id: String, recordSetId: String, institutionId: String, count: Int) : Instantiation(institutionId) {
override val resource: Resource = model.createResource(NS.mbpo + recordSetId + "-" + StringHelpers.normalizeId(id) + "-" + count)
class PhysicalObject(sourceId: String, recordSetId: String, institutionId: String, count: Int) : Instantiation(institutionId) {
private val id = recordSetId + "-" + StringHelpers.normalizeId(sourceId) + "-" + count
override val resource: Resource = model.createResource(NS.mbpo + id)
init {
addRdfType(RICO.Instantiation)
resource.addProperty(RICO.type, "physicalObject")
addRicoConcept(KEYS.identifiers, "main", listOf(literal(resource.uri)))
addRicoConcept(KEYS.identifiers, "main", listOf(literal(id)))
}
}
\ No newline at end of file
......@@ -25,16 +25,17 @@ import org.memobase.rdf.NS
import org.memobase.rdf.RDA
import org.memobase.rdf.RICO
class Record(id: String, type: String, recordSetId: String, institutionId: String, hasSponsoringAgent: Boolean) :
class Record(sourceId: String, type: String, recordSetId: String, institutionId: String, hasSponsoringAgent: Boolean) :
RecordResource(institutionId) {
override val resource: Resource = model.createResource(NS.mbr + recordSetId + "-" + StringHelpers.normalizeId(id))
private val id = recordSetId + "-" + StringHelpers.normalizeId(sourceId)
override val resource: Resource = model.createResource(NS.mbr + id)
init {
addRdfType(RICO.Record)
resource.addProperty(RICO.type, type)
resource.addProperty(RICO.isPartOf, recordSetUri(recordSetId))
resource.addProperty(RICO.heldBy, institutionUri)
addRicoConcept(KEYS.identifiers, "main", listOf(literal(resource.uri)))
addRicoConcept(KEYS.identifiers, "main", listOf(literal(id)))
if (hasSponsoringAgent) {
resource.addProperty(RDA.hasSponsoringAgentOfResource, model.createResource(KEYS.memoriavUri))
}
......
......@@ -15,10 +15,10 @@ _: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 <https://www.ica.org/standards/RiC/ontology#identifier> "BAZ-B_MEI-MEI_49884" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "BAZ-B_MEI-MEI_49884-1" .
_: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/physical/BAZ-B_MEI-MEI_49884-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/BAZ-B_MEI-MEI_49884" .
_: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" .
......
......@@ -20,8 +20,8 @@ _: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#Rule> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Rule> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Rule> .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/digital/TEST_RECORD_SET-Sig_Han_1293-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-Sig_Han_1293" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-Sig_Han_1293" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-Sig_Han_1293-1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Familie XYZ" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "In Copyright (InC)" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "public" .
......
......@@ -57,9 +57,9 @@ _:B <http://www.w3.org/2004/02/skos/core#editorialNote> "Ursprungsfeld: Sachthem
_:B <http://www.w3.org/2004/02/skos/core#prefLabel> "name"@de .
_:B <http://www.w3.org/2004/02/skos/core#prefLabel> "name"@de .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "Sig Han 1293" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/digital/TEST_RECORD_SET-Sig_Han_1293-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/physical/TEST_RECORD_SET-Sig_Han_1293-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-Sig_Han_1293" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-Sig_Han_1293" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-Sig_Han_1293-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-Sig_Han_1293-1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Familie XYZ" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "In Copyright (InC)" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "In Copyright (InC)" .
......
......@@ -16,7 +16,7 @@
<https://memobase.ch/record/TEST_RECORD_SET-sigantur-example> <https://www.ica.org/standards/RiC/ontology#type> "Foto" .
_: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 <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/physical/TEST_RECORD_SET-sigantur-example-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-sigantur-example" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-sigantur-example" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-sigantur-example-1" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
\ No newline at end of file
......@@ -12,5 +12,5 @@ _:B <http://www.w3.org/2004/02/skos/core#editorialNote> "Ursprungsfeld: Genre" .
_:B <http://www.w3.org/2004/02/skos/core#editorialNote> "Ursprungsfeld: Mots clés" .
_:B <http://www.w3.org/2004/02/skos/core#prefLabel> "Genre 1, Genre 2"@fr .
_:B <http://www.w3.org/2004/02/skos/core#prefLabel> "Schlagwort 1, Schlagwort 2"@fr .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
\ No newline at end of file
......@@ -8,7 +8,7 @@
_: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 <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "deutsch"@fr .
_:B <https://www.ica.org/standards/RiC/ontology#name> "franz"@fr .
_:B <https://www.ica.org/standards/RiC/ontology#type> "content" .
......
......@@ -40,7 +40,7 @@ _:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "DUMMY-VALUE" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "DUMMY-VALUE" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "DUMMY-VALUE" .
......
......@@ -12,8 +12,8 @@
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#CarrierType> .
_: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 <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/physical/TEST_RECORD_SET-ID_1-1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-ID_1-1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "16mm" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
_:B <https://www.ica.org/standards/RiC/ontology#type> "main" .
\ No newline at end of file
......@@ -22,7 +22,7 @@ _:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasSource> <http
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget> _:B .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "https://memobase.ch/record/TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "TEST_RECORD_SET-ID_1" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "DUMMY-VALUE" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Schauspieler" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Test Name" .
......
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