public class SimpleTcProvider extends Object implements WeightedTcProvider
Constructor and Description |
---|
SimpleTcProvider() |
Modifier and Type | Method and Description |
---|---|
Graph |
createGraph(IRI name)
Creates an initially empty
Graph with a specified name |
ImmutableGraph |
createImmutableGraph(IRI name,
Graph triples)
Creates a
ImmutableGraph with a specified name |
void |
deleteGraph(IRI name)
Deletes the
ImmutableGraph or Graph of a specified name. |
Graph |
getGraph(IRI name)
This method is used to get a
Graph indifferently
whether it's a ImmutableGraph or not. |
ImmutableGraph |
getImmutableGraph(IRI name)
Get a
ImmutableGraph by its name |
Graph |
getMGraph(IRI name)
Get an
Graph taht is not ImmutableGrah . |
Set<IRI> |
getNames(ImmutableGraph graph)
get a set of the names of a
ImmutableGraph |
int |
getWeight()
Get the weight of this provider.
|
Set<IRI> |
listGraphs()
Lists the name of the
Graph s available through this
TcProvider indifferently whether they are mutables or
immutables, implementations may take into account the security context and
omit Graph s for which access is not allowed. |
Set<IRI> |
listImmutableGraphs()
Lists the name of the
ImmutableGraph s available through this
TcProvider , implementations may take into account the
security context and omit ImmutableGraph s for which access is not
allowed. |
Set<IRI> |
listMGraphs()
Lists the name of the
Graph s available through this
TcProvider that are not ImmutableGraph , implementations may take into account the
security context and omit Graph s for which access is not
allowed. |
public ImmutableGraph createImmutableGraph(IRI name, Graph triples) throws EntityAlreadyExistsException
TcProvider
ImmutableGraph
with a specified namecreateImmutableGraph
in interface TcProvider
name
- the name of the ImmutableGraph
to be createdtriples
- the triples of the new ImmutableGraph
ImmutableGraph
EntityAlreadyExistsException
- if a ImmutableGraph with the specified name
already existspublic Graph createGraph(IRI name) throws EntityAlreadyExistsException
TcProvider
Graph
with a specified namecreateGraph
in interface TcProvider
name
- names the new Graph
Graph
EntityAlreadyExistsException
- if an Graph with the specified name
already existspublic void deleteGraph(IRI name) throws NoSuchEntityException, EntityUndeletableException
TcProvider
ImmutableGraph
or Graph
of a specified name.
If name
references a ImmutableGraph and the ImmutableGraph has other names, it
will still be available with those other names.deleteGraph
in interface TcProvider
name
- the entity to be removedNoSuchEntityException
- if name
doesn't refer to a
ImmutableGraph
or an Graph
.EntityUndeletableException
- if the specified ImmutableGraph is undeletablepublic ImmutableGraph getImmutableGraph(IRI name) throws NoSuchEntityException
TcProvider
ImmutableGraph
by its namegetImmutableGraph
in interface TcProvider
name
- the name of the ImmutableGraphImmutableGraph
with the specified nameNoSuchEntityException
- if there is no ImmutableGraph
with the specified namepublic Graph getMGraph(IRI name) throws NoSuchEntityException
TcProvider
Graph
taht is not ImmutableGrah
. The instances
returned in different invocations are equals
.getMGraph
in interface TcProvider
name
- the name of the Graph
Graph
with the specified nameNoSuchEntityException
- if there is no Graph
with the specified namepublic Set<IRI> getNames(ImmutableGraph graph)
TcProvider
ImmutableGraph
getNames
in interface TcProvider
ImmutableGraph
, the set is empty if
ImmutableGraph
is unknownpublic Graph getGraph(IRI name) throws NoSuchEntityException
TcProvider
Graph
indifferently
whether it's a ImmutableGraph or not. If the name
names an
Graph
the result is the same as when invoking
getMGraph
with that argument, analogously for
ImmutableGraph
S the method returns an instance equals to what
getImmutableGraph
would return.getGraph
in interface TcProvider
name
- the name of the ImmutableGraph
or Graph
ImmutableGraph
or Graph
NoSuchEntityException
- if there is no ImmutableGraph
or Graph
with the specified namepublic int getWeight()
WeightedTcProvider
TcManager
will prioritize
TcProvider
s with greater weight.getWeight
in interface WeightedTcProvider
public Set<IRI> listImmutableGraphs()
TcProvider
ImmutableGraph
s available through this
TcProvider
, implementations may take into account the
security context and omit ImmutableGraph
s for which access is not
allowed.listImmutableGraphs
in interface TcProvider
ImmutableGraph
spublic Set<IRI> listMGraphs()
TcProvider
Graph
s available through this
TcProvider
that are not ImmutableGraph
, implementations may take into account the
security context and omit Graph
s for which access is not
allowed.listMGraphs
in interface TcProvider
Graph
spublic Set<IRI> listGraphs()
TcProvider
Graph
s available through this
TcProvider
indifferently whether they are mutables or
immutables, implementations may take into account the security context and
omit Graph
s for which access is not allowed.listGraphs
in interface TcProvider
Graph
sCopyright © 2015–2022 The Apache Software Foundation. All rights reserved.