[Owlim-discussion] How to use "NOT EXISTS" relationship filter in rule

2011-11-24 Thread Miroslav Líška

Dear sirs,

I need to write a rule, that will be satisfied, if there exists one 
relationship between individuals and one not.


For example:


x   y [Constraint x != y ]
x  p  y [Constraint p != 
, x != y]

...
---
x  y


So, when there are two individuals, that are in relationship 
realestate:sameRealEstateAsCandidate, and there is not relationship 
owl:differentFrom between them, then x  y.

But, when I made a test for following triples

ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
ex:individual1 owl:differentFromex:individual2

Trree created following undesired triple.

ex:individual1 ex:rel ex:individual2


Could you please help me in this? I really need this inference, it is 
one key rules of our matching process. When I looked in the example 
shown in the start of OWL2 RL pie file, there is wery similar example, 
thus I belevie I am just making some mistake. Note, that both triples in 
the premise part are implicit triples.


with kindest personal regards
miro
___
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] How to use "NOT EXISTS" relationship filter in rule

2011-12-01 Thread Barry Bishop

Hello miro,

I think the rule you have created is correct, however you are getting in 
to a tricky area to do with negation. OWLIM's inferencer can only infer 
new statements when adding explicit statements - in effect, it assumes 
monotonicity. Added to this, it is an incremental reasoner and will 
apply all rules to each individual statement as it is added.


Therefore the behaviour you are seeing could well happen depending on 
the order in which statements are inserted. For example,


If you assert the statements in this order:

1. ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
=> the inferencer fires the rule to get ex:individual1 ex:rel 
ex:individual2

2. ex:individual1 owl:differentFromex:individual2
=> doesn't cause any rule to fire, but won't remove any statements either

In this order:

1. ex:individual1 owl:differentFromex:individual2
=> doesn't cause any rule to fire
2. ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
=> still no rule fires


Essentially, I believe the problem to be caused by modelling issues 
within your ontology. If you think about it, "not equal to 
owl:differentFrom" is already getting to be rather double-negative. It 
seems that you have a model where some real-estates are the same unless 
you state that they are different.


Is it not possible to organise things so that you make owl:sameAs 
statements about these entities rather than owl:differentFrom statements?


I hope this helps,
barry

On 24/11/11 14:37, Miroslav Líška wrote:

Dear sirs,

I need to write a rule, that will be satisfied, if there exists one 
relationship between individuals and one not.


For example:


x  y [Constraint x != y ]
x  p  y [Constraint p != 
, x != y]

...
---
x  y


So, when there are two individuals, that are in relationship 
realestate:sameRealEstateAsCandidate, and there is not relationship 
owl:differentFrom between them, then x  y.

But, when I made a test for following triples

ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
ex:individual1 owl:differentFromex:individual2

Trree created following undesired triple.

ex:individual1 ex:rel ex:individual2


Could you please help me in this? I really need this inference, it is 
one key rules of our matching process. When I looked in the example 
shown in the start of OWL2 RL pie file, there is wery similar example, 
thus I belevie I am just making some mistake. Note, that both triples 
in the premise part are implicit triples.


with kindest personal regards
miro
___
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion

___
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] How to use "NOT EXISTS" relationship filter in rule

2011-12-01 Thread damyan

Hello Miro,

the rule:
x  y [Constraint x != y ]
x  p  y [Constraint p != 
, x != y]

...
---
x  y

would fire for any relation that links X with Y and is not equal to 
owl:differentFrom ...


so one such relation is (x  y) 
that you've just asserted :-)


Not knowing your model (ontology) and intended use, my advice could look 
a bit vague to you ... but you may reject results from such 
contradictory inference at query time using optionals, e.g:


select  where {
 ...
?x  realestate:sameRealEstateAsCandidate ?y .
optional {
   ?x realestate:differentRealEstate ?y .
   ?x  ?foo .
}
FILTER (!bound(?foo)) ..
...
}
inthe above quert a bound value to ?foo indicates that all the patterns 
within the optional are satisfied so you could skip all the solutions 
where ?y is bound to an instance that is NOT to be considered a 
sameRealEstate to ?x


HTH,
Damyan Ognyanov
Ontotext AD.



On 12/1/2011 11:52 AM, Barry Bishop wrote:

Hello miro,

I think the rule you have created is correct, however you are getting 
in to a tricky area to do with negation. OWLIM's inferencer can only 
infer new statements when adding explicit statements - in effect, it 
assumes monotonicity. Added to this, it is an incremental reasoner and 
will apply all rules to each individual statement as it is added.


Therefore the behaviour you are seeing could well happen depending on 
the order in which statements are inserted. For example,


If you assert the statements in this order:

1. ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
=> the inferencer fires the rule to get ex:individual1 ex:rel 
ex:individual2

2. ex:individual1 owl:differentFromex:individual2
=> doesn't cause any rule to fire, but won't remove any statements either

In this order:

1. ex:individual1 owl:differentFromex:individual2
=> doesn't cause any rule to fire
2. ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
=> still no rule fires


Essentially, I believe the problem to be caused by modelling issues 
within your ontology. If you think about it, "not equal to 
owl:differentFrom" is already getting to be rather double-negative. It 
seems that you have a model where some real-estates are the same 
unless you state that they are different.


Is it not possible to organise things so that you make owl:sameAs 
statements about these entities rather than owl:differentFrom statements?


I hope this helps,
barry

On 24/11/11 14:37, Miroslav Líška wrote:

Dear sirs,

I need to write a rule, that will be satisfied, if there exists one 
relationship between individuals and one not.


For example:


x  y [Constraint x != y ]
x  p  y [Constraint p != 
, x != y]

...
---
x  y


So, when there are two individuals, that are in relationship 
realestate:sameRealEstateAsCandidate, and there is not relationship 
owl:differentFrom between them, then x  y.

But, when I made a test for following triples

ex:individual1 realestate:sameRealEstateAsCandidate ex:individual2
ex:individual1 owl:differentFromex:individual2

Trree created following undesired triple.

ex:individual1 ex:rel ex:individual2


Could you please help me in this? I really need this inference, it is 
one key rules of our matching process. When I looked in the example 
shown in the start of OWL2 RL pie file, there is wery similar 
example, thus I belevie I am just making some mistake. Note, that 
both triples in the premise part are implicit triples.


with kindest personal regards
miro
___
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion

___
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion



___
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion