有没有人可以帮助我使用“OWL API”生成这个 ObjectPropertyRange?
<ObjectPropertyRange>
<Annotation>
<AnnotationProperty abbreviatedIRI="owl:backwardCompatibleWith"/>
<IRI>#ProgramLanguage</IRI>
</Annotation>
<ObjectProperty IRI="#specifiedBy"/>
<ObjectMaxCardinality cardinality="1">
<ObjectProperty IRI="#specifiedBy"/>
<Class IRI="#Grammars"/>
</ObjectMaxCardinality>
</ObjectPropertyRange>
这就是我最近3天的样子......
<ObjectPropertyRange>
<ObjectProperty IRI="#has"/>
<ObjectMaxCardinality cardinality="1">
<ObjectProperty IRI="#has"/>
<Class IRI="#Quantity"/>
</ObjectMaxCardinality>
</ObjectPropertyRange>
从这段代码...
OWLClassExpression expression=df.getOWLObjectMaxCardinality(relations.max, objectProperty,range.getNNF());
OWLSubClassOfAxiom subClassOfAxiom=df.getOWLSubClassOfAxiom(df.getOWLClass(IRI.create(relations.class2)), expression);
OWLObjectPropertyRangeAxiom owlObjectPropertyRangeAxiom=df.getOWLObjectPropertyRangeAxiom(objectProperty,subClassOfAxiom.getSuperClass());
manager.addAxiom(new_ontology,owlObjectPropertyRangeAxiom);