MICO Platform  1.0.0
 All Classes Namespaces Functions Variables Friends
Public Member Functions | Protected Attributes | List of all members
mico::persistence::Metadata Class Reference

A class offering access to RDF metadata through SPARQL. More...

#include <Metadata.hpp>

Inheritance diagram for mico::persistence::Metadata:
mico::persistence::ContentItemMetadata mico::persistence::ExecutionMetadata mico::persistence::PersistenceMetadata mico::persistence::ResultMetadata

Public Member Functions

 Metadata (std::string baseUrl)
 Create a new metadata object for the given server using the global SPARQL endpoint. More...
 
 Metadata (std::string baseUrl, std::string context)
 Create a new metadata object for the given server base URL and context using the contextual SPARQL endpoint. More...
 
void load (std::istream &in, const std::string format)
 Load RDF data of the given format into the metadata dataset. More...
 
void dump (std::ostream &out, const std::string format)
 Dump the RDF data contained in the metadata dataset into the given output stream using the given serialization format. More...
 
void update (const std::string sparqlUpdate)
 Execute a SPARQL update query on the metadata (see http://www.w3.org/TR/sparql11-update/). More...
 
const
mico::rdf::query::TupleResult
query (const std::string sparqlQuery)
 Execute a SPARQL SELECT query on the metadata (see http://www.w3.org/TR/sparql11-query/). More...
 
const bool ask (const std::string sparqlQuery)
 Execute a SPARQL ASK query on the metadata (see http://www.w3.org/TR/sparql11-query/). More...
 
void close ()
 Close the metadata connection and clean up any open resources.
 

Protected Attributes

std::string baseUrl
 the base URL of the server
 
std::string contextUrl
 the URI of the context to use as named graph
 
mico::rdf::query::SPARQLClient sparqlClient
 an instance of a SPARQL client, will be initialised to baseUrl + "/sparql"
 
mico::http::HTTPClient httpClient
 an instance of an HTTP client, will be used for load/dump More...
 

Detailed Description

A class offering access to RDF metadata through SPARQL.

The Metadata class implements a wrapper around a SPARQL endpoint and can be used for any kind of RDF metadata representation. Together with a contextual Marmotta server, it is also context aware, i.e. when the ID of a named graph has been configured, all operations will only be executed on this graph.

Constructor & Destructor Documentation

mico::persistence::Metadata::Metadata ( std::string  baseUrl)

Create a new metadata object for the given server using the global SPARQL endpoint.

Optional context must be given explicitly in SPARQL queries.

mico::persistence::Metadata::Metadata ( std::string  baseUrl,
std::string  context 
)

Create a new metadata object for the given server base URL and context using the contextual SPARQL endpoint.

All queries and updates will exclusively access this context.

Member Function Documentation

const bool mico::persistence::Metadata::ask ( const std::string  sparqlQuery)

Execute a SPARQL ASK query on the metadata (see http://www.w3.org/TR/sparql11-query/).

This method can be used for any kind of data access.

Parameters
sparqlQuery
Returns
void mico::persistence::Metadata::dump ( std::ostream &  out,
const std::string  format 
)

Dump the RDF data contained in the metadata dataset into the given output stream using the given serialization format.

Can be used for exporting the metadata.

Parameters
outOutputStream to export the data to
formatdata format the RDF data is using (e.g. (e.g. text/turtle or application/rdf+xml; defined shortcuts: "turtle" and "rdfxml")

Can be used for exporting the metadata.

Parameters
outOutputStream to export the data to
formatdata format the RDF data is using (e.g. Turtle)
void mico::persistence::Metadata::load ( std::istream &  in,
const std::string  format 
)

Load RDF data of the given format into the metadata dataset.

Can be used for preloading existing metadata.

Parameters
inInputStream to load the data from
formatdata format the RDF data is using (e.g. text/turtle or application/rdf+xml; defined shortcuts: "turtle" and "rdfxml")

Can be used for preloading existing metadata.

Parameters
inInputStream to load the data from
formatdata format the RDF data is using (e.g. Turtle)
const TupleResult * mico::persistence::Metadata::query ( const std::string  sparqlQuery)

Execute a SPARQL SELECT query on the metadata (see http://www.w3.org/TR/sparql11-query/).

This method can be used for any kind of data access.

Parameters
sparqlQuery
Returns
void mico::persistence::Metadata::update ( const std::string  sparqlUpdate)

Execute a SPARQL update query on the metadata (see http://www.w3.org/TR/sparql11-update/).

This method can be used for any kind of modification of the data.

Parameters
sparqlUpdate

Member Data Documentation

mico::http:: HTTPClient mico::persistence::Metadata::httpClient
protected

an instance of an HTTP client, will be used for load/dump

using the baseUrl and the Marmotta import/export endpoints


The documentation for this class was generated from the following files: