class SubObjectPropertyOf(Annotatable): subObjectPropertyExpression: SubObjectPropertyExpression.types() superObjectPropertyExpression: ObjectPropertyExpression.types() annotations: List[Annotation] = empty_list() def to_functional(self, w: FunctionalWriter) -> FunctionalWriter: return self.annots( w, lambda: (w + self.subObjectPropertyExpression + self. superObjectPropertyExpression)) def to_rdf(self, g: Graph) -> None: if issubclass(type(self.subObjectPropertyExpression), ObjectPropertyChain): self.add_triple(g, self.superObjectPropertyExpression.to_rdf(g), OWL.propertyChainAxiom, self.subObjectPropertyExpression.to_rdf(g)) else: self.add_triple(g, self.subObjectPropertyExpression.to_rdf(g), RDF.subPropertyOf, self.superObjectPropertyExpression.to_rdf(g))
def objectPropertyRange(self, ope: ObjectPropertyExpression.types(), ce: ClassExpression) -> "Ontology": self.axioms.append(ObjectPropertyRange(ope, ce)) return self
def inverseFunctionalObjectProperty( self, ope: ObjectPropertyExpression.types()) -> "Ontology": opep = ObjectPropertyExpression(ope) self.axioms.append(InverseFunctionalObjectProperty(opep)) return self
def inverseObjectProperties(self, exp1: ObjectPropertyExpression.types(), exp2: ObjectPropertyExpression.types()) \ -> "Ontology": exp1p = ObjectPropertyExpression(exp1) exp2p = ObjectPropertyExpression(exp2) self.axioms.append(InverseObjectProperties(exp1p, exp2p)) return self
def subObjectPropertyOf(self, sub: SubObjectPropertyExpression.types(), sup: ObjectPropertyExpression.types()) \ -> "Ontology": subp = SubObjectPropertyExpression(sub) supp = ObjectPropertyExpression(sup) self.axioms.append(SubObjectPropertyOf(subp, supp)) return self
class SubObjectPropertyExpression(FunOwlChoice): v: Union[ObjectPropertyExpression.types(), ObjectPropertyChain]