private void convertToAnnotations(OWLNamedIndividual ind) { ontologies.forEach(ont -> addAnnotations(ind, ont)); remove(ind); }
private void generateChanges() { Stream<OWLNamedIndividual> inds = ontologies().flatMap(OWLOntology::individualsInSignature); getPunnedIndividuals(inds).forEach(this::convertToAnnotations); }
private void remove(OWLDataProperty prop) { ontologies().forEach(o -> { remove(o.declarationAxioms(prop), o); remove(o.axioms(prop), o); }); }
protected void addAnnotation(OWLNamedIndividual ind, OWLOntology ont, OWLDataPropertyAssertionAxiom ax) { addChange(new RemoveAxiom(ont, ax)); addChange(new AddAxiom(ont, convertToAnnotation(ind, ax))); remove(ax.getProperty().asOWLDataProperty()); }
/** * Instantiates a new convert property assertions to annotations. * * @param dataFactory factory to use * @param ontologies ontologies to change */ public ConvertPropertyAssertionsToAnnotations(OWLDataFactory dataFactory, Collection<OWLOntology> ontologies) { super(dataFactory); this.ontologies = checkNotNull(ontologies, "ontologies cannot be null"); generateChanges(); }
protected void addAnnotations(OWLNamedIndividual ind, OWLOntology ont) { ont.dataPropertyAssertionAxioms(ind).filter(ax -> !ax.getProperty().isAnonymous()) .forEach(ax -> addAnnotation( ind, ont, ax)); }
/** * Gets the punned individuals. * * @param individuals the individuals * @return the punned individuals */ private Collection<OWLNamedIndividual> getPunnedIndividuals( Stream<OWLNamedIndividual> individuals) { return asList(individuals .filter(i -> ontologies().anyMatch(o -> o.containsClassInSignature(i.getIRI())))); }
private void remove(Stream<? extends OWLAxiom> c, OWLOntology o) { c.forEach(ax -> addChange(new RemoveAxiom(o, ax))); }
protected void addAnnotation(OWLNamedIndividual ind, OWLOntology ont, OWLDataPropertyAssertionAxiom ax) { addChange(new RemoveAxiom(ont, ax)); addChange(new AddAxiom(ont, convertToAnnotation(ind, ax))); remove(ax.getProperty().asOWLDataProperty()); }
private void remove(OWLDataProperty prop) { ontologies().forEach(o -> { remove(o.declarationAxioms(prop), o); remove(o.axioms(prop), o); }); }
/** * Instantiates a new convert property assertions to annotations. * * @param dataFactory factory to use * @param ontologies ontologies to change */ public ConvertPropertyAssertionsToAnnotations(OWLDataFactory dataFactory, Collection<OWLOntology> ontologies) { super(dataFactory); this.ontologies = checkNotNull(ontologies, "ontologies cannot be null"); generateChanges(); }
protected void addAnnotations(OWLNamedIndividual ind, OWLOntology ont) { ont.dataPropertyAssertionAxioms(ind).filter(ax -> !ax.getProperty().isAnonymous()) .forEach(ax -> addAnnotation( ind, ont, ax)); }
/** * Gets the punned individuals. * * @param individuals the individuals * @return the punned individuals */ private Collection<OWLNamedIndividual> getPunnedIndividuals( Stream<OWLNamedIndividual> individuals) { return asList(individuals .filter(i -> ontologies().anyMatch(o -> o.containsClassInSignature(i.getIRI())))); }
private void remove(Stream<? extends OWLAxiom> c, OWLOntology o) { c.forEach(ax -> addChange(new RemoveAxiom(o, ax))); }
protected void addAnnotation(OWLNamedIndividual ind, OWLOntology ont, OWLDataPropertyAssertionAxiom ax) { addChange(new RemoveAxiom(ont, ax)); addChange(new AddAxiom(ont, convertToAnnotation(ind, ax))); remove(ax.getProperty().asOWLDataProperty()); }
private void remove(OWLNamedIndividual ind) { ontologies().forEach(o -> { remove(o.declarationAxioms(ind), o); remove(o.classAssertionAxioms(ind), o); }); }
private void convertToAnnotations(OWLNamedIndividual ind) { ontologies.forEach(ont -> addAnnotations(ind, ont)); remove(ind); }
private void generateChanges() { Stream<OWLNamedIndividual> inds = ontologies().flatMap(OWLOntology::individualsInSignature); getPunnedIndividuals(inds).forEach(this::convertToAnnotations); }
/** * Instantiates a new convert property assertions to annotations. * * @param dataFactory factory to use * @param ontologies ontologies to change */ public ConvertPropertyAssertionsToAnnotations(OWLDataFactory dataFactory, Collection<OWLOntology> ontologies) { super(dataFactory); this.ontologies = checkNotNull(ontologies, "ontologies cannot be null"); generateChanges(); }
protected void addAnnotations(OWLNamedIndividual ind, OWLOntology ont) { ont.dataPropertyAssertionAxioms(ind).filter(ax -> !ax.getProperty().isAnonymous()) .forEach(ax -> addAnnotation( ind, ont, ax)); }