public class ModelFactory extends ModelFactoryBase
Modifier and Type | Method and Description |
---|---|
static Model |
assembleModelFrom(Model singleRoot)
Answer a Model constructed from the single resource in
singleRoot of type ja:Model . |
static Model |
assembleModelFrom(Resource root)
Answer a Model as described the Assembler specification rooted
at the Resource
root in its Model. |
static Model |
createDefaultModel()
Answer a fresh Model with the default specification.
|
static InfModel |
createInfModel(InfGraph g)
Build an inference model from an InfGraph.
|
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 Model |
createModelForGraph(Graph g)
Answer a model that encapsulates the given graph.
|
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(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 Model |
createUnion(Model m1,
Model m2)
Answer a new model that is the dynamic union of two other models.
|
static Set<Resource> |
findAssemblerRoots(Model m)
Answer a Set of resources present in
m that are
explicitly or implicitly of type ja:Object, ie, suitable as roots for
assemblerModelFrom . |
static PrefixMapping |
getDefaultModelPrefixes()
Deprecated.
This feature wil be removed from ModelFactory
|
static PrefixMapping |
setDefaultModelPrefixes(PrefixMapping pm)
Deprecated.
This feature wil be removed from ModelFactory
|
@Deprecated 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@Deprecated public static PrefixMapping getDefaultModelPrefixes()
public static Model assembleModelFrom(Model singleRoot)
singleRoot
of type ja:Model
.
See the Assembler howto (doc/assembler/assembler-howto.html)
for documentation of Assembler descriptions. See also
findAssemblerRoots
to find the set of possible
roots in a description, and assemblerModelFrom(Resource)
for assembling a model from its single description.public static Set<Resource> findAssemblerRoots(Model m)
m
that are
explicitly or implicitly of type ja:Object, ie, suitable as roots for
assemblerModelFrom
. Note that the resource
objects returned need not have m
as
their getModel()
- they may be members of an
extended constructed model.public static Model assembleModelFrom(Resource root)
root
in its Model. Resource
must be of rdf:type ja:Object
, where ja
is the prefix of Jena Assembler objects.public static Model createDefaultModel()
public static Model createModelForGraph(Graph g)
g
- A graph structurepublic static ModelMaker createMemModelMaker()
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 over,
any statements added to the InfModel will be added to this underlying data model.public 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 assertions, any statements added to the InfModel
will be added to this underlying data model.public static InfModel createInfModel(InfGraph g)
g
- and inference graphpublic 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 and RDFS
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(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 processOntModelSpec.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 processedOntModelSpec
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 Model createUnion(Model m1, Model m2)
m1
or m2
will be reflected in the result model, and
vice versa: specifically, additions to and removals from the union
will be implemented as operations on m1
only. See also the behaviour of OntModel
and the MultiUnion class.
createUnion
only creates two-element unions.
Licenced under the Apache License, Version 2.0