private Set<OWLClass> getEquivalentClasses (OWLReasoner reasoner, OWLClass c) { Node<OWLClass> equivalentClasses = reasoner.getEquivalentClasses(c); Set<OWLClass> results; if (!c.isAnonymous()) { results = equivalentClasses.getEntities(); } else { results = equivalentClasses.getEntitiesMinus(c.asOWLClass()); } return results; }
public void copySubclass(OWLClass cls, OntologyLoader ontologyLoader) { List<AddAxiom> changes = new ArrayList<AddAxiom>(); for (OWLSubClassOfAxiom axiom : ontologyLoader.getSubClassAxiomsForSuperClass(cls)) { for (OWLClass subClass : axiom.getClassesInSignature()) { if (subClass != cls && !subClass.isAnonymous()) { copyClass(subClass, cls, ontologyLoader); copySubclass(subClass, ontologyLoader); } } changes.add(new AddAxiom(ontology, axiom)); } manager.applyChanges(changes); }
@Override public void visit(OWLClass ce) { AbstractClass clazz; if (ce.isOWLThing() || ce.isOWLNothing()) { // General class do not create here return; } else if (!ce.isAnonymous()) { clazz = new VowlClass(ce.getIRI()); } else { // TODO Anonymous behaviour undefined logger.info("Anonymous OWLClass " + ce); return; } vowlData.addClass(clazz); }
indent + " entity type = " + owlClass.getEntityType()); Logger.getLogger(OwlUtility.class).debug( indent + " anonymous = " + owlClass.isAnonymous()); Logger.getLogger(OwlUtility.class).debug( indent + " class expression type = "
@Override public void visit(OWLDisjointUnionAxiom axiom) { if (axiom.getOWLClass().isAnonymous()) { logger.info("Disjoint Union base is anonym."); return; } AbstractClass baseClass = vowlData.getClassForIri(axiom.getOWLClass().getIRI()); baseClass.addAttribute(VowlAttribute.DISJOINTUNION); for (OWLClassExpression disjointClassEx : axiom.classExpressions().collect(Collectors.toSet())){ OWLClass cls=disjointClassEx.asOWLClass(); baseClass.addDisjointUnion(cls.getIRI()); } //axiom.classesInSignature() << creates memory leak // for (OWLClass disjointClass : axiom.getOWLDisjointClassesAxiom().classesInSignature().collect(Collectors.toSet())) { // baseClass.addDisjointUnion(disjointClass.getIRI()); // } baseClass=null; }
if (owlClass.isAnonymous()) { concept.setAnonymous(true); String uuid = TerminologyUtility.getUuid(owlClass.toString()).toString(); concept.setAnonymous(owlClass.isAnonymous()); concept.setFullyDefined(false); concept.setTerminologyId(getTerminologyId(owlClass.getIRI()));