Interface GraphMaker


public interface GraphMaker
A factory for providing instances of named graphs with appropriate storage models. It represents a directory, or a database, or a mapping: names map to graphs for the lifetime of the GraphMaker. Names can be "arbitrary" character sequences.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the factory - no more requests will be executed, and any cleanup can be performed.
    org.apache.jena.graph.Graph
    Create a new graph associated with the given name.
    default org.apache.jena.graph.Graph
    Returns the existing graph or null if it does not exist.
    default Stream<org.apache.jena.graph.Graph>
    Lists all graphs.
    boolean
    Returns true iff the factory has a graph with the given name
    Answers a Stream where each element is the name of a graph in the maker, and the complete sequence exhausts the set of names.
    org.apache.jena.graph.Graph
    Finds an existing graph that this factory knows about under the given name.
    void
    Removes the association between the name and the graph.
  • Method Details

    • createGraph

      org.apache.jena.graph.Graph createGraph(String name) throws org.apache.jena.shared.AlreadyExistsException
      Create a new graph associated with the given name. If there is no such association, create one and return it. Otherwise, throw an AlreadyExistsException.
      Parameters:
      name - graph identifier, not null
      Returns:
      Graph, not null
      Throws:
      org.apache.jena.shared.AlreadyExistsException - if graph already exists in the underlying storage
    • openGraph

      org.apache.jena.graph.Graph openGraph(String name) throws org.apache.jena.shared.DoesNotExistException
      Finds an existing graph that this factory knows about under the given name. If such a graph exists, return it. Otherwise, throw a DoesNotExistException.
      Parameters:
      name - graph identifier, not null
      Returns:
      Graph, not null
      Throws:
      org.apache.jena.shared.DoesNotExistException - if there is no such graph in the underlying storage
    • removeGraph

      void removeGraph(String name) throws org.apache.jena.shared.DoesNotExistException
      Removes the association between the name and the graph. The method createGraph(String) will now be able to create a graph with that name, and openGraph(String) will no longer be able to find it. The graph itself is not touched.
      Parameters:
      name - graph identifier, not null
      Throws:
      org.apache.jena.shared.DoesNotExistException - if there is no such graph in the underlying storage
    • hasGraph

      boolean hasGraph(String name)
      Returns true iff the factory has a graph with the given name
      Parameters:
      name - graph identifier, not null
      Returns:
      boolean
    • names

      Stream<String> names()
      Answers a Stream 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:
      Stream of graph's identifiers
    • close

      void close()
      Closes the factory - no more requests will be executed, and any cleanup can be performed.
    • getGraphOrNull

      default org.apache.jena.graph.Graph getGraphOrNull(String name)
      Returns the existing graph or null if it does not exist.
      Parameters:
      name - graph identifier, not null
      Returns:
      Graph, or null
    • graphs

      default Stream<org.apache.jena.graph.Graph> graphs()
      Lists all graphs.
      Returns:
      Stream of Graphs