You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Laura Morales <la...@mail.com> on 2017/04/05 06:29:56 UTC
Fuseki config file
Could somebody please show me a working config file for a Fuseki standalone server using TDB (persistent storage)? I've tried to write one, but I keep getting errors such as this
[2017-04-05 08:23:07] Server ERROR Exception in initialization: Failed reading assembler description: Failed to determine the content type: (URI=~/db/config : stream=null)
[2017-04-05 08:23:07] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext@54dcfa5a{/,file://~/fuseki/apache-jena-fuseki-2.5.0/webapp/,STARTING}
org.apache.jena.sparql.ARQException: Failed reading assembler description: Failed to determine the content type: (URI=~/db/config : stream=null)
at org.apache.jena.sparql.core.assembler.AssemblerUtils.readAssemblerFile(AssemblerUtils.java:96)
at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:147)
...
=====================================
my config (copied from the website)
=====================================
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@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 : <#>
[] rdf:type fuseki:Server ;
# Server-wide context parameters can be given here.
# For example, to set query timeouts: on a server-wide basis:
# Format 1: "1000" -- 1 second timeout
# Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
# See java doc for ARQ.queryTimeout
ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ;
# Load custom code (rarely needed)
# ja:loadClass "your.code.Class" ;
# Services available. Only explicitly listed services are configured.
# If there is a service description not linked from this list, it is ignored.
fuseki:services (
<#service1>
) .
# Declaration additional assembler items.
[] ja:loadClass "org.apache.jena.tdb.TDB" .
# TDB
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
<#service1> rdf:type fuseki:Service ;
fuseki:name "tdb" ; # http://host:port/tdb
fuseki:serviceQuery "sparql" ; # SPARQL query service
fuseki:dataset <#dataset> ;
.
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "/home/myself/fusekidb" ;
# Query timeout on this dataset (1s, 1000 milliseconds)
ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ;
# Make the default graph be the union of all named graphs.
## tdb:unionDefaultGraph true .
Re: Fuseki config file
Posted by Andy Seaborne <an...@apache.org>.
Fuseki reads an RDF file using Jena - nothing special.
Reading a file on-disk, trhere is no meta data, the only clue as to
syntax is the file extension.
Every MIME type has a registered file extension.
Snooping the content type is a fools errand. (XML-based syntax are worst
for this.)
On 05/04/17 08:15, Osma Suominen wrote:
> 05.04.2017, 10:06, Laura Morales kirjoitti:
>
>> I actually find RDF pretty inconvenient for a config file. I don't
>> know why the software wants to use it. I don't even see the need to
>> put these things into a graph. A simple key-value list of options
>> would be enough, or a INI or JSON in the worst case.
It needs links and composition.
Note that structures can be shared. It's not a tree.
>
> Yeah, I meant that Turtle is the most convenient of the available RDF
> syntaxes. I agree that RDF is not ideal for config files, but at least
> it's very flexible. Jena assembler configurations are used for other
> things than just Fuseki, e.g. to set up text and spatial indexes. Then
> you need to have multiple levels of containment, perhaps reusing some
> entities etc. Key-value or INI style would probably not be enough to
> represent that.
>
> I suppose one could define a JSON-LD context that would allow writing
> Jena assembler definitions using a simplified JSON model where you
> wouldn't worry about namespaces and such.
That would be interesting to see.
Andy
>
> -Osma
>
>
Re: Fuseki config file
Posted by Osma Suominen <os...@helsinki.fi>.
05.04.2017, 10:06, Laura Morales kirjoitti:
> I actually find RDF pretty inconvenient for a config file. I don't
> know why the software wants to use it. I don't even see the need to
> put these things into a graph. A simple key-value list of options
> would be enough, or a INI or JSON in the worst case.
Yeah, I meant that Turtle is the most convenient of the available RDF
syntaxes. I agree that RDF is not ideal for config files, but at least
it's very flexible. Jena assembler configurations are used for other
things than just Fuseki, e.g. to set up text and spatial indexes. Then
you need to have multiple levels of containment, perhaps reusing some
entities etc. Key-value or INI style would probably not be enough to
represent that.
I suppose one could define a JSON-LD context that would allow writing
Jena assembler definitions using a simplified JSON model where you
wouldn't worry about namespaces and such.
-Osma
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi
Re: Fuseki config file
Posted by Laura Morales <la...@mail.com>.
> The assembler description is a set of RDF triples, usually expressed as
> a Turtle file. I suppose it could just as well be an RDF/XML (e.g.
> config.rdf) or N-Triples (e.g. config.nt) file, though I've never tried.
> There is little reason to use anything else than Turtle, since that's
> the most convenient syntax for human beings.
I actually find RDF pretty inconvenient for a config file. I don't know why the software wants to use it. I don't even see the need to put these things into a graph. A simple key-value list of options would be enough, or a INI or JSON in the worst case.
Re: Fuseki config file
Posted by Osma Suominen <os...@helsinki.fi>.
05.04.2017, 09:55, Laura Morales kirjoitti:
> Does Fuseki support other config formats?
The assembler description is a set of RDF triples, usually expressed as
a Turtle file. I suppose it could just as well be an RDF/XML (e.g.
config.rdf) or N-Triples (e.g. config.nt) file, though I've never tried.
There is little reason to use anything else than Turtle, since that's
the most convenient syntax for human beings.
-Osma
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi
Re: Fuseki config file
Posted by Laura Morales <la...@mail.com>.
> I'd rather call it a missing feature. There is no autodetection of RDF
> syntax based on file content, the code uses the filename extension to
> determine it.
Does Fuseki support other config formats?
Re: Fuseki config file
Posted by Osma Suominen <os...@helsinki.fi>.
05.04.2017, 09:44, Laura Morales kirjoitti:
> Thanks a lot, that fixed the problem! I guess this is a bug?
I'd rather call it a missing feature. There is no autodetection of RDF
syntax based on file content, the code uses the filename extension to
determine it.
-Osma
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi
Re: Fuseki config file
Posted by Laura Morales <la...@mail.com>.
> Try renaming the file to config.ttl instead. The content looks fine, but
> the parser seems to fail to detect the file type.
Thanks a lot, that fixed the problem! I guess this is a bug?
Re: Fuseki config file
Posted by Osma Suominen <os...@helsinki.fi>.
Hi Laura,
Try renaming the file to config.ttl instead. The content looks fine, but
the parser seems to fail to detect the file type.
-Osma
05.04.2017, 09:29, Laura Morales kirjoitti:
> Could somebody please show me a working config file for a Fuseki standalone server using TDB (persistent storage)? I've tried to write one, but I keep getting errors such as this
>
> [2017-04-05 08:23:07] Server ERROR Exception in initialization: Failed reading assembler description: Failed to determine the content type: (URI=~/db/config : stream=null)
> [2017-04-05 08:23:07] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext@54dcfa5a{/,file://~/fuseki/apache-jena-fuseki-2.5.0/webapp/,STARTING}
> org.apache.jena.sparql.ARQException: Failed reading assembler description: Failed to determine the content type: (URI=~/db/config : stream=null)
> at org.apache.jena.sparql.core.assembler.AssemblerUtils.readAssemblerFile(AssemblerUtils.java:96)
> at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:147)
> ...
>
> =====================================
> my config (copied from the website)
> =====================================
>
> @prefix fuseki: <http://jena.apache.org/fuseki#> .
> @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 : <#>
>
> [] rdf:type fuseki:Server ;
> # Server-wide context parameters can be given here.
> # For example, to set query timeouts: on a server-wide basis:
> # Format 1: "1000" -- 1 second timeout
> # Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
> # See java doc for ARQ.queryTimeout
> ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ;
>
> # Load custom code (rarely needed)
> # ja:loadClass "your.code.Class" ;
>
> # Services available. Only explicitly listed services are configured.
> # If there is a service description not linked from this list, it is ignored.
> fuseki:services (
> <#service1>
>
> ) .
>
> # Declaration additional assembler items.
> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>
> # TDB
> tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
> tdb:GraphTDB rdfs:subClassOf ja:Model .
>
> <#service1> rdf:type fuseki:Service ;
> fuseki:name "tdb" ; # http://host:port/tdb
> fuseki:serviceQuery "sparql" ; # SPARQL query service
> fuseki:dataset <#dataset> ;
> .
>
> <#dataset> rdf:type tdb:DatasetTDB ;
> tdb:location "/home/myself/fusekidb" ;
> # Query timeout on this dataset (1s, 1000 milliseconds)
> ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ;
> # Make the default graph be the union of all named graphs.
> ## tdb:unionDefaultGraph true .
>
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi