axiom.object_expression

OWL 2 object class-expression and class-axiom structural elements.

This module models object-side mirrors of the data-range patterns in axiom.datatype, plus Seq-backed class axioms that share the same owned-list mapping style.

Class expressions (subclasses of ClassExpression):

  • ObjectIntersectionOf — ObjectIntersectionOf( CE1 ... CEn ), n >= 2; owns an Seq fragment.

  • ObjectUnionOf — ObjectUnionOf( CE1 ... CEn ), n >= 2; owns an Seq fragment.

  • ObjectComplementOf — ObjectComplementOf( CE ); the operand is a cross-axiom node reference.

  • ObjectOneOf — ObjectOneOf( a1 ... an ), n >= 1; owns an Seq fragment of individual resources (not literals).

Object property expression:

  • ObjectInverseOf — ObjectInverseOf( OP ); RDF mapping emits only _:x owl:inverseOf OP (no rdf:type triple).

Class axioms:

  • DisjointClasses — binary DisjointClasses( CE1 CE2 ) via owl:disjointWith.

  • EquivalentClasses — binary EquivalentClasses( CE1 CE2 ) via owl:equivalentClass (n-ary structural forms serialize to multiple triples; reverse parse yields binaries).

  • DisjointClassesNary — DisjointClasses( CE1 ... CEn ), n > 2; owl:AllDisjointClasses with owned owl:members Seq.

  • DisjointUnion — DisjointUnion( C CE1 ... CEn ), n >= 2; named class with owned owl:disjointUnionOf Seq.

ClassExpression is an abstract umbrella: it blocks direct instantiation, provides the shared owl:Class declaration triple via as_triples, and concrete subclasses extend that projection with their own predicate-specific triples. Owned fragments share their owning element’s context and contribute their as_triples to the owner’s RDF partition; cross-axiom operands are RDF node identifiers via the package’s annotated aliases.

Classes

ClassExpression

Abstract umbrella for OWL 2 class expressions that declare owl:Class.

ObjectIntersectionOf

Element ObjectIntersectionOf( CE1 ... CEn ) of the OWL 2 structural specification.

ObjectUnionOf

Element ObjectUnionOf( CE1 ... CEn ) of the OWL 2 structural specification.

ObjectComplementOf

Element ObjectComplementOf( CE ) of the OWL 2 structural specification.

ObjectOneOf

Element ObjectOneOf( a1 ... an ) of the OWL 2 structural specification.

ObjectInverseOf

Element ObjectInverseOf( OP ) of the OWL 2 structural specification.

DisjointClasses

Element DisjointClasses( CE1 CE2 ) of the OWL 2 structural specification.

EquivalentClasses

Element EquivalentClasses( CE1 CE2 ) of the OWL 2 structural specification.

DisjointClassesNary

Element DisjointClasses( CE1 ... CEn ), n > 2, of the OWL 2 structural specification.

DisjointUnion

Element DisjointUnion( C CE1 ... CEn ) of the OWL 2 structural specification.

Module Contents

class axiom.object_expression.ClassExpression

Bases: axiom.structural_element.DeclarationElement, abc.ABC

Abstract umbrella for OWL 2 class expressions that declare owl:Class.

Not directly instantiable. Concrete subclasses include ObjectIntersectionOf, ObjectUnionOf, ObjectComplementOf, and ObjectOneOf. All concrete class expressions declare rdf:type owl:Class for name.

property rdf_type: rdflib.IdentifiedNode
class axiom.object_expression.ObjectIntersectionOf

Bases: ClassExpression

Element ObjectIntersectionOf( CE1 ... CEn ) of the OWL 2 structural specification.

The main RDF node is an anonymous blank node (written _:x below). OWL 2 structural syntax requires n >= 2 class expression operands.

Triples:

_:x rdf:type owl:Class .
_:x owl:intersectionOf T(SEQ CE1 ... CEn) .
kind: Literal['ObjectIntersectionOf'] = 'ObjectIntersectionOf'
intersection_of: axiom.structural_element.Seq
property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.ObjectUnionOf

Bases: ClassExpression

Element ObjectUnionOf( CE1 ... CEn ) of the OWL 2 structural specification.

The main RDF node is an anonymous blank node (written _:x below). OWL 2 structural syntax requires n >= 2 class expression operands.

Triples:

_:x rdf:type owl:Class .
_:x owl:unionOf T(SEQ CE1 ... CEn) .
kind: Literal['ObjectUnionOf'] = 'ObjectUnionOf'
union_of: axiom.structural_element.Seq
property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.ObjectComplementOf

Bases: ClassExpression

Element ObjectComplementOf( CE ) of the OWL 2 structural specification.

