Class DatasetGraphFactory


public class DatasetGraphFactory extends Object
  • Field Details

  • Constructor Details

    • DatasetGraphFactory

      public DatasetGraphFactory()
  • Method Details

    • create

      public static DatasetGraph create()
      Create an in-memory Dataset.

      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 transactional DatasetGraph.

      See Also:
    • createTxnMem

      public static DatasetGraph createTxnMem()
      Create an in-memory, transactional Dataset.

      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).

      a transactional, in-memory, modifiable DatasetGraph
    • createGeneral

      public static DatasetGraph createGeneral()
      Create a general-purpose Dataset.
      Any graphs needed are in-memory unless explicitly added with Dataset.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).

      a general-purpose Dataset
      See Also:
    • cloneStructure

      public static DatasetGraph cloneStructure(DatasetGraph dsg)
      Clone the structure of a DatasetGraph.
    • create

      public static DatasetGraph create(Graph dftGraph)
      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.
    • empty

      public static DatasetGraph empty()
      An always empty DatasetGraph. It has one graph (the default graph) with zero triples. No changes allowed - this is not a sink.