Class SimpleGraphMaker

java.lang.Object
org.apache.jena.ontology.models.BaseGraphMaker
org.apache.jena.ontology.models.SimpleGraphMaker
All Implemented Interfaces:
GraphMaker

public class SimpleGraphMaker extends BaseGraphMaker
A SimpleGraphFactory produces memory-based graphs and records them in a local map.
  • Constructor Details

    • SimpleGraphMaker

      public SimpleGraphMaker()
      Initialise a SimpleGraphMaker with reification style Minimal
  • Method Details

    • create

      public Graph create()
    • createGraph

      public Graph createGraph(String name, boolean strict)
      Create a graph and record it with the given name in the local map.
      Parameters:
      name - the name to give to the new graph
      strict - true to cause existing bindings to throw an exception
    • openGraph

      public Graph openGraph(String name, boolean strict)
      Open (aka find) a graph with the given name in the local map.
      Parameters:
      name - the name of the graph to find and return
      strict - false to create a new one if one doesn't already exist
    • openGraph

      public Graph openGraph()
      Description copied from interface: GraphMaker
      Answer the default graph of this GraphMaker, if it has one. If not, throw an exception.
      Specified by:
      openGraph in interface GraphMaker
      Overrides:
      openGraph in class BaseGraphMaker
    • removeGraph

      public void removeGraph(String name)
      Remove the mapping from name to any graph from the local map.
      Parameters:
      name - the name to disassociate
    • hasGraph

      public boolean hasGraph(String name)
      Return true iff we have a graph with the given name
      Parameters:
      name - the name of the graph to look for
      Returns:
      true iff there's a graph with that name
    • close

      public void close()
      Close this factory - we choose to do nothing.
    • listGraphs

      public ExtendedIterator<String> listGraphs()
      Description copied from interface: GraphMaker
      Answer an [extended] iterator where each element is the name of a graph in the maker, and the complete sequence exhausts the set of names. No particular order is expected from the list.
      Returns:
      an extended iterator over the names of graphs known to this Maker.