예제 #1
0
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))
예제 #2
0
 def objectPropertyRange(self, ope: ObjectPropertyExpression.types(),
                         ce: ClassExpression) -> "Ontology":
     self.axioms.append(ObjectPropertyRange(ope, ce))
     return self
예제 #3
0
 def inverseFunctionalObjectProperty(
     self, ope: ObjectPropertyExpression.types()) -> "Ontology":
     opep = ObjectPropertyExpression(ope)
     self.axioms.append(InverseFunctionalObjectProperty(opep))
     return self
예제 #4
0
 def inverseObjectProperties(self, exp1: ObjectPropertyExpression.types(), exp2: ObjectPropertyExpression.types()) \
         -> "Ontology":
     exp1p = ObjectPropertyExpression(exp1)
     exp2p = ObjectPropertyExpression(exp2)
     self.axioms.append(InverseObjectProperties(exp1p, exp2p))
     return self
예제 #5
0
 def subObjectPropertyOf(self, sub: SubObjectPropertyExpression.types(), sup: ObjectPropertyExpression.types()) \
         -> "Ontology":
     subp = SubObjectPropertyExpression(sub)
     supp = ObjectPropertyExpression(sup)
     self.axioms.append(SubObjectPropertyOf(subp, supp))
     return self
예제 #6
0
class SubObjectPropertyExpression(FunOwlChoice):
    v: Union[ObjectPropertyExpression.types(), ObjectPropertyChain]