@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
/** * Determines if this annotation assertion deprecates the IRI that is the subject of the * annotation. * * @return {@code true} if this annotation assertion deprecates the subject IRI of the * assertion, otherwise {@code false}. * @see org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation() */ @Override public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
/** * Determines if this annotation assertion deprecates the IRI that is the subject of the annotation. * * @return <code>true</code> if this annotation assertion deprecates the subject IRI of the assertion, otherwise * <code>false</code>. * * @see {@link org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation()} */ public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
/** * Determines if this annotation is an annotation used to deprecate an IRI. This is the case if the annotation * property has an IRI of <code>owl:deprecated</code> and the value of the annotation is <code>"true"^^xsd:boolean</code> * @return <code>true</code> if this annotation is an annotation that can be used to deprecate an IRI, otherwise * <code>false</code>. */ @Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); }
/** * Determines if this annotation assertion deprecates the IRI that is the subject of the * annotation. * * @return {@code true} if this annotation assertion deprecates the subject IRI of the * assertion, otherwise {@code false}. * @see org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation() */ @Override public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
/** * Determines if this annotation assertion deprecates the IRI that is the subject of the * annotation. * * @return {@code true} if this annotation assertion deprecates the subject IRI of the * assertion, otherwise {@code false}. * @see org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation() */ @Override public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
/** Determines if this annotation assertion deprecates the IRI that is the * subject of the annotation. * * @return <code>true</code> if this annotation assertion deprecates the * subject IRI of the assertion, otherwise <code>false</code>. * @see org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation() */ @Override public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
/** * Determines if this annotation assertion deprecates the IRI that is the subject of the * annotation. * * @return {@code true} if this annotation assertion deprecates the subject IRI of the * assertion, otherwise {@code false}. * @see org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation() */ @Override public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
/** * Determines if this annotation assertion deprecates the IRI that is the * subject of the annotation. * * @return {@code true} if this annotation assertion deprecates the subject * IRI of the assertion, otherwise {@code false}. * @see org.semanticweb.owlapi.model.OWLAnnotation#isDeprecatedIRIAnnotation() */ @Override public boolean isDeprecatedIRIAssertion() { return property.isDeprecated() && getAnnotation().isDeprecatedIRIAnnotation(); }
/** * Determines if this annotation is an annotation used to deprecate an IRI. * This is the case if the annotation property has an IRI of * {@code owl:deprecated} and the value of the annotation is * {@code "true"^^xsd:boolean} * * @return {@code true} if this annotation is an annotation that can be used * to deprecate an IRI, otherwise {@code false}. */ @Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); }
/** * Determines if this annotation is an annotation used to deprecate an IRI. This is the case if the annotation * property has an IRI of <code>owl:deprecated</code> and the value of the annotation is <code>"true"^^xsd:boolean</code> * * @return <code>true</code> if this annotation is an annotation that can be used to deprecate an IRI, otherwise * <code>false</code>. */ public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLTypedLiteral && ((OWLTypedLiteral) value).getDatatype().isBoolean() &&((OWLTypedLiteral) value).getLiteral().equalsIgnoreCase("true"); }
@Override protected Optional<ChangeSummary> getDescriptionForRemoveAxiomChange(OWLAnnotationAssertionAxiom axiom) { if(!axiom.getSubject().isIRI()) { return Optional.empty(); } var subject = (IRI) axiom.getSubject(); if(axiom.getProperty().isDeprecated()) { return Optional.of(ChangeSummary.get(UndeprecatedEntities.get(ImmutableSet.of(subject)))); } return Optional.of(ChangeSummary.get(RemovedAnnotation.get(subject, axiom.getProperty(), axiom.getValue()))); } }
@Override protected Optional<ChangeSummary> getDescriptionForAddAxiomChange(OWLAnnotationAssertionAxiom axiom, List<OWLOntologyChangeData> changes) { if(!axiom.getSubject().isIRI()) { return Optional.empty(); } if(axiom.getProperty().isDeprecated()) { return Optional.of(ChangeSummary.get(DeprecatedEntities.get(ImmutableSet.of((IRI) axiom.getSubject())))); } return Optional.of(ChangeSummary.get(AddedAnnotation.get((IRI) axiom.getSubject(), axiom.getProperty(), axiom.getValue()))); }
public static boolean isDeprecated(@Nonnull IRI iri, @Nonnull Collection<OWLOntology> ontologies) { for (OWLOntology ontology : ontologies) { for (OWLAnnotationAssertionAxiom assertion : ontology.getAnnotationAssertionAxioms(iri)) { if (!assertion.getProperty().isDeprecated()) { continue; } if (!(assertion.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) assertion.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; } }
@Override public void translateOntologyChanges(Revision revision, ChangeApplicationResult<?> changes, List<ProjectEvent<?>> projectEventList) { for(OWLOntologyChange change : changes.getChangeList()) { if (change.isAxiomChange()) { if (change.getAxiom() instanceof OWLAnnotationAssertionAxiom) { OWLAnnotationAssertionAxiom axiom = (OWLAnnotationAssertionAxiom) change.getAxiom(); if (axiom.getProperty().isDeprecated()) { if (axiom.getSubject() instanceof IRI) { IRI subject = (IRI) axiom.getSubject(); for (OWLEntity entity : hasGetEntitiesWithIRI.getEntitiesWithIRI(subject)) { boolean deprecated = deprecatedEntityChecker.isDeprecated(entity); projectEventList.add(new EntityDeprecatedChangedEvent(projectId, entity, deprecated)); } } } } } } } }
public static boolean isDeprecated(OWLEntity o, Collection<OWLOntology> ontologies) { for (OWLOntology ontology : ontologies) { for (OWLAnnotationAssertionAxiom assertion : ontology.getAnnotationAssertionAxioms(o.getIRI())) { if (!assertion.getProperty().isDeprecated()) { continue; } if (!(assertion.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) assertion.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; } }
public static boolean isDeprecated(OWLModelManager p4Manager, OWLObject o) { if (!(o instanceof OWLEntity)) { return false; } for (OWLOntology ontology : p4Manager.getActiveOntologies()) { for (OWLAnnotationAssertionAxiom assertion : ontology.getAnnotationAssertionAxioms(((OWLEntity) o).getIRI())) { if (!assertion.getProperty().isDeprecated()) { continue; } if (!(assertion.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) assertion.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; } }