Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.OWLEntityRenamer


        axioms2.add(ObjectPropertyRange(propA, clsAIRI2));
        axioms2.add(DataPropertyDomain(propB, clsAIRI2));
        axioms2.add(ClassAssertion(clsAIRI2, indA));
        axioms2.add(AnnotationAssertion(annoProp, clsAIRI2.getIRI(),
                Literal("X")));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(clsAIRI1,
                clsAIRI2.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                clsAIRI2.getIRI(), clsAIRI1.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here


        axioms2.add(ReflexiveObjectProperty(propA2));
        axioms2.add(IrreflexiveObjectProperty(propA2));
        axioms2.add(ObjectPropertyAssertion(propA2, indA, indB));
        axioms2.add(NegativeObjectPropertyAssertion(propA2, indA, indB));
        axioms2.add(AnnotationAssertion(annoProp, propA2.getIRI(), Literal("X")));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(propA,
                propA2.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                propA2.getIRI(), propA.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here

        axioms2.add(DataPropertyRange(propA2, TopDatatype()));
        axioms2.add(FunctionalDataProperty(propA2));
        axioms2.add(DataPropertyAssertion(propA2, indA, Literal(33)));
        axioms2.add(NegativeDataPropertyAssertion(propA2, indA, Literal(44)));
        axioms2.add(AnnotationAssertion(annoProp, propA2.getIRI(), Literal("X")));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(propA,
                propA2.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                propA2.getIRI(), propA.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here

        axioms2.add(DataPropertyAssertion(propA, indB, Literal(33)));
        axioms2.add(NegativeDataPropertyAssertion(propA, indB, Literal(44)));
        axioms2.add(AnnotationAssertion(annoProp, propA.getIRI(), Literal("X")));
        axioms2.add(ObjectPropertyAssertion(propB, indB, indB));
        axioms2.add(NegativeObjectPropertyAssertion(propB, indB, indB));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(indA,
                indB.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                indB.getIRI(), indA.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here

        ont.getOWLOntologyManager().addAxioms(ont, axioms1);
        Set<OWLAxiom> axioms2 = new HashSet<>();
        axioms2.add(DataPropertyRange(propB, rng1R));
        axioms2.add(DataPropertyRange(propB, rng2R));
        axioms2.add(DataPropertyRange(propB, rng3R));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(dtA,
                dtC.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                dtC.getIRI(), dtA.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here

        axioms2.add(Declaration(annoPropR));
        axioms2.add(AnnotationAssertion(annoPropR, indA.getIRI(), indB.getIRI()));
        axioms2.add(SubAnnotationPropertyOf(annoPropR, annoProp2));
        axioms2.add(AnnotationPropertyRange(annoPropR, indA.getIRI()));
        axioms2.add(AnnotationPropertyDomain(annoPropR, indA.getIRI()));
        OWLEntityRenamer entityRenamer = new OWLEntityRenamer(
                ont.getOWLOntologyManager(), singleton(ont));
        List<OWLOntologyChange> changes = entityRenamer.changeIRI(annoProp,
                annoPropR.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes);
        assertEquals(ont.getAxioms(), axioms2);
        List<OWLOntologyChange> changes2 = entityRenamer.changeIRI(
                annoPropR.getIRI(), annoProp.getIRI());
        ont.getOWLOntologyManager().applyChanges(changes2);
        assertEquals(ont.getAxioms(), axioms1);
    }
View Full Code Here

    }
  }

  public void setName(String name) {
    if(obj instanceof OWLEntity){
      OWLEntityRenamer renamer = getOWLEntityRenamer();
      IRI newIRI = IRI.create(getNameSpace()+name);
      List<OWLOntologyChange> changes = renamer.changeIRI((OWLEntity)obj,newIRI);
      getOWLOntologyManager().applyChanges(changes);
     }
  }
View Full Code Here

    return remover;
  }
 
  protected OWLEntityRenamer getOWLEntityRenamer(){
    if(renamer == null){
      renamer = new OWLEntityRenamer(manager,Collections.singleton(ontology));
    }
    return renamer;
  }
View Full Code Here

    }
  }

  public void setName(String name) {
    if(obj instanceof OWLEntity){
      OWLEntityRenamer renamer = getOWLEntityRenamer();
      IRI newIRI = IRI.create(getNameSpace()+name);
      List<OWLOntologyChange> changes = renamer.changeIRI((OWLEntity)obj,newIRI);
      getOWLOntologyManager().applyChanges(changes);
     }
  }
View Full Code Here

    return remover;
  }
 
  protected OWLEntityRenamer getOWLEntityRenamer(){
    if(renamer == null){
      renamer = new OWLEntityRenamer(manager,Collections.singleton(ontology));
    }
    return renamer;
  }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.OWLEntityRenamer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.