Class DatasetFactory
- java.lang.Object
-
- org.apache.jena.query.DatasetFactory
-
public class DatasetFactory extends java.lang.ObjectMakesDatasets in various ways.
-
-
Constructor Summary
Constructors Constructor Description DatasetFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Datasetassemble(java.lang.String filename)Assemble a dataset from the model in a filestatic Datasetassemble(java.lang.String filename, java.lang.String resourceURI)Assemble a dataset from the model in a filestatic Datasetassemble(Model model)Assemble a dataset from the modelstatic Datasetassemble(Resource resource)Assemble a dataset from a resourcestatic Datasetcreate()Create an in-memoryDataset.static Datasetcreate(java.lang.String uri)static Datasetcreate(java.lang.String uri, java.util.List<java.lang.String> namedSourceList)Create a dataset container based on two list of URIs.static Datasetcreate(java.lang.String uri, java.util.List<java.lang.String> namedSourceList, java.lang.String baseURI)Create a named graph container based on two list of URIs.static Datasetcreate(java.util.List<java.lang.String> uriList)static Datasetcreate(java.util.List<java.lang.String> uriList, java.util.List<java.lang.String> namedSourceList)Create a dataset based on two list of URIs.static Datasetcreate(java.util.List<java.lang.String> uriList, java.util.List<java.lang.String> namedSourceList, java.lang.String baseURI)Create a named graph container based on two list of URIs.static Datasetcreate(Model model)Create a dataset, starting with the model argument as the default graph of the dataset.static DatasetcreateGeneral()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 DatasetcreateNamed(java.util.List<java.lang.String> namedSourceList)static DatasetcreateTxnMem()Create an in-memory.static Datasetwrap(Model model)Wrap aModelto make a dataset; the model is the default graph of the RDF Dataset.static Datasetwrap(DatasetGraph dataset)Wrap aDatasetGraphto make a dataset
-
-
-
Method Detail
-
create
public static Dataset 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()
-
createTxnMem
public static Dataset 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
public static 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 viaDataset.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:
createTxnMem()
-
create
public static Dataset create(Model model)
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
public static Dataset wrap(DatasetGraph dataset)
Wrap aDatasetGraphto make a dataset- Parameters:
dataset- DatasetGraph- Returns:
- Dataset
-
wrap
public static Dataset wrap(Model model)
Wrap aModelto 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
-
create
public static Dataset create(java.util.List<java.lang.String> uriList)
- 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
public static Dataset create(java.lang.String uri)
- Parameters:
uri- URIs merged to form the default dataset- Returns:
- a dataset with a default graph and no named graphs
-
createNamed
public static Dataset createNamed(java.util.List<java.lang.String> namedSourceList)
- Parameters:
namedSourceList-- Returns:
- a named graph container of graphs based on a list of URIs.
-
create
public static Dataset create(java.util.List<java.lang.String> uriList, java.util.List<java.lang.String> namedSourceList)
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
public static Dataset create(java.lang.String uri, java.util.List<java.lang.String> namedSourceList)
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
public static Dataset create(java.lang.String uri, java.util.List<java.lang.String> namedSourceList, java.lang.String baseURI)
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
public static Dataset create(java.util.List<java.lang.String> uriList, java.util.List<java.lang.String> namedSourceList, java.lang.String baseURI)
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
public static Dataset assemble(java.lang.String filename)
Assemble a dataset from the model in a file- Parameters:
filename- The filename- Returns:
- Dataset
-
assemble
public static Dataset assemble(java.lang.String filename, java.lang.String resourceURI)
Assemble a dataset from the model in a file- Parameters:
filename- The filenameresourceURI- URI for the dataset to assembler- Returns:
- Dataset
-
assemble
public static Dataset assemble(Model model)
Assemble a dataset from the model- Parameters:
model-- Returns:
- Dataset
-
-