Class SSSOMTOwlApplication

java.lang.Object
org.incenp.obofoundry.sssom.transform.SSSOMTransformApplication<org.semanticweb.owlapi.model.OWLAxiom>
org.incenp.obofoundry.sssom.owl.SSSOMTOwlApplication
All Implemented Interfaces:
ISSSOMTransformApplication<org.semanticweb.owlapi.model.OWLAxiom>

public class SSSOMTOwlApplication extends SSSOMTransformApplication<org.semanticweb.owlapi.model.OWLAxiom>
A specialised application of the SSSOM/Transform language to read mapping processing rules that produce OWL axioms.
  • Constructor Details

    • SSSOMTOwlApplication

      public SSSOMTOwlApplication(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory)
      Creates a new instance.
      Parameters:
      ontology - A helper ontology. This does not need to be the ontology the axioms will be injected to afterwards, but it must contain declaration axioms for all the object and annotation properties that may be used in create_axiom function calls. It is also the ontology used by the functions that check whether a given entity exists or is a subclass of another entity.
      reasonerFactory - The reasoner factory to use when this application will need to reason over the ontology.
  • Method Details

    • onInit

      public void onInit(PrefixManager prefixManager)
      Description copied from interface: ISSSOMTransformApplication
      Initialises the application. This method is called by the SSSOM/Transform parser when all rules have been syntaxically parsed, before the parser attempts to process the action part of each rule.
      Specified by:
      onInit in interface ISSSOMTransformApplication<org.semanticweb.owlapi.model.OWLAxiom>
      Overrides:
      onInit in class SSSOMTransformApplication<org.semanticweb.owlapi.model.OWLAxiom>
      Parameters:
      prefixManager - A prefix manager initialised with all the prefix declarations found in the SSSOM/Transform file.
    • getEntityChecker

      public EditableEntityChecker getEntityChecker()
      Gets the ontology checker used by this application. SSSOM/T-Owl functions may use that object to add entities that should be recognised by OWLAPI classes and methods even if they do not actually exist in the ontology.
      Returns:
      The application’s entity checker.
    • getOntology

      public org.semanticweb.owlapi.model.OWLOntology getOntology()
      Gets the helper ontology used by this application.
      Returns:
      The helper ontology.
    • getUriExpressionRegistry

      public UriExpressionRegistry getUriExpressionRegistry()
      Gets the registry of URI Expression templates, needed to expand a URI Expression into a OWL expression.
      Returns:
      The registry.
    • classExists

      @Deprecated public boolean classExists(String cls)
      Deprecated.
      Checks if a given class exists in the helper ontology and if it is not obsolete.

      For this method, “exists” means that the class is present in the ontology’s signature.

      Parameters:
      cls - The name of the class to check.
      Returns:
      true if the class exists and is not deprecated, otherwise false.
    • entityExists

      public boolean entityExists(String entity)
      Checks if a given entity exists in the helper ontology and if it is not obsolete.

      For this method, “exists” means that the entity is present in the ontology’s signature.

      Parameters:
      entity - The name of the entity to check.
      Returns:
      true if the entity exists and is not deprecated, otherwise false.
    • getSubClassesOf

      public Set<String> getSubClassesOf(String root)
      Gets a list of all descendants of a given class.

      Implementation detail: the results are cached, so that calling this method several times for the same parent will query the ontology only once.

      Parameters:
      root - The name of the parent class.
      Returns:
      A set containing all the descendants of the parent class (including the parent class itself).
    • getSubPropertiesOf

      public Set<String> getSubPropertiesOf(String root)
      Gets a list of all descendants of a given property.

      Implementation details: the results are cached, so that calling this method several times for the same parent will query the ontology only once.

      Parameters:
      root - The name of the parent property.
      Returns:
      A set containing all the descendants of the parent property (including the parent property itself).
    • createAnnotatedTransformer

      @Deprecated public IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom> createAnnotatedTransformer(IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom> innerTransformer, String spec)
      Given an axiom generator, gets another generator that would produce the same axiom but annotated with metadata from the mapping.
      Parameters:
      innerTransformer - The original axiom generator.
      spec - A list of SSSOM metadata slot names to annotate the produced axiom with. See SlotHelper.getMappingSlotList(String) for details about the expected format of that argument.
      Returns:
      The modified axiom generator.