forked from EnnoMeijers/lod-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfinna-books2edm.rq
94 lines (82 loc) · 3.37 KB
/
finna-books2edm.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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX schema: <http://schema.org/>
PREFIX edm: <http://www.europeana.eu/schemas/edm/>
PREFIX ore: <http://www.openarchives.org/ore/terms/>
PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
CONSTRUCT {
?inst a edm:ProvidedCHO ;
edm:type ?edm_type ;
dc:identifier ?identifier ;
dc:creator ?creator ;
dc:contributor ?contributor ;
dc:description ?description ;
dc:subject ?subject ;
dc:title ?name ;
dc:publisher ?publisher ;
dc:date ?date ;
dc:extent ?extent ;
dc:language ?language ;
dcterms:isPartOf ?isPartOf ;
owl:sameAs ?sameAs ;
dcterms:spatial ?spatial ;
dcterms:temporal ?temporal ;
dcterms:medium ?material .
?inst_aggr a ore:Aggregation ;
edm:aggregatedCHO ?inst ;
edm:provider ?provider ;
edm:dataProvider ?dataProvider ;
edm:rights ?license ;
edm:isShownAt ?url .
?thes_uri a skos:Concept ;
skos:prefLabel ?prefLabel .
# ?uri_org a edm:Agent ;
# skos:prefLabel ?org_name ;
# skos:note ?org_description .
}
WHERE {
{
# treat instances of type schema:Book with a digital representation as CHO
?inst a bf:Instance .
?inst a schema:Book .
BIND(("TEXT") as ?edm_type)
# make sure we have only instances with a valid IRI
?inst schema:url ?url .
FILTER (ISIRI(?url))
# Generate an "URI_CHO#agg" URI pointing to a ore:Aggregation resource.
BIND( URI(CONCAT(STR(?inst),"#agg")) as ?inst_aggr)
# NOTE: The VAR_PROVIDER will be replaced during runtime by the starter.sh script.
# Europeana requires the provider value to be specified through the aggregation process.
BIND( STR('VAR_PROVIDER') as ?provider)
BIND( STR('VAR_PROVIDER') as ?dataProvider)
# The license statement is missing from the aggregated work and instances resources
# so we assume this CC license is appropriate??
BIND(IRI("http://creativecommons.org/licenses/by-nc-nd/4.0/") as ?license)
# identify the worklevel
?inst schema:exampleOfWork ?work .
# map the properties from the instance level
OPTIONAL { ?inst schema:identifier ?identifier }
OPTIONAL { ?inst schema:isbn ?identifier }
OPTIONAL { ?inst schema:issn ?identifier }
OPTIONAL { ?inst schema:description ?description }
OPTIONAL { ?inst schema:name ?name }
OPTIONAL { ?inst schema:publisher ?publisher }
OPTIONAL { ?inst schema:sameAs ?sameAs }
OPTIONAL { ?inst schema:datePublished ?date }
OPTIONAL { ?inst schema:isPartOf ?isPartOf }
OPTIONAL { ?inst schema:numberOfPages ?extent }
# map the properties from the work level
OPTIONAL { ?work schema:about ?subject }
OPTIONAL { ?work schema:author ?creator }
OPTIONAL { ?work schema:contributor ?contributor }
OPTIONAL { ?work schema:inLanguage ?language }
}
UNION {
?thes_uri skos:prefLabel ?prefLabel
}
}