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
>
35 #ifndef __com_sun_star_container_NoSuchElementException_idl__
36 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
39 #ifndef __com_sun_star_container_XEnumeration_idl__
40 #include
<com
/sun
/star
/container
/XEnumeration.idl
>
43 #ifndef __com_sun_star_rdf_RepositoryException_idl__
44 #include
<com
/sun
/star
/rdf
/RepositoryException.idl
>
47 #ifndef __com_sun_star_rdf_XURI_idl__
48 #include
<com
/sun
/star
/rdf
/XURI.idl
>
52 //=============================================================================
54 module com
{ module sun
{ module star
{ module rdf
{
56 //=============================================================================
57 /** represents an RDF named graph that is stored in an RDF Repository.
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.
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>.
77 interface XNamedGraph
: XURI
80 //-------------------------------------------------------------------------
81 /** returns the name of the graph.
84 The name is unique within the repository.
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.
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.
116 the subject of the RDF triple.
119 the predicate of the RDF triple.
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
,
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.
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>
157 the subject of the RDF triple.
160 the predicate of the RDF triple.
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
,
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.
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>
194 the subject of the RDF triple.
197 the predicate of the RDF triple.
200 the object of the RDF triple.
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.
215 com
::sun
::star
::container
::XEnumeration
/*<Statement>*/ getStatements
(
216 [in] XResource Subject
,
219 raises
( com
::sun
::star
::container
::NoSuchElementException
,
220 RepositoryException
);
222 //FIXME reification: addReifiedStatement(Statement)...
225 //=============================================================================