本文整理汇总了Java中org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom类的典型用法代码示例。如果您正苦于以下问题:Java OWLSubAnnotationPropertyOfAxiom类的具体用法?Java OWLSubAnnotationPropertyOfAxiom怎么用?Java OWLSubAnnotationPropertyOfAxiom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLSubAnnotationPropertyOfAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLSubAnnotationPropertyOfAxiom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSubAnnotationProperties
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
void addSubAnnotationProperties(Set<OWLAxiom> axioms) {
// add ALL subannotprop axioms
// - this is quite geared towards obo ontologies, where
// we want to preserve obo headers.
// TODO: make this configurable
LOG.info("adding SubAnnotationProperties");
Set<OWLAxiom> sapAxioms = new HashSet<OWLAxiom>();
for (OWLOntology refOnt : this.getReferencedOntologies()) {
for (OWLSubAnnotationPropertyOfAxiom a : refOnt.getAxioms(AxiomType.SUB_ANNOTATION_PROPERTY_OF)) {
sapAxioms.add(a);
Set<OWLAnnotationAssertionAxiom> s = refOnt.getAnnotationAssertionAxioms(a.getSubProperty().getIRI());
if (s != null && !s.isEmpty()) {
for (OWLAnnotationAssertionAxiom owlAnnotationAssertionAxiom : s) {
sapAxioms.add(owlAnnotationAssertionAxiom);
}
}
}
}
axioms.addAll(sapAxioms);
}
示例2: getSubAnnotationPropertiesOf
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
/**
* Returns the direct child properties of <code>prop</code> in all ontologies.
* @param prop The <code>OWLAnnotationProperty</code> for which
* we want the direct sub-properties.
* @return A <code>Set</code> of <code>OWLAnnotationProperty</code>s
* that are the direct sub-properties of <code>prop</code>.
*
* @see #getSubPropertyClosureOf(OWLObjectPropertyExpression)
* @see #getSubPropertyReflexiveClosureOf(OWLObjectPropertyExpression)
*/
public Set<OWLAnnotationProperty> getSubAnnotationPropertiesOf(
OWLAnnotationProperty prop) {
Set<OWLAnnotationProperty> subProps = new HashSet<OWLAnnotationProperty>();
for (OWLOntology ont : this.getAllOntologies()) {
//we need to iterate each annotation property, to get
//its getSubAnnotationPropertyOfAxioms and see if prop is its parent
//(there is no method "getSuperAnnotationPropertyOfAxioms").
for (OWLAnnotationProperty subProp : ont.getAnnotationPropertiesInSignature()) {
for (OWLSubAnnotationPropertyOfAxiom ax:
ont.getSubAnnotationPropertyOfAxioms(subProp)) {
if (ax.getSuperProperty().equals(prop)) {
subProps.add(subProp);
}
}
}
}
return subProps;
}
示例3: equals
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
// superclass is responsible for null, identity, owlaxiom type and
// annotations
if (!(obj instanceof OWLSubAnnotationPropertyOfAxiom)) {
return false;
}
OWLSubAnnotationPropertyOfAxiom other = (OWLSubAnnotationPropertyOfAxiom) obj;
return subProperty.equals(other.getSubProperty())
&& superProperty.equals(other.getSuperProperty());
}
示例4: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
public OWLSubAnnotationPropertyOfAxiom visit(
ElkSubAnnotationPropertyOfAxiom axiom) {
return owlFactory_.getOWLSubAnnotationPropertyOfAxiom(
convert(axiom.getSubAnnotationProperty()),
convert(axiom.getSuperAnnotationProperty()));
}
示例5: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
public T visit(OWLSubAnnotationPropertyOfAxiom axiom) {
throw new IllegalArgumentException(
OWLSubAnnotationPropertyOfAxiom.class.getSimpleName()
+ " cannot be converted to "
+ getTargetClass().getSimpleName());
}
示例6: getSubProperties
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
public static Set<OWLAnnotationProperty> getSubProperties(OWLAnnotationProperty superProp, Set<OWLOntology> ontologies) {
Set<OWLAnnotationProperty> result = new HashSet<OWLAnnotationProperty>();
for (OWLOntology ont : ontologies) {
for (OWLSubAnnotationPropertyOfAxiom ax : ont.getAxioms(AxiomType.SUB_ANNOTATION_PROPERTY_OF)) {
if (ax.getSuperProperty().equals(superProp)) {
result.add(ax.getSubProperty());
}
}
}
return result;
}
示例7: getSuperProperties
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
public static Set<OWLAnnotationProperty> getSuperProperties(OWLAnnotationProperty subProp, Set<OWLOntology> ontologies) {
Set<OWLAnnotationProperty> result = new HashSet<OWLAnnotationProperty>();
for (OWLOntology ont : ontologies) {
for (OWLSubAnnotationPropertyOfAxiom ax : ont.getAxioms(AxiomType.SUB_ANNOTATION_PROPERTY_OF)) {
if (ax.getSubProperty().equals(subProp)) {
result.add(ax.getSuperProperty());
}
}
}
return result;
}
示例8:
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
/**
* Convenience method for asserting a subAnnotationProperty relation
* between a parent and child property in an ontology.
*
* @param ontology the current ontology
* @param child the child property
* @param parent the parent property
* @return the axiom
*/
protected static OWLSubAnnotationPropertyOfAxiom
assertSubAnnotationProperty(
OWLOntology ontology, OWLAnnotationProperty child,
OWLAnnotationProperty parent) {
OWLOntologyManager manager = ontology.getOWLOntologyManager();
OWLDataFactory dataFactory = manager.getOWLDataFactory();
OWLSubAnnotationPropertyOfAxiom axiom =
dataFactory.getOWLSubAnnotationPropertyOfAxiom(
child, parent);
manager.addAxiom(ontology, axiom);
return axiom;
}
示例9: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
public Void visit(OWLSubAnnotationPropertyOfAxiom axiom) {
long subProperty =
getOrCreateNode(getIri(axiom.getSubProperty()), OwlLabels.OWL_ANNOTATION_PROPERTY);
long superProperty =
getOrCreateNode(getIri(axiom.getSuperProperty()), OwlLabels.OWL_ANNOTATION_PROPERTY);
getOrCreateRelationship(subProperty, superProperty, OwlRelationships.RDFS_SUB_PROPERTY_OF);
return null;
}
示例10: getAxiomWithoutAnnotations
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
public OWLSubAnnotationPropertyOfAxiom getAxiomWithoutAnnotations() {
if (!isAnnotated()) {
return this;
}
return new OWLSubAnnotationPropertyOfAxiomImpl(getSubProperty(),
getSuperProperty(), NO_ANNOTATIONS);
}
示例11: compareObjectOfSameType
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
protected int compareObjectOfSameType(OWLObject object) {
OWLSubAnnotationPropertyOfAxiom other = (OWLSubAnnotationPropertyOfAxiom) object;
int diff = subProperty.compareTo(other.getSubProperty());
if (diff != 0) {
return diff;
}
return superProperty.compareTo(other.getSuperProperty());
}
示例12: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
public void visit(OWLSubAnnotationPropertyOfAxiom axiom) {
notSupported(axiom);
}
示例13: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
public void visit(OWLSubAnnotationPropertyOfAxiom axiom) {
}
示例14: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
public Boolean visit(OWLSubAnnotationPropertyOfAxiom axiom) {
return Boolean.TRUE;
}
示例15: visit
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom; //导入依赖的package包/类
@Override
public ElkAnnotationAxiom visit(OWLSubAnnotationPropertyOfAxiom owlSubAnnotationPropertyOfAxiom) {
return new ElkSubAnnotationPropertyOfAxiomWrap<OWLSubAnnotationPropertyOfAxiom>(owlSubAnnotationPropertyOfAxiom);
}