-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.rq
38 lines (38 loc) · 1.43 KB
/
type.rq
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
31
32
33
34
35
36
37
38
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix bf: <http://bibframe.org/vocab/>
prefix klb: <http://knowledgelinks.io/ns/bibcat/>
prefix dbo: <http://dbpedia.org/ontology/>
prefix dbp: <http://dbpedia.org/property/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix sesame: <http://www.openrdf.org/schema/sesame#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix fn: <http://www.w3.org/2005/xpath-functions#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix dc: <http://purl.org/dc/elements/1.1/>
prefix hint: <http://www.bigdata.com/queryHints#>
prefix bd: <http://www.bigdata.com/rdf#>
prefix bds: <http://www.bigdata.com/rdf/search#>
prefix bfe: <http://bibframe.org/extensions/>
SELECT ?resource ?data
{
{SELECT ?resource (GROUP_CONCAT(CONCAT('"',?label,'"'); SEPARATOR =",") AS ?type)
WHERE
{
#BIND (<http://localhost:8080/fedora/rest/ref/fre> AS ?resource)
{
{
?resource a ?rType .
?rType rdfs:label ?label
} UNION {
?resource a ?rType .
?rType rdfs:subClassOf ?sub .
?sub rdfs:label ?label
FILTER (?sub!=bf:Resource)
}
}
}
GROUP BY ?resource}
BIND (CONCAT("\"Type\":[",?type,"]") as ?data)
}