LibreOffice: XRepository Interface Reference

LibreOffice LibreOffice 7.0 SDK API Reference

Public Member Functions | List of all members
XRepository Interface Reference

provides access to a set of named RDF graphs. More...

`import"XRepository.idl";`

Inheritance diagram for XRepository:

## Public Member Functions
XBlankNode | createBlankNode ()
| creates a fresh unique blank node. More...
XNamedGraph | importGraph ([in] short Format, [in] com::sun::star::io::XInputStream InStream, [in] XURI GraphName, [in] XURI BaseURI) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::datatransfer::UnsupportedFlavorException, com::sun::star::container::ElementExistException, ParseException, RepositoryException, com::sun::star::io::IOException )
| imports a named graph into the repository. More...
void | exportGraph ([in] short Format, [in] com::sun::star::io::XOutputStream OutStream, [in] XURI GraphName, [in] XURI BaseURI) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::datatransfer::UnsupportedFlavorException, com::sun::star::container::NoSuchElementException, RepositoryException, com::sun::star::io::IOException )
| exports a named graph from the repository. More...
sequence< XURI > | getGraphNames () raises ( RepositoryException )
| gets the names of all the graphs in the repository. More...
XNamedGraph | getGraph ([in] XURI GraphName) raises ( com::sun::star::lang::IllegalArgumentException, RepositoryException )
| gets a graph by its name. More...
XNamedGraph | createGraph ([in] XURI GraphName) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException, RepositoryException )
| creates a graph with the given name. More...
void | destroyGraph ([in] XURI GraphName) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException, RepositoryException )
| destroys the graph with the given name, and removes it from the repository. More...
com::sun::star::container::XEnumeration | getStatements ([in] XResource Subject, [in] XURI Predicate, [in] XNode Object) raises ( RepositoryException )
| gets matching RDF statements from the repository. More...
XQuerySelectResult | querySelect ([in] string Query) raises ( QueryException, RepositoryException )
| executes a SPARQL "SELECT" query. More...
com::sun::star::container::XEnumeration | queryConstruct ([in] string Query) raises ( QueryException, RepositoryException )
| executes a SPARQL "CONSTRUCT" query. More...
boolean | queryAsk ([in] string Query) raises ( QueryException, RepositoryException )
| executes a SPARQL "ASK" query. More...

## Detailed Description

provides access to a set of named RDF graphs.

A repository for storing information according to the data model of the Resource Description Framework. This interface may be used e.g. for repositories that correspond to a loaded ODF document, or for repositories that are backed by some kind of database.

The RDF triples are stored as a set of named RDF graphs. Importing and exporting files in the RDF/XML format is supported. Support for other file formats is optional. Support for querying the repository with the SPARQL query language is provided.

Since
  OOo 3.2

See also
  XRepositorySupplier
  XDocumentRepository

## Member Function Documentation

## ◆ createBlankNode()

XBlankNode createBlankNode | ( |  | ) |

creates a fresh unique blank node.

Returns
  a newly generated blank node which is unique in this repository

## ◆ createGraph()

XNamedGraph createGraph | ( | [in] XURI | GraphName | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | com::sun::star::container::ElementExistException,
|  | RepositoryException
| ) |  |

creates a graph with the given name.

The name must be unique within the repository.

Parameters

  GraphName | the name of the graph that is to be created

Returns
  the graph with the given name

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the given GraphName is invalid
  com::sun::star::container::ElementExistException | if a graph with the given GraphName already exists
  RepositoryException | if an error occurs when accessing the repository.

## ◆ destroyGraph()

void destroyGraph | ( | [in] XURI | GraphName | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | com::sun::star::container::NoSuchElementException,
|  | RepositoryException
| ) |  |

destroys the graph with the given name, and removes it from the repository.

This invalidates any instances of XNamedGraph for the argument.

Parameters

  GraphName | the name of the graph that is to be destroyed

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the given GraphName is invalid
  com::sun::star::container::NoSuchElementException | if a graph with the given GraphName does not exist
  RepositoryException | if an error occurs when accessing the repository.

## ◆ exportGraph()

void exportGraph | ( | [in] short | Format,
|  | [in] com::sun::star::io::XOutputStream | OutStream,
|  | [in] XURI | GraphName,
|  | [in] XURI | BaseURI
| ) |  |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | com::sun::star::datatransfer::UnsupportedFlavorException,
|  | com::sun::star::container::NoSuchElementException,
|  | RepositoryException,
|  | com::sun::star::io::IOException
| ) |  |

exports a named graph from the repository.

Implementations must support RDF/XML format. Support for other RDF formats is optional. If the format is not supported by the implementation, an com::sun::star::datatransfer::UnsupportedFlavorException is raised.

Parameters

  Format | the format of the output file
  OutStream | the target output stream
  GraphName | the name of the graph that is to be exported
  BaseURI | a base URI to resolve relative URI references

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the given stream or the GraphName is `NULL`, or BaseURI is `NULL` and the format requires use of a base URI
  com::sun::star::datatransfer::UnsupportedFlavorException | if the format requested is unknown or not supported
  com::sun::star::container::NoSuchElementException | if a graph with the given GraphName does not exist
  RepositoryException | if an error occurs when accessing the repository.
  com::sun::star::io::IOException | if an I/O error occurs.

See also
  FileFormat

## ◆ getGraph()

XNamedGraph getGraph | ( | [in] XURI | GraphName | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | RepositoryException
| ) |  |

gets a graph by its name.

Parameters

  GraphName | the name of the graph that is to be returned

Returns
  the graph with the given name if it exists, else `NULL`

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the given GraphName is invalid
  RepositoryException | if an error occurs when accessing the repository.

## ◆ getGraphNames()

sequence<XURI> getGraphNames | ( |  | ) |
raises | ( | RepositoryException
| ) |  |

gets the names of all the graphs in the repository.

Returns
  a list containing the names of the graphs in the repository

Exceptions

  RepositoryException | if an error occurs when accessing the repository.

## ◆ getStatements()

com::sun::star::container::XEnumeration getStatements | ( | [in] XResource | Subject,
|  | [in] XURI | Predicate,
|  | [in] XNode | Object
| ) |  |
raises | ( | RepositoryException
| ) |  |

gets matching RDF statements from the repository.

Any parameter may be `NULL`, which acts as a wildcard. For example, to get all statements about myURI: `getStatements(myURI, null, null)`

Parameters

  Subject | the subject of the RDF triple.
  Predicate | the predicate of the RDF triple.
  Object | the object of the RDF triple.

Returns
  an iterator over all RDF statements in the repository that match the parameters, represented as an enumeration of Statement

Exceptions

  RepositoryException | if an error occurs when accessing the repository.

See also
  Statement
  XNamedGraph::getStatements

## ◆ importGraph()

XNamedGraph importGraph | ( | [in] short | Format,
|  | [in] com::sun::star::io::XInputStream | InStream,
|  | [in] XURI | GraphName,
|  | [in] XURI | BaseURI
| ) |  |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | com::sun::star::datatransfer::UnsupportedFlavorException,
|  | com::sun::star::container::ElementExistException,
|  | ParseException,
|  | RepositoryException,
|  | com::sun::star::io::IOException
| ) |  |

imports a named graph into the repository.

Implementations must support RDF/XML format. Support for other RDF formats is optional. If the format is not supported by the implementation, an com::sun::star::datatransfer::UnsupportedFlavorException is raised. If the format requires use of a BaseURI, but none is given, an com::sun::star::lang::IllegalArgumentException is raised.

Parameters

  Format | the format of the input file
  InStream | the input stream, containing an RDF file in the specified format
  GraphName | the name of the graph that is imported
  BaseURI | a base URI to resolve relative URI references

Returns
  the imported graph

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the given stream or the GraphName is `NULL`, or BaseURI is `NULL` and the format requires use of a base URI
  com::sun::star::datatransfer::UnsupportedFlavorException | if the format requested is unknown or not supported
  com::sun::star::container::ElementExistException | if a graph with the given GraphName already exists in the repository
  ParseException | if the input does not conform to the specified file format.
  RepositoryException | if an error occurs when accessing the repository.
  com::sun::star::io::IOException | if an I/O error occurs.

See also
  FileFormat

## ◆ queryAsk()

boolean queryAsk | ( | [in] string | Query | ) |
raises | ( | QueryException,
|  | RepositoryException
| ) |  |

executes a SPARQL "ASK" query.

This method runs a SPARQL query that computes a boolean, i.e., a query beginning with "ASK".

Parameters

  Query | the SPARQL query `string`

Returns
  the boolean query result

Exceptions

  QueryException | if the query is malformed, or evaluation fails
  RepositoryException | if an error occurs when accessing the repository.

## ◆ queryConstruct()

com::sun::star::container::XEnumeration queryConstruct | ( | [in] string | Query | ) |
raises | ( | QueryException,
|  | RepositoryException
| ) |  |

executes a SPARQL "CONSTRUCT" query.

This method runs a SPARQL query that constructs a result graph, i.e., a query beginning with "CONSTRUCT".

Parameters

  Query | the SPARQL query `string`

Returns
  an iterator over the query result graph, represented as an enumeration of Statement

Exceptions

  QueryException | if the query is malformed, or evaluation fails
  RepositoryException | if an error occurs when accessing the repository.

See also
  Statement

## ◆ querySelect()

XQuerySelectResult querySelect | ( | [in] string | Query | ) |
raises | ( | QueryException,
|  | RepositoryException
| ) |  |

executes a SPARQL "SELECT" query.

This method runs a SPARQL query that returns a list of variable bindings, i.e., a query beginning with "SELECT". The result is basically a (rectangular) table with labeled columns, where individual cells may be `NULL`.

Parameters

  Query | the SPARQL query `string`

Returns
  an enumeration, containing
  1. a list of query variable names (column labels)
  2. the query results (rows), each being a list of bindings for the above variables

Exceptions

  QueryException | if the query is malformed, or evaluation fails
  RepositoryException | if an error occurs when accessing the repository.

See also
  XQuerySelectResult

The documentation for this interface was generated from the following file:

- com/sun/star/rdf/XRepository.idl