org.apache.clerezza.rdf.core.access
Interface TcProvider

All Known Subinterfaces:
WeightedTcProvider
All Known Implementing Classes:
TcManager, TcProviderMultiplexer

public interface TcProvider

A TC (TripleCollection) Provider allows access to and optionally creation of named Graphs and MGraphs (mutable graphs)

Author:
reto

Method Summary
 Graph createGraph(UriRef name, TripleCollection triples)
          Creates a Graph with a specified name
 MGraph createMGraph(UriRef name)
          Creates an initially empty MGraph with a specified name
 void deleteTripleCollection(UriRef name)
          Deletes the Graph or MGraph of a specified name.
 Graph getGraph(UriRef name)
          Get a Graph by its name
 MGraph getMGraph(UriRef name)
          Get an MGraph by its name.
 Set<UriRef> getNames(Graph graph)
          get a set of the names of a Graph
 TripleCollection getTriples(UriRef name)
          This method is used to get a TripleCollection indifferently whether it's a Graph or an MGraph.
 Set<UriRef> listGraphs()
          Lists the name of the Graphs available through this TcProvider, implementations may take into account the security context and omit Graphs for which access is not allowed.
 Set<UriRef> listMGraphs()
          Lists the name of the MGraphs available through this TcProvider, implementations may take into account the security context and omit MGraphs for which access is not allowed.
 Set<UriRef> listTripleCollections()
          Lists the name of the TripleCollections available through this TcProvider indifferently whether they are Graphs or an MGraphs, implementations may take into account the security context and omit TripleCollections for which access is not allowed.
 

Method Detail

getGraph

Graph getGraph(UriRef name)
               throws NoSuchEntityException
Get a Graph by its name

Parameters:
name - the name of the Graph
Returns:
the Graph with the specified name
Throws:
NoSuchEntityException - if there is no Graph with the specified name

getMGraph

MGraph getMGraph(UriRef name)
                 throws NoSuchEntityException
Get an MGraph by its name. The instances returned in different invocations are equals.

Parameters:
the - name of the MGraph
Returns:
name the MGraph with the specified name
Throws:
NoSuchEntityException - if there is no MGraph with the specified name

getTriples

TripleCollection getTriples(UriRef name)
                            throws NoSuchEntityException
This method is used to get a TripleCollection indifferently whether it's a Graph or an MGraph. If the name names an MGraph the result is the same as when invoking getMGraph with that argument, analogously for GraphS the method returns an instance equals to what getGraph would return.

Parameters:
name - the name of the Graph or MGraph
Returns:
the Graph or MGraph
Throws:
NoSuchEntityException - if there is no Graph or MGraph with the specified name

listGraphs

Set<UriRef> listGraphs()
Lists the name of the Graphs available through this TcProvider, implementations may take into account the security context and omit Graphs for which access is not allowed.

Returns:
the list of Graphs

listMGraphs

Set<UriRef> listMGraphs()
Lists the name of the MGraphs available through this TcProvider, implementations may take into account the security context and omit MGraphs for which access is not allowed.

Returns:
the list of MGraphs

listTripleCollections

Set<UriRef> listTripleCollections()
Lists the name of the TripleCollections available through this TcProvider indifferently whether they are Graphs or an MGraphs, implementations may take into account the security context and omit TripleCollections for which access is not allowed.

Returns:
the list of TripleCollections

createMGraph

MGraph createMGraph(UriRef name)
                    throws UnsupportedOperationException,
                           EntityAlreadyExistsException
Creates an initially empty MGraph with a specified name

Parameters:
name - names the new MGraph
Returns:
the newly created MGraph
Throws:
UnsupportedOperationException - if this provider doesn't support creating MGraphS
EntityAlreadyExistsException - if an MGraph with the specified name already exists

createGraph

Graph createGraph(UriRef name,
                  TripleCollection triples)
                  throws UnsupportedOperationException,
                         EntityAlreadyExistsException
Creates a Graph with a specified name

Parameters:
name - the name of the Graph to be created
triples - the triples of the new Graph
Returns:
the newly created Graph
Throws:
UnsupportedOperationException - if this provider doesn't support creating GraphS
EntityAlreadyExistsException - if a Graph with the specified name already exists

deleteTripleCollection

void deleteTripleCollection(UriRef name)
                            throws UnsupportedOperationException,
                                   NoSuchEntityException,
                                   EntityUndeletableException
Deletes the Graph or MGraph of a specified name. If name references a Graph and the graph has other names, it will still be available with those other names.

Parameters:
name - the entity to be removed
Throws:
UnsupportedOperationException - if this provider doesn't support entities deletion.
NoSuchEntityException - if name doesn't refer to a Graph or an MGraph.
EntityUndeletableException - if the specified Graph is undeletable

getNames

Set<UriRef> getNames(Graph graph)
get a set of the names of a Graph

Parameters:
graph -
Returns:
the set names of Graph, the set is empty if Graph is unknown


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.