public class GraphManager extends ResourceManager
Constructor and Description |
---|
GraphManager(DatabaseClient client) |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the deafult graph
|
void |
delete(String graphUri)
Deletes a named graph.
|
void |
insert(com.marklogic.client.example.extension.GraphManager.GraphFormat format,
GenericWriteHandle graph)
Appends a graph to the default graph on the REST server
|
void |
insert(String graphUri,
com.marklogic.client.example.extension.GraphManager.GraphFormat format,
GenericWriteHandle graph)
Appends a named graph to the REST server, or creates it if that name doesn't yet exist on the graph store.
|
static void |
install(DatabaseClient client)
Installs this extension on the REST server
|
<T extends TextReadHandle> |
list(T response) |
<T extends GenericReadHandle> |
read(com.marklogic.client.example.extension.GraphManager.GraphFormat format,
T response)
Reads the default RDF graph from the server
|
<T extends XMLReadHandle> |
read(String graphUri,
com.marklogic.client.example.extension.GraphManager.GraphFormat format,
T response)
Reads a named graph from the server
|
void |
replace(com.marklogic.client.example.extension.GraphManager.GraphFormat format,
GenericWriteHandle graph)
Replaces the default graph on the REST server/
|
void |
replace(String graphUri,
com.marklogic.client.example.extension.GraphManager.GraphFormat format,
GenericWriteHandle graph)
Replaces a named graph on the REST server
|
static void |
uninstall(DatabaseClient client)
Uninstalls this extension from the REST server
|
getName, startLogging, stopLogging
public static final String NAME
public GraphManager(DatabaseClient client)
public <T extends TextReadHandle> T list(T response)
public void delete()
public void delete(String graphUri)
graphUri
- The URI of the graph to delete.public <T extends GenericReadHandle> T read(com.marklogic.client.example.extension.GraphManager.GraphFormat format, T response)
format
- The format in which to serialize the graph.response
- a templated parameter to hold the response type.public <T extends XMLReadHandle> T read(String graphUri, com.marklogic.client.example.extension.GraphManager.GraphFormat format, T response)
graphUri
- URI of the graph to retrieve.format
- The format in which to serialize the graph.response
- a templated parameter to hold the response type.public void insert(com.marklogic.client.example.extension.GraphManager.GraphFormat format, GenericWriteHandle graph)
format
- Format of the graph serializationgraph
- The graph to write.public void insert(String graphUri, com.marklogic.client.example.extension.GraphManager.GraphFormat format, GenericWriteHandle graph)
graphUri
- The graph URIformat
- the serialization format of the graph payloadgraph
- The graph to write.public void replace(com.marklogic.client.example.extension.GraphManager.GraphFormat format, GenericWriteHandle graph)
format
- the serialization format of the graph payloadgraph
- The graph to write.public void replace(String graphUri, com.marklogic.client.example.extension.GraphManager.GraphFormat format, GenericWriteHandle graph)
graphUri
- The graph URIformat
- the serialization format of the graph payloadgraph
- The graph to write.public static void install(DatabaseClient client) throws IOException
client
- the database client connection.IOException
- Thrown in case of an IO problem.public static void uninstall(DatabaseClient client) throws IOException
client
- the database client connection.IOException
- Thrown in the case of some IO issue.Copyright © 2013-2015 MarkLogic Corporation.