-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataset-construct.sparql
65 lines (53 loc) · 1.56 KB
/
dataset-construct.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pmdcat: <http://publishmydata.com/pmdcat#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
CONSTRUCT {
?entry
a pmdcat:Dataset;
rdfs:label ?label;
pmdcat:datasetContents ?qb;
rdfs:comment ?comment;
dcterms:description ?description;
pmdcat:markdownDescription ?md_description;
dcterms:publisher ?publisher;
<http://gss-data.org.uk/def/gdp#family> ?family;
<http://example.net/def/components> ?component;
.
?publisher
rdfs:label ?publisher_label;
skos:altLabel ?publisher_altlabel;
.
} WHERE {
?entry
pmdcat:datasetContents ?qb;
rdfs:label ?label_;
dcterms:publisher ?publisher;
<http://gss-data.org.uk/def/gdp#family> ?family;
.
BIND(STR(?label_) AS ?label)
OPTIONAL {
?entry rdfs:comment ?comment_;
BIND(STR(?comment_) AS ?comment)
}
OPTIONAL {
?entry dcterms:description ?description_;
BIND(STR(?description_) AS ?description)
}
OPTIONAL {
?entry pmdcat:markdownDescription ?md_description_;
BIND(STR(?md_description_) AS ?md_description)
}
OPTIONAL {
?publisher rdfs:label ?publisher_label_ .
BIND(STR(?publisher_label_) AS ?publisher_label)
OPTIONAL {
?publisher skos:altLabel ?publisher_altlabel_ .
BIND(STR(?publisher_altlabel_) AS ?publisher_altlabel)
}
}
?qb a qb:DataSet;
qb:structure/qb:component/qb:dimension ?component; # TODO: attributes & measures
.
}