axiom.datatype¶
OWL 2 Data Range and data-property class-expression structural elements.
This module models two related families of OWL 2 structural elements plus the
owned StructuralFragment scaffolding their RDF mappings require.
Data Range expressions (subclasses of DataRange):
DeclarationDatatype—Declaration( Datatype( DT ) ); the fallback when no richer data range can be reconstructed from the graph.DataIntersectionOf—DataIntersectionOf( DR1 ... DRn ),n >= 2; owns anSeqfragment.DataUnionOf—DataUnionOf( DR1 ... DRn ),n >= 2; owns anSeqfragment.DataComplementOf—DataComplementOf( DR ); the operand is a cross-axiom node reference.DataOneOf—DataOneOf( lt1 ... ltn ),n >= 1; owns anSeqfragment of literals.DatatypeRestriction—DatatypeRestriction( DT F1 lt1 ... Fn ltn ); owns aFacetListfragment carrying both the cons-cell chain and the per-facet(_:yi Fi lti)triples.
Data property class expressions (subclasses of DataRestriction):
DataSomeValuesFrom— unary formDataSomeValuesFrom( DPE DR ).DataSomeValuesFromNary— n-ary formDataSomeValuesFrom( DPE1 ... DPEn DR ),n >= 2; owns anSeqfragment of property expressions.DataAllValuesFrom— unary formDataAllValuesFrom( DPE DR ).DataAllValuesFromNary— n-ary formDataAllValuesFrom( DPE1 ... DPEn DR ),n >= 2; owns anSeqfragment of property expressions.DataHasValue—DataHasValue( DPE lt ).Cardinality forms —
DataMinCardinality,DataMinCardinalityQualified,DataMaxCardinality,DataMaxCardinalityQualified,DataExactCardinality,DataExactCardinalityQualified.
Owned scaffolding fragments defined here:
FacetEntryandFacetList— therdf:Listcarrier forDatatypeRestriction’s facet operand list, including the per-facet anchor triple.
DataRange and DataRestriction are abstract umbrellas: both
block direct instantiation, both provide the shared declaration triple
(rdfs:Datatype for DataRange subclasses, owl:Restriction for
DataRestriction subclasses) 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¶
Abstract umbrella for OWL 2 Data Range expressions. |
|
Element Declaration( Datatype( DT ) ) of the structural specification. |
|
Element |
|
Element |
|
Element |
|
Element |
|
Abstract base for OWL 2 class expressions that restrict a data property. |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
Element |
|
One facet row in a |
|
Owned |
|
Element |
Module Contents¶
- class axiom.datatype.DataRange(/, **data: Any)¶
Bases:
axiom.structural_element.DeclarationElement,abc.ABCAbstract umbrella for OWL 2 Data Range expressions.
Not directly instantiable. Concrete subclasses include
DeclarationDatatype(the fallback when no richer data range can be constructed from the graph) and the richer expressionsDataIntersectionOf,DataUnionOf,DataComplementOf,DataOneOf, andDatatypeRestriction. All concrete data ranges declarerdf:type rdfs:Datatypeforname.- property rdf_type: rdflib.IdentifiedNode¶
rdf:typeobject for the declaration triple.
- class axiom.datatype.DeclarationDatatype(/, **data: Any)¶
Bases:
DataRangeElement Declaration( Datatype( DT ) ) of the structural specification.
Note that all of our DataRange classes share the same properties as a DeclarationDatatype instance, but we keep this as a separate axiom so that OWL axioms can partition a graph. _This_ axiom is only constructed if we are lacking the necessary triples to construct a different DataRange axiom.
- kind: Literal['DeclarationDatatype'] = 'DeclarationDatatype'¶
- class axiom.datatype.DataIntersectionOf(/, **data: Any)¶
Bases:
DataRangeElement
DataIntersectionOf( DR1 ... DRn )of the OWL 2 structural specification.The main RDF node is an anonymous blank node (written
_:xbelow). OWL 2 structural syntax requires n >= 2 data range operands.Triples:
_:x rdf:type rdfs:Datatype . _:x owl:intersectionOf T(SEQ DR1 ... DRn) .
- kind: Literal['DataIntersectionOf'] = 'DataIntersectionOf'¶
- intersection_of: axiom.structural_element.Seq¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Single
name rdf:type rdf_typedeclaration triple.
- class axiom.datatype.DataUnionOf(/, **data: Any)¶
Bases:
DataRangeElement
DataUnionOf( DR1 ... DRn )of the OWL 2 structural specification.The main RDF node is an anonymous blank node (written
_:xbelow). OWL 2 structural syntax requires n >= 2 data range operands.Triples:
_:x rdf:type rdfs:Datatype . _:x owl:unionOf T(SEQ DR1 ... DRn) .
- kind: Literal['DataUnionOf'] = 'DataUnionOf'¶
- union_of: axiom.structural_element.Seq¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Single
name rdf:type rdf_typedeclaration triple.
- class axiom.datatype.DataComplementOf(/, **data: Any)¶
Bases:
DataRangeElement
DataComplementOf( DR )of the OWL 2 structural specification.The main RDF node is an anonymous blank node (written
_:xbelow).complement_ofis the RDF subject of the complemented datatype description (IRI or blank node);as_triplesemits only this axiom’s triples (shallow projection per DR-031). Declaration and other triples forDRbelong in a separate axiom instance or graph partition, not inlined here.Triples:
_:x rdf:type rdfs:Datatype . _:x owl:complementOf DR .
- kind: Literal['DataComplementOf'] = 'DataComplementOf'¶
- complement_of: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Single
name rdf:type rdf_typedeclaration triple.
- class axiom.datatype.DataOneOf(/, **data: Any)¶
Bases:
DataRangeElement
DataOneOf( lt1 ... ltn )of the OWL 2 structural specification.The main RDF node is an anonymous blank node (written
_:xbelow).one_ofis an ownedSeqfragment carrying the enumerated RDF literals asrdf:firstvalues; the fragment shares this element’scontext. OWL 2 structural syntax requires n >= 1 literal operands.Triples:
_:x rdf:type rdfs:Datatype . _:x owl:oneOf T(SEQ lt1 ... ltn) .
- kind: Literal['DataOneOf'] = 'DataOneOf'¶
- one_of: axiom.structural_element.Seq¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Single
name rdf:type rdf_typedeclaration triple.
- class axiom.datatype.DataRestriction(/, **data: Any)¶
Bases:
axiom.structural_element.StructuralElement,abc.ABCAbstract base for OWL 2 class expressions that restrict a data property.
Not directly instantiable. Each concrete subclass declares a node of
rdf:type owl:Restrictionand pairsowl:onProperty(orowl:onPropertiesfor n-ary forms) with a range or value predicate per the OWL 2 RDF mapping.nameis the RDF subject of the restriction node (typically a blank node).- name_value: axiom.common.N3Resource = None¶
- property name: rdflib.IdentifiedNode¶
Restriction node identifier (alias of
name_value).
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataSomeValuesFrom(/, **data: Any)¶
Bases:
DataRestrictionElement
DataSomeValuesFrom(data existential restriction) in the OWL 2 structural specification.The RDF subject is typically an anonymous blank node (written
_:xbelow).Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:someValuesFrom DR .
- kind: Literal['DataSomeValuesFrom'] = 'DataSomeValuesFrom'¶
- on_property: axiom.common.N3IRIRef¶
- some_values_from: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataSomeValuesFromNary(/, **data: Any)¶
Bases:
DataRestrictionElement
DataSomeValuesFrom( DPE1 ... DPEn DR ), n >= 2, in the OWL 2 structural specification.The RDF subject is typically an anonymous blank node (written
_:xbelow).on_propertiesis an ownedSeqfragment carrying the data property expressions; the fragment shares this element’scontext.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperties T(SEQ DPE1 ... DPEn) . _:x owl:someValuesFrom DR .
- kind: Literal['DataSomeValuesFromNary'] = 'DataSomeValuesFromNary'¶
- on_properties: axiom.structural_element.Seq¶
- some_values_from: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataAllValuesFrom(/, **data: Any)¶
Bases:
DataRestrictionElement
DataAllValuesFrom( DPE DR )in the OWL 2 structural specification.The RDF subject is typically an anonymous blank node (written
_:xbelow).Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:allValuesFrom DR .
- kind: Literal['DataAllValuesFrom'] = 'DataAllValuesFrom'¶
- on_property: axiom.common.N3IRIRef¶
- all_values_from: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataAllValuesFromNary(/, **data: Any)¶
Bases:
DataRestrictionElement
DataAllValuesFrom( DPE1 ... DPEn DR ), n >= 2, in the OWL 2 structural specification.The RDF subject is typically an anonymous blank node (written
_:xbelow).on_propertiesis an ownedSeqfragment carrying the data property expressions; the fragment shares this element’scontext.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperties T(SEQ DPE1 ... DPEn) . _:x owl:allValuesFrom DR .
- kind: Literal['DataAllValuesFromNary'] = 'DataAllValuesFromNary'¶
- on_properties: axiom.structural_element.Seq¶
- all_values_from: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataHasValue(/, **data: Any)¶
Bases:
DataRestrictionElement
DataHasValue( DPE lt )in the OWL 2 structural specification.The RDF subject is typically an anonymous blank node (written
_:xbelow).has_valueis a literal.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:hasValue lt .
- kind: Literal['DataHasValue'] = 'DataHasValue'¶
- on_property: axiom.common.N3IRIRef¶
- has_value: axiom.common.N3Node¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataMinCardinality(/, **data: Any)¶
Bases:
DataRestrictionElement
DataMinCardinality( n DPE )in the OWL 2 structural specification.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:minCardinality "n"^^xsd:nonNegativeInteger .
- kind: Literal['DataMinCardinality'] = 'DataMinCardinality'¶
- on_property: axiom.common.N3IRIRef¶
- min_cardinality: axiom.common.N3Node¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataMinCardinalityQualified(/, **data: Any)¶
Bases:
DataRestrictionElement
DataMinCardinality( n DPE DR )in the OWL 2 structural specification.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:minQualifiedCardinality "n"^^xsd:nonNegativeInteger . _:x owl:onDataRange DR .
- kind: Literal['DataMinCardinalityQualified'] = 'DataMinCardinalityQualified'¶
- on_property: axiom.common.N3IRIRef¶
- min_qualified_cardinality: axiom.common.N3Node¶
- on_data_range: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataMaxCardinality(/, **data: Any)¶
Bases:
DataRestrictionElement
DataMaxCardinality( n DPE )in the OWL 2 structural specification.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:maxCardinality "n"^^xsd:nonNegativeInteger .
- kind: Literal['DataMaxCardinality'] = 'DataMaxCardinality'¶
- on_property: axiom.common.N3IRIRef¶
- max_cardinality: axiom.common.N3Node¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataMaxCardinalityQualified(/, **data: Any)¶
Bases:
DataRestrictionElement
DataMaxCardinality( n DPE DR )in the OWL 2 structural specification.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:maxQualifiedCardinality "n"^^xsd:nonNegativeInteger . _:x owl:onDataRange DR .
- kind: Literal['DataMaxCardinalityQualified'] = 'DataMaxCardinalityQualified'¶
- on_property: axiom.common.N3IRIRef¶
- max_qualified_cardinality: axiom.common.N3Node¶
- on_data_range: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataExactCardinality(/, **data: Any)¶
Bases:
DataRestrictionElement
DataExactCardinality( n DPE )in the OWL 2 structural specification.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:cardinality "n"^^xsd:nonNegativeInteger .
- kind: Literal['DataExactCardinality'] = 'DataExactCardinality'¶
- on_property: axiom.common.N3IRIRef¶
- cardinality: axiom.common.N3Node¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.DataExactCardinalityQualified(/, **data: Any)¶
Bases:
DataRestrictionElement
DataExactCardinality( n DPE DR )in the OWL 2 structural specification.Triples:
_:x rdf:type owl:Restriction . _:x owl:onProperty DPE . _:x owl:qualifiedCardinality "n"^^xsd:nonNegativeInteger . _:x owl:onDataRange DR .
- kind: Literal['DataExactCardinalityQualified'] = 'DataExactCardinalityQualified'¶
- on_property: axiom.common.N3IRIRef¶
- qualified_cardinality: axiom.common.N3Node¶
- on_data_range: axiom.common.N3Resource¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Triples representing this element as RDF; MUST NOT recurse into related elements.
- class axiom.datatype.FacetEntry(/, **data: Any)¶
Bases:
pydantic.BaseModelOne facet row in a
DatatypeRestrictionoperand list.cellis therdf:Listcons-cell node (the_:liin the OWL 2 mapping).anchoris the facet anchor node referenced by the cons-cell’srdf:first(the_:yi).facetis the facet predicate (for examplexsd:minInclusive) andvalueis the facet literal.The terminal sentinel row uses
cell == rdf:nilwithanchor,facet, andvalueallNoneand emits no facet or list-membership triple fromFacetList.as_triples. Non-sentinel rows MUST supply all three ofanchor,facet, andvalue.- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- cell: axiom.common.N3Resource = None¶
- check_rdf_nil_or_facet_value() Self¶
Require
rdf:nilrows to be empty and facet rows to supply anchor, facet, and value.
- class axiom.datatype.FacetList(/, **data: Any)¶
Bases:
axiom.structural_element.StructuralFragmentOwned
rdf:Listscaffolding for the operand list ofDatatypeRestriction.Encodes both the cons-cell chain of facet anchor nodes and each per-facet
(_:yi Fi lti)triple in a singleas_triplesprojection (all rows belong to the owningDatatypeRestriction’s partition per DR-031).Triples (omit
rdf:firstand facet rows wherecell == rdf:nil):Ei.cell rdf:first Ei.anchor . # when row is non-sentinel Ei.anchor Ei.facet Ei.value . # when row is non-sentinel Ei.cell rdf:rest entries[i+1].cell . # i < len(entries)-1
- kind: Literal['facet_list'] = 'facet_list'¶
- entries: collections.abc.Sequence[FacetEntry] = None¶
- property name: rdflib.IdentifiedNode¶
Facet list head node taken from the first
FacetEntrycell.
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Emit list scaffolding and per-facet constraint triples for
DatatypeRestriction.
- check_list_integrity() Self¶
Validate non-empty entries, a terminal
rdf:nil, and unique list cells.
- class axiom.datatype.DatatypeRestriction(/, **data: Any)¶
Bases:
DataRangeElement
DatatypeRestriction( DT F1 lt1 ... Fn ltn )in the OWL 2 structural specification.The main RDF node is an anonymous blank node (written
_:xbelow).on_datatypeis the constrained datatype IRI;with_restrictionsis an ownedFacetListfragment that carries the facet anchor nodes and their per-facet(_:yi Fi lti)triples.Triples:
_:x rdf:type rdfs:Datatype . _:x owl:onDatatype DT . _:x owl:withRestrictions T(SEQ _:y1 ... _:yn) . _:y1 F1 lt1 . ... _:yn Fn ltn .
- kind: Literal['DatatypeRestriction'] = 'DatatypeRestriction'¶
- on_datatype: axiom.common.N3IRIRef¶
- property as_triples: collections.abc.Sequence[axiom.common.Triple]¶
Single
name rdf:type rdf_typedeclaration triple.