3

this is the builtin_owl2-rl.pie line 361

// Part 1 of cls_oo
Id: cls_oo_1
     c <owl:oneOf>    x
     ------------------
     c <onto:_oneOf>  x                     [Context <onto:_cls_oo>]


// Part 2 of cls_oo
Id: cls_oo_2
     c  <onto:_oneOf>  x                    [Context <onto:_cls_oo>]
     x  <rdf:first>    y
     x  <rdf:rest>     z
    -------------------------------
     y  <rdf:type>     c
     c  <onto:_oneOf>  z                    [Context <onto:_cls_oo>][Constraint z != <rdf:nil>]

Some random stuff to pacify stackoverflow's "AI" suggestion "this is only code, add explanation"

Vladimir Alexiev
  • 2,176
  • 1
  • 16
  • 28
isaac Lee
  • 111
  • 5

1 Answers1

1

This rule implements https://www.w3.org/TR/owl2-profiles/#cls-oo.

  • owl:oneOf is the original property; its object is a list.
  • onto:_oneOf is an implementation property used to unroll the list. It's always put in an implementation context onto:_cls_oo. Triples from this context should never be returned.

Now imagine you got c owl:oneOf (y1 y2) which really means

c owl:oneOf [rdf:first y1;
         rdf:rest [rdf:first y2;
                   rdf:rest rdf:nil]]

The first rule copies it to onto:_oneOf. Then the second rule produces

y1 rdf:type c.
c onto:_oneOf [rdf:first y2; 
               rdf:rest rdf:nil]]

The second rule kicks again and produces

y1 rdf:type c.
y2 rdf:type c.
c onto:_oneOf rdf:nil

The first two are what you want inferred, and the third is a leftover hidden in the implementation context.

Did you get this? If you did, try to prove the implementation of owl:propertyChainAxiom https://www.w3.org/TR/owl2-profiles/#prp-spo2 is correct:

Id: prp_spo2_1
    p <owl:propertyChainAxiom> pc
    start pc last                   [Context <onto:_checkChain>]
    ----------------------------
    start p last

Id: prp_spo2_2
    pc <rdf:first> p
    pc <rdf:rest> t                 [Constraint t != <rdf:nil>]
    start p next
    next t last                     [Context <onto:_checkChain>]
    ----------------------------
    start pc last                   [Context <onto:_checkChain>]

Id: prp_spo2_3
    pc <rdf:first> p
    pc <rdf:rest> <rdf:nil>
    start p last
    ----------------------------
    start pc last                   [Context <onto:_checkChain>]
Vladimir Alexiev
  • 2,176
  • 1
  • 16
  • 28