0

I'm new to Apache Jena and Fuseki. I've installed Apache Jena Fuseki as a standalone server and I'm trying to define a very simple inference rule and seemingly, I'm not configuring it correctly. My configuration file config_new.ttl looks like this:

@prefix :        <#> .
@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 ao:      <http://ao.com> .

[] rdf:type fuseki:Server ;
   fuseki:services (
       <#mainservice>
   ) .

<#mainservice> rdf:type fuseki:Service ;
    fuseki:name                       "mainservice" ;  
    fuseki:serviceQuery               "sparql"      ;   
    fuseki:serviceQuery               "query"       ;   
    fuseki:serviceUpdate              "update"      ;   
    fuseki:serviceUpload              "upload"      ;   
    fuseki:serviceReadWriteGraphStore "data"        ;   
    fuseki:serviceReadGraphStore      "get"         ;   
    fuseki:dataset                    <#ao>         ;
    .

### In-memory, initially empty.
## This database set-up allows OWL inference.
<#ao> rdf:type ja:MemoryModel ;
                ja:defaultGraph <#infGraph> .

<#infGraph>  rdf:type ja:InfModel ;
             ja:reasoner [ ja:rulesFrom <file:inference_rules.rules> ; ] .

I'm starting the server from a console with:

./fuseki-server --update --file=config_new.ttl /mainservice

It's starting and I am able to upload some data and query it successfully from the web-page, but seemingly it doesn't read the file inference_rules.rules. Even if the file name is wrong or the file doesn't exist or the contents of the file is incorrect, I don't get any errors and the rule is not working.

What am I missing?

There's a second question here. Apparently, I'm not there yet, but let me put here the contents of inference_rules.rules. I'm trying to define a simple transitive rule - if (A is a B) and (B is a C), then A is a C:

@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
@prefix ex: http://example.com/
@prefix xs: http://www.w3.org/2001/XMLSchema#
@prefix ao: http://ao.com/

[isATransitive:
(?a ao:isA ?b)
(?b ao:isA ?c)
                 ->
                 (?a ao:isA ?c)
         ]

Did I define it correctly?

Jimo
  • 143
  • 2
  • 14

1 Answers1

1

In the part that says:

<#ao> rdf:type ja:MemoryModel ;
                ja:defaultGraph <#infGraph> .

<#infGraph>  rdf:type ja:InfModel ;
             ja:reasoner [ ja:rulesFrom <file:inference_rules.rules> ; ] .

<#ao> must be of type ja:RDFDataset not a model.

<#ao> rdf:type ja:RDFDataset ;

AndyS
  • 16,345
  • 17
  • 21
  • It doesn't work :( . It doesn't care if the file **inference_rules.rules** exists or not and what's in it. The rule doesn't get loaded. – Jimo Mar 22 '17 at 18:27
  • I think there's something wrong with **** – Jimo Mar 22 '17 at 18:55