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 $
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
>
38 #ifndef __com_sun_star_container_NoSuchElementException_idl__
39 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
42 #ifndef __com_sun_star_container_XEnumeration_idl__
43 #include
<com
/sun
/star
/container
/XEnumeration.idl
>
46 #ifndef __com_sun_star_rdf_RepositoryException_idl__
47 #include
<com
/sun
/star
/rdf
/RepositoryException.idl
>
50 #ifndef __com_sun_star_rdf_XURI_idl__
51 #include
<com
/sun
/star
/rdf
/XURI.idl
>
55 //=============================================================================
57 module com
{ module sun
{ module star
{ module rdf
{
59 //=============================================================================
60 /** represents an RDF named graph that is stored in an RDF Repository.
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.
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>.
80 interface XNamedGraph
: XURI
83 //-------------------------------------------------------------------------
84 /** returns the name of the graph.
87 The name is unique within the repository.
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.
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.
119 the subject of the RDF triple.
122 the predicate of the RDF triple.
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
,
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.
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>
160 the subject of the RDF triple.
163 the predicate of the RDF triple.
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
,
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.
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>
197 the subject of the RDF triple.
200 the predicate of the RDF triple.
203 the object of the RDF triple.
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.
218 com
::sun
::star
::container
::XEnumeration
/*<Statement>*/ getStatements
(
219 [in] XResource Subject
,
222 raises
( com
::sun
::star
::container
::NoSuchElementException
,
223 RepositoryException
);
225 //FIXME reification: addReifiedStatement(Statement)...
228 //=============================================================================