Commit 912cdfc6 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

Index alternative names in altNames

parent e96ea9f9
......@@ -96,6 +96,7 @@
"desc": "deichman:desc",
"origLang": "deichman:origLang",
"created": "deichman:created",
"untranscribedTitle": "deichman:untranscribedTitle"
"untranscribedTitle": "deichman:untranscribedTitle",
"altNames": "deichman:alternativeNames"
}
}
\ No newline at end of file
......@@ -49,7 +49,8 @@ CONSTRUCT {
deich:kd ?locDewey ;
deich:writingSystem ?wsNo ;
deich:origLang ?origLang ;
deich:created ?created .
deich:created ?created ;
deich:alternativeNames ?contribAgentAlternativeName .
?mediaType a deich:Mediatype ;
deich:format ?mtFormat .
?contrib a deich:Contribution ;
......@@ -138,6 +139,7 @@ WHERE {
deich:role ?contribRoleURI .
?contribAgent deich:name ?contribAgentOnlyName .
OPTIONAL { ?contribAgent deich:specification ?contribSpec }
OPTIONAL { ?contribAgent deich:alternativeName ?contribAgentAlternativeName }
BIND(IF(BOUND(?contribSpec), CONCAT(?contribAgentOnlyName, " (", ?contribSpec, ")"), ?contribAgentOnlyName) AS ?contribAgentName)
BIND(str(?contribRoleURI) AS ?contribRole)
# strictly, main entry does not belong to publication index document, but is kept in order to generate a displayLine
......
......@@ -98,6 +98,7 @@
"fictionNonfiction": "deichman:fictionNonfiction",
"created": "deichman:created",
"untranscribedTitle": "deichman:untranscribedTitle",
"tag": "deichman:hasTag"
"tag": "deichman:hasTag",
"altNames": "deichman:alternativeNames"
}
}
\ No newline at end of file
......@@ -34,7 +34,12 @@ CONSTRUCT {
deich:literaryForm ?litform ;
deich:created ?created ;
deich:untranscribedTitle ?untranscribedTitle ;
deich:hasTag ?hasTag .
deich:hasTag ?hasTag ;
deich:alternativeNames ?subjectAlternativeName ;
deich:alternativeNames ?contribAgentAlternativeName ;
deich:alternativeNames ?compTypeAlternativeName ;
deich:alternativeNames ?instrumentAlternativeName ;
deich:alternativeNames ?genreAlternativeName .
?workContrib a deich:Contribution ;
deich:role ?role ;
deich:mainEntry ?mainEntry ;
......@@ -59,6 +64,7 @@ WHERE {
OPTIONAL { ?subject deich:ordinal ?subjectOrdinal }
OPTIONAL { ?subject deich:subdivision ?subjectSubdivision }
OPTIONAL { ?subject deich:specification ?subjectSpecification }
OPTIONAL { ?subject deich:alternativeName ?subjectAlternativeName }
BIND(IF (BOUND(?subjectOrdinal),
CONCAT(?subjectNameStep1, " ", str(?subjectOrdinal)),
......@@ -83,6 +89,7 @@ WHERE {
OPTIONAL { ?subject deich:specification ?subjectSpecification }
OPTIONAL { ?subject deich:date ?subjectDate }
OPTIONAL { ?subject deich:place ?subjectPlace . ?subjectPlace deich:prefLabel ?placeLabel }
OPTIONAL { ?subject deich:alternativeName ?subjectAlternativeName }
BIND(IF (BOUND(?subjectOrdinal),
CONCAT(?subjectNameStep1, " ", STR(?subjectOrdinal)),
......@@ -157,6 +164,7 @@ WHERE {
?contribAgent deich:name ?contribAgentNameStep1 .
OPTIONAL { ?contribAgent deich:ordinal ?agentOrdinal }
OPTIONAL { ?contribAgent deich:specification ?agentSpecification }
OPTIONAL { ?contribAgent deich:alternativeName ?contribAgentAlternativeName }
BIND(IF (BOUND(?agentOrdinal),
CONCAT(?contribAgentNameStep1, " ", STR(?agentOrdinal)),
......@@ -193,12 +201,14 @@ WHERE {
?genre a deich:Genre ;
deich:prefLabel ?genreName .
OPTIONAL { <__WORKURI__> deich:genre ?genre. ?genre deich:specification ?genreSpec }
OPTIONAL { <__WORKURI__> deich:genre ?genre. ?genre deich:alternativeName ?genreAlternativeName }
BIND(IF(BOUND(?genreSpec), CONCAT(?genreName, " (", ?genreSpec, ")"), ?genreName) AS ?genreLabel)
}
UNION { <__WORKURI__> deich:hasCompositionType ?compType .
?compType deich:prefLabel ?compTypeString .
OPTIONAL { ?compType deich:specification ?compTypeSpec }
OPTIONAL { ?compType deich:alternativeName ?compTypeAlternativeName}
BIND(IF(BOUND(?compTypeSpec), CONCAT(?compTypeString, " (", ?compTypeSpec, ")"), ?compTypeString) AS ?compTypeLabel)
}
UNION { <__WORKURI__> deich:fictionNonfiction ?ficturi .
......@@ -214,6 +224,7 @@ WHERE {
?instrumentation deich:hasInstrument ?instrument .
?instrument deich:prefLabel ?instName
OPTIONAL { ?instrument deich:specification ?instrumentSpec }
OPTIONAL { ?instrument deich:alternativeName ?instrumentAlternativeName }
BIND(IF(BOUND(?instrumentSpec), CONCAT(?instName, " (", ?instrumentSpec, ")"), ?instName) AS ?inst)
}
UNION { <__WORKURI__> deich:biography ?b .
......
......@@ -83,7 +83,10 @@ public class WorkModelToIndexMapperTest {
+ " \"uri\": \"http://data.deichman.no/workType#Literature\"\n"
+ " },"
+ " \"untranscribedTitle\": \"김치\",\n"
+ " \"tag\": \"sausage\"\n"
+ " \"tag\": \"sausage\",\n"
+ " \"altNames\": [\n"
+ " \"Bartebyen\",\"Anni Bee\", \"Opere\""
+ " ],\n"
+ "}";
@Test
......@@ -170,6 +173,7 @@ public class WorkModelToIndexMapperTest {
+ " ns2:subtitle \"roman\" ;\n"
+ " ns4:locationSignature \"Rag\" ;\n"
+ " ns4:publicationHistory \"Forts. i: Eremittkrepsene\" ;\n"
+ " ns2:variantTitle \"Berlinpoplan\" ;\n"
+ " ns4:statementOfResponsibility \"Anne Birkefeldt Ragde\" .\n"
+ "\n"
+ "<http://data.deichman.no/publication/p73593303342> rdf:type ns2:Publication ;\n"
......@@ -185,6 +189,7 @@ public class WorkModelToIndexMapperTest {
+ "<http://data.deichman.no/person/h10834700> rdf:type ns2:Person ;\n"
+ " ns2:birthYear \"1957\" ;\n"
+ " ns2:name \"Ragde, Anne B.\" ;\n"
+ " ns2:alternativeName \"Anni Bee\" ;\n"
+ " ns2:nationality <http://data.deichman.no/nationality#n> ;\n"
+ " ns2:personTitle \"forfatter\" ;\n"
+ " ns4:lifeSpan \"1957-\" ;\n"
......@@ -207,10 +212,12 @@ public class WorkModelToIndexMapperTest {
+ "\n"
+ "<http://deichman.no/compositionType/c1> rdf:type ns2:CompositionType ;\n"
+ " ns2:prefLabel \"Opera\" ;\n"
+ " ns2:alternativeName \"Opere\" ;\n"
+ " ns2:specification \"It isn't over until the fat lady sins\" ."
+ "\n"
+ "<http://data.deichman.no/subject/e1200005> rdf:type ns2:Subject ;\n"
+ " ns2:prefLabel \"Trondheim\" .\n"
+ " ns2:prefLabel \"Trondheim\" ;\n"
+ " ns2:alternativeName \"Bartebyen\" .\n"
+ "<http://data.deichman.no/subject/e1200006> rdf:type ns2:Subject ;\n"
+ " ns2:prefLabel \"Fauske\" .\n"
+ "<http://data.deichman.no/workType#Literature> rdfs:label \"Litteratur\"@no, \"Literature\"@en .\n"
......
Markdown is supported
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