public Set<Set<OWLAnnotation>> getAnnotationsForSectionObject(Object sectionObject) { Collection<OWLAxiom> axioms = object2Axioms.get(sectionObject); if(axioms == null) { return new HashSet<Set<OWLAnnotation>>(); } Set<Set<OWLAnnotation>> annos = new HashSet<Set<OWLAnnotation>>(); for(OWLAxiom ax : axioms) { annos.add(ax.getAnnotations()); } return annos; }
void renderAxiomAnnotations(OWLAxiom axiom) { Set<OWLAnnotation> annotations = axiom.getAnnotations(); if (!annotations.isEmpty()) { stringBuilder.append("<div class=\"ms-annotations\">"); annotations.forEach(anno -> { stringBuilder.append("<div>"); anno.accept(this); stringBuilder.append("</div>"); }); stringBuilder.append("</div>"); } }
@Override public void generateSearchMetadataFor(OWLAxiom axiom, OWLEntity axiomSubject, String axiomSubjectRendering, SearchMetadataImportContext context, SearchMetadataDB db) { for (OWLAnnotation annotation : axiom.getAnnotations()) { generateSearchMetadataForAnnotation(annotation, axiomSubject, axiomSubjectRendering, context, db); } }
@Override public void generateSearchMetadataFor(OWLAxiom axiom, OWLEntity axiomSubject, String axiomSubjectRendering, SearchMetadataImportContext context, SearchMetadataDB db) { for (OWLAnnotation annotation : axiom.getAnnotations()) { generateSearchMetadataForAnnotation(annotation, axiomSubject, axiomSubjectRendering, context, db); } }
private Set<OWLAnnotation> duplicateAxiomAnnotations(OWLAxiom axiom, OWLObjectDuplicator duplicator) { Set<OWLAnnotation> duplicatedAnnos = new HashSet<OWLAnnotation>(); for(OWLAnnotation anno : axiom.getAnnotations()) { duplicatedAnnos.add((OWLAnnotation) duplicator.duplicateObject(anno)); } return duplicatedAnnos; }
protected void processAxiomAnnotations(OWLAxiom ax) { for(OWLAnnotation anno : ax.getAnnotations()) { anno.accept(this); } }
protected void processAxiomAnnotations(OWLAxiom ax) { // default behavior: iterate over the annotations outside the axiom for (OWLAnnotation anno : ax.getAnnotations()) { anno.accept(this); } }
@Override public void generateSearchMetadataFor(OWLAxiom axiom, OWLEntity axiomSubject, String axiomSubjectRendering, SearchMetadataImportContext context, SearchMetadataDB db) { for (OWLAnnotation annotation : axiom.getAnnotations()) { generateSearchMetadataForAnnotation(annotation, axiomSubject, axiomSubjectRendering, context, db); } }
private void writeAnnotations(OWLAxiom axiom) { for(OWLAnnotation anno : axiom.getAnnotations()) { anno.accept(this); } }
public boolean equals(Object obj) { if (super.equals(obj)) { return obj instanceof OWLAsymmetricObjectPropertyAxiom && getAnnotations().equals(((OWLAxiom) obj).getAnnotations()); } return false; }
private void translateAnnotations(OWLAxiom ax) { translateAnonymousNode(ax); for (OWLAnnotation anno : ax.getAnnotations()) { translateAnnotation(ax, anno); } }
public void writeAnnotations(OWLAxiom ax) { for (OWLAnnotation anno : ax.getAnnotations()) { anno.accept(this); write(" "); } }
public void writeAnnotations(OWLAxiom ax) { for (OWLAnnotation anno : ax.getAnnotations()) { anno.accept(this); write(" "); } }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getReplaceChanges(OWLAnnotation oldAnnotation, OWLAnnotation newAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); annotations.add(newAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getDeleteChanges(OWLAnnotation oldAnnotation) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<>(ax.getAnnotations()); annotations.remove(oldAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected java.util.List<OWLOntologyChange> getAddChanges(OWLAnnotation annot) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom oldAxiom = getRoot().getAxiom(); Set<OWLAnnotation> annotations = new HashSet<>(oldAxiom.getAnnotations()); annotations.add(annot); // because for some reason the merge does not work newAxiom = oldAxiom.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); final OWLOntology ont = getRoot().getOntology(); changes.add(new RemoveAxiom(ont, oldAxiom)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected List<OWLOntologyChange> getDeleteChanges(OWLAnnotation oldAnnotation) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); final OWLAxiom ax = getRoot().getAxiom(); final OWLOntology ont = getRoot().getOntology(); Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>(ax.getAnnotations()); annotations.remove(oldAnnotation); newAxiom = ax.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); changes.add(new RemoveAxiom(ont, ax)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }
protected java.util.List<OWLOntologyChange> getAddChanges(OWLAnnotation annot) { List<OWLOntologyChange> changes = new ArrayList<>(); final OWLAxiom oldAxiom = getRoot().getAxiom(); Set<OWLAnnotation> annotations = new HashSet<>(oldAxiom.getAnnotations()); annotations.add(annot); // because for some reason the merge does not work newAxiom = oldAxiom.getAxiomWithoutAnnotations().getAnnotatedAxiom(annotations); final OWLOntology ont = getRoot().getOntology(); changes.add(new RemoveAxiom(ont, oldAxiom)); changes.add(new AddAxiom(ont, newAxiom)); return changes; }