Commit 6d8172f3 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

services: index all parts of work series and publication series

parent cb6b0454
......@@ -59,7 +59,8 @@ public final class SPARQLQueryBuilder {
+ "DESCRIBE <__WORKURI__> ?publication ?workContributor ?compType ?format ?mediaType ?subject\n"
+ " ?genre ?instrument ?litform ?workType ?serial ?nation ?language \n"
+ " ?pubContrib ?publicationContributor ?place ?publishedBy ?publicationPartValues \n"
+ " ?audience ?bio ?country ?contentAdaptation ?formatAdaptation ?relatedWork ?workSeries ?workAsSubjectAgent ?subPlace ?relworkMainEntry\n"
+ " ?audience ?bio ?country ?contentAdaptation ?formatAdaptation ?relatedWork ?workSeriesPart ?workSeries ?workAsSubjectAgent ?subPlace ?relworkMainEntry\n"
+ "FROM <https://katalog.deichman.no>\n"
+ "WHERE {\n"
+ " { <__WORKURI__> a deichman:Work }\n"
+ " UNION { <__WORKURI__> deichman:isRelatedTo ?related . \n"
......
......@@ -97,6 +97,7 @@
"origLang": "deichman:origLang",
"created": "deichman:created",
"untranscribedTitle": "deichman:untranscribedTitle",
"altNames": "deichman:alternativeNames"
"altNames": "deichman:alternativeNames",
"seriesLabel": "deichman:seriesLabel"
}
}
\ No newline at end of file
......@@ -30,6 +30,11 @@ CONSTRUCT {
deich:adaptation ?contentAdaptNo ;
deich:ageLimit ?ageLimit ;
deich:series ?seriesTitle ;
deich:series ?seriesMainTitle ;
deich:series ?seriesPartNumber ;
deich:series ?seriesPartTitle ;
deich:series ?seriesSubtitle ;
deich:seriesLabel ?seriesLabel ;
deich:nationality ?nationLabel ;
deich:title ?pubMainTitle ;
deich:title ?pubPartTitle ;
......@@ -99,9 +104,12 @@ WHERE {
UNION { <__PUBLICATIONURI__> deich:inSerial ?serialBnode .
?serialBnode deich:serial ?serial .
?serial ?seriesPred ?seriesTitle .
VALUES ?seriesPred { deich:mainTitle deich:subtitle deich:partNumber deich:partTitle }
}
OPTIONAL { ?serialBnode deich:issue ?seriesPartNumber }
?serial deich:mainTitle ?seriesMainTitle ;
OPTIONAL { ?serial deich:subtitle ?seriesSubtitle }
OPTIONAL { ?serial deich:partTitle ?seriesPartTitle }
BIND(IF(BOUND(?seriesPartNumber), CONCAT(?seriesMainTitle, " (", ?seriesPartNumber, ")"), ?seriesMainTitle) AS ?seriesLabel)
}
UNION { <__PUBLICATIONURI__> deich:locationClassNumber ?locDewey }
UNION { <__PUBLICATIONURI__> deich:hasFormatAdaptation ?formatAdaptation .
......
......@@ -99,6 +99,7 @@
"created": "deichman:created",
"untranscribedTitle": "deichman:untranscribedTitle",
"tag": "deichman:hasTag",
"altNames": "deichman:alternativeNames"
"altNames": "deichman:alternativeNames",
"seriesLabel": "deichman:seriesLabel"
}
}
\ No newline at end of file
......@@ -30,8 +30,11 @@ CONSTRUCT {
deich:country ?country ;
deich:nationality ?nationLabel ;
deich:contentAdaptation ?contentAdaptationNorwegianName ;
deich:series ?seriesTitle ;
deich:series ?seriesNumber ;
deich:series ?seriesMainTitle ;
deich:series ?seriesPartNumber ;
deich:series ?seriesPartTitle ;
deich:series ?seriesSubtitle ;
deich:seriesLabel ?seriesLabel ;
deich:literaryForm ?litform ;
deich:created ?created ;
deich:untranscribedTitle ?untranscribedTitle ;
......@@ -246,9 +249,11 @@ WHERE {
UNION { <__WORKURI__> deich:isPartOfWorkSeries ?wsBnode .
?wsBnode deich:workSeries ?workSeries .
OPTIONAL { ?wsBnode deich:partNumber ?seriesNumber }
?workSeries ?seriesPred ?seriesTitle .
VALUES ?seriesPred { deich:mainTitle deich:subtitle deich:partNumber deich:partTitle }
OPTIONAL { ?wsBnode deich:partNumber ?seriesPartNumber }
?workSeries deich:mainTitle ?seriesMainTitle .
OPTIONAL { ?workSeries deich:partTitle ?seriesPartTitle }
OPTIONAL { ?workSeries deich:subtitle ?seriesSubtitle }
BIND(IF(BOUND(?seriesPartNumber), CONCAT(?seriesMainTitle, " (", ?seriesPartNumber, ")"), ?seriesMainTitle) AS ?seriesLabel)
}
UNION { <__WORKURI__> deich:hasTag ?hasTag }
}
......@@ -73,7 +73,9 @@ public class PublicationModelToIndexMapperTest {
+ " \"series\": [\n"
+ " \"italiano norveigano\","
+ " \"serialissimo\","
+ " \"12\""
+ " ],\n"
+ " \"seriesLabel\": \"italiano norveigano (12)\","
+ " \"subtitle\": \"xyz\",\n"
+ " \"title\": [\n"
+ " \"La casa delle bugie\",\n"
......@@ -120,7 +122,7 @@ public class PublicationModelToIndexMapperTest {
+ " ns2:agent <http://data.deichman.no/person/h77635> ;\n"
+ " ns2:mainTitle \"Part two\" ;\n"
+ " ns2:role ns5:author ] ;\n"
+ " ns2:inSerial [ rdf:type ns2:SerialIssue ;\n"
+ " ns2:inSerial [ rdf:type ns2:SerialIssue ; ns2:issue \"12\" ;\n"
+ " ns2:serial <http://data.deichman.no/serial/s1> ] ;\n"
+ " ns2:format <http://data.deichman.no/format#E-Book> ;\n"
+ " ns2:hasMediaType <http://data.deichman.no/mediaType#Book> ;\n"
......
......@@ -67,8 +67,10 @@ public class WorkModelToIndexMapperTest {
+ " ],\n"
+ " \"series\": [\n"
+ " \"workSeriesMainTitle\","
+ " \"workSeriesPartTitle\"\n"
+ " \"workSeriesPartTitle\","
+ " \"33\""
+ " ],\n"
+ " \"seriesLabel\": \"workSeriesMainTitle (33)\","
+ " \"compositionType\": \"Opera (It isn't over until the fat lady sins)\",\n"
+ " \"fictionNonfiction\": \"http://data.deichman.no/fictionNonfiction#fiction\",\n"
+ " \"workTypeLabel\": \"Litteratur\",\n"
......@@ -132,7 +134,7 @@ public class WorkModelToIndexMapperTest {
+ " ns2:nationality <http://data.deichman.no/nationality#n> ;\n"
+ " ns2:fictionNonfiction <http://data.deichman.no/fictionNonfiction#fiction> ;\n"
+ " ns2:hasContentAdaptation <http://data.deichman.no/contentAdaptation#easyLanguage> ;\n"
+ " ns2:isPartOfWorkSeries [ a ns2:WorkSeriesPart ; ns2:workSeries <http://data.deichman.no/workSeries/s1> ] ;\n"
+ " ns2:isPartOfWorkSeries [ a ns2:WorkSeriesPart ; ns2:partNumber \"33\" ; ns2:workSeries <http://data.deichman.no/workSeries/s1> ] ;\n"
+ " ns2:created \"2016-11-17T07:03:10.239Z\"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;\n"
+ " ns2:hasWorkType <http://data.deichman.no/workType#Literature> ;\n"
+ " ns2:hasTag \"sausage\" .\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