Skip to content

Commit 42af566

Browse files
Create name
1 parent fa0e71a commit 42af566

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

  • sparql/beta/find-manuscripts/by-specific
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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 associated with particular name(s) (personal or corporate entity or entities)
13+
SELECT ?record ?recordLabel ?nameString (GROUP_CONCAT(?nameLabel;separator="|") as ?names) ?typeLabel ?roleLabel
14+
WHERE {
15+
# set variable value for name or names to be queried
16+
VALUES ?name { wd:Q383 wd:Q425 wd:Q1488 wd:Q3203 wd:Q28158 } # Lawrence Schoenberg, Catholic Church, Masters of the Gold Scrolls, Ali Qushji, Ananda Coomaraswamy
17+
# bind query variables
18+
BIND(p:P14 AS ?nameAsRecordedStatement).
19+
BIND(ps:P14 AS ?nameAsRecorded).
20+
BIND(pq:P17 AS ?hasName).
21+
BIND(pq:P15 AS ?hasRole).
22+
BIND(wdt:P16 AS ?hasType).
23+
24+
# statement: manuscript record has statement for associated name
25+
?record ?nameAsRecordedStatement ?nameStatement .
26+
# statement: name statement has name object recorded as string value
27+
?nameStatement ?nameAsRecorded ?nameString .
28+
# statement: name statement has qualifier for structured/authority value
29+
?nameStatement ?hasName ?name .
30+
# statement: associated name has role
31+
?nameStatement ?hasRole ?role .
32+
# statement: authority value has type (Personal or Corporate)
33+
?name ?hasType ?type .
34+
35+
# return English language labels
36+
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
37+
?record rdfs:label ?recordLabel .
38+
?name rdfs:label ?nameLabel .
39+
?role rdfs:label ?roleLabel .
40+
?type rdfs:label ?typeLabel .
41+
}
42+
}
43+
GROUP BY ?record ?recordLabel ?nameString ?roleLabel ?typeLabel
44+
ORDER BY ?recordLabel

0 commit comments

Comments
 (0)