0

I want to use Jena Fuseki to construct a SPARQL endpoint for some ontology file. and my fuseki config as follow:

@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#> .

<#service1> rdf:type fuseki:Service ;
    fuseki:name                       "ds" ;       # http://host:port/ds
    fuseki:serviceQuery               "sparql" ;   # SPARQL query service
    fuseki:serviceQuery               "query" ;    # SPARQL query service (alt name)
    fuseki:serviceUpdate              "update" ;   # SPARQL update service
    fuseki:serviceUpload              "upload" ;   # Non-SPARQL upload service
    fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol (read and write)
    # A separate read-only graph store endpoint:
    fuseki:serviceReadGraphStore      "get" ;      # SPARQL Graph store protocol (read only)
    fuseki:dataset                   <#dataset> ;
    .

<#dataset> rdf:type ja:RDFDataset ;
    ja:defaultGraph <#inf_model> ;
    .

<#mv_data_model> a ja:MemoryModel;
    ja:content[ja:externalContent <file://D:/Program%20Files/d2rq-0.8.1/movie.nt>] ;
    ja:content[ja:externalContent <file://D:/Program%20Files/apache-jena-fuseki-3.13.1/run/ontology.ttl>]
    .

<#inf_model> a ja:InfModel ;
    ja:baseModel <#mv_data_model>;
    ja:reasoner [ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>] ;

    #ja:reasoner [
    #    ja:reasonerURL <http://jena.hpl.hp.com/2003/GenericRuleReasoner> ; 
    #    ja:rulesFrom <file://D:/Program%20Files/apache-jena-fuseki-3.13.1/run/rule.ttl>; ]
    .

I run fuseki as a Standalone Server.when I close the OWL reasoner it works well.But once the OWL reasoner is enabled,the server has no response for the query,even the query like

SELECT ?s ?p ?o
WHERE {
    ?s ?p ?o
}
limit 10

has no response, and then throw a Exception: java.lang.OutOfMemoryError. However,the RuleReasoner works well. And my ttl file has about 1500000 triples, is the data scale is too large for the OWL Reasoner to have a inference? All work is done on my pc,can any friend offer me a help? Thanks

xrds
  • 61
  • 3
  • How do you run Fuseki? Did you set the heap size? – AndyS Jan 08 '20 at 19:58
  • 1. the OWL reasoner performance depends more on the complexity of your ontology than on the size of the instance data. 2.) that said, do you really need the OWL max reasoner of Jena? There are other subsets of OWL reasoning (micro, etc.) in Jena 3.) no response means it's still working and as you can see, your assigned heap space is not enough, thus, the OOM error, thus no response. – UninformedUser Jan 09 '20 at 07:46
  • Thanks, I start Fuseki by run "fuseki-server.bat",and use the default JVM setting. As @AKSW 's suggesting,I use the to replace OWLFBRuleReasoner,then I get the correct response. But I didn't know the micro reasoner before,how can I get all of the reasoner URL, is there any document about it? I haven't found the reasoner's URL at [Jena Assembler howto](https://jena.apache.org/documentation/assembler/assembler-howto.html). – xrds Jan 10 '20 at 16:44
  • Apparently, all reasoner URIs can be found based on the ReasonerFactory interface getURI() method: https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/reasoner/ReasonerFactory.html Not sure if there is a list somewhere online. @AndyS maybe knows this? – UninformedUser Jan 11 '20 at 16:13
  • Edit fuseki-server.bat and increase the -Xmx setting. The default heap size is quite small. – AndyS Jan 12 '20 at 18:47

1 Answers1

0

In fuseki, when running a Reasoner over a too big DataSet, the inferences will be applied to All Graph in query execution time. Besides that, all inferences will be materialized in Fuseki TDB case reasoner applies forward reasoning. It will burden the system, cause the graph will be to big to materialize and reason using RAM memory.

We have alredy crashed a machine dedicating 1 TD RAM to Fuseki.

A possible solution is to split your dataset into independent parts for tunning the queries. For more information, look at hadoop and AllegroGraph solution for high-perfomance with Clusters https://allegrograph.com/hadoop-and-allegrograph-the-semantic-data-lake-for-analytics/

It depends on your demand. In an unlimited scale, cluster solution seems to be the best, but maybe locally increasing the dedicated RAM memory to JVM solve your problem.