The main RDF node is an anonymous blank node (written _:x below). complement_of is the RDF subject of the complemented class expression (IRI or blank node); as_triples emits only this axiom’s triples (shallow projection). Declaration and other triples for CE belong in a separate axiom instance or graph partition, not inlined here.

Triples:

_:x rdf:type owl:Class .
_:x owl:complementOf CE .
kind: Literal['ObjectComplementOf'] = 'ObjectComplementOf'
complement_of: axiom.common.N3Resource
property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.ObjectOneOf

Bases: ClassExpression

Element ObjectOneOf( a1 ... an ) of the OWL 2 structural specification.

The main RDF node is an anonymous blank node (written _:x below). one_of is an owned Seq fragment carrying the enumerated individuals as rdf:first values (IRIs or blank nodes, not literals); the fragment shares this element’s context. OWL 2 structural syntax requires n >= 1 individual operands.

Triples:

_:x rdf:type owl:Class .
_:x owl:oneOf T(SEQ a1 ... an) .
kind: Literal['ObjectOneOf'] = 'ObjectOneOf'
one_of: axiom.structural_element.Seq
property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.ObjectInverseOf

Bases: axiom.structural_element.StructuralElement

Element ObjectInverseOf( OP ) of the OWL 2 structural specification.

The main RDF node is an anonymous blank node (written _:x below). inverse_of is the RDF node of the inverted object property expression; as_triples emits only this axiom’s triples (shallow projection). The OWL 2 RDF mapping does not emit an rdf:type triple for this form.

Triples:

_:x owl:inverseOf OP .
kind: Literal['ObjectInverseOf'] = 'ObjectInverseOf'
name_value: axiom.common.N3Resource = None
inverse_of: axiom.common.N3Resource
property name: rdflib.IdentifiedNode

Inverse property expression node identifier (alias of name_value).

property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.DisjointClasses

Bases: axiom.structural_element.StructuralElement

Element DisjointClasses( CE1 CE2 ) of the OWL 2 structural specification.

Both operands are RDF node references. If an operand is itself represented by another structural element, that element belongs to a separate partition.

Triples:

CE1 owl:disjointWith CE2 .
kind: Literal['DisjointClasses'] = 'DisjointClasses'
class_expression_1: axiom.common.N3Resource
class_expression_2: axiom.common.N3Resource
property name: rdflib.IdentifiedNode
property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.EquivalentClasses

Bases: axiom.structural_element.StructuralElement

Element EquivalentClasses( CE1 CE2 ) of the OWL 2 structural specification.

Binary form only. An n-ary structural EquivalentClasses( CE1 ... CEn ) serializes to n-1 owl:equivalentClass triples; OWL 2 RDF reverse mapping parses each triple as a binary axiom. This class models that binary parse shape. Shares owl:equivalentClass with DatatypeDefinition.

Both operands are RDF node references. If an operand is itself represented by another structural element, that element belongs to a separate partition.

Triples:

CE1 owl:equivalentClass CE2 .
kind: Literal['EquivalentClasses'] = 'EquivalentClasses'
class_expression_1: axiom.common.N3Resource
class_expression_2: axiom.common.N3Resource
property name: rdflib.IdentifiedNode
property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.DisjointClassesNary

Bases: axiom.structural_element.StructuralElement

Element DisjointClasses( CE1 ... CEn ), n > 2, of the OWL 2 structural specification.

The RDF subject is typically an anonymous blank node (written _:x below) of type owl:AllDisjointClasses. members is an owned Seq fragment carrying the class expression operands; the fragment shares this element’s context.

Triples:

_:x rdf:type owl:AllDisjointClasses .
_:x owl:members T(SEQ CE1 ... CEn) .
kind: Literal['DisjointClassesNary'] = 'DisjointClassesNary'
name_value: axiom.common.N3Resource = None
members: axiom.structural_element.Seq
property name: rdflib.IdentifiedNode

AllDisjointClasses node identifier (alias of name_value).

property as_triples: collections.abc.Sequence[axiom.common.Triple]
class axiom.object_expression.DisjointUnion

Bases: axiom.structural_element.StructuralElement

Element DisjointUnion( C CE1 ... CEn ) of the OWL 2 structural specification.

union_class is the named class C. disjoint_union_of is an owned Seq fragment carrying the covering class expression operands (n >= 2); the fragment shares this element’s context. The OWL 2 RDF mapping does not emit an rdf:type triple for this axiom.

Triples:

C owl:disjointUnionOf T(SEQ CE1 ... CEn) .
kind: Literal['DisjointUnion'] = 'DisjointUnion'
union_class: axiom.common.N3Resource
disjoint_union_of: axiom.structural_element.Seq
property name: rdflib.IdentifiedNode
property as_triples: collections.abc.Sequence[axiom.common.Triple]