LibreOffice
LibreOffice 24.2 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:
Repository XDocumentRepository

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< XURIgetGraphNames () 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()

creates a graph with the given name.

The name must be unique within the repository.

Parameters
GraphNamethe name of the graph that is to be created
Returns
the graph with the given name
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif the given GraphName is invalid
com::sun::star::container::ElementExistExceptionif a graph with the given GraphName already exists
RepositoryExceptionif an error occurs when accessing the repository.

◆ destroyGraph()

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

This invalidates any instances of XNamedGraph for the argument.

Parameters
GraphNamethe name of the graph that is to be destroyed
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif the given GraphName is invalid
com::sun::star::container::NoSuchElementExceptionif a graph with the given GraphName does not exist
RepositoryExceptionif an error occurs when accessing the repository.

◆ exportGraph()

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
Formatthe format of the output file
OutStreamthe target output stream
GraphNamethe name of the graph that is to be exported
BaseURIa base URI to resolve relative URI references
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif 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::UnsupportedFlavorExceptionif the format requested is unknown or not supported
com::sun::star::container::NoSuchElementExceptionif a graph with the given GraphName does not exist
RepositoryExceptionif an error occurs when accessing the repository.
com::sun::star::io::IOExceptionif an I/O error occurs.
See also
FileFormat

◆ getGraph()

gets a graph by its name.

Parameters
GraphNamethe 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::IllegalArgumentExceptionif the given GraphName is invalid
RepositoryExceptionif 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
RepositoryExceptionif 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
Subjectthe subject of the RDF triple.
Predicatethe predicate of the RDF triple.
Objectthe 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
RepositoryExceptionif an error occurs when accessing the repository.
See also
Statement
XNamedGraph::getStatements

◆ importGraph()

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
Formatthe format of the input file
InStreamthe input stream, containing an RDF file in the specified format
GraphNamethe name of the graph that is imported
BaseURIa base URI to resolve relative URI references
Returns
the imported graph
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif 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::UnsupportedFlavorExceptionif the format requested is unknown or not supported
com::sun::star::container::ElementExistExceptionif a graph with the given GraphName already exists in the repository
ParseExceptionif the input does not conform to the specified file format.
RepositoryExceptionif an error occurs when accessing the repository.
com::sun::star::io::IOExceptionif 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
Querythe SPARQL query string
Returns
the boolean query result
Exceptions
QueryExceptionif the query is malformed, or evaluation fails
RepositoryExceptionif 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
Querythe SPARQL query string
Returns
an iterator over the query result graph, represented as an enumeration of Statement
Exceptions
QueryExceptionif the query is malformed, or evaluation fails
RepositoryExceptionif 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
Querythe 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
QueryExceptionif the query is malformed, or evaluation fails
RepositoryExceptionif an error occurs when accessing the repository.
See also
XQuerySelectResult

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