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
.
This repository does not permit modification of underlying storage (source
).-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all graphs.boolean
org.apache.jena.graph.Graph
Gets Graph by ID.Provides access to the underlying storage.Stream<org.apache.jena.graph.Graph>
graphs()
Lists all graphs.ids()
org.apache.jena.graph.Graph
Associates the specified graph with the specified ID, returning the previous association ornull
if there was no association.org.apache.jena.graph.Graph
Removes graph.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:GraphRepository
Gets Graph by ID.- Specified by:
get
in interfaceGraphRepository
- Parameters:
id
-String
Graph's identifier, usually it is ontology ID or source URL or file path- Returns:
Graph
-
put
Description copied from interface:GraphRepository
Associates the specified graph with the specified ID, returning the previous association ornull
if there was no association.- Specified by:
put
in interfaceGraphRepository
- Parameters:
id
-String
Graph's identifiergraph
-Graph
- Returns:
Graph
ornull
-
remove
Description copied from interface:GraphRepository
Removes graph.- Specified by:
remove
in interfaceGraphRepository
- Parameters:
id
-String
Graph's identifier- Returns:
Graph
-
clear
public void clear()Description copied from interface:GraphRepository
Removes all graphs.- Specified by:
clear
in interfaceGraphRepository
-
ids
- Specified by:
ids
in interfaceGraphRepository
- Returns:
Stream
of Graph's identifiers
-
graphs
Description copied from interface:GraphRepository
Lists all graphs.- Specified by:
graphs
in interfaceGraphRepository
- Returns:
Stream
ofGraph
s
-
contains
- Specified by:
contains
in interfaceGraphRepository
- Parameters:
id
-String
Graph's identifier- Returns:
- boolean
-