30,537
edits
(→TBD) |
|||
Line 1,591: | Line 1,591: | ||
==User generated examples== | ==User generated examples== | ||
=== | ===Books of Hours with institutional, dated and date, and place information=== | ||
This query is a modified version of a query contributed by Dominique Stutzmann, , | |||
<syntaxhighlight lang="SPARQL"> | |||
PREFIX wd: <https://catalog.digital-scriptorium.org/entity/> | |||
PREFIX wds: <https://catalog.digital-scriptorium.org/entity/statement/> | |||
PREFIX wdv: <https://catalog.digital-scriptorium.org/value/> | |||
PREFIX wdt: <https://catalog.digital-scriptorium.org/prop/direct/> | |||
PREFIX p: <https://catalog.digital-scriptorium.org/prop/> | |||
PREFIX ps: <https://catalog.digital-scriptorium.org/prop/statement/> | |||
PREFIX pq: <https://catalog.digital-scriptorium.org/prop/qualifier/> | |||
PREFIX schema: <http://schema.org/> | |||
PREFIX wikibase: <http://wikiba.se/ontology#> | |||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |||
SELECT ?record ?recordLabel (GROUP_CONCAT(DISTINCT ?titleString;separator="|") as ?titleAsRecorded) ?DSID ?institutionLabel | |||
?shelfmark ?dateAsRecorded ?dated ?placeAsRecorded (GROUP_CONCAT(DISTINCT ?place2;separator="|") as ?place_norm) (GROUP_CONCAT(DISTINCT ?date3;separator="|") as ?earliest_date) (GROUP_CONCAT(DISTINCT ?date4;separator="|") as ?latest_date) | |||
WHERE | |||
{ | |||
?record p:P10 ?titleStatement . # DS record has a title as recorded statement | |||
?titleStatement ps:P10 ?titleString . # title statement has an as recorded string value | |||
?titleStatement pq:P11 wd:Q795 . # title statement has been enriched/aligned with a standard title "Book of hours (Q795)" | |||
?record wdt:P3 ?ms . # DS record describes a manuscript object | |||
?ms wdt:P1 ?DSID . # manuscript object has a DSID | |||
?ms wdt:P2 ?holding . # manuscript object has holding information | |||
?holding wdt:P5 ?institution . # holding is held by institution as recorded | |||
?holding wdt:P8 ?shelfmark . # holding has assigned shelfmark | |||
OPTIONAL { ?record wdt:P23 ?dateAsRecorded . } # DS record provides "production date as recorded" | |||
OPTIONAL { ?record wdt:P26 ?datedInfo . ?datedInfo rdfs:label ?dated . } # DS record provides "dated" / "non-dated" information | |||
OPTIONAL { ?record wdt:P27 ?placeAsRecorded . } # DS record provides "production place as recorded (P27)" | |||
OPTIONAL { ?record p:P27 ?place . ?place pq:P28 ?placeQual . ?placeQual rdfs:label ?place2 . } # DS record provides "place in authority file (P28)" | |||
OPTIONAL { ?record p:P23 ?date . ?date pq:P37 ?earliestDate . } # DS record provides "earliest date (P37)" | |||
OPTIONAL { ?record p:P23 ?date . ?date pq:P36 ?latestDate . } # DS record provides "latest date (P36)" | |||
# render date values as years | |||
BIND(year(?earliestDate) AS ?date3) | |||
BIND(year(?latestDate) AS ?date4) | |||
# return English language labels for Wikibase items where "Label" is appended to variable name | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". } | |||
} | |||
GROUP BY ?record ?recordLabel ?msLabel ?DSID ?institutionLabel ?shelfmark ?dateAsRecorded ?dated ?placeAsRecorded ?place_norm | |||
</syntaxhighlight> | |||
Try it [https://catalog.digital-scriptorium.org/query/#PREFIX%20wd%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2Fqualifier%2F%3E%0A%0APREFIX%20schema%3A%20%3Chttp%3A%2F%2Fschema.org%2F%3E%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0A%0A%20%0ASELECT%20%3Frecord%20%3FrecordLabel%20%28GROUP_CONCAT%28DISTINCT%20%3FtitleString%3Bseparator%3D%22%7C%22%29%20as%20%3FtitleAsRecorded%29%20%3FDSID%20%3FinstitutionLabel%0A%3Fshelfmark%20%3FdateAsRecorded%20%3Fdated%20%3FplaceAsRecorded%20%28GROUP_CONCAT%28DISTINCT%20%3Fplace2%3Bseparator%3D%22%7C%22%29%20as%20%3Fplace_norm%29%20%28GROUP_CONCAT%28DISTINCT%20%3Fdate3%3Bseparator%3D%22%7C%22%29%20as%20%3Fearliest_date%29%20%28GROUP_CONCAT%28DISTINCT%20%3Fdate4%3Bseparator%3D%22%7C%22%29%20as%20%3Flatest_date%29%0AWHERE%0A%7B%0A%20%0A%20%20%3Frecord%20p%3AP10%20%3FtitleStatement%20.%20%23%20DS%20record%20has%20a%20title%20as%20recorded%20statement%0A%20%0A%20%20%3FtitleStatement%20ps%3AP10%20%3FtitleString%20.%20%23%20title%20statement%20has%20an%20as%20recorded%20string%20value%0A%20%20%3FtitleStatement%20pq%3AP11%20wd%3AQ795%20.%20%23%20title%20statement%20has%20been%20enriched%2Faligned%20with%20a%20standard%20title%20%22Book%20of%20hours%20%28Q795%29%22%0A%20%0A%20%20%3Frecord%20wdt%3AP3%20%3Fms%20.%20%23%20DS%20record%20describes%20a%20manuscript%20object%0A%20%20%3Fms%20wdt%3AP1%20%3FDSID%20.%20%23%20manuscript%20object%20has%20a%20DSID%0A%20%20%3Fms%20wdt%3AP2%20%3Fholding%20.%20%23%20manuscript%20object%20has%20holding%20information%0A%20%20%3Fholding%20wdt%3AP5%20%3Finstitution%20.%20%23%20holding%20is%20held%20by%20institution%20as%20recorded%0A%20%20%3Fholding%20wdt%3AP8%20%3Fshelfmark%20.%20%23%20holding%20has%20assigned%20shelfmark%0A%20%20OPTIONAL%20%7B%20%20%3Frecord%20wdt%3AP23%20%3FdateAsRecorded%20.%20%7D%20%20%20%20%20%23%20DS%20record%20provides%20%22production%20date%20as%20recorded%22%0A%20%20OPTIONAL%20%7B%20%20%3Frecord%20wdt%3AP26%20%3FdatedInfo%20.%20%3FdatedInfo%20rdfs%3Alabel%20%3Fdated%20.%20%7D%20%20%23%20DS%20record%20provides%20%22dated%22%20%2F%20%22non-dated%22%20information%0A%20%20OPTIONAL%20%7B%20%20%3Frecord%20wdt%3AP27%20%3FplaceAsRecorded%20.%20%7D%20%23%20DS%20record%20provides%20%22production%20place%20as%20recorded%20%28P27%29%22%0A%20%20OPTIONAL%20%7B%20%20%3Frecord%20p%3AP27%20%3Fplace%20.%20%3Fplace%20pq%3AP28%20%3FplaceQual%20.%20%3FplaceQual%20rdfs%3Alabel%20%3Fplace2%20.%20%7D%20%23%20DS%20record%20provides%20%22place%20in%20authority%20file%20%28P28%29%22%0A%20%20OPTIONAL%20%7B%20%20%3Frecord%20p%3AP23%20%3Fdate%20.%20%3Fdate%20pq%3AP37%20%3FearliestDate%20.%20%7D%20%20%23%20DS%20record%20provides%20%22earliest%20date%20%28P37%29%22%0A%20%20OPTIONAL%20%7B%20%20%3Frecord%20p%3AP23%20%3Fdate%20.%20%3Fdate%20pq%3AP36%20%3FlatestDate%20.%20%7D%20%20%23%20DS%20record%20provides%20%22latest%20date%20%28P36%29%22%0A%20%20%0A%20%20%23%20render%20date%20values%20as%20years%0A%20%20BIND%28year%28%3FearliestDate%29%20AS%20%3Fdate3%29%0A%20%20BIND%28year%28%3FlatestDate%29%20AS%20%3Fdate4%29%0A%20%20%0A%20%20%23%20return%20English%20language%20labels%20for%20Wikibase%20items%20where%20%22Label%22%20is%20appended%20to%20variable%20name%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%20%20%7D%0AGROUP%20BY%20%3Frecord%20%3FrecordLabel%20%3FmsLabel%20%3FDSID%20%3FinstitutionLabel%20%3Fshelfmark%20%3FdateAsRecorded%20%3Fdated%20%3FplaceAsRecorded%20%3Fplace_norm here]. | |||
=Technical Queries= | =Technical Queries= |