You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Frances the mute <fr...@gmail.com> on 2019/01/17 05:58:25 UTC

How can I configure Fuseki so works in-memory with a reasoner on?

I have a ontology with ~5000 triplets and a few rules, with Fuselo 3.10.
But it’s really slow when doing something like this:


SELECT DISTINCT  ?class ?prop ?nombre ?p ?cat
WHERE {
  ?class a owl:NamedIndividual .
  ?class su:tienePropiedad ?prop .
  ?prop su:categoria ?nombre .
  ?nombre ?p ?cat .
  FILTER NOT EXISTS {
                       ?nombre a ?other .
                       ?other rdfs:subClassOf ?cat .
                       FILTER(?other != ?cat)
   }
  FILTER(isUri(?class) && STRSTARTS(STR(?class), STR(su:)))
}
LIMIT 25

I've been searching in the mailing list and I found that it's something
common: Slow query when getting rdf:type
<https://markmail.org/message/qnsfm3ynorxmlupx>

I found some examples of how to modified the config file. This is my
ssrsi.ttl (server config)

@prefix :      <http://base/#> .
@prefix tdb:   <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@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#> .

:service1   a                fuseki:Service ;
        fuseki:dataset                :dataset ;
        fuseki:name                   “ssrsi_mem” ;
        fuseki:serviceQuery           “query” , “sparql” ;
        fuseki:serviceReadGraphStore  “get” ;
        fuseki:serviceReadWriteGraphStore “data” ;
        fuseki:serviceUpdate          “update” ;
        fuseki:serviceUpload          “upload” .

:dataset a ja:DatasetTxnMem ;
       rdfs:label     “SSRSI in-memory”;
       ja:defaultGraph [
               rdfs:label “SSRSI” ;
      a ja:InfModel ;
                  #Model
                  ja:content  [ ja:externalContent
file:///C:/bin/apache-jena-fuseki3.10.0/run/databases/onto_mem_turtle.ttl
] ;
                  #Data
                  ja:content  [ ja:externalContent
file:///C:/bin/apache-jena-fuseki-3.10.0/run/databases/sitios.ttl ] ;
              ja:reasoner [ ja:reasonerURL
<http://jena.hpl.hp.com/2003/OWLFBRuleReasoner> ] ;
] ;

But doesn't work the reasoner (I've been using this tutorial for making
tests Configuring Apache Jena Fuseki 2.4.1 inference and reasoning
<https://github.com/jfmunozf/Jena-Fuseki-Reasoner-Inference/wiki/Configuring-Apache-Jena-Fuseki-2.4.1-inference-and-reasoning-support-using-SPARQL-1.1:-Jena-inference-rules,-RDFS-Entailment-Regimes-and-OWL-reasoning>
)

So how do I configure the server to work as in-memory with the reasoner?

Re: How can I configure Fuseki so works in-memory with a reasoner on?

Posted by Andy Seaborne <an...@apache.org>.
 > :dataset a ja:DatasetTxnMem ;
This will need to be a ja:RDFDataset.

An example:
https://github.com/apache/jena/blob/master/jena-fuseki2/examples/service-inference-1.ttl

On 17/01/2019 05:58, Frances the mute wrote:
> I have a ontology with ~5000 triplets and a few rules, with Fuselo 3.10.
> But it’s really slow when doing something like this:
> 
> 
> SELECT DISTINCT  ?class ?prop ?nombre ?p ?cat
> WHERE {
>    ?class a owl:NamedIndividual .
>    ?class su:tienePropiedad ?prop .
>    ?prop su:categoria ?nombre .
>    ?nombre ?p ?cat .
>    FILTER NOT EXISTS {
>                         ?nombre a ?other .
>                         ?other rdfs:subClassOf ?cat .
>                         FILTER(?other != ?cat)
>     }
>    FILTER(isUri(?class) && STRSTARTS(STR(?class), STR(su:)))
> }
> LIMIT 25
> 
> I've been searching in the mailing list and I found that it's something
> common: Slow query when getting rdf:type
> <https://markmail.org/message/qnsfm3ynorxmlupx>
> 
> I found some examples of how to modified the config file. This is my
> ssrsi.ttl (server config)
> 
> @prefix :      <http://base/#> .
> @prefix tdb:   <http://jena.hpl.hp.com/2008/tdb#> .
> @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @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#> .
> 
> :service1   a                fuseki:Service ;
>          fuseki:dataset                :dataset ;
>          fuseki:name                   “ssrsi_mem” ;
>          fuseki:serviceQuery           “query” , “sparql” ;
>          fuseki:serviceReadGraphStore  “get” ;
>          fuseki:serviceReadWriteGraphStore “data” ;
>          fuseki:serviceUpdate          “update” ;
>          fuseki:serviceUpload          “upload” .
> 
> :dataset a ja:DatasetTxnMem ;
>         rdfs:label     “SSRSI in-memory”;
>         ja:defaultGraph [
>                 rdfs:label “SSRSI” ;
>        a ja:InfModel ;
>                    #Model
>                    ja:content  [ ja:externalContent
> file:///C:/bin/apache-jena-fuseki3.10.0/run/databases/onto_mem_turtle.ttl
> ] ;
>                    #Data
>                    ja:content  [ ja:externalContent
> file:///C:/bin/apache-jena-fuseki-3.10.0/run/databases/sitios.ttl ] ;
>                ja:reasoner [ ja:reasonerURL
> <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner> ] ;
> ] ;
> 
> But doesn't work the reasoner (I've been using this tutorial for making
> tests Configuring Apache Jena Fuseki 2.4.1 inference and reasoning
> <https://github.com/jfmunozf/Jena-Fuseki-Reasoner-Inference/wiki/Configuring-Apache-Jena-Fuseki-2.4.1-inference-and-reasoning-support-using-SPARQL-1.1:-Jena-inference-rules,-RDFS-Entailment-Regimes-and-OWL-reasoning>
> )
> 
> So how do I configure the server to work as in-memory with the reasoner?
>