axiom.restriction ================= .. py:module:: axiom.restriction .. autoapi-nested-parse:: OWL 2 object-property class-expression (restriction) structural elements. Mirrors the data-property restriction family in :mod:`rdflib_reasoning.axiom.datatype`. Concrete subclasses of :class:`ObjectRestriction` declare ``rdf:type owl:Restriction`` and pair ``owl:onProperty`` with a filler or cardinality predicate per the OWL 2 RDF mapping. Value and universal/existential restrictions: - :class:`ObjectSomeValuesFrom` --- ``ObjectSomeValuesFrom( OPE CE )``. - :class:`ObjectAllValuesFrom` --- ``ObjectAllValuesFrom( OPE CE )``. - :class:`ObjectHasValue` --- ``ObjectHasValue( OPE a )``. - :class:`ObjectHasSelf` --- ``ObjectHasSelf( OPE )``. Cardinality restrictions (unqualified and qualified via ``owl:onClass``): - :class:`ObjectMinCardinality` / :class:`ObjectMinCardinalityQualified` - :class:`ObjectMaxCardinality` / :class:`ObjectMaxCardinalityQualified` - :class:`ObjectExactCardinality` / :class:`ObjectExactCardinalityQualified` Classes ------- .. autoapisummary:: axiom.restriction.ObjectRestriction axiom.restriction.ObjectSomeValuesFrom axiom.restriction.ObjectAllValuesFrom axiom.restriction.ObjectHasValue axiom.restriction.ObjectHasSelf axiom.restriction.ObjectMinCardinality axiom.restriction.ObjectMinCardinalityQualified axiom.restriction.ObjectMaxCardinality axiom.restriction.ObjectMaxCardinalityQualified axiom.restriction.ObjectExactCardinality axiom.restriction.ObjectExactCardinalityQualified Module Contents --------------- .. py:class:: ObjectRestriction(/, **data: Any) Bases: :py:obj:`axiom.structural_element.StructuralElement`, :py:obj:`abc.ABC` Abstract base for OWL 2 class expressions that restrict an object property. Not directly instantiable. Each concrete subclass declares a node of ``rdf:type owl:Restriction`` and pairs ``owl:onProperty`` with a class, individual, self, or cardinality predicate per the OWL 2 RDF mapping. ``name`` is the RDF subject of the restriction node (typically a blank node). .. py:attribute:: name_value :type: axiom.common.N3Resource :value: None .. py:property:: name :type: rdflib.IdentifiedNode Restriction node identifier (alias of ``name_value``). .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectSomeValuesFrom(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectSomeValuesFrom( OPE CE )`` in the OWL 2 structural specification. The RDF subject is typically an anonymous blank node (written ``_:x`` below). Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:someValuesFrom CE . .. py:attribute:: kind :type: Literal['ObjectSomeValuesFrom'] :value: 'ObjectSomeValuesFrom' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: some_values_from :type: axiom.common.N3Resource .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectAllValuesFrom(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectAllValuesFrom( OPE CE )`` in the OWL 2 structural specification. The RDF subject is typically an anonymous blank node (written ``_:x`` below). Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:allValuesFrom CE . .. py:attribute:: kind :type: Literal['ObjectAllValuesFrom'] :value: 'ObjectAllValuesFrom' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: all_values_from :type: axiom.common.N3Resource .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectHasValue(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectHasValue( OPE a )`` in the OWL 2 structural specification. The RDF subject is typically an anonymous blank node (written ``_:x`` below). ``has_value`` is an individual (IRI or blank node). Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:hasValue a . .. py:attribute:: kind :type: Literal['ObjectHasValue'] :value: 'ObjectHasValue' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: has_value :type: axiom.common.N3Resource .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectHasSelf(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectHasSelf( OPE )`` in the OWL 2 structural specification. The RDF subject is typically an anonymous blank node (written ``_:x`` below). The mapping always uses the boolean literal ``"true"^^xsd:boolean``. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:hasSelf "true"^^xsd:boolean . .. py:attribute:: kind :type: Literal['ObjectHasSelf'] :value: 'ObjectHasSelf' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectMinCardinality(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectMinCardinality( n OPE )`` in the OWL 2 structural specification. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:minCardinality "n"^^xsd:nonNegativeInteger . .. py:attribute:: kind :type: Literal['ObjectMinCardinality'] :value: 'ObjectMinCardinality' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: min_cardinality :type: axiom.common.N3Node .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectMinCardinalityQualified(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectMinCardinality( n OPE CE )`` in the OWL 2 structural specification. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:minQualifiedCardinality "n"^^xsd:nonNegativeInteger . _:x owl:onClass CE . .. py:attribute:: kind :type: Literal['ObjectMinCardinalityQualified'] :value: 'ObjectMinCardinalityQualified' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: min_qualified_cardinality :type: axiom.common.N3Node .. py:attribute:: on_class :type: axiom.common.N3Resource .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectMaxCardinality(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectMaxCardinality( n OPE )`` in the OWL 2 structural specification. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:maxCardinality "n"^^xsd:nonNegativeInteger . .. py:attribute:: kind :type: Literal['ObjectMaxCardinality'] :value: 'ObjectMaxCardinality' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: max_cardinality :type: axiom.common.N3Node .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectMaxCardinalityQualified(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectMaxCardinality( n OPE CE )`` in the OWL 2 structural specification. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:maxQualifiedCardinality "n"^^xsd:nonNegativeInteger . _:x owl:onClass CE . .. py:attribute:: kind :type: Literal['ObjectMaxCardinalityQualified'] :value: 'ObjectMaxCardinalityQualified' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: max_qualified_cardinality :type: axiom.common.N3Node .. py:attribute:: on_class :type: axiom.common.N3Resource .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectExactCardinality(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectExactCardinality( n OPE )`` in the OWL 2 structural specification. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:cardinality "n"^^xsd:nonNegativeInteger . .. py:attribute:: kind :type: Literal['ObjectExactCardinality'] :value: 'ObjectExactCardinality' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: cardinality :type: axiom.common.N3Node .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements. .. py:class:: ObjectExactCardinalityQualified(/, **data: Any) Bases: :py:obj:`ObjectRestriction` Element ``ObjectExactCardinality( n OPE CE )`` in the OWL 2 structural specification. Triples:: _:x rdf:type owl:Restriction . _:x owl:onProperty OPE . _:x owl:qualifiedCardinality "n"^^xsd:nonNegativeInteger . _:x owl:onClass CE . .. py:attribute:: kind :type: Literal['ObjectExactCardinalityQualified'] :value: 'ObjectExactCardinalityQualified' .. py:attribute:: on_property :type: axiom.common.N3IRIRef .. py:attribute:: qualified_cardinality :type: axiom.common.N3Node .. py:attribute:: on_class :type: axiom.common.N3Resource .. py:property:: as_triples :type: collections.abc.Sequence[axiom.common.Triple] Triples representing this element as RDF; MUST NOT recurse into related elements.