Newer
Older
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
const perspectiveID = 'finds'
export const findPropertiesInstancePage =
` {
?id skos:prefLabel ?prefLabel__id .
BIND(?prefLabel__id as ?prefLabel__prefLabel)
BIND(?id as ?uri__id)
BIND(?id as ?uri__dataProviderUrl)
BIND(?id as ?uri__prefLabel)
}
UNION
{
?id :type ?type .
}
UNION
{
?id :sub_category ?subCategory .
}
UNION
{
?id :material_literal ?materialLiteral .
}
UNION
{
?id :material ?material__id .
?material__id skos:prefLabel ?material__prefLabel .
}
UNION
{
?id :period ?period .
}
UNION
{
?id :municipality_literal ?municipalityLiteral .
}
UNION
{
?id :municipality ?municipality__id .
?municipality__id skos:prefLabel ?municipality__prefLabel .
}
UNION
{
?id :image_url ?image__id .
?id :find_name ?image__title .
BIND(?image__id as ?image__url)
BIND(CONCAT("Sample description text for image ", ?image__id) as ?image__description)
}
`
export const findPropertiesFacetResults =
` {
?id skos:prefLabel ?prefLabel__id .
BIND (?prefLabel__id as ?prefLabel__prefLabel)
BIND(CONCAT("/${perspectiveID}/page/", REPLACE(STR(?id), "^.*\\\\/(.+)", "$1")) AS ?prefLabel__dataProviderUrl)
}
UNION
{
?id :specification ?specification .
}
UNION
{
?id :type ?type .
}
UNION
{
?id :sub_category ?subCategory .
}
UNION
{
?id :object_type ?objectType__id.
?objectType__id skos:prefLabel ?objectType__prefLabel .
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
}
UNION
{
?id :material_literal ?materialLiteral .
}
UNION
{
?id :material ?material__id .
?material__id skos:prefLabel ?material__prefLabel .
}
UNION
{
?id :period ?period .
}
UNION
{
?id :start_year ?startYearLiteral .
}
UNION
{
?id :end_year ?endYearLiteral .
}
UNION
{
?id :municipality_literal ?municipalityLiteral .
}
UNION
{
?id :municipality ?municipality__id .
?municipality__id skos:prefLabel ?municipality__prefLabel .
}
UNION
{
?id :province_literal ?provinceLiteral .
}
UNION
{
?id :province ?province__id .
?province__id skos:prefLabel ?province__prefLabel .
}
UNION
{
?id crm:P4_has_time_span/crm:P82a_begin_of_the_begin ?earliestStart .
BIND (YEAR(?earliestStart) as ?startYear) .
}
UNION
{
?id crm:P4_has_time_span/crm:P82b_end_of_the_end ?latestEnd .
BIND (YEAR(?latestEnd) as ?endYear) .
}
UNION
{
?id :image_url ?image__id .
?id :find_name ?image__title .
BIND(?image__id as ?image__url)
BIND(CONCAT("Sample description text for image ", ?image__id) as ?image__description)
}
`
export const findsPlacesQuery = `
SELECT ?id ?lat ?long
WHERE {
<FILTER>
?id wgs84:lat ?lat ;
wgs84:long ?long .
}
`
export const findsTimelineQuery = `
SELECT ?id ?group ?data__id ?data__uri ?data__label
?data__data__id ?data__data__label ?data__data__val ?data__data__timeRange
WHERE {
<FILTER> # a placeholder for facet filters
?find :material/skos:prefLabel ?id . # ?id = first hierarchy level
BIND (?id as ?group)
#?find :find_name ?data__id . # ?data__id = second hierarchy level
?find :find_name ?lable_temp .
BIND( STRAFTER(STR(?find),'http://ldf.fi/findsampo/finds/' ) AS ?find_num ).
BIND (CONCAT(str(?lable_temp), str(?find_num)) as ?data__id) .
BIND (?data__id as ?data__label)
BIND (?find_num as ?data__data__id) # ?data__data__id = third hierarchy level
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
BIND (?data__id as ?data__data__label)
BIND (?data__id as ?data__data__val)
# make sure that the selected finds have both 'start_year' and 'end_year'
#?find :start_year [] .
#?find :end_year [] .
?find crm:P4_has_time_span/crm:P82a_begin_of_the_begin [] .
?find crm:P4_has_time_span/crm:P82b_end_of_the_end [] .
# Combine 'start_year' and 'end_year' into same variable,
# so that the result mapper creates an array from these.
#?find :start_year|:end_year ?data__data__timeRange .
#?find crm:P4_has_time_span/crm:P82a_begin_of_the_begin|crm:P4_has_time_span/crm:P82b_end_of_the_end ?date .
#BIND(CONCAT(str(?date), 'T00:00:00+00:00') AS ?date_wth_ending) .
#BIND(STRDT(STR(?date_wth_ending), xsd:dateTime) AS ?data__data__timeRange)
?find crm:P4_has_time_span/crm:P82a_begin_of_the_begin|crm:P4_has_time_span/crm:P82b_end_of_the_end ?date .
# Ignore missing values in the first hierarchy level
FILTER (?id != "-")
# fill two extra digits with zeros for BCE dates
BIND (STRAFTER(str(?date), '-') AS ?after)
BIND (IF (STRSTARTS(str(?date), '-'), CONCAT('-00', ?after), str(?date)) AS ?new_date) .
BIND(STRDT(STR(?new_date), xsd:dateTime) AS ?data__data__timeRange) .
}
`