Skip to content

Commit 8d482d9

Browse files
Create standard-title
1 parent 4ae9060 commit 8d482d9

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 with particular standard title(s)
13+
SELECT ?record ?recordLabel ?titleString ?uniformTitleString (GROUP_CONCAT(?standardTitleLabel;separator="|") as ?standardTitles)
14+
WHERE {
15+
# set variable value for standard title or titles to be queried
16+
VALUES ?standardTitle { wd:Q6034 wd:Q1389 wd:Q1347 wd:Q1437 wd:Q665 } # Gospels, Gospel of Matthew, Gospel of Mark, Gospel of Luke, Gospel of John
17+
# bind query variables
18+
BIND(p:P10 AS ?titleAsRecordedStatement).
19+
BIND(ps:P10 AS ?titleAsRecorded).
20+
BIND(ps:P12 AS ?uniformTitleAsRecorded).
21+
BIND(pq:P11 AS ?hasStandardTitle).
22+
23+
# statement: manuscript record has statement for title as recorded
24+
?record ?titleAsRecordedStatement ?titleStatement .
25+
# statement: title statement has title object recorded as string value
26+
?titleStatement ?titleAsRecorded ?titleString .
27+
# statement: title statement has qualifier for structured/authority value
28+
?titleStatement ?hasStandardTitle ?standardTitle .
29+
# statement: record may have uniform title recorded
30+
OPTIONAL { ?record ?uniformTitleAsRecorded ?uniformTitleString . }
31+
32+
# return English language labels
33+
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
34+
?record rdfs:label ?recordLabel .
35+
?standardTitle rdfs:label ?standardTitleLabel .
36+
}
37+
}
38+
GROUP BY ?record ?recordLabel ?titleString ?uniformTitleString
39+
ORDER BY ?recordLabel

0 commit comments

Comments
 (0)