1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_rdf_XNamedGraph_idl__
21 #define __com_sun_star_rdf_XNamedGraph_idl__
23 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
24 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
25 #include
<com
/sun
/star
/container
/XEnumeration.idl
>
26 #include
<com
/sun
/star
/rdf
/RepositoryException.idl
>
27 #include
<com
/sun
/star
/rdf
/XURI.idl
>
31 module com
{ module sun
{ module star
{ module rdf
{
33 /** represents an RDF named graph that is stored in an RDF Repository.
36 Note that this interface inherits from XResource: the
37 name of the graph is the string value of the RDF node.
38 This is so that you can easily make RDF statements about named graphs.
42 Note that instances may be destroyed via
43 XRepository::destroyGraph().
44 If a graph is destroyed, subsequent calls to addStatement(),
45 removeStatements() will fail with an
46 com::sun::star::container::NoSuchElementException.
53 interface XNamedGraph
: XURI
56 /** returns the name of the graph.
59 The name is unique within the repository.
67 /** removes all statements from the graph.
69 @throws com::sun::star::container::NoSuchElementException
70 if this graph does not exist in the repository any more
72 @throws RepositoryException
73 if an error occurs when accessing the repository.
76 raises
( com
::sun
::star
::container
::NoSuchElementException
,
77 RepositoryException
);
79 /** adds a RDF statement to the graph.
82 Note that the ODF elements that can have metadata attached all
83 implement the interface XMetadatable, which inherits
84 from XResource, meaning that you can simply pass them
85 in as arguments here, and it will magically work.
89 the subject of the RDF triple.
92 the predicate of the RDF triple.
95 the object of the RDF triple.
97 @throws com::sun::star::lang::IllegalArgumentException
98 if any parameter is `NULL`
100 @throws com::sun::star::container::NoSuchElementException
101 if this graph does not exist in the repository any more
103 @throws RepositoryException
104 if an error occurs when accessing the repository.
106 void addStatement
([in] XResource Subject
,
109 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
110 com
::sun
::star
::container
::NoSuchElementException
,
111 RepositoryException
);
113 /** removes matching RDF statements from the graph.
116 Note that the ODF elements that can have metadata attached all
117 implement the interface XMetadatable, which inherits
118 from XResource, meaning that you can simply pass them
119 in as arguments here, and it will magically work.
123 Any parameter may be `NULL`, which acts as a wildcard.
124 For example, to remove all statements about myURI:
125 <code>removeStatement(myURI, null, null)</code>
129 the subject of the RDF triple.
132 the predicate of the RDF triple.
135 the object of the RDF triple.
137 @throws com::sun::star::container::NoSuchElementException
138 if this graph does not exist in the repository any more
140 @throws RepositoryException
141 if an error occurs when accessing the repository.
143 void removeStatements
([in] XResource Subject
,
146 raises
( com
::sun
::star
::container
::NoSuchElementException
,
147 RepositoryException
);
149 /** gets matching RDF statements from a graph.
152 Note that the ODF elements that can have metadata attached all
153 implement the interface XMetadatable, which inherits
154 from XResource, meaning that you can simply pass them
155 in as arguments here, and it will magically work.
159 Any parameter may be `NULL`, which acts as a wildcard.
160 For example, to get all statements about myURI:
161 <code>getStatements(myURI, null, null)</code>
165 the subject of the RDF triple.
168 the predicate of the RDF triple.
171 the object of the RDF triple.
174 an iterator over all RDF statements in the graph that match
175 the parameters, represented as an
176 enumeration of Statement
178 @throws com::sun::star::container::NoSuchElementException
179 if this graph does not exist in the repository any more
181 @throws RepositoryException
182 if an error occurs when accessing the repository.
186 com
::sun
::star
::container
::XEnumeration
/*<Statement>*/ getStatements
(
187 [in] XResource Subject
,
190 raises
( com
::sun
::star
::container
::NoSuchElementException
,
191 RepositoryException
);
193 //FIXME reification: addReifiedStatement(Statement)...
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */