Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.AddAxiom


    public void handle(String id, String value) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(id);
            OWLAxiom ax = getDataFactory().getOWLSymmetricObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
        else {
            addAnnotation(id, OBOVocabulary.IS_SYMMETRIC.getName(), getBooleanConstant(false));
        }
    }
View Full Code Here



    public void handle(String id, String value) {
        OWLAxiom ax = getDataFactory().getOWLInverseObjectPropertiesAxiom(getOWLObjectProperty(id),
                                                                          getOWLObjectProperty(value));
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

    public void handle(String id, String value) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(id);
            OWLAxiom ax = getDataFactory().getOWLAntiSymmetricObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
        else {
            addAnnotation(id, OBOVocabulary.IS_ANTI_SYMMETRIC.getName(), getBooleanConstant(false));
        }
    }
View Full Code Here

        OWLObjectProperty second = getOWLObjectProperty(value);
        List<OWLObjectProperty> chain = new ArrayList<OWLObjectProperty>();
        chain.add(first);
        chain.add(second);
        OWLAxiom ax = getDataFactory().getOWLObjectPropertyChainSubPropertyAxiom(chain, first);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here


    public void handle(String id, String value) {
        OWLObjectProperty prop = getOWLObjectProperty(getConsumer().getCurrentId());
        OWLClass cls = getOWLClass(value);
        applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLObjectPropertyDomainAxiom(prop, cls)));
    }
View Full Code Here

    // rdfs:label
    if ( id.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(id.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, rdfsLabel, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }

    // rdfs:comment
    if ( description.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(description.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, rdfsComment, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
   
    // canonicalUnits
    if ( canonicalUnits != null && canonicalUnits.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(canonicalUnits.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, canonicalUnitsProp, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
   
    // grib
    if ( grib != null && grib.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(grib.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, gribProp, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
    // amip
    if ( amip != null && amip.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(amip.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, amipProp, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
  }
View Full Code Here

    OWLOntology module;
    try {
      module = manager.createOntology( uri );
      List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
      for( OWLAxiom axiom : axioms ) {
        changes.add( new AddAxiom( module, axiom ) );
      }
      manager.applyChanges( changes );
    } catch( OWLOntologyCreationException e ) {
      throw new RuntimeException( e );
    } catch( OWLOntologyChangeException e ) {
View Full Code Here

  public static void updateOntology(OWLOntology ontology, Collection<? extends OWLAxiom> axioms, boolean add)
      throws OWLException {
    List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
    for( OWLAxiom axiom : axioms ) {
      OWLOntologyChange change = add
        ? new AddAxiom( ontology, axiom )
        : new RemoveAxiom( ontology, axiom );
      changes.add( change );
    }
    manager.applyChanges( changes );
  }
View Full Code Here

   * @throws OWLOntologyChangeException
   */
  public static void addAxiom(OWLAxiom axiom, Set<OWLOntology> ontologies,
      OWLOntologyManager manager) throws OWLOntologyChangeException {
    for( OWLOntology ont : ontologies ) {
      manager.applyChange( new AddAxiom( ont, axiom ) );
    }
  }
View Full Code Here

      changes = new ArrayList<OWLOntologyChange>();
      for( OWLEntity entity : referencedEntities ) {
        if( !ontology.containsEntityReference( entity ) ) {
          OWLDeclarationAxiom declaration = manager.getOWLDataFactory()
              .getOWLDeclarationAxiom( entity );
          changes.add( new AddAxiom( ontology, declaration ) );
        }
      }
     
      manager.applyChanges( changes );
    } catch( OWLOntologyChangeException e ) {
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.AddAxiom

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.