Hi guys, I am using GraphDB 8.2 and I have a repo with the following statements

data1:I10.0.3.1           net:ipv4     "10.0.3.1"
data1:ROSPFID10.0.3.1     net:ipv4     "10.0.3.1"

I am trying to load a simple rule file "myfile.pie" with sys:addRuleset. The file is as follows

Prefices
{
    owl : http://www.w3.org/2002/07/owl#
    net : http://encaby.dsto.defence.gov.au/ont/net#
}
Axioms
{
}
Rules
{
Id: same_interface
  x1 <net:ipv4> y
  x2 <net:ipv4> y [Constraint x1 != x2]
  -------------------------------
  x1 <owl:sameAs> x2
}

Basically, the rule says "if two interfaces have the same IP address then they are the same interface

After running addRuleset, the result is "No statements added or removed. Update took 0.7s, today at ....."

However, if I run a SPARQL query like the following, I got the expected results

SELECT ?x1 ?x2 
WHERE { 
    ?x1  net:ipv4 ?y .
    ?x2  net:ipv4 ?y .
    FILTER(?x1 != ?x2) .
}

My rule and my SPARQL query look identical, why my rule does not produce any statements?

Thank you

Best Regards

asked 29 Jul, 23:52

alexto's gravatar image

alexto
01
accept rate: 0%

edited 29 Jul, 23:54


Hi, adding a ruleset does not make it 'default' so it is not used unless selected with sys:defaultRuleset predicate (you may add that within the same update through which you added the custom ruleset content.

Note, that even set to default it will not automatically recompute against the exiting data, it will be used to the subsequent updates. You need to trigger recompute of the closure manualy using :reinfer system predicate, e.g. execute an an update like:

INSERT DATA { [] http://www.ontotext.com/owlim/system#reinfer [] }

the easier way to achieve the same inference is to use a ruleset that already has support for owl:InverseFunctionalProperty and make your net:ipv4 predicate member of it (relate it with rdf:type to the owl:InverseFunctionalProperty class. For instance, "owl-horst" ruleset support such inference.

The answers.ontotext.com board is not monitored reguarily. If you like qucker recponce and wider audience plese use stackexchange with tags 'graphdb' ...

HTH, Damyan

link

answered yesterday

Damyan%20Ognyanov's gravatar image

Damyan Ognyanov ♦♦
34317
accept rate: 25%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×17

Asked: 29 Jul, 23:52

Seen: 26 times

Last updated: yesterday

powered by BitNami OSQA