Commit 2dcca2fc authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add test with multiple authors.

parent b8a48815
......@@ -115,7 +115,6 @@ class TestAgentMapper {
RDFDataMgr.write(FileOutputStream("$resourcePath/agent-mapper-with-name-only.ttl"), record.model, Lang.TURTLE)
}
// TODO: Actually test this.
@Test
fun `test agent mapper with name and relation`() {
val source: Map<String, Any> = mapOf(
......@@ -140,6 +139,32 @@ class TestAgentMapper {
)
}
@Test
fun `test agent mapper with multiple authors`() {
val source: Map<String, Any> = mapOf(
Pair(
"creatorPerson",
listOf(
mapOf(Pair("name", "PERSON 1"), Pair("relationName", "RELATION 1")),
mapOf(Pair("name", "PERSON 2"), Pair("relationName", "RELATION 2")))
)
)
val record = Record(
"1",
"Foto",
"rs1",
"ins1",
hasSponsoringAgent = true,
isPublished = false
)
mapper.apply(source, record)
RDFDataMgr.write(
FileOutputStream("$resourcePath/agent-mapper-with-multiple-authors.ttl"),
record.model,
Lang.TURTLE
)
}
@Test
fun `test missing role name in list`() {
val source: Map<String, Any> = mapOf(
......@@ -149,7 +174,6 @@ class TestAgentMapper {
mapOf(Pair("name", "First Person"), Pair("relationName", "Relation 1")),
mapOf(Pair("name", "Second Person")),
mapOf(Pair("name", "Third Person"), Pair("relationName", "Relation 3"))
)
)
)
......
@prefix rdau: <http://rdaregistry.info/Elements/u/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rico: <https://www.ica.org/standards/RiC/ontology#> .
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
<https://memobase.ch/record/rs1-1>
a rico:Record ;
rdau:P60451 <https://memobase.ch/institution/mav> ;
<https://memobase.ch/internal/isPublished>
false ;
rico:heldBy <https://memobase.ch/institution/ins1> ;
rico:identifiedBy [ a rico:Identifier ;
rico:identifier "rs1-1" ;
rico:type "main"
] ;
rico:isPartOf <https://memobase.ch/recordSet/rs1> ;
rico:recordResourceOrInstantiationIsSourceOfCreationRelation
_:b0 , _:b1 ;
rico:type "Foto" .
_:b1 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b1 ;
rico:name "PERSON 1"
] ;
rico:name "RELATION 1" ;
rico:type "creator" .
_:b0 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b0 ;
rico:name "PERSON 2"
] ;
rico:name "RELATION 2" ;
rico:type "creator" .
......@@ -5,15 +5,6 @@
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
_:b0 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b0 ;
rico:name "Hans Zimmer"
] ;
rico:type "creator" .
<https://memobase.ch/record/rs1-1>
a rico:Record ;
rdau:P60451 <https://memobase.ch/institution/mav> ;
......@@ -28,3 +19,12 @@ _:b0 a rico:CreationRelation ;
rico:recordResourceOrInstantiationIsSourceOfCreationRelation
_:b0 ;
rico:type "Foto" .
_:b0 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b0 ;
rico:name "Hans Zimmer"
] ;
rico:type "creator" .
......@@ -5,19 +5,9 @@
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
_:b0 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b0 ;
rico:name "Third Person"
] ;
rico:name "Relation 3" ;
rico:type "creator" .
<https://memobase.ch/record/rs1-1>
a rico:Record ;
rdau:P60451 <https://memobase.ch/institution/mrv> ;
rdau:P60451 <https://memobase.ch/institution/mav> ;
<https://memobase.ch/internal/isPublished>
false ;
rico:heldBy <https://memobase.ch/institution/ins1> ;
......@@ -27,24 +17,34 @@ _:b0 a rico:CreationRelation ;
] ;
rico:isPartOf <https://memobase.ch/recordSet/rs1> ;
rico:recordResourceOrInstantiationIsSourceOfCreationRelation
_:b1 , _:b2 , _:b0 ;
_:b0 , _:b1 , _:b2 ;
rico:type "Foto" .
_:b1 a rico:CreationRelation ;
_:b2 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b1 ;
rico:name "First Person"
_:b2 ;
rico:name "Second Person"
] ;
rico:name "Relation 1" ;
rico:type "creator" .
_:b2 a rico:CreationRelation ;
_:b0 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b2 ;
rico:name "Second Person"
_:b0 ;
rico:name "Third Person"
] ;
rico:name "Relation 3" ;
rico:type "creator" .
_:b1 a rico:CreationRelation ;
rico:creationRelationHasSource <https://memobase.ch/record/rs1-1> ;
rico:creationRelationHasTarget [ a rico:Person ;
rico:agentIsTargetOfCreationRelation
_:b1 ;
rico:name "First Person"
] ;
rico:name "Relation 1" ;
rico:type "creator" .
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