-
Notifications
You must be signed in to change notification settings - Fork 1
/
subjects-list.sparql
32 lines (27 loc) · 1.17 KB
/
subjects-list.sparql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX tate: <http://sparql.xyz/example/tate/>
PREFIX tsub: <http://sparql.xyz/example/tate/subject/>
SELECT DISTINCT ?subjectId ?subjectName
WHERE {
# List of artworks
SERVICE <x-sparql-anything:csv.headers=true,location=./collection/artwork_data.csv> {
[] xyz:id ?id ; xyz:accession_number ?accId .
}
BIND ( IF ( STRSTARTS( ?accId, "AR" ) ,
LCASE(CONCAT( "ar/", SUBSTR( ?accId ,3 ,3), "/", ?accId, "-", ?id , ".json" )),
LCASE(CONCAT( SUBSTR( ?accId ,1 , 1), "/", SUBSTR( ?accId ,2 , 3), "/" , ?accId, "-", ?id , ".json" ))
) AS ?filepath ) .
# JSON file with subjects
BIND (IRI(CONCAT("x-sparql-anything:location=./collection/artworks/", ?filepath )) AS ?artworkMetadata ) .
SERVICE ?artworkMetadata {
{
[] xyz:subjects [ xyz:id ?subjectId ; xyz:name ?subjectName ] .
} UNION {
[] xyz:children [ ?li2 [ xyz:id ?subjectId ; xyz:name ?subjectName ] ] .
}
} .
} ORDER BY ?subjectId