Class GraphFactory

java.lang.Object
org.apache.jena.sparql.graph.GraphFactory

public class GraphFactory extends Object
Ways to make graphs and models
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.graph.Graph
    Create a graph.
    static org.apache.jena.graph.Graph
    Create a graph that is a Jena memory graph.
    static org.apache.jena.graph.Graph
    Deprecated, for removal: This API element is subject to removal in a future version.
    static GraphTxn
    Create an in-memory, thread-safe, transactional graph.
    static org.apache.jena.graph.Graph
    Return an immutable, transactional, empty graph.
    static org.apache.jena.rdf.model.Model
    Create a model over a default graph (system-wide for default graph type)
    static org.apache.jena.rdf.model.Model
    Deprecated, for removal: This API element is subject to removal in a future version.
    static void
    setDftGraphSameTerm(boolean value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Do not use.
    static org.apache.jena.graph.Graph
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GraphFactory

      public GraphFactory()
  • Method Details

    • setDftGraphSameTerm

      @Deprecated(forRemoval=true) public static void setDftGraphSameTerm(boolean value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use.
      Set the default mode for in-memory graphs : same term (true) or same value (false).

      This is initially set with system property "jena:graphSameTerm" with the system default is same value (Jena4).

      This affects createDefaultGraph().

    • createGraphMem

      public static org.apache.jena.graph.Graph createGraphMem()
      Create a graph that is a Jena memory graph. The created graph is not thread safe. Inappropriate use of graph iterators and streams may cause ConcurrentModificationException.
      See Also:
    • createTxnGraph

      public static GraphTxn createTxnGraph()
      Create an in-memory, thread-safe, transactional graph.

      This fully supports transactions, including abort to roll-back changes. It provides "autocommit" if operations are performed outside a transaction. The implementation adds a begin/commit around each add or delete so overheads can accumulate).

    • emptyGraph

      public static org.apache.jena.graph.Graph emptyGraph()
      Return an immutable, transactional, empty graph.

      This fully supports transactions.

    • createDefaultGraph

      public static org.apache.jena.graph.Graph createDefaultGraph()
      Create a graph.

      From Jena5, this is "same-term"

    • createJenaDefaultGraph

      @Deprecated(forRemoval=true) public static org.apache.jena.graph.Graph createJenaDefaultGraph()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a graph - the Jena default graph.
    • sinkGraph

      public static org.apache.jena.graph.Graph sinkGraph()
    • makeJenaDefaultModel

      @Deprecated(forRemoval=true) public static org.apache.jena.rdf.model.Model makeJenaDefaultModel()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • makeDefaultModel

      public static org.apache.jena.rdf.model.Model makeDefaultModel()
      Create a model over a default graph (system-wide for default graph type)