-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmesh_Jena5.ttl
183 lines (171 loc) · 6.38 KB
/
mesh_Jena5.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
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
@prefix : <http://localhost/jena_example/#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb2: <http://jena.apache.org/2016/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix meshv: <http://id.nlm.nih.gov/mesh/vocab#> .
@prefix mesht: <http://www.medvik.cz/schema/mesh/vocab/#> .
### Version 1.5.0 for Jena v5
## Initialize text query
[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
# A TextDataset is a regular dataset with a text index.
text:TextDataset rdfs:subClassOf ja:RDFDataset .
# Lucene index
text:TextIndexLucene rdfs:subClassOf text:TextIndex .
# Elasticsearch index
text:TextIndexES rdfs:subClassOf text:TextIndex .
## ---------------------------------------------------------------
## This URI must be fixed - it's used to assemble the text dataset.
:text_dataset
a text:TextDataset ;
text:dataset <#dataset> ;
text:index <#indexLucene> ;
.
# A TDB dataset used for RDF storage
<#dataset>
a tdb2:DatasetTDB2 ;
tdb2:location "d:/Data/jena5/databases/mesh" ;
.
# Text index description
<#indexLucene>
a text:TextIndexLucene ;
text:directory "d:/Data/jena5/indexes/mesh" ;
text:entityMap <#entMap> ;
text:storeValues false ;
## text:analyzer[ a text:StandardAnalyzer ] ;
text:analyzer [
a text:ConfigurableAnalyzer ;
text:tokenizer text:StandardTokenizer ;
text:filters (
text:ASCIIFoldingFilter
text:LowerCaseFilter
# text:PorterStemFilter
)
] ;
## text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
text:queryParser text:AnalyzingQueryParser ;
## text:defineAnalyzers [ . . . ] ;
text:multilingualSupport true ;
## https://jena.apache.org/documentation/query/text-query.html#lists-of-indexed-properties - available since Jena 5.0
text:propLists (
[ text:propListProp mesht:queryDef ;
text:props (
rdfs:label
meshv:identifier
meshv:prefLabel
meshv:altLabel
meshv:casn1_label
meshv:abbreviation
meshv:registryNumber
meshv:relatedRegistryNumber
mesht:identifier
mesht:prefLabel
mesht:altLabel
) ;
]
[ text:propListProp mesht:queryAll ;
text:props (
rdfs:label
meshv:identifier
meshv:prefLabel
meshv:altLabel
meshv:casn1_label
meshv:abbreviation
meshv:registryNumber
meshv:relatedRegistryNumber
mesht:identifier
mesht:prefLabel
mesht:altLabel
mesht:translatorsNote
mesht:annotation
mesht:historyNote
mesht:scopeNote
meshv:annotation
meshv:historyNote
meshv:note
meshv:onlineNote
meshv:publicMeSHNote
meshv:scopeNote
# meshv:source
) ;
]
[ text:propListProp mesht:queryNotes ;
text:props (
mesht:translatorsNote
mesht:annotation
mesht:historyNote
mesht:scopeNote
meshv:annotation
meshv:historyNote
meshv:note
meshv:onlineNote
meshv:publicMeSHNote
meshv:scopeNote
# meshv:source
) ;
]
) ;
.
<#entMap>
a text:EntityMap ;
text:defaultField "label" ;
text:entityField "uri" ;
text:uidField "uid" ;
text:langField "lang" ;
text:graphField "graph" ;
text:map (
[ text:field "label" ; text:predicate rdfs:label ]
[ text:field "abbreviation" ; text:predicate meshv:abbreviation ]
[ text:field "annotation" ; text:predicate meshv:annotation ]
[ text:field "historyNote" ; text:predicate meshv:historyNote ]
[ text:field "identifier" ; text:predicate meshv:identifier ]
[ text:field "prefLabel" ; text:predicate meshv:prefLabel ]
[ text:field "altLabel" ; text:predicate meshv:altLabel ]
[ text:field "casn1_label" ; text:predicate meshv:casn1_label ]
[ text:field "registryNumber" ; text:predicate meshv:registryNumber ]
[ text:field "relatedRegistryNumber" ; text:predicate meshv:relatedRegistryNumber ]
[ text:field "note" ; text:predicate meshv:note ]
[ text:field "onlineNote" ; text:predicate meshv:onlineNote ]
[ text:field "publicMeSHNote" ; text:predicate meshv:publicMeSHNote ]
# [ text:field "source" ; text:predicate meshv:source ]
[ text:field "scopeNote" ; text:predicate meshv:scopeNote ]
[ text:field "abbreviation_t" ; text:predicate mesht:abbreviation ]
[ text:field "annotation_t" ; text:predicate mesht:annotation ]
[ text:field "historyNote_t" ; text:predicate mesht:historyNote ]
[ text:field "identifier_t" ; text:predicate mesht:identifier ]
[ text:field "prefLabel_t" ; text:predicate mesht:prefLabel ]
[ text:field "altLabel_t" ; text:predicate mesht:altLabel ]
[ text:field "scopeNote_t" ; text:predicate mesht:scopeNote ]
[ text:field "translatorsNote" ; text:predicate mesht:translatorsNote ]
) .
### MeSH common:
## abbreviation
## annotation
## historyNote
## identifier
## prefLabel
## altLabel
## scopeNote
### MeSH master only:
## rdfs:label
## meshv:casn1_label
## meshv:note
## meshv:onlineNote
## meshv:publicMeSHNote
## meshv:source
### Translation only:
## mesht:translatorsNote
<#service_text_tdb>
a fuseki:Service ;
rdfs:label "MeSH-Translation-service" ;
fuseki:name "mesh" ;
fuseki:serviceQuery "query" ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:dataset :text_dataset ;
.