private OWLAxiom rewriteAxiom(OWLAxiom axiom) { return duplicator.duplicateObject(axiom); }
/** * Returns a clone of the given class expression. * @param ce the class expression * @return a class expression clone */ public static OWLClassExpression clone(OWLClassExpression ce) { return duplicator.duplicateObject(ce); }
private OWLAxiom rewriteAxiom(OWLAxiom axiom) { return duplicator.duplicateObject(axiom); }
private OWLAxiom rewriteAxiom(OWLAxiom axiom) { return duplicator.duplicateObject(axiom); }
private OWLAxiom rewriteAxiom(OWLAxiom axiom) { return duplicator.duplicateObject(axiom); }
/** * Tries to shorten a concept, e.g. male AND male is shortened to male. * @param concept The input concepts. * @return A shortened version of the concept (equal to the input concept if it cannot be shortened). */ public static OWLClassExpression getShortConcept(OWLClassExpression concept) { long shorteningTimeNsStart = System.nanoTime(); OWLClassExpression clone = DUPLICATOR.duplicateObject(concept); shorteningTimeNs += System.nanoTime() - shorteningTimeNsStart; return clone; }
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; }
private Set<OWLAnnotation> duplicateAxiomAnnotations(OWLAxiom axiom, OWLObjectDuplicator duplicator) { Set<OWLAnnotation> duplicatedAnnos = new HashSet<>(); for(OWLAnnotation anno : axiom.getAnnotations()) { duplicatedAnnos.add(duplicator.duplicateObject(anno)); } return duplicatedAnnos; }
public OWLClassExpression minimizeClone(OWLClassExpression ce){ OWLObjectDuplicator objectDuplicator = new OWLObjectDuplicator(df); OWLClassExpression clone = objectDuplicator.duplicateObject(ce); return clone.accept(this); }
/** * Fills a list with ontology annotaton changes which will replace ontology annotations. * * @param changes A list that will be filled with ontology changes which will remove the * specified axioms from the specified ontology, and add the duplicated/transformed * version * @param ont The ontology to which the changed should be applied * @param duplicator The duplicator that will do the duplicating */ private static void fillListWithOntologyAnnotationTransformChanges( List<OWLOntologyChange> changes, OWLOntology ont, OWLObjectDuplicator duplicator) { ont.annotations().forEach(ax -> { OWLAnnotation dupAx = duplicator.duplicateObject(ax); if (!dupAx.equals(ax)) { changes.add(new RemoveOntologyAnnotation(ont, ax)); changes.add(new AddOntologyAnnotation(ont, dupAx)); } }); }
/** * Fills a list with ontology annotaton changes which will replace ontology annotations. * * @param changes A list that will be filled with ontology changes which will remove the * specified axioms from the specified ontology, and add the duplicated/transformed * version * @param ont The ontology to which the changed should be applied * @param duplicator The duplicator that will do the duplicating */ private static void fillListWithOntologyAnnotationTransformChanges( List<OWLOntologyChange> changes, OWLOntology ont, OWLObjectDuplicator duplicator) { ont.annotations().forEach(ax -> { OWLAnnotation dupAx = duplicator.duplicateObject(ax); if (!dupAx.equals(ax)) { changes.add(new RemoveOntologyAnnotation(ont, ax)); changes.add(new AddOntologyAnnotation(ont, dupAx)); } }); }
private List<OWLOntologyChange> duplicateClassAxioms(OWLClass selectedClass, OWLObjectDuplicator dup) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); boolean useActiveOnt = prefs.getBoolean(DUPLICATE_INTO_ACTIVE_ONTOLOGY_KEY, false); for (OWLOntology ont : getOWLModelManager().getActiveOntologies()) { for (OWLAxiom ax : ont.getAxioms(selectedClass)) { if (ax.isLogicalAxiom() && !(ax instanceof OWLDisjointClassesAxiom)) { OWLAxiom duplicatedAxiom = dup.duplicateObject(ax); changes.add(new AddAxiom(useActiveOnt ? getOWLModelManager().getActiveOntology() : ont, duplicatedAxiom)); } } } return changes; }
private List<OWLOntologyChange> duplicateClassAxioms(OWLClass selectedClass, OWLObjectDuplicator dup, Preferences prefs) { List<OWLOntologyChange> changes = new ArrayList<>(); boolean useActiveOnt = prefs.getBoolean(DUPLICATE_INTO_ACTIVE_ONTOLOGY_KEY, false); for (OWLOntology ont : getOWLModelManager().getActiveOntologies()) { for (OWLAxiom ax : ont.getAxioms(selectedClass, Imports.EXCLUDED)) { if (ax.isLogicalAxiom() && !(ax instanceof OWLDisjointClassesAxiom)) { OWLAxiom duplicatedAxiom = dup.duplicateObject(ax); changes.add(new AddAxiom(useActiveOnt ? getOWLModelManager().getActiveOntology() : ont, duplicatedAxiom)); } } } return changes; }
private List<OWLOntologyChange> duplicateClassAxioms(OWLClass selectedClass, OWLObjectDuplicator dup) { List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); boolean useActiveOnt = prefs.getBoolean(DUPLICATE_INTO_ACTIVE_ONTOLOGY_KEY, false); for (OWLOntology ont : getOWLModelManager().getActiveOntologies()) { for (OWLAxiom ax : ont.getAxioms(selectedClass)) { if (ax.isLogicalAxiom() && !(ax instanceof OWLDisjointClassesAxiom)) { OWLAxiom duplicatedAxiom = dup.duplicateObject(ax); changes.add(new AddAxiom(useActiveOnt ? getOWLModelManager().getActiveOntology() : ont, duplicatedAxiom)); } } } return changes; }
private List<OWLOntologyChange> duplicateClassAxioms(OWLClass selectedClass, OWLObjectDuplicator dup, Preferences prefs) { List<OWLOntologyChange> changes = new ArrayList<>(); boolean useActiveOnt = prefs.getBoolean(DUPLICATE_INTO_ACTIVE_ONTOLOGY_KEY, false); for (OWLOntology ont : getOWLModelManager().getActiveOntologies()) { for (OWLAxiom ax : ont.getAxioms(selectedClass, Imports.EXCLUDED)) { if (ax.isLogicalAxiom() && !(ax instanceof OWLDisjointClassesAxiom)) { OWLAxiom duplicatedAxiom = dup.duplicateObject(ax); changes.add(new AddAxiom(useActiveOnt ? getOWLModelManager().getActiveOntology() : ont, duplicatedAxiom)); } } } return changes; }
private void handleNewSplitAxioms(OWLClass newlyCreatedClass, OWLClass classThatWasSplit, EntityBasedDiff diff) { OWLOntology sourceOntology = diffMap.getSourceOntology(); Map<OWLEntity, IRI> newTargetToSplitSource = Collections.singletonMap((OWLEntity) newlyCreatedClass, classThatWasSplit.getIRI()); OWLObjectDuplicator duplicator = new OWLObjectDuplicator(newTargetToSplitSource, diffMap.getOWLDataFactory()); Set<OWLClassExpression> inferredParents = getInferredParents(sourceOntology, classThatWasSplit); for (MatchedAxiom match : new ArrayList<MatchedAxiom>(diff.getAxiomMatches())) { if (match.getDescription().equals(MatchedAxiom.AXIOM_ADDED) && cameFromSourceOntology((OWLAxiom) duplicator.duplicateObject(match.getTargetAxiom()), sourceOntology, classThatWasSplit, inferredParents)) { MatchedAxiom modifiedBySplit = new MatchedAxiom(null, match.getTargetAxiom(), COPIED_FROM_SPLIT); changes.removeMatch(match); changes.addMatch(modifiedBySplit); } } }
private void handleNewSplitAxioms(OWLClass newlyCreatedClass, OWLClass classThatWasSplit, EntityBasedDiff diff) { OWLOntology sourceOntology = diffMap.getSourceOntology(); Map<OWLEntity, IRI> newTargetToSplitSource = Collections.singletonMap((OWLEntity) newlyCreatedClass, classThatWasSplit.getIRI()); OWLObjectDuplicator duplicator = new OWLObjectDuplicator(newTargetToSplitSource, diffMap.getOWLDataFactory()); Set<OWLClassExpression> inferredParents = getInferredParents(sourceOntology, classThatWasSplit); for (MatchedAxiom match : new ArrayList<MatchedAxiom>(diff.getAxiomMatches())) { if (match.getDescription().equals(MatchedAxiom.AXIOM_ADDED) && cameFromSourceOntology((OWLAxiom) duplicator.duplicateObject(match.getTargetAxiom()), sourceOntology, classThatWasSplit, inferredParents)) { MatchedAxiom modifiedBySplit = new MatchedAxiom(null, match.getTargetAxiom(), COPIED_FROM_SPLIT); changes.removeMatch(match); changes.addMatch(modifiedBySplit); } } }
public void drop(DropTargetDropEvent dtde) { if (!isDropAcceptable(dtde)) { dtde.rejectDrop(); } else { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List<OWLObject> objs = getDropObjects(dtde.getTransferable()); List<OWLObject> dupObjs = new ArrayList<>(); OWLObject dupObj = null; for (OWLObject obj : objs) { OWLObjectDuplicator duplicator = new OWLObjectDuplicator(target.getOWLModelManager().getOWLDataFactory()); dupObj = duplicator.duplicateObject(obj); dupObjs.add(dupObj); } dtde.dropComplete(target.dropOWLObjects(dupObjs, dtde.getLocation(), dtde.getDropAction())); } component.setCursor(orginalCursor); }
public void drop(DropTargetDropEvent dtde) { if (isDropAcceptable(dtde) == false) { dtde.rejectDrop(); } else { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List<OWLObject> objs = getDropObjects(dtde.getTransferable()); List<OWLObject> dupObjs = new ArrayList<OWLObject>(); OWLObject dupObj = null; for (OWLObject obj : objs) { OWLObjectDuplicator duplicator = new OWLObjectDuplicator(target.getOWLModelManager().getOWLDataFactory()); dupObj = duplicator.duplicateObject(obj); dupObjs.add(dupObj); } dtde.dropComplete(target.dropOWLObjects(dupObjs, dtde.getLocation(), dtde.getDropAction())); } component.setCursor(orginalCursor); }
public void drop(DropTargetDropEvent dtde) { if (!isDropAcceptable(dtde)) { dtde.rejectDrop(); } else { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List<OWLObject> objs = getDropObjects(dtde.getTransferable()); List<OWLObject> dupObjs = new ArrayList<>(); OWLObject dupObj = null; for (OWLObject obj : objs) { OWLObjectDuplicator duplicator = new OWLObjectDuplicator(target.getOWLModelManager().getOWLDataFactory()); dupObj = duplicator.duplicateObject(obj); dupObjs.add(dupObj); } dtde.dropComplete(target.dropOWLObjects(dupObjs, dtde.getLocation(), dtde.getDropAction())); } component.setCursor(orginalCursor); }