Jinja
Browse files
query.j2
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
PREFIX cdm:<http://publications.europa.eu/ontology/cdm#>
|
2 |
+
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
|
3 |
+
PREFIX dc:<http://purl.org/dc/elements/1.1/>
|
4 |
+
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
|
5 |
+
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
6 |
+
PREFIX owl:<http://www.w3.org/2002/07/owl#>
|
7 |
+
SELECT
|
8 |
+
DISTINCT (group_concat(distinct ?work;separator=",") as ?cellarURIs)
|
9 |
+
(group_concat(distinct ?title_;separator=",") as ?title)
|
10 |
+
?langIdentifier
|
11 |
+
(group_concat(distinct ?mtype;separator=",") as ?mtypes)
|
12 |
+
(group_concat(distinct ?resType;separator=",") as ?workTypes)
|
13 |
+
(group_concat(distinct ?agentName;separator=",") as ?authors)
|
14 |
+
?date
|
15 |
+
(group_concat(distinct ?subjectLabel;separator=",") as ?subjects)
|
16 |
+
(group_concat(distinct ?workId_;separator=",") as ?workIds)
|
17 |
+
WHERE
|
18 |
+
{
|
19 |
+
graph ?gw{
|
20 |
+
?work rdf:type ?resType .
|
21 |
+
?work cdm:work_date_document ?date .
|
22 |
+
?work cdm:work_id_document ?workId_.
|
23 |
+
?work cdm:work_is_about_concept_eurovoc ?subject. graph ?gs
|
24 |
+
{ ?subject skos:prefLabel ?subjectLabel filter (lang(?subjectLabel)="en") }.
|
25 |
+
}
|
26 |
+
graph ?eg {
|
27 |
+
?exp cdm:expression_belongs_to_work ?work .
|
28 |
+
?exp cdm:expression_title ?title_
|
29 |
+
filter(lang(?title_)="en" or lang(?title_)="eng" or lang(?title_)='' ).
|
30 |
+
?exp cdm:expression_uses_language ?lg.
|
31 |
+
graph ?lgc { ?lg dc:identifier ?langIdentifier .}
|
32 |
+
}
|
33 |
+
graph ?gm {
|
34 |
+
?manif cdm:manifestation_manifests_expression ?exp .
|
35 |
+
{?manif cdm:manifestation_type ?mtype .}
|
36 |
+
}
|
37 |
+
OPTIONAL { graph ?gagent { {?work cdm:work_contributed_to_by_agent ?agent .}
|
38 |
+
union
|
39 |
+
{?work cdm:work_created_by_agent ?agent }
|
40 |
+
union
|
41 |
+
{?work cdm:work_authored_by_agent ?agent }
|
42 |
+
} graph ?ga { ?agent skos:prefLabel ?agentName
|
43 |
+
filter (lang(?agentName)="en") . }}.
|
44 |
+
{ SELECT DISTINCT ?work WHERE {
|
45 |
+
?work rdf:type ?resType .
|
46 |
+
?work cdm:work_date_document ?date .
|
47 |
+
FILTER( ?date > "{{ start }}"^^xsd:date) .
|
48 |
+
FILTER( ?date < "{{ end }}"^^xsd:date)
|
49 |
+
?work cdm:work_id_document ?workId_.
|
50 |
+
}
|
51 |
+
LIMIT 10000000
|
52 |
+
}
|
53 |
+
}
|
54 |
+
GROUP BY ?work ?date ?langIdentifier
|
55 |
+
OFFSET 0
|