-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdspace-cris-mapping.rdf
446 lines (405 loc) · 14.7 KB
/
dspace-cris-mapping.rdf
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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
#############
## Extension
##by Florian Gantner
##Tested with Dspace-CRIS 5.8
##additional R2RML-Mapping for Dspace and Dspace-CRIS-Content
## 1. Metadata for Researcherpages
## 2. Relation Item -> Researcherpages using AuthorityValue
## 3. Project/OrganizationUnit
## 4. Relation ResearcherPage -> Project
## 5. DigitalObject/ResearchObject
## 6. Relation ResearcherPage -> DigitalObject
## 7. Relation Item -> DigitalObject
#############
##CRIS
## 1. Metadata for Researcherpages
## Generating identifier based on rpage information
<#cris-researcherpage-view>
rr:sqlQuery """
SELECT rp.crisid AS handle, rp.uuid AS uuid
FROM cris_rpage AS rp
WHERE
rp.status = 't'
""".
map:cris-rp
rr:logicalTable <#cris-researcherpage-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/researcherpage/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"handle"' ];
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"uuid"' ];
];
rr:predicateObjectMap [
rr:predicate dc:CRISentityType;
rr:objectMap [ rr:template 'ResearcherPage' ];
]
.
## Generating metadata to ResearchPage
<#cris-researcherpage-fullName-view>
rr:sqlQuery """
SELECT rp.crisid AS handle, cris_rp_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_rpage AS rp, cris_rp_prop AS rp_prop, cris_rp_pdef, jdyna_values AS jv
WHERE rp.status = 't' AND
rp.id=rp_prop.parent_id AND
rp_prop.typo_id=cris_rp_pdef.id AND
jv.id = rp_prop.value_id AND
cris_rp_pdef.shortname='fullName' AND
rp_prop.visibility = '1'
""".
<#cris-researcherpage-email-view>
rr:sqlQuery """
SELECT rp.crisid AS handle, cris_rp_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_rpage AS rp, cris_rp_prop AS rp_prop, cris_rp_pdef, jdyna_values AS jv
WHERE rp.status = 't' AND
rp.id=rp_prop.parent_id AND
rp_prop.typo_id=cris_rp_pdef.id AND
jv.id = rp_prop.value_id AND
cris_rp_pdef.shortname='email' AND
rp_prop.visibility = '1'
""".
map:cris-rp-metadata-fullName
rr:logicalTable <#cris-researcherpage-fullName-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/researcherpage/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dcterms:contributor;
rr:objectMap [ rr:column '"value"' ];
].
map:cris-rp-metadata-email
rr:logicalTable <#cris-researcherpage-email-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/researcherpage/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate foaf:mbox;
rr:objectMap [ rr:column '"value"' ];
].
############
##2. Relation Item -> Researcherpages using AuthorityValue
##if the authority is configured in Dspace-CRIs, the metadata also saves the crisid as the authority-value
##text_value can be used to generate a literal
##this generates a node
<#dc-contributor-author-rp-view>
rr:sqlQuery """
SELECT h.handle AS handle, mv.text_value AS text_value, mv.authority AS authority
FROM handle AS h, item AS i, metadatavalue AS mv, metadataschemaregistry AS msr, metadatafieldregistry AS mfr, cris_rpage AS rp WHERE
i.in_archive=TRUE AND
h.resource_id=i.item_id AND
h.resource_type_id=2 AND
msr.metadata_schema_id=mfr.metadata_schema_id AND
mfr.metadata_field_id=mv.metadata_field_id AND
mv.text_value is not null AND
mv.authority!='' AND
mv.authority is not null AND
i.item_id=mv.resource_id AND
msr.namespace='http://dublincore.org/documents/dcmi-terms/' AND
mfr.element='contributor' AND
mfr.qualifier='author' AND
mv.authority = rp.crisid AND
rp.status = 't'
""".
map:cris-rp-metadata-author-crisid
rr:logicalTable <#dc-contributor-author-rp-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/repository/item/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:author;
rr:objectMap [ rr:column '"text_value"' ];
];
rr:predicateObjectMap [
rr:predicate dc:author;
rr:objectMap [
rr:termType rr:IRI;
rr:template 'http://localhost:8080/cris/researcherpage/{authority}' ];
].
############
##3. Project
##smiliar way for OrganizationUnit,
#replace pj or project by ou
<#cris-project-view>
rr:sqlQuery """
SELECT pj.crisid AS handle, pj.uuid AS uuid
FROM cris_project AS pj
WHERE
pj.status = 't'
""".
map:cris-pj
rr:logicalTable <#cris-project-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/project/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"handle"' ];
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"uuid"' ];
];
rr:predicateObjectMap [
rr:predicate dc:CRISentityType;
rr:objectMap [ rr:template 'Project' ];
]
.
## Generate Metadata to the Projects
## as samples: code and title
<#cris-project-title-view>
rr:sqlQuery """
SELECT pj.crisid AS handle, cris_pj_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_project AS pj, cris_pj_prop AS pj_prop, cris_pj_pdef, jdyna_values AS jv
WHERE pj.id=pj_prop.parent_id AND
pj_prop.typo_id=cris_pj_pdef.id AND
jv.id = pj_prop.value_id AND
cris_pj_pdef.shortname='title' AND
pj.status = 't' AND
pj_prop.visibility = 1
""".
<#cris-project-code-view>
rr:sqlQuery """
SELECT pj.crisid AS handle, cris_pj_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_project AS pj, cris_pj_prop AS pj_prop, cris_pj_pdef, jdyna_values AS jv
WHERE pj.id=pj_prop.parent_id AND
pj_prop.typo_id=cris_pj_pdef.id AND
jv.id = pj_prop.value_id AND
cris_pj_pdef.shortname='code' AND
pj.status = 't' AND
pj_prop.visibility = 1
""".
map:cris-pj-title
rr:logicalTable <#cris-project-title-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/project/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:title;
rr:objectMap [ rr:column '"value"' ];
].
map:cris-pj-code
rr:logicalTable <#cris-project-code-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/project/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"value"' ];
].
############
## 4. Relation ResearcherPage -> Project
##as shortname the value from the RP has to be used
##'mainproj' is the shortname of the ResearcherPage's metadata value field pointing to the project
map:cris-rp-mainproj-project-relation
rr:logicalTable <#cris-rp-mainproj>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/researcherpage/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:relationtoProject;
rr:objectMap [
rr:termType rr:IRI;
rr:template 'http://localhost:8080/cris/project/{crisid}' ];
].
<#cris-rp-mainproj>
rr:sqlQuery """
SELECT rp.crisid AS handle, cris_project.crisid AS crisid
FROM cris_rpage AS rp, cris_rp_prop AS rp_prop, cris_rp_pdef, jdyna_values AS jv, cris_project
WHERE rp.status = 't' AND
rp.id=rp_prop.parent_id AND
rp_prop.typo_id=cris_rp_pdef.id AND
jv.id = rp_prop.value_id AND
jv.dtype='projectpointer' AND
cris_project.id = jv.projectvalue AND
rp_prop.visibility = 1 AND
cris_project.status = 't' AND
cris_rp_pdef.shortname='mainproj'
""".
################
## 5. DigitalObject/ResearchObject
## Own ResearchObject / DigitalObject (do)
# do can't be used as an alias (POSTGRESQL-Expression), using dob instead
## Generate Identifier(s), from the do 'bsp' Entity with shortname bsp
map:cris-do-bsp
rr:logicalTable <#cris-do-bsp-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/bsp/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"handle"' ];
];
rr:predicateObjectMap [
rr:predicate dc:identifier;
rr:objectMap [ rr:column '"uuid"' ];
].
<#cris-do-bsp-view>
rr:sqlQuery """
SELECT dob.crisid AS handle, dob.uuid AS uuid
FROM cris_do AS dob, cris_do_tp
WHERE
dob.status = 't' AND
dob.typo_id = cris_do_tp.id AND
cris_do_tp.shortname = 'bsp'
""".
###
# Example Metadata of an ResearchObject / DigitalObject.
# using some fields of an journal here for samples
<#cris-bsp-journalsname-view>
rr:sqlQuery """
SELECT dob.crisid AS handle, cris_do_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_do AS dob, cris_do_prop AS do_prop, cris_do_pdef, jdyna_values AS jv, cris_do_tp
WHERE dob.id=do_prop.parent_id AND
do_prop.typo_id=cris_do_pdef.id AND
jv.id = do_prop.value_id AND
dob.typo_id = cris_do_tp.id AND
dob.status = 't' AND
do_prop.visibility = 1 AND
cris_do_tp.shortname = 'bsp' AND
cris_do_pdef.shortname='journalsname'
""".
map:cris-bsp-journalsname
rr:logicalTable <#cris-bsp-journalsname-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/bsp/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:bsp_journalsname;
rr:objectMap [ rr:column '"value"' ];
].
<#cris-bsp-journaldescription-view>
rr:sqlQuery """
SELECT dob.crisid AS handle, cris_do_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_do AS dob, cris_do_prop AS do_prop, cris_do_pdef, jdyna_values AS jv, cris_do_tp
WHERE dob.id=do_prop.parent_id AND
do_prop.typo_id=cris_do_pdef.id AND
dob.typo_id = cris_do_tp.id AND
jv.id = do_prop.value_id AND
dob.status = 't' AND
do_prop.visibility = 1 AND
cris_do_tp.shortname = 'bsp' AND
cris_do_pdef.shortname='journalsdescription'
""".
map:cris-bsp-journaldescription
rr:logicalTable <#cris-bsp-journaldescription-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/bsp/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:bsp_journalsdescription;
rr:objectMap [ rr:column '"value"' ];
].
<#cris-bsp-journalsissn-view>
rr:sqlQuery """
SELECT dob.crisid AS handle, cris_do_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_do AS dob, cris_do_prop AS do_prop, cris_do_pdef, jdyna_values AS jv, cris_do_tp
WHERE dob.id=do_prop.parent_id AND
do_prop.typo_id=cris_do_pdef.id AND
jv.id = do_prop.value_id AND
dob.status = 't' AND
do_prop.visibility = 1 AND
dob.typo_id = cris_do_tp.id AND
cris_do_tp.shortname = 'bsp' AND
cris_do_pdef.shortname='journalsissn'
""".
map:cris-bsp-journalsissn
rr:logicalTable <#cris-bsp-journalsissn-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/bsp/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:bsp_journalsissn;
rr:objectMap [ rr:column '"value"' ];
].
<#cris-bsp-journalkeywords-view>
rr:sqlQuery """
SELECT dob.crisid AS handle, cris_do_pdef.shortname AS schema, jv.textvalue AS value
FROM cris_do AS dob, cris_do_prop AS do_prop, cris_do_pdef, jdyna_values AS jv, cris_do_tp
WHERE dob.id=do_prop.parent_id AND
do_prop.typo_id=cris_do_pdef.id AND
jv.id = do_prop.value_id AND
dob.status = 't' AND
do_prop.visibility = 1 AND
dob.typo_id = cris_do_tp.id AND
cris_do_tp.shortname = 'bsp' AND
cris_do_pdef.shortname='journalskeywords'
""".
map:cris-bsp-journalskeywords
rr:logicalTable <#cris-bsp-journalkeywords-view>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/bsp/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:bsp_journalkeyws;
rr:objectMap [ rr:column '"value"' ];
].
################
## 6. Relation ResearcherPage -> DigitalObject
##CRIS Relation Researcherpage -> ResearchObject / DigitalObject / second-Level Entity
## here abbrevation/shortname with do 'bsp' ; ResearcherPage is using 'bsp_link' as shortname of the metadatavalue pointing at the digital object
map:cris-rp-bsp-relation
rr:logicalTable <#cris-rp-bsp_link>;
rr:subjectMap [
rr:template 'http://localhost:8080/cris/researcherpage/{"handle"}';
];
rr:predicateObjectMap [
rr:predicate dc:relationtoBeispielEntity;
rr:objectMap [
rr:termType rr:IRI;
rr:template 'http://localhost:8080/cris/bsp/{crisid}' ];
].
<#cris-rp-bsp_link>
rr:sqlQuery """
SELECT rp.crisid AS handle, jv.projectvalue, cris_rp_pdef.shortname AS schema, jv.textvalue AS value, cris_do.crisid AS crisid
FROM cris_rpage AS rp, cris_rp_prop AS rp_prop, cris_rp_pdef, jdyna_values AS jv, cris_do , cris_do_tp
WHERE rp.id=rp_prop.parent_id AND
rp_prop.typo_id=cris_rp_pdef.id AND
jv.id = rp_prop.value_id AND
jv.dtype='dopointer' AND
cris_do.id = jv.dovalue AND
rp.status = 't' AND
rp_prop.visibility = 1 AND
cris_do.status = 't' AND
cris_rp_pdef.shortname='bsp_link' AND
cris_do.typo_id = cris_do_tp.id AND
cris_do_tp.shortname = 'bsp'
""".
#################
## 7. Relation Item -> DigitalObject
## Link Dspace-Entity to CRIS-DO-Entity, e.g. to 'events' object, must be configured and defined as authority before
#map:cris-do-metadata-author-crisid
#rr:logicalTable <#dc-contributor-author-do-event-view>;
#rr:subjectMap [
# rr:template 'http://localhost:8080/repository/item/{"handle"}';
#];
#rr:predicateObjectMap [
# rr:predicate dc:relation;
# rr:objectMap [
# rr:termType rr:IRI;
# rr:template 'http://localhost:8080/cris/event/{authority}' ];
#].
#<#dc-contributor-author-do-event-view>
#rr:sqlQuery """
#SELECT h.handle AS handle, mv.text_value AS text_value, mv.authority AS authority
#FROM handle AS h, item AS i, metadatavalue AS mv, metadataschemaregistry AS msr, metadatafieldregistry AS mfr, cris_do AS dbo, cris_do_tp
#WHERE i.in_archive=TRUE AND
#h.resource_id=i.item_id AND
#h.resource_type_id=2 AND
#msr.metadata_schema_id=mfr.metadata_schema_id AND
#mfr.metadata_field_id=mv.metadata_field_id AND
#mv.text_value is not null AND
#mv.authority!='' AND
#mv.authority is not null AND
#i.item_id=mv.resource_id AND
#msr.namespace='http://dublincore.org/documents/dcmi-terms/' AND
#mfr.element='relation' AND
#mfr.qualifier='conference' AND
#mv.authority = dbo.crisid AND
#dbo.status = 't' AND
#dbo.typo_id = cris_do_tp.id AND
#cris_do_tp.shortname = 'events'
#""".