Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / rdf / XNamedGraph.idl
blob3de01b4763b9c528558089dbd3e0738d0041ecda
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_rdf_XNamedGraph_idl__
21 #define __com_sun_star_rdf_XNamedGraph_idl__
23 #include <com/sun/star/lang/IllegalArgumentException.idl>
24 #include <com/sun/star/container/NoSuchElementException.idl>
25 #include <com/sun/star/container/XEnumeration.idl>
26 #include <com/sun/star/rdf/RepositoryException.idl>
27 #include <com/sun/star/rdf/XURI.idl>
31 module com { module sun { module star { module rdf {
33 /** represents an RDF named graph that is stored in an RDF Repository.
35 <p>
36 Note that this interface inherits from XResource: the
37 name of the graph is the string value of the RDF node.
38 This is so that you can easily make RDF statements about named graphs.
39 </p>
41 <p>
42 Note that instances may be destroyed via
43 XRepository::destroyGraph().
44 If a graph is destroyed, subsequent calls to addStatement(),
45 removeStatements() will fail with an
46 com::sun::star::container::NoSuchElementException.
47 </p>
49 @since OOo 3.2
51 @see XRepository
53 interface XNamedGraph : XURI
56 /** returns the name of the graph.
58 <p>
59 The name is unique within the repository.
60 </p>
62 @returns
63 the name of the graph
65 XURI getName();
67 /** removes all statements from the graph.
69 @throws com::sun::star::container::NoSuchElementException
70 if this graph does not exist in the repository any more
72 @throws RepositoryException
73 if an error occurs when accessing the repository.
75 void clear()
76 raises( com::sun::star::container::NoSuchElementException,
77 RepositoryException );
79 /** adds a RDF statement to the graph.
81 <p>
82 Note that the ODF elements that can have metadata attached all
83 implement the interface XMetadatable, which inherits
84 from XResource, meaning that you can simply pass them
85 in as arguments here, and it will magically work.
86 </p>
88 @param Subject
89 the subject of the RDF triple.
91 @param Predicate
92 the predicate of the RDF triple.
94 @param Object
95 the object of the RDF triple.
97 @throws com::sun::star::lang::IllegalArgumentException
98 if any parameter is `NULL`
100 @throws com::sun::star::container::NoSuchElementException
101 if this graph does not exist in the repository any more
103 @throws RepositoryException
104 if an error occurs when accessing the repository.
106 void addStatement([in] XResource Subject,
107 [in] XURI Predicate,
108 [in] XNode Object)
109 raises( com::sun::star::lang::IllegalArgumentException,
110 com::sun::star::container::NoSuchElementException,
111 RepositoryException );
113 /** removes matching RDF statements from the graph.
116 Note that the ODF elements that can have metadata attached all
117 implement the interface XMetadatable, which inherits
118 from XResource, meaning that you can simply pass them
119 in as arguments here, and it will magically work.
120 </p>
123 Any parameter may be `NULL`, which acts as a wildcard.
124 For example, to remove all statements about myURI:
125 <code>removeStatement(myURI, null, null)</code>
126 </p>
128 @param Subject
129 the subject of the RDF triple.
131 @param Predicate
132 the predicate of the RDF triple.
134 @param Object
135 the object of the RDF triple.
137 @throws com::sun::star::container::NoSuchElementException
138 if this graph does not exist in the repository any more
140 @throws RepositoryException
141 if an error occurs when accessing the repository.
143 void removeStatements([in] XResource Subject,
144 [in] XURI Predicate,
145 [in] XNode Object)
146 raises( com::sun::star::container::NoSuchElementException,
147 RepositoryException );
149 /** gets matching RDF statements from a graph.
152 Note that the ODF elements that can have metadata attached all
153 implement the interface XMetadatable, which inherits
154 from XResource, meaning that you can simply pass them
155 in as arguments here, and it will magically work.
156 </p>
159 Any parameter may be `NULL`, which acts as a wildcard.
160 For example, to get all statements about myURI:
161 <code>getStatements(myURI, null, null)</code>
162 </p>
164 @param Subject
165 the subject of the RDF triple.
167 @param Predicate
168 the predicate of the RDF triple.
170 @param Object
171 the object of the RDF triple.
173 @returns
174 an iterator over all RDF statements in the graph that match
175 the parameters, represented as an
176 enumeration of Statement
178 @throws com::sun::star::container::NoSuchElementException
179 if this graph does not exist in the repository any more
181 @throws RepositoryException
182 if an error occurs when accessing the repository.
184 @see Statement
186 com::sun::star::container::XEnumeration/*<Statement>*/ getStatements(
187 [in] XResource Subject,
188 [in] XURI Predicate,
189 [in] XNode Object)
190 raises( com::sun::star::container::NoSuchElementException,
191 RepositoryException );
193 //FIXME reification: addReifiedStatement(Statement)...
197 }; }; }; };
199 #endif
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */