Search code examples
semantic-webn3

How to use :notIncludes in Notation 3 rules?


I'm currently learning how to use the rules in Notation 3 with CWM. I want to build a rule that gives the stepchilds in a family ontology. So, the stepchild is the child of someone but not the child of this someone's spouse.

@prefix ex: <http://www.smith-family.com/familyOntology.owl#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#>.    
{
        ?p1 :hasWife ?p2 .
        ?p2 :hasChild ?c .
        : log:notIncludes {?p1 :hasChild ?c}
    }
    => {?p1 :hasStepChild ?c}.

I don't really understand how to use notIncludes... Also, I miss the ?p1 :hasHusband ?p2 statement, but it even does not work like that.

Does anyone know how I could make it work?


Solution

  • You have to specify the dataset and what the negation as failure is applied to. See https://www.w3.org/2000/10/swap/doc/paper/#neg23 for reference.