|
| 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 for manuscripts produced in a given century or centuries |
| 13 | +SELECT ?record ?recordLabel ?dateString (GROUP_CONCAT(?centuryLabel;separator="|") as ?centuries) |
| 14 | +WHERE { |
| 15 | +# set variable value for century or centuries to be queried |
| 16 | + VALUES ?century { wd:Q95 wd:Q96 } # thirteenth and fourteenth centuries |
| 17 | +# bind query variables |
| 18 | + BIND(p:P23 AS ?dateAsRecordedStatement). |
| 19 | + BIND(ps:P23 AS ?dateAsRecorded). |
| 20 | + BIND(pq:P24 AS ?hasCentury). |
| 21 | + |
| 22 | +# statement: manuscript record has statement for date of production |
| 23 | + ?record ?dateAsRecordedStatement ?dateStatement . |
| 24 | +# statement: date statement has date object recorded as string value |
| 25 | + ?dateStatement ?dateAsRecorded ?dateString . |
| 26 | +# statement: date statement has qualifier for structured/authority value |
| 27 | + ?dateStatement ?hasCentury ?century . |
| 28 | + |
| 29 | +# return English language labels |
| 30 | + SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". |
| 31 | + ?record rdfs:label ?recordLabel . |
| 32 | + ?century rdfs:label ?centuryLabel . |
| 33 | + } |
| 34 | + } |
| 35 | +GROUP BY ?record ?recordLabel ?dateString |
| 36 | +ORDER BY ?recordLabel |
0 commit comments