merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / rdf / XNamedGraph.idl
blobd71c5a599e9e60d767bf9c88783e7be09f9f7cfd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef __com_sun_star_rdf_XNamedGraph_idl__
29 #define __com_sun_star_rdf_XNamedGraph_idl__
31 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
32 #include <com/sun/star/lang/IllegalArgumentException.idl>
33 #endif
35 #ifndef __com_sun_star_container_NoSuchElementException_idl__
36 #include <com/sun/star/container/NoSuchElementException.idl>
37 #endif
39 #ifndef __com_sun_star_container_XEnumeration_idl__
40 #include <com/sun/star/container/XEnumeration.idl>
41 #endif
43 #ifndef __com_sun_star_rdf_RepositoryException_idl__
44 #include <com/sun/star/rdf/RepositoryException.idl>
45 #endif
47 #ifndef __com_sun_star_rdf_XURI_idl__
48 #include <com/sun/star/rdf/XURI.idl>
49 #endif
52 //=============================================================================
54 module com { module sun { module star { module rdf {
56 //=============================================================================
57 /** represents an RDF named graph that is stored in an RDF Repository.
59 <p>
60 Note that this interface inherits from <type>XResource</type>: the
61 name of the graph is the string value of the RDF node.
62 This is so that you can easily make RDF statements about named graphs.
63 </p>
65 <p>
66 Note that instances may be destroyed via
67 <member>XRepository::destroyGraph</member>.
68 If a graph is destroyed, subsequent calls to <member>addStatement</member>,
69 <member>removeStatements</member> will fail with an
70 <type scope="com::sun::star::container">NoSuchElementException</type>.
71 </p>
73 @since OOo 3.2
75 @see XRepository
77 interface XNamedGraph : XURI
80 //-------------------------------------------------------------------------
81 /** returns the name of the graph.
83 <p>
84 The name is unique within the repository.
85 </p>
87 @returns
88 the name of the graph
90 XURI getName();
92 //-------------------------------------------------------------------------
93 /** removes all statements from the graph.
95 @throws com::sun::star::container::NoSuchElementException
96 if this graph does not exist in the repository any more
98 @throws RepositoryException
99 if an error occurs when accessing the repository.
101 void clear()
102 raises( com::sun::star::container::NoSuchElementException,
103 RepositoryException );
105 //-------------------------------------------------------------------------
106 /** adds a RDF statement to the graph.
109 Note that the ODF elements that can have metadata attached all
110 implement the interface <type>XMetadatable</type>, which inherits
111 from <type>XResource</type>, meaning that you can simply pass them
112 in as arguments here, and it will magically work.
113 </p>
115 @param Subject
116 the subject of the RDF triple.
118 @param Predicate
119 the predicate of the RDF triple.
121 @param Object
122 the object of the RDF triple.
124 @throws com::sun::star::lang::IllegalArgumentException
125 if any parameter is <NULL/>
127 @throws com::sun::star::container::NoSuchElementException
128 if this graph does not exist in the repository any more
130 @throws RepositoryException
131 if an error occurs when accessing the repository.
133 void addStatement([in] XResource Subject,
134 [in] XURI Predicate,
135 [in] XNode Object)
136 raises( com::sun::star::lang::IllegalArgumentException,
137 com::sun::star::container::NoSuchElementException,
138 RepositoryException );
140 //-------------------------------------------------------------------------
141 /** removes matching RDF statements from the graph.
144 Note that the ODF elements that can have metadata attached all
145 implement the interface <type>XMetadatable</type>, which inherits
146 from <type>XResource</type>, meaning that you can simply pass them
147 in as arguments here, and it will magically work.
148 </p>
151 Any parameter may be <NULL/>, which acts as a wildcard.
152 For example, to remove all statements about myURI:
153 <code>removeStatement(myURI, null, null)</code>
154 </p>
156 @param Subject
157 the subject of the RDF triple.
159 @param Predicate
160 the predicate of the RDF triple.
162 @param Object
163 the object of the RDF triple.
165 @throws com::sun::star::container::NoSuchElementException
166 if this graph does not exist in the repository any more
168 @throws RepositoryException
169 if an error occurs when accessing the repository.
171 void removeStatements([in] XResource Subject,
172 [in] XURI Predicate,
173 [in] XNode Object)
174 raises( com::sun::star::container::NoSuchElementException,
175 RepositoryException );
177 //-------------------------------------------------------------------------
178 /** gets matching RDF statements from a graph.
181 Note that the ODF elements that can have metadata attached all
182 implement the interface <type>XMetadatable</type>, which inherits
183 from <type>XResource</type>, meaning that you can simply pass them
184 in as arguments here, and it will magically work.
185 </p>
188 Any parameter may be <NULL/>, which acts as a wildcard.
189 For example, to get all statements about myURI:
190 <code>getStatements(myURI, null, null)</code>
191 </p>
193 @param Subject
194 the subject of the RDF triple.
196 @param Predicate
197 the predicate of the RDF triple.
199 @param Object
200 the object of the RDF triple.
202 @returns
203 an iterator over all RDF statements in the graph that match
204 the parameters, represented as an
205 enumeration of <type>Statement</type>
207 @throws com::sun::star::container::NoSuchElementException
208 if this graph does not exist in the repository any more
210 @throws RepositoryException
211 if an error occurs when accessing the repository.
213 @see Statement
215 com::sun::star::container::XEnumeration/*<Statement>*/ getStatements(
216 [in] XResource Subject,
217 [in] XURI Predicate,
218 [in] XNode Object)
219 raises( com::sun::star::container::NoSuchElementException,
220 RepositoryException );
222 //FIXME reification: addReifiedStatement(Statement)...
225 //=============================================================================
227 }; }; }; };
229 #endif