|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.rdf.model.ModelFactoryBase
com.hp.hpl.jena.rdf.model.ModelFactory
public class ModelFactory
ModelFactory provides methods for creating standard kinds of Model. (ModelFactoryBase is helper functions for it).
Field Summary | |
---|---|
static ReificationStyle |
Convenient
The convenient reification style; quadlets contribute to reified statements, but are invisible to listStatements(). |
static ReificationStyle |
Minimal
The minimal reification style; quadlets do not contribute to reified statements, and are visible to listStatements(). |
static ReificationStyle |
Standard
The standard reification style; quadlets contribute to reified statements, and are visible to listStatements(). |
Method Summary | |
---|---|
static DAMLModel |
createDAMLModel()
Answer a model for processing DAML+OIL, using the legacy Jena1 DAML API. |
static Model |
createDefaultModel()
Answer a fresh Model with the default specification and Standard reification style [reification triples contribute to ReifiedStatements, and are visible to listStatements, etc]. |
static Model |
createDefaultModel(ReificationStyle style)
Answer a new memory-based model with the given reification style |
static ModelMaker |
createFileModelMaker(java.lang.String root)
Answer a ModelMaker that constructs memory-based Models that are backed by files in the root directory. |
static ModelMaker |
createFileModelMaker(java.lang.String root,
ReificationStyle style)
Answer a ModelMaker that constructs memory-based Models that are backed by files in the root directory. |
static InfModel |
createInfModel(Reasoner reasoner,
Model model)
Build an inferred model by attaching the given RDF model to the given reasoner. |
static InfModel |
createInfModel(Reasoner reasoner,
Model schema,
Model model)
Build an inferred model by attaching the given RDF model to the given reasoner. |
static ModelMaker |
createMemModelMaker()
Answer a ModelMaker that constructs memory-based Models that do not persist past JVM termination. |
static ModelMaker |
createMemModelMaker(ReificationStyle style)
Answer a ModelMaker that constructs memory-based Models that do not persist past JVM termination, with the given reification style. |
static Model |
createModel(ModelSpec desc)
Answer a fresh Model created according to the ModelSpec argument. |
static Model |
createModelForGraph(Graph g)
Answer a model that encapsulates the given graph. |
static Model |
createModelOver(ModelSpec desc,
java.lang.String name)
Answer a fresh Model created according to the given specification and based on any underlying model with the given name. |
static ModelMaker |
createModelRDBMaker(IDBConnection c)
Answer a ModelMaker that accesses database-backed Models on the database at the other end of the connection c with the usual Standard reification style. |
static ModelMaker |
createModelRDBMaker(IDBConnection c,
ReificationStyle style)
Answer a ModelMaker that accesses database-backed Models on the database at the other end of the connection c with the given reification style. |
static Model |
createNonreifyingModel()
construct a new memory-based model that does not capture reification triples (but still handles reifyAs() and .as(ReifiedStatement). |
static OntModel |
createOntologyModel()
Answer a new ontology model which will process in-memory models of ontologies expressed the default ontology language (OWL). |
static OntModel |
createOntologyModel(OntModelSpec spec)
Answer a new ontology model constructed according to the specification, which includes a ModelMaker which will create the necessary base model. |
static OntModel |
createOntologyModel(OntModelSpec spec,
Model base)
Answer a new ontology model, constructed according to the given ontology model specification, and starting with the ontology data in the given model. |
static OntModel |
createOntologyModel(OntModelSpec spec,
ModelMaker maker,
Model base)
Answer a new ontology model which will process in-memory models of ontologies expressed the default ontology language (OWL). |
static OntModel |
createOntologyModel(java.lang.String languageURI)
Answer a new ontology model which will process in-memory models of ontologies in the given language. |
static InfModel |
createRDFSModel(Model model)
Return a Model through which all the RDFS entailments derivable from the given model are accessible. |
static InfModel |
createRDFSModel(Model schema,
Model model)
Return a Model through which all the RDFS entailments derivable from the given data and schema models are accessible. |
static IDBConnection |
createSimpleRDBConnection()
Answer a plain IDBConnection to a database, with the arguments implicitly supplied by system properties: The database URL - jena.db.url The user - jena.db.user, or fails back to "test" The password - jena.db.password, or fails back to "" The db type - jena.db.type, or guessed from the URL |
static IDBConnection |
createSimpleRDBConnection(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String dbType)
Answer a plain IDBConnection to a database with the given URL, with the given user having the given password. |
static ModelSpec |
createSpec(Model desc)
Answer a ModelSpec which can create models to the specifications in the RDF description. |
static ModelSpec |
createSpec(Resource root,
Model desc)
Answer a ModelSpec which can create models to the specifcations in the RDF description rooted at the given root. |
static Model |
createUnion(Model m1,
Model m2)
Answer a new model that is the dynamic union of two other models. |
static PrefixMapping |
getDefaultModelPrefixes()
Answer the current default model prefixes PrefixMapping object. |
static PrefixMapping |
setDefaultModelPrefixes(PrefixMapping pm)
Each Model created by ModelFactory has a default set of prefix mappings. |
static Model |
withHiddenStatements(Model m)
Answer a read-only Model with all the statements of this Model and any statements "hidden" by reification. |
Methods inherited from class com.hp.hpl.jena.rdf.model.ModelFactoryBase |
---|
extractType, guessDBDriver, guessDBPassword, guessDBType, guessDBURL, guessDBUser |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ReificationStyle Standard
public static final ReificationStyle Convenient
public static final ReificationStyle Minimal
Method Detail |
---|
public static PrefixMapping setDefaultModelPrefixes(PrefixMapping pm)
When a Model is created from an existing Graph, the prefixes of that Graph are not disturbed; only ones not present in the Graph are added.
pm
- the default prefixes to use
public static PrefixMapping getDefaultModelPrefixes()
public static ModelSpec createSpec(Model desc)
public static ModelSpec createSpec(Resource root, Model desc)
public static Model createModel(ModelSpec desc)
public static Model createModelOver(ModelSpec desc, java.lang.String name)
desc
- the ModelSpec which describes the kind of model to createname
- the name of the base model in the underlying ModelMaker
public static Model createDefaultModel()
public static Model createDefaultModel(ReificationStyle style)
public static Model withHiddenStatements(Model m)
public static Model createNonreifyingModel()
public static Model createModelForGraph(Graph g)
g
- A graph structure
public static ModelMaker createFileModelMaker(java.lang.String root)
root
- the name of the directory in which the backing files are held
public static ModelMaker createFileModelMaker(java.lang.String root, ReificationStyle style)
root
- the name of the directory in which the backing files are heldstyle
- the desired reification style
public static ModelMaker createMemModelMaker()
public static ModelMaker createMemModelMaker(ReificationStyle style)
style
- the reification style for the model
public static ModelMaker createModelRDBMaker(IDBConnection c)
c
- a connection to the database holding the models
public static ModelMaker createModelRDBMaker(IDBConnection c, ReificationStyle style)
c
- a connection to the database holding the modelsstyle
- the desired reification style
public static IDBConnection createSimpleRDBConnection(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String dbType)
url
- the URL of the databaseuser
- the user name to use to access the databasepassword
- the password to use. WARNING: open text.dbType
- the databate type: currently, "Oracle" or "MySQL".
quite
- possiblypublic static IDBConnection createSimpleRDBConnection()
The database URL - jena.db.url
The user - jena.db.user, or fails back to "test"
The password - jena.db.password, or fails back to ""
The db type - jena.db.type, or guessed from the URL
public static InfModel createRDFSModel(Model model)
model
- the Model containing both instance data and schema assertions to be inferenced overpublic static InfModel createRDFSModel(Model schema, Model model)
model
- a Model containing instance data assertionsschema
- a Model containing RDFS schema datapublic static InfModel createInfModel(Reasoner reasoner, Model model)
reasoner
- the reasoner to use to process the datamodel
- the Model containing both instance data and schema assertions to be inferenced overpublic static InfModel createInfModel(Reasoner reasoner, Model schema, Model model)
reasoner
- the reasoner to use to process the dataschema
- a Model containing RDFS schema datamodel
- a Model containing instance data assertionspublic static OntModel createOntologyModel()
Answer a new ontology model which will process in-memory models of ontologies expressed the default ontology language (OWL). The default document manager will be used to load the ontology's included documents.
Note:The default model chosen for OWL, RDFS and DAML+OIL
includes a weak reasoner that includes some entailments (such as
transitive closure on the sub-class and sub-property hierarchies). Users
who want either no inference at all, or alternatively
more complete reasoning, should use
one of the other createOntologyModel
methods that allow the
preferred OntModel specification to be stated.
OntModelSpec.getDefaultSpec(java.lang.String)
,
createOntologyModel(OntModelSpec, Model)
public static OntModel createOntologyModel(java.lang.String languageURI)
Answer a new ontology model which will process in-memory models of ontologies in the given language. The default document manager will be used to load the ontology's included documents.
languageURI
- The URI specifying the ontology language we want to process
OntModelSpec.getDefaultSpec(java.lang.String)
public static OntModel createOntologyModel(OntModelSpec spec, ModelMaker maker, Model base)
Answer a new ontology model which will process in-memory models of ontologies expressed the default ontology language (OWL). The default document manager will be used to load the ontology's included documents.
spec
- An ontology model specification that defines the language and reasoner to usemaker
- A model maker that is used to get the initial store for the ontology (unless
the base model is given),
and create addtional stores for the models in the imports closurebase
- The base model, which contains the contents of the ontology to be processed
OntModelSpec
public static OntModel createOntologyModel(OntModelSpec spec, Model base)
Answer a new ontology model, constructed according to the given ontology model specification, and starting with the ontology data in the given model.
spec
- An ontology model specification object, that will be used to construct the ontology
model with different options of ontology language, reasoner, document manager and storage modelbase
- An existing model to treat as an ontology model, or null.
OntModelSpec
public static OntModel createOntologyModel(OntModelSpec spec)
public static DAMLModel createDAMLModel()
Answer a model for processing DAML+OIL, using the legacy Jena1 DAML API. Users are encouraged
to switch from the DAML-specific API to the new generic ontology API
(see createOntologyModel(OntModelSpec, Model)
). The continuation of the DAML-specific
API in Jena is not assured beyond Jena version 2.
public static Model createUnion(Model m1, Model m2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |