|
| 1 | +# prefixes |
| 2 | +PREFIX wd: <https://catalog.digital-scriptorium.org/entity/> |
| 3 | +PREFIX wds: <https://catalog.digital-scriptorium.org/entity/statement/> |
| 4 | +PREFIX wdv: <https://catalog.digital-scriptorium.org/value/> |
| 5 | +PREFIX wdt: <https://catalog.digital-scriptorium.org/prop/direct/> |
| 6 | +PREFIX p: <https://catalog.digital-scriptorium.org/prop/> |
| 7 | +PREFIX ps: <https://catalog.digital-scriptorium.org/prop/statement/> |
| 8 | +PREFIX pq: <https://catalog.digital-scriptorium.org/prop/qualifier/> |
| 9 | +PREFIX wikibase: <http://wikiba.se/ontology#> |
| 10 | +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> |
| 11 | + |
| 12 | +# find manuscript records held by particular institution(s) |
| 13 | +SELECT ?record ?recordLabel ?holdingInstitutionLabel ?shelfmark ?link |
| 14 | +WHERE { |
| 15 | +# set variable value for institution or institutions to be queried |
| 16 | +VALUES ?holdingInstitution { wd:Q801 wd:Q16442 wd:Q18629 } # Providence Public Library, Boston Public Library, Free Library of Philadelphia |
| 17 | +# bind query variables |
| 18 | + BIND(wdt:P3 AS ?describes). |
| 19 | + BIND(wdt:P2 AS ?hasHoldingInformation). |
| 20 | + BIND(p:P5 AS ?holdingInstitutionAsRecordedStatement). |
| 21 | + BIND(pq:P4 AS ?hasHoldingInstitution). |
| 22 | + BIND(wdt:P8 AS ?hasShelfmark). |
| 23 | + BIND(wdt:P9 AS ?hasLink). |
| 24 | + |
| 25 | +# statement: manuscript record describes manuscript object |
| 26 | + ?record ?describes ?manuscript . |
| 27 | +# statement: manuscript object has holding information |
| 28 | + ?manuscript ?hasHoldingInformation ?holdingInformation . |
| 29 | +# statement: holding information has statement for holding institution |
| 30 | + ?holdingInformation ?holdingInstitutionAsRecordedStatement ?holdingInstitutionStatement . |
| 31 | +# statement: holding institution statement has qualifier for structured/authority value |
| 32 | + ?holdingInstitutionStatement ?hasHoldingInstitution ?holdingInstitution . |
| 33 | +# statement: holding information has shelfmark |
| 34 | + ?holdingInformation ?hasShelfmark ?shelfmark . |
| 35 | +# statement: holding information may have link to online catalog record |
| 36 | + OPTIONAL { |
| 37 | + ?holdingInformation ?hasLink ?link . |
| 38 | + } |
| 39 | + |
| 40 | +# return English language labels |
| 41 | + SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". |
| 42 | + } |
| 43 | + } |
| 44 | +ORDER BY ?holdingInstitutionLabel ?recordLabel |
0 commit comments