Class DatasetGraphFactory
- java.lang.Object
-
- org.apache.jena.sparql.core.DatasetGraphFactory
-
public class DatasetGraphFactory extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDatasetGraphFactory.GraphMakerInterface for making graphs when a dataset needs to add a new graph.
-
Field Summary
Fields Modifier and Type Field Description static DatasetGraphFactory.GraphMakergraphMakerMemA graph maker that creates unnamed Jena default graphsstatic DatasetGraphFactory.GraphMakergraphMakerNamedGraphMemA graph maker that createsNamedGraphs around a Jena default graphsstatic DatasetGraphFactory.GraphMakergraphMakerNullA graph maker that doesn't make graphs.
-
Constructor Summary
Constructors Constructor Description DatasetGraphFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DatasetGraphcloneStructure(DatasetGraph dsg)Clone the structure of aDatasetGraph.static DatasetGraphcreate()Create an in-memoryDataset.static DatasetGraphcreate(Graph graph)Create a DatasetGraph starting with a single graph.static DatasetGraphcreateGeneral()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 DatasetGraphcreateTxnMem()Create an in-memory, transactionalDataset.static DatasetGraphwrap(Graph graph)Create a DatasetGraph which only ever has a single default graph.
-
-
-
Field Detail
-
graphMakerNull
public static DatasetGraphFactory.GraphMaker graphMakerNull
A graph maker that doesn't make graphs.
-
graphMakerMem
public static DatasetGraphFactory.GraphMaker graphMakerMem
A graph maker that creates unnamed Jena default graphs
-
graphMakerNamedGraphMem
public static DatasetGraphFactory.GraphMaker graphMakerNamedGraphMem
A graph maker that createsNamedGraphs around a Jena default graphs
-
-
Method Detail
-
create
public static DatasetGraph 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 provides "best effort" transactions; it only provides MRSW locking. Use
createTxnMem()for a proper in-memory transactionalDatasetGraph.- See Also:
createTxnMem()
-
createTxnMem
public static DatasetGraph 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 DatasetGraph
-
createGeneral
public static DatasetGraph 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()
-
cloneStructure
public static DatasetGraph cloneStructure(DatasetGraph dsg)
Clone the structure of aDatasetGraph.
-
create
public static DatasetGraph create(Graph graph)
Create a DatasetGraph starting with a single graph. New graphs must be explicitly added.
-
wrap
public static DatasetGraph wrap(Graph graph)
Create a DatasetGraph which only ever has a single default graph.
-
-