/** * Adds an annotation assertion that specifies that the entity is deprecated. * * @param changes A list of changes that the enacting change will be added to. */ private void addDeprecatedAnnotationAssertion(@Nonnull List<OWLOntologyChange> changes) { OWLAnnotationAxiom ax = dataFactory.getOWLAnnotationAssertionAxiom( dataFactory.getOWLDeprecated(), info.getEntityToDeprecate().getIRI(), dataFactory.getOWLLiteral(true) ); logger.info("[Deprecate Entity] Added owl:deprecated annotation"); changes.add(new AddAxiom(getHomeOntology(), ax)); }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLDataFactory df = getDataFactory(); OWLAnnotationProperty deprecatedProperty = df.getOWLDeprecated(); OWLLiteral annotationValue = df.getOWLLiteral(true); IRI subject = getIRIFromOBOId(currentId); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(deprecatedProperty, subject, annotationValue); applyChange(new AddAxiom(getOntology(), ax)); } }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLDataFactory df = getDataFactory(); OWLAnnotationProperty deprecatedProperty = df.getOWLDeprecated(); OWLLiteral annotationValue = df.getOWLLiteral(true); IRI subject = getIRIFromOBOId(currentId); OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(deprecatedProperty, subject, annotationValue); applyChange(new AddAxiom(getOntology(), ax)); } }
public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLDataFactory df = getDataFactory(); OWLAnnotationProperty deprecatedProperty = df.getOWLDeprecated(); OWLLiteral annotationValue = df.getOWLLiteral(true); IRI subject = getIRIFromOBOId(currentId); OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(deprecatedProperty, subject, annotationValue); applyChange(new AddAxiom(getOntology(), ax)); } }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLDataFactory df = getDataFactory(); OWLAnnotationProperty deprecatedProperty = df.getOWLDeprecated(); OWLLiteral annotationValue = df.getOWLLiteral(true); IRI subject = getIRIFromOBOId(currentId); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(deprecatedProperty, subject, annotationValue); applyChange(new AddAxiom(getOntology(), ax)); } }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLDataFactory df = getDataFactory(); OWLAnnotationProperty deprecatedProperty = df.getOWLDeprecated(); OWLLiteral annotationValue = df.getOWLLiteral(true); IRI subject = getIRIFromOBOId(currentId); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(deprecatedProperty, subject, annotationValue); applyChange(new AddAxiom(getOntology(), ax)); } }
public boolean isRetirementAxiom(OWLAxiom axiom) { boolean ret = false; if (axiom instanceof OWLSubClassOfAxiom) { OWLSubClassOfAxiom subClassAxiom = (OWLSubClassOfAxiom) axiom; ret = !subClassAxiom.getSubClass().isAnonymous() && !subClassAxiom.getSuperClass().isAnonymous() && subClassAxiom.getSuperClass().asOWLClass().getIRI().toString().startsWith(retirementClassPrefix); } else if (axiom instanceof OWLAnnotationAssertionAxiom && retirementStatusProperty != null) { OWLAnnotationAssertionAxiom annotationAxiom = (OWLAnnotationAssertionAxiom) axiom; OWLAnnotationProperty property = annotationAxiom.getAnnotation().getProperty(); if (property.equals(retirementStatusProperty)) { ret = annotationAxiom.getAnnotation().getValue() instanceof OWLLiteral && ((OWLLiteral) annotationAxiom.getAnnotation().getValue()).getLiteral().equals(retirementStatusString); } else if (property.equals(factory.getOWLDeprecated())) { ret = annotationAxiom.getAnnotation().getValue() instanceof OWLLiteral && ((OWLLiteral) annotationAxiom.getAnnotation().getValue()).getLiteral().toLowerCase().equals("true"); } else if (retirementMetaProperties.contains(property)) { ret = true; } } return ret; } }
public boolean isRetirementAxiom(OWLAxiom axiom) { boolean ret = false; if (axiom instanceof OWLSubClassOfAxiom) { OWLSubClassOfAxiom subClassAxiom = (OWLSubClassOfAxiom) axiom; ret = !subClassAxiom.getSubClass().isAnonymous() && !subClassAxiom.getSuperClass().isAnonymous() && subClassAxiom.getSuperClass().asOWLClass().getIRI().toString().startsWith(retirementClassPrefix); } else if (axiom instanceof OWLAnnotationAssertionAxiom && retirementStatusProperty != null) { OWLAnnotationAssertionAxiom annotationAxiom = (OWLAnnotationAssertionAxiom) axiom; OWLAnnotationProperty property = annotationAxiom.getAnnotation().getProperty(); if (property.equals(retirementStatusProperty)) { ret = annotationAxiom.getAnnotation().getValue() instanceof OWLLiteral && ((OWLLiteral) annotationAxiom.getAnnotation().getValue()).getLiteral().equals(retirementStatusString); } else if (property.equals(factory.getOWLDeprecated())) { ret = annotationAxiom.getAnnotation().getValue() instanceof OWLLiteral && ((OWLLiteral) annotationAxiom.getAnnotation().getValue()).getLiteral().toLowerCase().equals("true"); } else if (retirementMetaProperties.contains(property)) { ret = true; } } return ret; } }
.getOWLDeprecated(), fac.getOWLLiteral(true))));
.getOWLDeprecated(), fac.getOWLLiteral(true))));
.getOWLDeprecated(), fac.getOWLLiteral(true))));
.getOWLDeprecated(), fac.getOWLLiteral(true))));
public boolean isDeprecated(OWLEntity e, DifferencePosition position) { OWLOntology ontology = position.getOntology(engine.getOwlDiffMap()); for (OWLOntology ont : ontology.getImportsClosure()) { for (OWLAnnotation annotation : e.getAnnotations(ont, engine.getOWLDataFactory().getOWLDeprecated())) { if (!(annotation.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) annotation.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; }
public boolean isDeprecated(OWLEntity e, DifferencePosition position) { OWLOntology ontology = position.getOntology(engine.getOwlDiffMap()); OWLAnnotationProperty deprecated = engine.getOWLDataFactory().getOWLDeprecated(); for (OWLOntology ont : ontology.getImportsClosure()) { for (OWLAnnotation annotation : EntitySearcher.getAnnotations(e, ont, deprecated)) { if (!(annotation.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) annotation.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; }
public OWLModelManagerImpl() { super(); manager = OntologyManagerFactory.createManager(); manager.addOntologyChangeListener(this); objectRenderer = new OWLObjectRendererImpl(this); owlEntityRenderingCache = new OWLEntityRenderingCacheImpl(); owlEntityRenderingCache.setOWLModelManager(this); owlObjectRenderingCache = new OWLObjectRenderingCache(this); owlExpressionCheckerFactory = new ManchesterOWLExpressionCheckerFactory(this); //needs to be initialized activeOntologiesStrategy = new ImportsClosureOntologySelectionStrategy(this); historyManager = new HistoryManagerImpl(this); owlReasonerManager = new OWLReasonerManagerImpl(this); owlReasonerManager.getReasonerPreferences().addListener(() -> fireEvent(EventType.ONTOLOGY_CLASSIFIED)); deprecationCache = new DeprecationCache(manager.getOWLDataFactory().getOWLDeprecated()); // force the renderer to be created // to prevent double cache rebuild once ontologies loaded getOWLEntityRenderer(); put(OntologySourcesManager.ID, new OntologySourcesManager(this)); }