Class PersistentGraphRepository

java.lang.Object
org.apache.jena.ontapi.impl.repositories.PersistentGraphRepository
All Implemented Interfaces:
GraphRepository

public class PersistentGraphRepository extends Object implements GraphRepository
A GraphRepository implementation that supports persistence via GraphMaker. Note that this repository does not permit modification of underlying storage (source). Removing graph from the source is not reflected by this repository, so it will still contain reference to the graph, even the graph is no longer available via GraphMaker. This repository does not permit modification of underlying storage (source).
  • Constructor Details

    • PersistentGraphRepository

      public PersistentGraphRepository(GraphMaker source)
  • Method Details

    • getGraphMaker

      public GraphMaker getGraphMaker()
      Provides access to the underlying storage.
      Returns:
      GraphMaker
    • get

      public org.apache.jena.graph.Graph get(String id)
      Description copied from interface: GraphRepository
      Gets Graph by ID.
      Specified by:
      get in interface GraphRepository
      Parameters:
      id - String Graph's identifier, usually it is ontology ID or source URL or file path
      Returns:
      Graph
    • put

      public org.apache.jena.graph.Graph put(String id, org.apache.jena.graph.Graph graph)
      Description copied from interface: GraphRepository
      Associates the specified graph with the specified ID, returning the previous association or null if there was no association.
      Specified by:
      put in interface GraphRepository
      Parameters:
      id - String Graph's identifier
      graph - Graph
      Returns:
      Graph or null
    • remove

      public org.apache.jena.graph.Graph remove(String id)
      Description copied from interface: GraphRepository
      Removes graph.
      Specified by:
      remove in interface GraphRepository
      Parameters:
      id - String Graph's identifier
      Returns:
      Graph
    • clear

      public void clear()
      Description copied from interface: GraphRepository
      Removes all graphs.
      Specified by:
      clear in interface GraphRepository
    • ids

      public Stream<String> ids()
      Specified by:
      ids in interface GraphRepository
      Returns:
      Stream of Graph's identifiers
    • graphs

      public Stream<org.apache.jena.graph.Graph> graphs()
      Description copied from interface: GraphRepository
      Lists all graphs.
      Specified by:
      graphs in interface GraphRepository
      Returns:
      Stream of Graphs
    • contains

      public boolean contains(String id)
      Specified by:
      contains in interface GraphRepository
      Parameters:
      id - String Graph's identifier
      Returns:
      boolean