Module org.apache.jena.ontapi
Class PersistentGraphRepository
java.lang.Object
org.apache.jena.ontapi.impl.repositories.PersistentGraphRepository
- All Implemented Interfaces:
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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all graphs.booleanorg.apache.jena.graph.GraphGets Graph by ID.Provides access to the underlying storage.Stream<org.apache.jena.graph.Graph>graphs()Lists all graphs.ids()org.apache.jena.graph.GraphAssociates the specified graph with the specified ID, returning the previous association ornullif there was no association.org.apache.jena.graph.GraphRemoves graph.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.ontapi.GraphRepository
count
-
Constructor Details
-
PersistentGraphRepository
-
-
Method Details
-
getGraphMaker
Provides access to the underlying storage.- Returns:
GraphMaker
-
get
Description copied from interface:GraphRepositoryGets Graph by ID.- Specified by:
getin interfaceGraphRepository- Parameters:
id-StringGraph's identifier, usually it is ontology ID or source URL or file path- Returns:
Graph
-
put
Description copied from interface:GraphRepositoryAssociates the specified graph with the specified ID, returning the previous association ornullif there was no association.- Specified by:
putin interfaceGraphRepository- Parameters:
id-StringGraph's identifiergraph-Graph- Returns:
Graphornull
-
remove
Description copied from interface:GraphRepositoryRemoves graph.- Specified by:
removein interfaceGraphRepository- Parameters:
id-StringGraph's identifier- Returns:
Graphassociated with the id, or null if there was no graph for the given id
-
clear
public void clear()Description copied from interface:GraphRepositoryRemoves all graphs.- Specified by:
clearin interfaceGraphRepository
-
ids
- Specified by:
idsin interfaceGraphRepository- Returns:
Streamof Graph's identifiers
-
graphs
Description copied from interface:GraphRepositoryLists all graphs.- Specified by:
graphsin interfaceGraphRepository- Returns:
StreamofGraphs
-
contains
- Specified by:
containsin interfaceGraphRepository- Parameters:
id-StringGraph's identifier- Returns:
- boolean
-