- All Known Implementing Classes:
DocumentGraphRepository,PersistentGraphRepository
public interface GraphRepository
Graph repository.
Each
Graph is associated with ID.
For OWL Ontology Graphs, Graph ID can be OntID.getImportsIRI().-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all graphs.default booleandefault longcount()static DocumentGraphRepositorycreateGraphDocumentRepository(Supplier<org.apache.jena.graph.Graph> factory) A factory method to createsGraphRepositoryinstance that loads graphs on demand from the given location.static DocumentGraphRepositoryA factory method to createGraphRepositoryinstance that loads graphs on demand from the given location.static PersistentGraphRepositoryA factory method for creating persistentGraphRepository; persistence is ensured by themaker.org.apache.jena.graph.GraphGets Graph by ID.default 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.
-
Method Details
-
createGraphDocumentRepositoryMem
A factory method to createGraphRepositoryinstance that loads graphs on demand from the given location. The location is specified by the methodDocumentGraphRepository.addMapping(String, String). If there is no mapping specified, graph id will be used as a source.- Returns:
DocumentGraphRepository
-
createGraphDocumentRepository
static DocumentGraphRepository createGraphDocumentRepository(Supplier<org.apache.jena.graph.Graph> factory) A factory method to createsGraphRepositoryinstance that loads graphs on demand from the given location. The location is specified by the methodDocumentGraphRepository.addMapping(String, String). If there is no mapping specified, graph id will be used as a source URL or file path.- Parameters:
factory-Supplierto produce newGraph, notnull- Returns:
DocumentGraphRepository
-
createPersistentGraphRepository
A factory method for creating persistentGraphRepository; persistence is ensured by themaker.- Parameters:
maker-GraphMakera factory to create/fetch/removeGraphs- Returns:
PersistentGraphRepository
-
get
Gets Graph by ID.- Parameters:
id-StringGraph's identifier, usually it is ontology ID or source URL or file path- Returns:
Graph
-
ids
- Returns:
Streamof Graph's identifiers
-
put
Associates the specified graph with the specified ID, returning the previous association ornullif there was no association.- Parameters:
id-StringGraph's identifiergraph-Graph- Returns:
Graphornull
-
remove
Removes graph.- Parameters:
id-StringGraph's identifier- Returns:
Graphassociated with the id, or null if there was no graph for the given id
-
clear
void clear()Removes all graphs. -
count
default long count()- Returns:
- number of graphs
-
graphs
Lists all graphs.- Returns:
StreamofGraphs
-
contains
- Parameters:
id-StringGraph's identifier- Returns:
- boolean
-