com.hp.hpl.jena.ontology
Class OntModelSpec

java.lang.Object
  extended bycom.hp.hpl.jena.ontology.OntModelSpec

public class OntModelSpec
extends java.lang.Object

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

Version:
CVS $Id: OntModelSpec.java,v 1.8 2003/06/26 19:25:57 ian_dickinson Exp $
Author:
Ian Dickinson, HP Labs (email)

Field Summary
static OntModelSpec DAML_MEM
          A specification for DAML models that are stored in memory and do no additional entailment reasoning
static OntModelSpec DAML_MEM_RDFS_INF
          A specification for DAML models that are stored in memory and use the RDFS inferencer for additional entailments
static OntModelSpec DAML_MEM_TRANS_INF
          A specification for DAML models that are stored in memory and use the transitive reasoner for entailments
static OntModelSpec OWL_DL_MEM
          A specification for OWL DL models that are stored in memory and do no additional entailment reasoning
static OntModelSpec OWL_DL_MEM_RDFS_INF
          A specification for OWL DL models that are stored in memory and use the RDFS inferencer for additional entailments
static OntModelSpec OWL_DL_MEM_RULE_INF
          A specification for OWL DL models that are stored in memory and use the OWL rules inference engine for additional entailments
static OntModelSpec OWL_DL_MEM_TRANS_INF
          A specification for OWL DL models that are stored in memory and use the transitive inferencer for additional entailments
static OntModelSpec OWL_LITE_MEM
          A specification for OWL Lite models that are stored in memory and do no entailment additional reasoning
static OntModelSpec OWL_LITE_MEM_RDFS_INF
          A specification for OWL Lite models that are stored in memory and use the RDFS inferencer for additional entailments
static OntModelSpec OWL_LITE_MEM_RULES_INF
          A specification for OWL Lite models that are stored in memory and use the OWL rules inference engine for additional entailments
static OntModelSpec OWL_LITE_MEM_TRANS_INF
          A specification for OWL Lite models that are stored in memory and use the transitive inferencer for additional entailments
static OntModelSpec OWL_MEM
          A specification for OWL models that are stored in memory and do no additional entailment reasoning
static OntModelSpec OWL_MEM_RDFS_INF
          A specification for OWL models that are stored in memory and use the RDFS inferencer for additional entailments
static OntModelSpec OWL_MEM_RULE_INF
          A specification for OWL models that are stored in memory and use the OWL rules inference engine for additional entailments
static OntModelSpec OWL_MEM_TRANS_INF
          A specification for OWL models that are stored in memory and use the transitive inferencer for additional entailments
static OntModelSpec RDFS_MEM
          A specification for RDFS ontology models that are stored in memory and do no additional entailment reasoning
static OntModelSpec RDFS_MEM_RDFS_INF
          A specification for RDFS ontology models that are stored in memory and use the RDFS inferencer for additional entailments
static OntModelSpec RDFS_MEM_TRANS_INF
          A specification for RDFS ontology models that are stored in memory and use the transitive reasoner for entailments
 
Constructor Summary
OntModelSpec(ModelMaker maker, OntDocumentManager docMgr, ReasonerFactory rFactory, java.lang.String languageURI)
          Construct a new ontology model specification with the given specification parameters
OntModelSpec(OntModelSpec spec)
          Create one model spec as a copy of another.
 
Method Summary
static OntModelSpec getDefaultSpec(java.lang.String languageURI)
          Answer a default specification for the given language URI.
 OntDocumentManager getDocumentManager()
          Answer the document manager for this model specification.
 java.lang.String getLanguage()
          Answer the URI of the ontology lanuage to use when constructing models from this specification.
 ModelMaker getModelMaker()
          Answer the model maker that will be used to create new models to hold ontologies loaded as imports for a given ontology document
 Profile getProfile()
          Answer the language profile for this ontology specification
 Reasoner getReasoner()
          Answer the reasoner that will be used to infer additional entailed triples in the ontology model.
 ReasonerFactory getReasonerFactory()
          Answer the current reasoner factory
 void setDocumentManager(OntDocumentManager docMgr)
          Set the document manager in this specification
 void setLanguage(java.lang.String languageURI)
          Set the URI of the ontology to use for models that conform to this specification.
 void setModelMaker(ModelMaker maker)
          Set the model maker that will be used when the ontology model needs to create an additional container for an imported ontology
 void setReasoner(Reasoner reasoner)
          Set the reasoner that will be used by ontology models that conform to this specification to compute entailments.
 void setReasonerFactory(ReasonerFactory rFactory)
          Set the factory object that will be used to generate the reasoner object for this model specification.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OWL_MEM

public static final OntModelSpec OWL_MEM
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
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
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
A specification for OWL models that are stored in memory and use the OWL rules inference engine for additional entailments


OWL_DL_MEM

public static final OntModelSpec OWL_DL_MEM
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
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
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
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
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
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
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
A specification for OWL Lite models that are stored in memory and use the OWL rules inference engine for additional entailments


DAML_MEM

public static final OntModelSpec DAML_MEM
A specification for DAML models that are stored in memory and do no additional entailment reasoning


DAML_MEM_TRANS_INF

public static final OntModelSpec DAML_MEM_TRANS_INF
A specification for DAML models that are stored in memory and use the transitive reasoner for entailments


DAML_MEM_RDFS_INF

public static final OntModelSpec DAML_MEM_RDFS_INF
A specification for DAML models that are stored in memory and use the RDFS inferencer for additional entailments


RDFS_MEM

public static final OntModelSpec RDFS_MEM
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
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
A specification for RDFS ontology models that are stored in memory and use the RDFS inferencer for additional entailments

Constructor Detail

OntModelSpec

public OntModelSpec(ModelMaker maker,
                    OntDocumentManager docMgr,
                    ReasonerFactory rFactory,
                    java.lang.String languageURI)

Construct a new ontology model specification with the given specification parameters

Parameters:
maker - 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(OntModelSpec spec)

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 Detail

getDefaultSpec

public static OntModelSpec getDefaultSpec(java.lang.String languageURI)

Answer a default specification for the given language URI. This default will typically use a memory model and have minimal inferencing capabilities.

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()

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)

Set the document manager in this specification

Parameters:
docMgr - The new document manager

getModelMaker

public ModelMaker getModelMaker()

Answer the model maker that will be used to create new models to hold ontologies loaded as imports for a given ontology document

Returns:
The model maker for this ontology specification

setModelMaker

public void setModelMaker(ModelMaker maker)

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

getReasoner

public Reasoner getReasoner()

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)

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(com.hp.hpl.jena.reasoner.ReasonerFactory).

Parameters:
reasoner - The new reasoner

setReasonerFactory

public void setReasonerFactory(ReasonerFactory rFactory)

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()

Answer the current reasoner factory

Returns:
The reasoner factory, or null.

getLanguage

public java.lang.String getLanguage()

Answer the URI of the ontology lanuage 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(java.lang.String languageURI)

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()

Answer the language profile for this ontology specification

Returns:
An ontology langauge profile object


Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.