Skip to content

Commit

Permalink
Use Jena Text
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed May 2, 2020
1 parent 8033ce7 commit 50fc04d
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dockerfiles/config/config-docker-compose.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# skosmos:sparqlEndpoint <http://api.dev.finto.fi/sparql> ;
# sparql-query extension, or "Generic" for plain SPARQL 1.1
# set to "JenaText" instead if you use Fuseki with jena-text index
skosmos:sparqlDialect "Generic" ;
skosmos:sparqlDialect "JenaText" ;
# whether to enable collation in sparql queries
skosmos:sparqlCollationEnabled false ;
# HTTP client configuration
Expand Down
85 changes: 85 additions & 0 deletions dockerfiles/config/skosmos.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
@prefix : <http://base/#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix tdb2: <http://jena.apache.org/2016/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

ja:DatasetTxnMem rdfs:subClassOf ja:RDFDataset .
ja:MemoryDataset rdfs:subClassOf ja:RDFDataset .
ja:RDFDatasetOne rdfs:subClassOf ja:RDFDataset .
ja:RDFDatasetSink rdfs:subClassOf ja:RDFDataset .
ja:RDFDatasetZero rdfs:subClassOf ja:RDFDataset .

tdb2:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb2:DatasetTDB2 rdfs:subClassOf ja:RDFDataset .

tdb2:GraphTDB rdfs:subClassOf ja:Model .
tdb2:GraphTDB2 rdfs:subClassOf ja:Model .

<http://jena.hpl.hp.com/2008/tdb#DatasetTDB>
rdfs:subClassOf ja:RDFDataset .

<http://jena.hpl.hp.com/2008/tdb#GraphTDB>
rdfs:subClassOf ja:Model .

text:TextDataset
rdfs:subClassOf ja:RDFDataset .

:service_tdb_all a fuseki:Service ;
rdfs:label "TDB2+text skosmos" ;
fuseki:dataset :text_dataset ;
fuseki:name "skosmos" ;
fuseki:serviceQuery "query" , "" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadQuads "" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceReadWriteQuads "" ;
fuseki:serviceUpdate "" , "update" ;
fuseki:serviceUpload "upload" .

:text_dataset a text:TextDataset ;
text:dataset :tdb_dataset_readwrite ;
text:index :index_lucene .

:tdb_dataset_readwrite
a tdb2:DatasetTDB2 ;
# tdb2:unionDefaultGraph true ;
tdb2:location "/fuseki/databases/skosmos" .

:index_lucene a text:TextIndexLucene ;
text:directory <file:/fuseki/databases/skosmos/text> ;
text:entityMap :entity_map ;
text:storeValues true .

# Text index configuration for Skosmos
:entity_map a text:EntityMap ;
text:entityField "uri" ;
text:graphField "graph" ;
text:defaultField "pref" ;
text:uidField "uid" ;
text:langField "lang" ;
text:map (
# skos:prefLabel
[ text:field "pref" ;
text:predicate skos:prefLabel ;
text:analyzer [ a text:LowerCaseKeywordAnalyzer ]
]
# skos:altLabel
[ text:field "alt" ;
text:predicate skos:altLabel ;
text:analyzer [ a text:LowerCaseKeywordAnalyzer ]
]
# skos:hiddenLabel
[ text:field "hidden" ;
text:predicate skos:hiddenLabel ;
text:analyzer [ a text:LowerCaseKeywordAnalyzer ]
]
# skos:notation
[ text:field "notation" ;
text:predicate skos:notation ;
text:analyzer [ a text:LowerCaseKeywordAnalyzer ]
]
) .
5 changes: 4 additions & 1 deletion dockerfiles/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ services:
environment:
- ADMIN_PASSWORD=admin
- JVM_ARGS=-Xmx2g
- FUSEKI_DATASET_1=skosmos
ports:
- 9030:3030
# You can uncomment the line below to have a local volume bound onto the container, or
# visit https://hub.docker.com/r/stain/jena-fuseki/ for other alternatives
# volumes:
# - ${PWD}/fuseki:/fuseki
volumes:
- type: bind
source: ./config/skosmos.ttl
target: /fuseki/configuration/skosmos.ttl
skosmos:
container_name: skosmos-web
build:
Expand Down

0 comments on commit 50fc04d

Please sign in to comment.