Dataset
s in various ways.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Dataset
Assemble a dataset from the model in a filestatic Dataset
Assemble a dataset from the model in a filestatic Dataset
assemble
(org.apache.jena.rdf.model.Model model) Assemble a dataset from the model.static Dataset
Assemble a dataset from a specific resource in a model.static Dataset
assemble
(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource resource) Assemble a dataset from a specific resource in a model.static Dataset
assemble
(org.apache.jena.rdf.model.Resource resource) Assemble a dataset from a resourcestatic Dataset
create()
Create an in-memoryDataset
.static Dataset
static Dataset
Create a dataset container based on two list of URIs.static Dataset
Create a named graph container based on two list of URIs.static Dataset
static Dataset
Create a dataset based on two list of URIs.static Dataset
Create a named graph container based on two list of URIs.static Dataset
create
(org.apache.jena.rdf.model.Model model) Create a dataset, starting with the model argument as the default graph of the dataset.static Dataset
Create a general-purposeDataset
.
Any graphs needed are in-memory unless explicitly added withDataset.addNamedModel(java.lang.String, org.apache.jena.rdf.model.Model)
.static Dataset
createNamed
(List<String> namedSourceList) static Dataset
Create an in-memory. transactionalDataset
.static Dataset
empty()
An always emptyDataset
.static Dataset
wrap
(org.apache.jena.rdf.model.Model model) Wrap aModel
to make a dataset; the model is the default graph of the RDF Dataset.static Dataset
wrap
(DatasetGraph dataset) Wrap aDatasetGraph
to make a dataset
-
Constructor Details
-
DatasetFactory
public DatasetFactory()
-
-
Method Details
-
create
Create an in-memoryDataset
.See also
createTxnMem()
for a transactional dataset.This implementation copies models when
Dataset.addNamedModel(String, Model)
is called.This implementation does not support serialized transactions (it only provides MRSW locking).
- See Also:
-
createTxnMem
Create an in-memory. transactionalDataset
.This fully supports transactions, including abort to roll-back changes. It provides "autocommit" if operations are performed outside a transaction but with a performance impact (the implementation adds a begin/commit around each add or delete so overheads can accumulate).
- Returns:
- a transactional, in-memory, modifiable Dataset
-
createGeneral
Create a general-purposeDataset
.
Any graphs needed are in-memory unless explicitly added withDataset.addNamedModel(java.lang.String, org.apache.jena.rdf.model.Model)
.This dataset type can contain graphs from any source when added via
Dataset.addNamedModel(java.lang.String, org.apache.jena.rdf.model.Model)
. These are held as links to the supplied graph and not copied.This dataset does not support the graph indexing feature of jena-text.
This dataset does not support serialized transactions (it only provides MRSW locking).
- Returns:
- a general-purpose Dataset
- See Also:
-
create
Create a dataset, starting with the model argument as the default graph of the dataset. Named graphs can be added.Use
wrap(Model)
to put dataset functionality around a single model when named graphs will not be added.- Parameters:
model
- The model for the default graph- Returns:
- a dataset with the given model as the default graph
-
wrap
Wrap aDatasetGraph
to make a dataset- Parameters:
dataset
- DatasetGraph- Returns:
- Dataset
-
wrap
Wrap aModel
to make a dataset; the model is the default graph of the RDF Dataset. This dataset can not have additional models added to it, including indirectly through SPARQL Update adding new graphs.- Parameters:
model
-- Returns:
- Dataset
-
empty
An always emptyDataset
. It has one graph (the default graph) with zero triples. No changes allowed - this is not a sink. -
create
- Parameters:
uriList
- URIs merged to form the default dataset- Returns:
- a dataset based on a list of URIs : these are merged into the default graph of the dataset.
-
create
- Parameters:
uri
- URIs merged to form the default dataset- Returns:
- a dataset with a default graph and no named graphs
-
createNamed
- Parameters:
namedSourceList
-- Returns:
- a named graph container of graphs based on a list of URIs.
-
create
Create a dataset based on two list of URIs. The first lists is used to create the background (unnamed graph) by merging, the second is used to create the collection of named graphs. (Jena calls graphs "Models" and triples "Statements")- Parameters:
uriList
- graphs to be loaded into the unnamed, default graphnamedSourceList
- graphs to be attached as named graphs- Returns:
- Dataset
-
create
Create a dataset container based on two list of URIs. The first is used to create the background (unnamed graph), the second is used to create the collection of named graphs. (Jena calls graphs "Models" and triples "Statements")- Parameters:
uri
- graph to be loaded into the unnamed, default graphnamedSourceList
- graphs to be attached as named graphs- Returns:
- Dataset
-
create
Create a named graph container based on two list of URIs. The first is used to create the background (unnamed graph), the second is used to create the collection of named graphs. (Jena calls graphs "Models" and triples "Statements")- Parameters:
uri
- graph to be loaded into the unnamed, default graphnamedSourceList
- graphs to be attached as named graphsbaseURI
- baseURI for relative URI expansion- Returns:
- Dataset
-
create
Create a named graph container based on two list of URIs. The first is used to create the background (unnamed graph), the second is used to create the collection of named graphs. (Jena calls graphs "Models" and triples "Statements")- Parameters:
uriList
- graphs to be loaded into the unnamed, default graphnamedSourceList
- graphs to be attached as named graphsbaseURI
- baseURI for relative URI expansion- Returns:
- Dataset
-
assemble
Assemble a dataset from the model in a file- Parameters:
filename
- The filename- Returns:
- Dataset
-
assemble
Assemble a dataset from the model in a file- Parameters:
filename
- The filenameresourceURI
- URI for the dataset to assembler- Returns:
- Dataset
-
assemble
Assemble a dataset from a specific resource in a model.- Parameters:
model
- The ModelresourceURI
- The URI for the the dataset in the assembler model.- Returns:
- Dataset
-
assemble
public static Dataset assemble(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource resource) Assemble a dataset from a specific resource in a model.- Parameters:
model
- The Modelresource
- The resource for the the dataset in the assembler model.- Returns:
- Dataset
-
assemble
Assemble a dataset from the model. There must be only one dataset description in the model; this function looks for therdf:type
. Useassemble(Model, String)
orassemble(Model, Resource)
to select a particular resource in the model.- Parameters:
model
-- Returns:
- Dataset
-
assemble
Assemble a dataset from a resource- Parameters:
resource
- The resource for the dataset- Returns:
- Dataset
-