1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef __com_sun_star_rdf_XNamedGraph_idl__
30 #define __com_sun_star_rdf_XNamedGraph_idl__
32 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
33 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
34 #include
<com
/sun
/star
/container
/XEnumeration.idl
>
35 #include
<com
/sun
/star
/rdf
/RepositoryException.idl
>
36 #include
<com
/sun
/star
/rdf
/XURI.idl
>
39 //=============================================================================
41 module com
{ module sun
{ module star
{ module rdf
{
43 //=============================================================================
44 /** represents an RDF named graph that is stored in an RDF Repository.
47 Note that this interface inherits from <type>XResource</type>: the
48 name of the graph is the string value of the RDF node.
49 This is so that you can easily make RDF statements about named graphs.
53 Note that instances may be destroyed via
54 <member>XRepository::destroyGraph</member>.
55 If a graph is destroyed, subsequent calls to <member>addStatement</member>,
56 <member>removeStatements</member> will fail with an
57 <type scope="com::sun::star::container">NoSuchElementException</type>.
64 interface XNamedGraph
: XURI
67 //-------------------------------------------------------------------------
68 /** returns the name of the graph.
71 The name is unique within the repository.
79 //-------------------------------------------------------------------------
80 /** removes all statements from the graph.
82 @throws com::sun::star::container::NoSuchElementException
83 if this graph does not exist in the repository any more
85 @throws RepositoryException
86 if an error occurs when accessing the repository.
89 raises
( com
::sun
::star
::container
::NoSuchElementException
,
90 RepositoryException
);
92 //-------------------------------------------------------------------------
93 /** adds a RDF statement to the graph.
96 Note that the ODF elements that can have metadata attached all
97 implement the interface <type>XMetadatable</type>, which inherits
98 from <type>XResource</type>, meaning that you can simply pass them
99 in as arguments here, and it will magically work.
103 the subject of the RDF triple.
106 the predicate of the RDF triple.
109 the object of the RDF triple.
111 @throws com::sun::star::lang::IllegalArgumentException
112 if any parameter is <NULL/>
114 @throws com::sun::star::container::NoSuchElementException
115 if this graph does not exist in the repository any more
117 @throws RepositoryException
118 if an error occurs when accessing the repository.
120 void addStatement
([in] XResource Subject
,
123 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
124 com
::sun
::star
::container
::NoSuchElementException
,
125 RepositoryException
);
127 //-------------------------------------------------------------------------
128 /** removes matching RDF statements from the graph.
131 Note that the ODF elements that can have metadata attached all
132 implement the interface <type>XMetadatable</type>, which inherits
133 from <type>XResource</type>, meaning that you can simply pass them
134 in as arguments here, and it will magically work.
138 Any parameter may be <NULL/>, which acts as a wildcard.
139 For example, to remove all statements about myURI:
140 <code>removeStatement(myURI, null, null)</code>
144 the subject of the RDF triple.
147 the predicate of the RDF triple.
150 the object of the RDF triple.
152 @throws com::sun::star::container::NoSuchElementException
153 if this graph does not exist in the repository any more
155 @throws RepositoryException
156 if an error occurs when accessing the repository.
158 void removeStatements
([in] XResource Subject
,
161 raises
( com
::sun
::star
::container
::NoSuchElementException
,
162 RepositoryException
);
164 //-------------------------------------------------------------------------
165 /** gets matching RDF statements from a graph.
168 Note that the ODF elements that can have metadata attached all
169 implement the interface <type>XMetadatable</type>, which inherits
170 from <type>XResource</type>, meaning that you can simply pass them
171 in as arguments here, and it will magically work.
175 Any parameter may be <NULL/>, which acts as a wildcard.
176 For example, to get all statements about myURI:
177 <code>getStatements(myURI, null, null)</code>
181 the subject of the RDF triple.
184 the predicate of the RDF triple.
187 the object of the RDF triple.
190 an iterator over all RDF statements in the graph that match
191 the parameters, represented as an
192 enumeration of <type>Statement</type>
194 @throws com::sun::star::container::NoSuchElementException
195 if this graph does not exist in the repository any more
197 @throws RepositoryException
198 if an error occurs when accessing the repository.
202 com
::sun
::star
::container
::XEnumeration
/*<Statement>*/ getStatements
(
203 [in] XResource Subject
,
206 raises
( com
::sun
::star
::container
::NoSuchElementException
,
207 RepositoryException
);
209 //FIXME reification: addReifiedStatement(Statement)...
212 //=============================================================================
218 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */