Tabnine Logo
OWLOntologyManager.addAxiom
Code IndexAdd Tabnine to your IDE (free)

How to use
addAxiom
method
in
org.semanticweb.owlapi.model.OWLOntologyManager

Best Java code snippets using org.semanticweb.owlapi.model.OWLOntologyManager.addAxiom (Showing top 20 results out of 324)

origin: protegeproject/webprotege

@Override
public ChangeApplied addAxiom(OWLOntology ont, OWLAxiom axiom) {
  if (sealed) {
    throw new DirectChangeApplicationNotAllowedException();
  }
  return delegate.addAxiom(ont, axiom);
}
origin: net.sourceforge.owlapi/oppl2-oppl2patterns

@Override
public OWLEntity visitOBJECTPROPERTYVariableType(OBJECTPROPERTYVariableType v) {
  OWLObjectProperty owlObjectProperty = factory.getOWLObjectProperty(create());
  try {
    manager.addAxiom(scratchpad, factory.getOWLDeclarationAxiom(owlObjectProperty));
  } catch (OWLOntologyChangeException e) {
    // should never happen
    throw new RuntimeException("Unexpected condition", e);
  }
  return owlObjectProperty;
}
origin: net.sourceforge.owlapi/oppl2-oppl2patterns

@Override
public OWLEntity visitINDIVIDUALVariableType(INDIVIDUALVariableType v) {
  OWLNamedIndividual owlIndividual = factory.getOWLNamedIndividual(create());
  try {
    manager.addAxiom(scratchpad, factory.getOWLDeclarationAxiom(owlIndividual));
  } catch (OWLOntologyChangeException e) {
    // should never happen
    throw new RuntimeException("Unexpected condition", e);
  }
  return owlIndividual;
}
origin: net.sourceforge.owlapi/oppl2-oppl2patterns

@Override
public OWLEntity visitDATAPROPERTYVariableType(DATAPROPERTYVariableType v) {
  OWLDataProperty owlDataProperty = factory.getOWLDataProperty(create());
  try {
    manager.addAxiom(scratchpad, factory.getOWLDeclarationAxiom(owlDataProperty));
  } catch (OWLOntologyChangeException e) {
    // should never happen
    throw new RuntimeException("Unexpected condition", e);
  }
  return owlDataProperty;
}
origin: net.sourceforge.owlapi/oppl2-oppl2patterns

  @Override
  public OWLEntity visitCLASSVariableType(CLASSVariableType v) {
    OWLClass owlClass = factory.getOWLClass(create());
    try {
      manager.addAxiom(scratchpad, factory.getOWLDeclarationAxiom(owlClass));
    } catch (OWLOntologyChangeException e) {
      // should never happen
      throw new RuntimeException("Unexpected condition", e);
    }
    return owlClass;
  }
}
origin: com.github.monnetproject/ontology.owlapi

public boolean addSubClassOf(Class clazz2) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLSubClassOfAxiom(clazz,convert(clazz2))));
}
public boolean removeSubClassOf(Class clazz2) {
origin: com.github.monnetproject/ontology.owlapi

public boolean addSubPropertyOf(Property property){
  return isChange(manager.addAxiom(onto,
      factory.getOWLSubAnnotationPropertyOfAxiom(annoProp,convert((AnnotationProperty)property))));
}
public boolean removeSubPropertyOf(Property property){
origin: com.github.monnetproject/ontology.owlapi

public boolean addDomain(Class clazz) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLDataPropertyDomainAxiom(dataProp,convert(clazz))));
}
public boolean removeDomain(Class clazz) {
origin: edu.stanford.protege/org.protege.editor.owl.codegeneration

/**
 * Asserts that the individual has a particular OWL type.
 */

public void assertOwlType(OWLClassExpression type) {
  OWLOntologyManager manager = owlOntology.getOWLOntologyManager();
  OWLDataFactory factory = manager.getOWLDataFactory();
  manager.addAxiom(owlOntology, factory.getOWLClassAssertionAxiom(type, owlIndividual));
}
 
origin: edu.stanford.protege/org.protege.editor.owl.codegeneration

public void addPropertyValue(OWLNamedIndividual i, OWLDataProperty p, Object o) {
  OWLLiteral literal = getLiteralFromObject(owlDataFactory, o);
  if (literal != null) {
    OWLAxiom axiom = owlDataFactory.getOWLDataPropertyAssertionAxiom(p, i, literal);
    manager.addAxiom(owlOntology, axiom);
  }
  else {
    throw new CodeGenerationRuntimeException("Invalid type for property value object " + o);
  }
}
origin: com.github.monnetproject/ontology.owlapi

public boolean addType(Class clazz) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLClassAssertionAxiom(convert(clazz),indiv)));
}
public boolean removeType(Class clazz) {
origin: com.github.monnetproject/ontology.owlapi

public boolean addSameAs(Individual individual) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLSameIndividualAxiom(convert(individual),indiv)));
}        
public boolean removeSameAs(Individual individual){
origin: com.github.monnetproject/ontology.owlapi

public boolean addDomain(Class clazz) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLObjectPropertyDomainAxiom(objProp,convert(clazz))));
}
public boolean removeDomain(Class clazz) {
origin: com.github.monnetproject/ontology.owlapi

public boolean addSubPropertyOf(Property property){
  return isChange(manager.addAxiom(onto,
    factory.getOWLSubObjectPropertyOfAxiom(objProp,convert((ObjectProperty)property))));
}
public boolean removeSubPropertyOf(Property property){
origin: com.github.monnetproject/ontology.owlapi

public boolean addEquivalentProperty(Property property) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLEquivalentDataPropertiesAxiom(dataProp,convert((DatatypeProperty)property))));
}
public boolean removeEquivalentProperty(Property property) {
origin: com.github.monnetproject/ontology.owlapi

public boolean addDisjointWith(Class clazz2) {
  return isChange(manager.addAxiom(onto,
    factory.getOWLDisjointClassesAxiom(clazz,convert(clazz2))));
}
public boolean removeDisjointWith(Class clazz2) {
origin: com.github.monnetproject/ontology.owlapi

@Override
public boolean addClass(Class type) {
  OWLClassExpression oce;
  if(type instanceof OWLAPIClass) {
    oce = ((OWLAPIClass)type).clazz;
  } else {
    oce = dataFactory.getOWLClass(IRI.create(type.getURI()));
  }
  final List<OWLOntologyChange> changes = manager.addAxiom(onto, dataFactory.getOWLSubClassOfAxiom(oce, dataFactory.getOWLClass(IRI.create(OWL+"Thing"))));
  return !changes.isEmpty();
}
origin: com.github.monnetproject/ontology.owlapi

@Override
public boolean addObjectProperty(ObjectProperty op) {
  OWLObjectProperty oop;
  if(op instanceof OWLAPIObjectProperty) {
    oop = ((OWLAPIObjectProperty)op).objProp;
  } else {
    oop = dataFactory.getOWLObjectProperty(IRI.create(op.getURI()));
  }
  final List<OWLOntologyChange> changes = manager.addAxiom(onto, dataFactory.getOWLSubObjectPropertyOfAxiom(oop, dataFactory.getOWLObjectProperty(IRI.create(OWL+"topObjectProperty"))));
  return !changes.isEmpty();
}
origin: edu.stanford.protege/org.protege.editor.owl.codegeneration

public <X extends WrappedIndividualImpl> X createWrappedIndividual(String name, OWLClass type, Class<X> c) {
  OWLNamedIndividual i = owlDataFactory.getOWLNamedIndividual(IRI.create(name));
  manager.addAxiom(owlOntology, owlDataFactory.getOWLClassAssertionAxiom(type, i));
  if (!inference.canAs(i, type)) {
    return null;
  }
  return getWrappedIndividual(name, c);
}
 
origin: SciGraph/SciGraph

@Test
public void doesNotReason_whenOntologyIsUnsatisfiable() throws Exception {
 OWLAxiom axiom = dataFactory.getOWLSubClassOfAxiom(
   dataFactory.getOWLClass(IRI.generateDocumentIRI()), dataFactory.getOWLNothing());
 manager.addAxiom(ont, axiom);
 util.flush();
 assertThat(util.shouldReason(), is(false));
}
org.semanticweb.owlapi.modelOWLOntologyManageraddAxiom

Javadoc

A convenience method that adds a single axiom to an ontology. The appropriate AddAxiom change object is automatically generated.

Popular methods of OWLOntologyManager

  • getOWLDataFactory
    Gets a data factory which can be used to create OWL API objects such as classes, properties, individ
  • loadOntologyFromOntologyDocument
    Loads an ontology from an ontology document specified by an IRI. In contrast the the #loadOntology(I
  • createOntology
    Creates a new (empty) ontology that has the specified ontology ID.
  • saveOntology
    Saves the specified ontology to the specified document IRI in the specified ontology format.
  • applyChanges
  • applyChange
  • removeOntology
  • addOntologyChangeListener
    Adds an ontology change listener, which listens to ontology changes. An ontology change broadcast st
  • removeOntologyChangeListener
    Removes a previously added listener.
  • addAxioms
  • loadOntology
    Loads an ontology that is assumed to have the specified ontologyIRI as its IRI or version IRI. The
  • getOntologyFormat
    Gets the ontology format for the specified ontology.
  • loadOntology,
  • getOntologyFormat,
  • getOntology,
  • addIRIMapper,
  • getOntologyDocumentIRI,
  • getOntologies,
  • getIRIMappers,
  • getImportsClosure,
  • makeLoadImportRequest

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Notification (javax.management)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now