Skip to content

Commit 7b4175e

Browse files
Create languages
1 parent 8d482d9 commit 7b4175e

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

  • sparql/beta/authority-record-generator
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
SELECT ?authorityValue ?authorityValueLabel ?authorityTypeLabel ?externalID
13+
14+
WHERE {
15+
16+
BIND (wd:Q12 as ?authorityType) # language authority
17+
18+
?authorityValue wdt:P16 ?authorityType .
19+
# find authority records by authority type specified above
20+
OPTIONAL { ?authorityValue wdt:P42 ?QID . }
21+
# find Wikidata QIDs matched to authority value
22+
23+
BIND(CONCAT("https://wikidata.org/entity/",?QID) AS ?externalID)
24+
# render QIDs as URLs
25+
26+
SERVICE wikibase:label {
27+
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
28+
# allows English language labels to be returned for Wikibase items
29+
}
30+
}
31+
ORDER BY ASC (?authorityValueLabel)

0 commit comments

Comments
 (0)