update dev300-m58
[ooovba.git] / offapi / com / sun / star / rdf / XNamedGraph.idl
blob33c09cdfceee081cc588ec4a741d60649afd9021
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XNamedGraph.idl,v $
10 * $Revision: 1.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_rdf_XNamedGraph_idl__
32 #define __com_sun_star_rdf_XNamedGraph_idl__
34 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
35 #include <com/sun/star/lang/IllegalArgumentException.idl>
36 #endif
38 #ifndef __com_sun_star_container_NoSuchElementException_idl__
39 #include <com/sun/star/container/NoSuchElementException.idl>
40 #endif
42 #ifndef __com_sun_star_container_XEnumeration_idl__
43 #include <com/sun/star/container/XEnumeration.idl>
44 #endif
46 #ifndef __com_sun_star_rdf_RepositoryException_idl__
47 #include <com/sun/star/rdf/RepositoryException.idl>
48 #endif
50 #ifndef __com_sun_star_rdf_XURI_idl__
51 #include <com/sun/star/rdf/XURI.idl>
52 #endif
55 //=============================================================================
57 module com { module sun { module star { module rdf {
59 //=============================================================================
60 /** represents an RDF named graph that is stored in an RDF Repository.
62 <p>
63 Note that this interface inherits from <type>XResource</type>: the
64 name of the graph is the string value of the RDF node.
65 This is so that you can easily make RDF statements about named graphs.
66 </p>
68 <p>
69 Note that instances may be destroyed via
70 <member>XRepository::destroyGraph</member>.
71 If a graph is destroyed, subsequent calls to <member>addStatement</member>,
72 <member>removeStatements</member> will fail with an
73 <type scope="com::sun::star::container">NoSuchElementException</type>.
74 </p>
76 @since OOo 3.2
78 @see XRepository
80 interface XNamedGraph : XURI
83 //-------------------------------------------------------------------------
84 /** returns the name of the graph.
86 <p>
87 The name is unique within the repository.
88 </p>
90 @returns
91 the name of the graph
93 XURI getName();
95 //-------------------------------------------------------------------------
96 /** removes all statements from the graph.
98 @throws com::sun::star::container::NoSuchElementException
99 if this graph does not exist in the repository any more
101 @throws RepositoryException
102 if an error occurs when accessing the repository.
104 void clear()
105 raises( com::sun::star::container::NoSuchElementException,
106 RepositoryException );
108 //-------------------------------------------------------------------------
109 /** adds a RDF statement to the graph.
112 Note that the ODF elements that can have metadata attached all
113 implement the interface <type>XMetadatable</type>, which inherits
114 from <type>XResource</type>, meaning that you can simply pass them
115 in as arguments here, and it will magically work.
116 </p>
118 @param Subject
119 the subject of the RDF triple.
121 @param Predicate
122 the predicate of the RDF triple.
124 @param Object
125 the object of the RDF triple.
127 @throws com::sun::star::lang::IllegalArgumentException
128 if any parameter is <NULL/>
130 @throws com::sun::star::container::NoSuchElementException
131 if this graph does not exist in the repository any more
133 @throws RepositoryException
134 if an error occurs when accessing the repository.
136 void addStatement([in] XResource Subject,
137 [in] XURI Predicate,
138 [in] XNode Object)
139 raises( com::sun::star::lang::IllegalArgumentException,
140 com::sun::star::container::NoSuchElementException,
141 RepositoryException );
143 //-------------------------------------------------------------------------
144 /** removes matching RDF statements from the graph.
147 Note that the ODF elements that can have metadata attached all
148 implement the interface <type>XMetadatable</type>, which inherits
149 from <type>XResource</type>, meaning that you can simply pass them
150 in as arguments here, and it will magically work.
151 </p>
154 Any parameter may be <NULL/>, which acts as a wildcard.
155 For example, to remove all statements about myURI:
156 <code>removeStatement(myURI, null, null)</code>
157 </p>
159 @param Subject
160 the subject of the RDF triple.
162 @param Predicate
163 the predicate of the RDF triple.
165 @param Object
166 the object of the RDF triple.
168 @throws com::sun::star::container::NoSuchElementException
169 if this graph does not exist in the repository any more
171 @throws RepositoryException
172 if an error occurs when accessing the repository.
174 void removeStatements([in] XResource Subject,
175 [in] XURI Predicate,
176 [in] XNode Object)
177 raises( com::sun::star::container::NoSuchElementException,
178 RepositoryException );
180 //-------------------------------------------------------------------------
181 /** gets matching RDF statements from a graph.
184 Note that the ODF elements that can have metadata attached all
185 implement the interface <type>XMetadatable</type>, which inherits
186 from <type>XResource</type>, meaning that you can simply pass them
187 in as arguments here, and it will magically work.
188 </p>
191 Any parameter may be <NULL/>, which acts as a wildcard.
192 For example, to get all statements about myURI:
193 <code>getStatements(myURI, null, null)</code>
194 </p>
196 @param Subject
197 the subject of the RDF triple.
199 @param Predicate
200 the predicate of the RDF triple.
202 @param Object
203 the object of the RDF triple.
205 @returns
206 an iterator over all RDF statements in the graph that match
207 the parameters, represented as an
208 enumeration of <type>Statement</type>
210 @throws com::sun::star::container::NoSuchElementException
211 if this graph does not exist in the repository any more
213 @throws RepositoryException
214 if an error occurs when accessing the repository.
216 @see Statement
218 com::sun::star::container::XEnumeration/*<Statement>*/ getStatements(
219 [in] XResource Subject,
220 [in] XURI Predicate,
221 [in] XNode Object)
222 raises( com::sun::star::container::NoSuchElementException,
223 RepositoryException );
225 //FIXME reification: addReifiedStatement(Statement)...
228 //=============================================================================
230 }; }; }; };
232 #endif