Class OntModelSpec

java.lang.Object
org.apache.jena.ontology.OntModelSpec

@Deprecated(forRemoval=true) public class OntModelSpec extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use org.apache.jena.ontapi.

Encapsulates a description of the components of an ontology model, including the storage scheme, reasoner and language profile.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL DL models that are stored in memory and do no additional entailment reasoning
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL DL models that are stored in memory and use the RDFS inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL DL models that are stored in memory and use the OWL rules inference engine for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL DL models that are stored in memory and use the transitive inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL Lite models that are stored in memory and do no entailment additional reasoning
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL Lite models that are stored in memory and use the RDFS inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL Lite models that are stored in memory and use the OWL rules inference engine for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL Lite models that are stored in memory and use the transitive inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL models that are stored in memory and do no additional entailment reasoning
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL models that are stored in memory and use the micro OWL rules inference engine for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL models that are stored in memory and use the mini OWL rules inference engine for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL models that are stored in memory and use the RDFS inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL models that are stored in memory and use the OWL rules inference engine for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for OWL models that are stored in memory and use the transitive inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for RDFS ontology models that are stored in memory and do no additional entailment reasoning
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for RDFS ontology models that are stored in memory and use the RDFS inferencer for additional entailments
    static final OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    A specification for RDFS ontology models that are stored in memory and use the transitive reasoner for entailments
  • Constructor Summary

    Constructors
    Constructor
    Description
    OntModelSpec(String baseModelName, ModelMaker baseMaker, ModelMaker importsMaker, OntDocumentManager docMgr, ReasonerFactory rFactory, String languageURI)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct a new ontology model specification from the supplied components.
    OntModelSpec(ModelMaker baseMaker, ModelMaker importsMaker, OntDocumentManager docMgr, ReasonerFactory rFactory, String languageURI)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct a new ontology model specification from the supplied components.
    OntModelSpec(ModelMaker importsMaker, OntDocumentManager docMgr, ReasonerFactory rFactory, String languageURI)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct a new ontology model specification with the given specification parameters
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create one model spec as a copy of another.
  • Method Summary

    Modifier and Type
    Method
    Description
    assemble(Model model)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the OntModelSpec described using the Jena Assembler vocabulary properties of the single resource in model of type JA:OntModelSpec.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the OntModelSpec described using the Jena Assembler vocabulary properties of root.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer a base model constructed according to this specification.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create an OntModel according to this model specification.
    boolean
    equals(Object other)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the model maker used for creating base models.
    getDefaultSpec(String languageURI)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer a default specification for the given language URI.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the document manager for this model specification.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the model maker used for creating imported models.
    String[][]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the set of known (built-in) namespace prefixes for this OntModelSpec
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the URI of the ontology language to use when constructing models from this specification.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the language profile for this ontology specification
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the reasoner that will be used to infer additional entailed triples in the ontology model.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Answer the current reasoner factory
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create an OntModel according to this model specification.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the model maker used for base models.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the document manager in this specification
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the model maker that will be used when the ontology model needs to create an additional container for an imported ontology
    void
    setLanguage(String languageURI)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the URI of the ontology to use for models that conform to this specification.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the reasoner that will be used by ontology models that conform to this specification to compute entailments.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the factory object that will be used to generate the reasoner object for this model specification.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • OWL_MEM

      public static final OntModelSpec OWL_MEM
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL models that are stored in memory and do no additional entailment reasoning
    • OWL_MEM_RDFS_INF

      public static final OntModelSpec OWL_MEM_RDFS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL models that are stored in memory and use the RDFS inferencer for additional entailments
    • OWL_MEM_TRANS_INF

      public static final OntModelSpec OWL_MEM_TRANS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL models that are stored in memory and use the transitive inferencer for additional entailments
    • OWL_MEM_RULE_INF

      public static final OntModelSpec OWL_MEM_RULE_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL models that are stored in memory and use the OWL rules inference engine for additional entailments
    • OWL_MEM_MICRO_RULE_INF

      public static final OntModelSpec OWL_MEM_MICRO_RULE_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL models that are stored in memory and use the micro OWL rules inference engine for additional entailments
    • OWL_MEM_MINI_RULE_INF

      public static final OntModelSpec OWL_MEM_MINI_RULE_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL models that are stored in memory and use the mini OWL rules inference engine for additional entailments
    • OWL_DL_MEM

      public static final OntModelSpec OWL_DL_MEM
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL DL models that are stored in memory and do no additional entailment reasoning
    • OWL_DL_MEM_RDFS_INF

      public static final OntModelSpec OWL_DL_MEM_RDFS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL DL models that are stored in memory and use the RDFS inferencer for additional entailments
    • OWL_DL_MEM_TRANS_INF

      public static final OntModelSpec OWL_DL_MEM_TRANS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL DL models that are stored in memory and use the transitive inferencer for additional entailments
    • OWL_DL_MEM_RULE_INF

      public static final OntModelSpec OWL_DL_MEM_RULE_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL DL models that are stored in memory and use the OWL rules inference engine for additional entailments
    • OWL_LITE_MEM

      public static final OntModelSpec OWL_LITE_MEM
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL Lite models that are stored in memory and do no entailment additional reasoning
    • OWL_LITE_MEM_TRANS_INF

      public static final OntModelSpec OWL_LITE_MEM_TRANS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL Lite models that are stored in memory and use the transitive inferencer for additional entailments
    • OWL_LITE_MEM_RDFS_INF

      public static final OntModelSpec OWL_LITE_MEM_RDFS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL Lite models that are stored in memory and use the RDFS inferencer for additional entailments
    • OWL_LITE_MEM_RULES_INF

      public static final OntModelSpec OWL_LITE_MEM_RULES_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for OWL Lite models that are stored in memory and use the OWL rules inference engine for additional entailments
    • RDFS_MEM

      public static final OntModelSpec RDFS_MEM
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for RDFS ontology models that are stored in memory and do no additional entailment reasoning
    • RDFS_MEM_TRANS_INF

      public static final OntModelSpec RDFS_MEM_TRANS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for RDFS ontology models that are stored in memory and use the transitive reasoner for entailments
    • RDFS_MEM_RDFS_INF

      public static final OntModelSpec RDFS_MEM_RDFS_INF
      Deprecated, for removal: This API element is subject to removal in a future version.
      A specification for RDFS ontology models that are stored in memory and use the RDFS inferencer for additional entailments
  • Constructor Details

    • OntModelSpec

      public OntModelSpec(ModelMaker importsMaker, OntDocumentManager docMgr, ReasonerFactory rFactory, String languageURI)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Construct a new ontology model specification with the given specification parameters

      Parameters:
      importsMaker - The model maker, which will be used to construct stores for statements in the imported ontologies and the base ontology. Use null to get a default (memory) model maker.
      docMgr - The document manager, or null for the default document manager.
      rFactory - The factory for the reasoner to use to infer additional triples in the model, or null for no reasoner
      languageURI - The URI of the ontology language. Required.
    • OntModelSpec

      public OntModelSpec(ModelMaker baseMaker, ModelMaker importsMaker, OntDocumentManager docMgr, ReasonerFactory rFactory, String languageURI)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct a new ontology model specification from the supplied components.
      Parameters:
      baseMaker - the model-maker to use for the base model
      importsMaker - the model-maker to use for imported models
      docMgr - the document manager (null for the default manager)
      rFactory - the reasoner (null for no reasoner)
      languageURI - the ontology language URI (must not be null)
    • OntModelSpec

      public OntModelSpec(String baseModelName, ModelMaker baseMaker, ModelMaker importsMaker, OntDocumentManager docMgr, ReasonerFactory rFactory, String languageURI)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct a new ontology model specification from the supplied components.
      Parameters:
      baseModelName - the name of the model in the baseModelMaker
      baseMaker - the model-maker to use for the base model
      importsMaker - the model-maker to use for imported models
      docMgr - the document manager (null for the default manager)
      rFactory - the reasoner (null for no reasoner)
      languageURI - the ontology language URI (must not be null)
    • OntModelSpec

      public OntModelSpec(OntModelSpec spec)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Create one model spec as a copy of another. This is useful when what is required is similar to an existing spec, but with some changes. Note: this is only a shallow copy, so the structured objects (reasoners, document managers, etc) are not themselves copied. Thus, even after calling this copy constructor, making a change to the document manager in the copy specification will also affect the one that the copy was made from. The correct idiom is to replace the object before side-effecting it, e.g:

         OntModelSpec newSpec = new OntModelSpec( existingSpec );
         newSpec.setDocumentManager( new OntDocumentManager() );
         newSpec.getDocumentManager().setMetaDataSearchPath( "..." );
       
      Parameters:
      spec -
  • Method Details

    • equals

      public boolean equals(Object other)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object
    • getImportModelMaker

      public ModelMaker getImportModelMaker()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Answer the model maker used for creating imported models.
      Returns:
      The ModelMaker that is used to get or create a model used to hold imports to an OntModel.
    • getBaseModelMaker

      public ModelMaker getBaseModelMaker()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Answer the model maker used for creating base models.
    • getImportModelGetter

      public ModelGetter getImportModelGetter()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setImportModelGetter

      public void setImportModelGetter(ModelGetter mg)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • assemble

      public static OntModelSpec assemble(Resource root)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Answer the OntModelSpec described using the Jena Assembler vocabulary properties of root. If the assembled resource is not an OntModelSpec, throw an exception reporting the constructed class.
    • assemble

      public static OntModelSpec assemble(Model model)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Answer the OntModelSpec described using the Jena Assembler vocabulary properties of the single resource in model of type JA:OntModelSpec.
    • getDefaultSpec

      public static OntModelSpec getDefaultSpec(String languageURI)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Answer a default specification for the given language URI. This default will typically use a memory model and have minimal inferencing capabilities. Specifically, OWL and RDFS languages will have RDFS level inferencing capability (chosen to give a reasonable balance between power and efficiency of computation). To get other (more powerful or less powerful) reasoning capabilities, users should create ontology models by passing an explicit OntModelSpec parameter to the model factory.

      Parameters:
      languageURI - The ontology language we want a default model spec for
      Returns:
      The default model spec for that language
      Throws:
      OntologyException - if the URI is not a recognised name of an ontology language
    • getDocumentManager

      public OntDocumentManager getDocumentManager()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Answer the document manager for this model specification. Defaults to a standard instance of OntDocumentManager

      Returns:
      The document manager to be used by models matching this specification
    • setDocumentManager

      public void setDocumentManager(OntDocumentManager docMgr)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Set the document manager in this specification

      Parameters:
      docMgr - The new document manager
    • setImportModelMaker

      public void setImportModelMaker(ModelMaker maker)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Set the model maker that will be used when the ontology model needs to create an additional container for an imported ontology

      Parameters:
      maker - The new model maker to use
    • setBaseModelMaker

      public void setBaseModelMaker(ModelMaker m)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Set the model maker used for base models.

      Parameters:
      m - The model maker that is used to create the base model if one is not supplied when a model is created.
    • getReasoner

      public Reasoner getReasoner()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Answer the reasoner that will be used to infer additional entailed triples in the ontology model.

      Returns:
      The reasoner for this specification
    • setReasoner

      public void setReasoner(Reasoner reasoner)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Set the reasoner that will be used by ontology models that conform to this specification to compute entailments. Note: The reasoner is generated on demand by the reasoner factory. To prevent this spec from having a reasoner, set the reasoner factory to null, see setReasonerFactory(org.apache.jena.reasoner.ReasonerFactory).

      Parameters:
      reasoner - The new reasoner
    • setReasonerFactory

      public void setReasonerFactory(ReasonerFactory rFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Set the factory object that will be used to generate the reasoner object for this model specification. Note that the reasoner itself is cached, so setting the factory after a call to getReasoner() will have no effect.

      Parameters:
      rFactory - The new reasoner factory, or null to prevent any reasoner being used
    • getReasonerFactory

      public ReasonerFactory getReasonerFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Answer the current reasoner factory

      Returns:
      The reasoner factory, or null.
    • getLanguage

      public String getLanguage()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Answer the URI of the ontology language to use when constructing models from this specification. Well known language URI's are available from the ProfileRegistry

      Returns:
      The ontology language URI
    • setLanguage

      public void setLanguage(String languageURI)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Set the URI of the ontology to use for models that conform to this specification.

      Parameters:
      languageURI - The new language URI
      Throws:
      OntologyException - if the URI does not map to a known language profile
    • getProfile

      public Profile getProfile()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Answer the language profile for this ontology specification

      Returns:
      An ontology language profile object
    • doCreateModel

      public Model doCreateModel()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Create an OntModel according to this model specification. The base model comes from the attached base ModelMaker.

      Returns:
      an OntModel satisfying this specification
    • implementCreateModelOver

      public Model implementCreateModelOver(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Create an OntModel according to this model specification. The base model comes from the underlying ModelMaker and is named by the given name.

    • createBaseModel

      public Model createBaseModel()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Answer a base model constructed according to this specification. This is used for the "base" (i.e. non-imported) model for an OntModel.
    • getKnownPrefixes

      public String[][] getKnownPrefixes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the set of known (built-in) namespace prefixes for this OntModelSpec
      Returns:
      Known prefixes as an array of length-2 arrays