30,537
edits
Line 209: | Line 209: | ||
# find manuscript records by dates of production as well as records without dates | # find manuscript records by dates of production as well as records without dates | ||
SELECT | SELECT ?record ?recordLabel | ||
(GROUP_CONCAT(?dateString;separator="|") as ?datesAsRecorded) | |||
(GROUP_CONCAT(?earliestDateYear;separator="|") as ?earliestDates) | |||
(GROUP_CONCAT(?latestDateYear;separator="|") as ?latestDates) | |||
WHERE { | WHERE { | ||
# bind query variables | # bind query variables | ||
Line 231: | Line 235: | ||
} | } | ||
# render date values as years | # render date values as years | ||
BIND(year(?earliestDateValue) AS ? | BIND(year(?earliestDateValue) AS ?earliestDateYear) | ||
BIND(year(?latestDateValue) AS ? | BIND(year(?latestDateValue) AS ?latestDateYear) | ||
# return English language labels | # return English language labels | ||
Line 239: | Line 243: | ||
} | } | ||
} | } | ||
GROUP BY ?record ?recordLabel | |||
ORDER BY ?recordLabel | ORDER BY ?recordLabel | ||
LIMIT 10000 | LIMIT 10000 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Try it [https://catalog.digital-scriptorium.org/query/#%23%20prefixes%0APREFIX%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%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%23%20find%20manuscript%20records%20by%20dates%20of%20production%20as%20well%20as%20records%20without%20dates%0ASELECT | Try it [https://catalog.digital-scriptorium.org/query/#%23%20prefixes%0APREFIX%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%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%23%20find%20manuscript%20records%20by%20dates%20of%20production%20as%20well%20as%20records%20without%20dates%0ASELECT%20%3Frecord%20%3FrecordLabel%0A%28GROUP_CONCAT%28%3FdateString%3Bseparator%3D%22%7C%22%29%20as%20%3FdatesAsRecorded%29%0A%28GROUP_CONCAT%28%3FearliestDateYear%3Bseparator%3D%22%7C%22%29%20as%20%3FearliestDates%29%0A%28GROUP_CONCAT%28%3FlatestDateYear%3Bseparator%3D%22%7C%22%29%20as%20%3FlatestDates%29%0A%0AWHERE%20%7B%0A%23%20bind%20query%20variables%0A%20%20BIND%28p%3AP23%20AS%20%3FdateAsRecordedStatement%29.%0A%20%20BIND%28ps%3AP23%20AS%20%3FdateAsRecorded%29.%0A%20%20BIND%28pq%3AP37%20AS%20%3FhasEarliestDate%29.%0A%20%20BIND%28pq%3AP36%20AS%20%3FhasLatestDate%29.%0A%20%20BIND%28wdt%3AP44%20AS%20%3FhasExternalID%29.%0A%0A%23%20manuscript%20record%20is%20instance%20of%20DS%20record%0A%20%20%3Frecord%20wdt%3AP16%20wd%3AQ3%20.%0A%20%20OPTIONAL%20%7B%0A%23%20statement%3A%20manuscript%20record%20has%20statement%20for%20date%20of%20production%0A%20%20%3Frecord%20%3FdateAsRecordedStatement%20%3FdateStatement%20.%0A%23%20statement%3A%20date%20statement%20has%20date%20object%20recorded%20as%20string%20value%0A%20%20%3FdateStatement%20%3FdateAsRecorded%20%3FdateString%20.%0A%23%20statement%3A%20date%20statement%20has%20qualifier%20for%20earliest%20date%0A%20%20%3FdateStatement%20%3FhasEarliestDate%20%3FearliestDateValue%20.%0A%23%20statement%3A%20date%20statement%20has%20qualifier%20for%20latest%20date%0A%20%20%3FdateStatement%20%3FhasLatestDate%20%3FlatestDateValue%20.%0A%20%20%20%20%7D%0A%23%20render%20date%20values%20as%20years%0A%20%20BIND%28year%28%3FearliestDateValue%29%20AS%20%3FearliestDateYear%29%0A%20%20BIND%28year%28%3FlatestDateValue%29%20AS%20%3FlatestDateYear%29%0A%0A%23%20return%20English%20language%20labels%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%0A%20%20%7D%0A%20%20%7D%0AGROUP%20BY%20%3Frecord%20%3FrecordLabel%0AORDER%20BY%20%3FrecordLabel%0ALIMIT%2010000 here]. | ||
====Dated status==== | ====Dated status==== |