-
Notifications
You must be signed in to change notification settings - Fork 23
/
jena.spatial+text3.assembler.ttl
74 lines (62 loc) · 2.45 KB
/
jena.spatial+text3.assembler.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
## TDB dataset and spatial index
@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 tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix spatial: <http://jena.apache.org/spatial#> .
@prefix text: <http://jena.apache.org/text#> .
# Initialize TDB
[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
# Initialize Spatial
[] ja:loadClass "org.apache.jena.query.spatial.SpatialQuery" .
spatial:SpatialDataset rdfs:subClassOf ja:RDFDataset .
spatial:SpatialIndexLucene rdfs:subClassOf spatial:SpatialIndex .
## 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 .
## ---------------------------------------------------------------
## This URI must be fixed - it's used to assemble the spatial dataset.
:indexed-dataset rdf:type spatial:SpatialDataset ;
spatial:dataset <#dataset> ;
spatial:index <#indexLucene> ;
rdf:type text:TextDataset ;
text:dataset <#dataset> ;
text:index <#indexLuceneText> .
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "TDB" ;
.
<#indexLucene> a spatial:SpatialIndexLucene ;
spatial:directory <file:LUCENESpatial> ;
spatial:definition <#definition> ;
.
<#definition> a spatial:EntityDefinition ;
spatial:entityField "uri" ;
spatial:geoField "geo"
.
# Text index description
<#indexLuceneText> a text:TextIndexLucene ;
text:directory <file:/home/jmv/src/semantic_forms/scala/LUCENE> ;
text:entityMap <#entMap> ;
text:storeValues true ;
text:analyzer [ a text:StandardAnalyzer ] ;
text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
text:queryParser text:AnalyzingQueryParser ;
# text:defineAnalyzers [ . . . ] ;
text:multilingualSupport true ;
.
<#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 ]
) .