private boolean containsDeclarationAxiomChange(List<OWLOntologyChangeData> dataList) { return dataList .stream() .anyMatch(data -> data.getItem() instanceof OWLDeclarationAxiom); }
protected String getTemplate() { return getName() + "(%s)"; }
protected String toString(Object o) { return String.format(getTemplate(), o); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLOntologyChangeRecord)) { return false; } OWLOntologyChangeRecord other = (OWLOntologyChangeRecord) obj; return ontologyID.equals(other.ontologyID) && data.equals(other.data); }
@Override public int hashCode() { return getClass().hashCode() + ontologyID.hashCode() + data.hashCode(); }
/** * Creates an {@link OWLOntologyChange} from the {@link OWLOntologyID} and * {@link OWLOntologyChangeData} associated with this * {@code OWLOntologyChangeRecord} object. The {@link OWLOntology} that is * the target of the resulting {@link OWLOntologyChange} is derived from an * {@link OWLOntologyManager}. The manager <i>must</i> contain an ontology * that has an {@link OWLOntologyID} which is equal to the * {@link OWLOntologyID} associated with this * {@code OWLOntologyChangeRecord} object. * * @param manager The manager which will be used to obtain a reference to an {@link OWLOntology} * object having the same {@link OWLOntologyID} as the {@link OWLOntologyID} associated with * this {@code OWLOntologyChangeRecord}. * @return The {@link OWLOntologyChange} object that is derived from this record's {@link * OWLOntologyID} and {@link OWLOntologyChangeData}. The specific concrete subclass of the * returned {@link OWLOntologyChange} will depend upon the specific concrete subclass of the * {@link OWLOntologyChangeData} associated with this {@code OWLOntologyChangeRecord}. * @throws UnknownOWLOntologyException if the specified manager does not contain an ontology * which has an {@link OWLOntologyID} equal to the {@link OWLOntologyID} associated with this * {@code OWLOntologyChangeRecord}. */ public OWLOntologyChange createOntologyChange(OWLOntologyManager manager) { OWLOntology ontology = manager.getOntology(ontologyID); if (ontology == null) { throw new UnknownOWLOntologyException(ontologyID); } return data.createOntologyChange(ontology); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLOntologyChangeRecord)) { return false; } OWLOntologyChangeRecord other = (OWLOntologyChangeRecord) obj; return ontologyID.equals(other.ontologyID) && data.equals(other.data); }
@Override public int hashCode() { return getClass().hashCode() + ontologyID.hashCode() + data.hashCode(); }
/** * Creates an {@link OWLOntologyChange} from the {@link OWLOntologyID} and * {@link OWLOntologyChangeData} associated with this * {@code OWLOntologyChangeRecord} object. The {@link OWLOntology} that is * the target of the resulting {@link OWLOntologyChange} is derived from an * {@link OWLOntologyManager}. The manager <i>must</i> contain an ontology * that has an {@link OWLOntologyID} which is equal to the * {@link OWLOntologyID} associated with this * {@code OWLOntologyChangeRecord} object. * * @param manager The manager which will be used to obtain a reference to an {@link OWLOntology} * object having the same {@link OWLOntologyID} as the {@link OWLOntologyID} associated with * this {@code OWLOntologyChangeRecord}. * @return The {@link OWLOntologyChange} object that is derived from this record's {@link * OWLOntologyID} and {@link OWLOntologyChangeData}. The specific concrete subclass of the * returned {@link OWLOntologyChange} will depend upon the specific concrete subclass of the * {@link OWLOntologyChangeData} associated with this {@code OWLOntologyChangeRecord}. * @throws UnknownOWLOntologyException if the specified manager does not contain an ontology * which has an {@link OWLOntologyID} equal to the {@link OWLOntologyID} associated with this * {@code OWLOntologyChangeRecord}. */ public OWLOntologyChange createOntologyChange(OWLOntologyManager manager) { OWLOntology ontology = manager.getOntology(ontologyID); if (ontology == null) { throw new UnknownOWLOntologyException(ontologyID); } return data.createOntologyChange(ontology); }
private static Stream<OWLAxiom> addedAxioms(List<OWLOntologyChangeData> change) { return change.stream() .filter(data -> data instanceof AddAxiomData) .map(data -> (OWLAxiom) data.getItem()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLOntologyChangeRecord)) { return false; } OWLOntologyChangeRecord other = (OWLOntologyChangeRecord) obj; return ontologyID.equals(other.ontologyID) && data.equals(other.data); }
@Override public int hashCode() { return getClass().hashCode() + ontologyID.hashCode() + data.hashCode(); }
protected String getTemplate() { return getName() + "(%s)"; }
protected String toString(Object o) { return String.format(getTemplate(), o); }
/** * Creates an {@link OWLOntologyChange} from the {@link OWLOntologyID} and * {@link OWLOntologyChangeData} associated with this * {@code OWLOntologyChangeRecord} object. The {@link OWLOntology} that is * the target of the resulting {@link OWLOntologyChange} is derived from an * {@link OWLOntologyManager}. The manager <i>must</i> contain an ontology * that has an {@link OWLOntologyID} which is equal to the * {@link OWLOntologyID} associated with this * {@code OWLOntologyChangeRecord} object. * * @param manager The manager which will be used to obtain a reference to an {@link OWLOntology} * object having the same {@link OWLOntologyID} as the {@link OWLOntologyID} associated with * this {@code OWLOntologyChangeRecord}. * @return The {@link OWLOntologyChange} object that is derived from this record's {@link * OWLOntologyID} and {@link OWLOntologyChangeData}. The specific concrete subclass of the * returned {@link OWLOntologyChange} will depend upon the specific concrete subclass of the * {@link OWLOntologyChangeData} associated with this {@code OWLOntologyChangeRecord}. * @throws UnknownOWLOntologyException if the specified manager does not contain an ontology * which has an {@link OWLOntologyID} equal to the {@link OWLOntologyID} associated with this * {@code OWLOntologyChangeRecord}. */ public OWLOntologyChange createOntologyChange(OWLOntologyManager manager) { OWLOntology ontology = manager.getOntology(ontologyID); if (ontology == null) { throw new UnknownOWLOntologyException(ontologyID); } return data.createOntologyChange(ontology); }
private static Stream<OWLAxiom> removedAxiom(List<OWLOntologyChangeData> changes) { return changes.stream() .filter(data -> data instanceof RemoveAxiomData) .map(data -> (OWLAxiom) data.getItem()); }
protected String getTemplate() { return getName() + "(%s)"; }