-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrml4tcf.ttl
132 lines (109 loc) · 3.53 KB
/
rml4tcf.ttl
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
## USAGE:
# java -jar rmlmapper-<VERSION>-all.jar -m rml4tcf.ttl -s turtle
#
# this will convert INPUT.tcf in the current directory
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://github.com/lueck/standoff-mode/rml/tcf#> .
@prefix som: <http://github.com/lueck/standoff-mode/owl#> .
@prefix dsd: <http://www.dspin.de/data> .
@prefix dsm: <http://www.dspin.de/data/metadata> .
@prefix tcf: <http://www.dspin.de/data/textcorpus> .
:TextMap a rr:TriplesMap ;
rml:logicalSource [
rml:source "INPUT.tcf" ; # TODO
rml:referenceFormulation ql:XPath ;
rml:iterator "//D-Spin/TextCorpus/text" ;
] .
:TextMap rr:subjectMap [
rr:template "http://github.com/lueck/standoff-mode/annotation/INPUT"
] .
:TextMap rr:predicateObjectMap [
rr:predicate som:text ;
rr:objectMap [
rml:reference "." ;
]
] .
:TokenMap a rr:TriplesMap ;
rml:logicalSource [
rml:source "INPUT.tcf" ; # TODO
rml:referenceFormulation ql:XPath ;
rml:iterator "//D-Spin/TextCorpus/tokens/token" ;
] .
:TokenMap rr:subjectMap [
rr:template "http://github.com/lueck/standoff-mode/annotation/INPUT/tokens/{@ID}"
] .
:TokenMap rr:predicateObjectMap [
rr:predicate rdf:type ;
rr:objectMap [
rr:constant som:token
]
] .
:TokenMap rr:predicateObjectMap [
rr:predicate som:inRange ;
rr:objectMap [
rr:template "http://github.com/lueck/standoff-mode/annotation/INPUT"
]
] .
:TokenMap rr:predicateObjectMap [
rr:predicate som:index ;
rr:objectMap [
rml:reference "@ID"
]
] .
:TokenMap rr:predicateObjectMap [
rr:predicate som:token ;
rr:objectMap [
rml:reference "." ;
]
] .
:TokenMap rr:predicateObjectMap [
rr:predicate som:lemma2 ;
rr:objectMap [
rml:reference "following::lemma[@tokenIDs = self::token/@ID]"
]
] .
:TokenMap rr:predicateObjectMap [
rr:predicate som:lemma ;
rr:objectMap [
#rml:reference "." ;
rr:parentTriplesMap :LemmaMap ;
rr:joinCondition [
rr:parent "@ID" ;
rr:child "@tokenIDs" ;
]
]
] .
:LemmaMap a rr:TriplesMap ;
rml:logicalSource [
rml:source "INPUT.tcf" ; # TODO
rml:referenceFormulation ql:XPath ;
rml:iterator "//D-Spin/TextCorpus/lemmas/lemma" ;
] .
:LemmaMap rr:subjectMap [
rr:template "http://github.com/lueck/standoff-mode/annotation/INPUT/tokens/{@tokenIDs}"
] .
:LemmaMap rr:predicateObjectMap [
rr:predicate som:lemma ;
rr:objectMap [
rml:reference "." ;
]
] .
:PostagMap a rr:TriplesMap ;
rml:logicalSource [
rml:source "INPUT.tcf" ; # TODO
rml:referenceFormulation ql:XPath ;
rml:iterator "//D-Spin/TextCorpus/POStags/tag" ;
] .
:PostagMap rr:subjectMap [
rr:template "http://github.com/lueck/standoff-mode/annotation/INPUT/tokens/{@tokenIDs}"
] .
:PostagMap rr:predicateObjectMap [
rr:predicate som:postag ;
rr:objectMap [
rml:reference "." ;
]
] .