1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_rdf_XNamedGraph_idl__ 25cdf0e10cSrcweir#define __com_sun_star_rdf_XNamedGraph_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 28cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 32cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 33cdf0e10cSrcweir#endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir#ifndef __com_sun_star_container_XEnumeration_idl__ 36cdf0e10cSrcweir#include <com/sun/star/container/XEnumeration.idl> 37cdf0e10cSrcweir#endif 38cdf0e10cSrcweir 39cdf0e10cSrcweir#ifndef __com_sun_star_rdf_RepositoryException_idl__ 40cdf0e10cSrcweir#include <com/sun/star/rdf/RepositoryException.idl> 41cdf0e10cSrcweir#endif 42cdf0e10cSrcweir 43cdf0e10cSrcweir#ifndef __com_sun_star_rdf_XURI_idl__ 44cdf0e10cSrcweir#include <com/sun/star/rdf/XURI.idl> 45cdf0e10cSrcweir#endif 46cdf0e10cSrcweir 47cdf0e10cSrcweir 48cdf0e10cSrcweir//============================================================================= 49cdf0e10cSrcweir 50cdf0e10cSrcweirmodule com { module sun { module star { module rdf { 51cdf0e10cSrcweir 52cdf0e10cSrcweir//============================================================================= 53cdf0e10cSrcweir/** represents an RDF named graph that is stored in an RDF Repository. 54cdf0e10cSrcweir 55cdf0e10cSrcweir <p> 56cdf0e10cSrcweir Note that this interface inherits from <type>XResource</type>: the 57cdf0e10cSrcweir name of the graph is the string value of the RDF node. 58cdf0e10cSrcweir This is so that you can easily make RDF statements about named graphs. 59cdf0e10cSrcweir </p> 60cdf0e10cSrcweir 61cdf0e10cSrcweir <p> 62cdf0e10cSrcweir Note that instances may be destroyed via 63cdf0e10cSrcweir <member>XRepository::destroyGraph</member>. 64cdf0e10cSrcweir If a graph is destroyed, subsequent calls to <member>addStatement</member>, 65cdf0e10cSrcweir <member>removeStatements</member> will fail with an 66cdf0e10cSrcweir <type scope="com::sun::star::container">NoSuchElementException</type>. 67cdf0e10cSrcweir </p> 68cdf0e10cSrcweir 69*96af39f7SJürgen Schmidt @since OpenOffice 3.2 70cdf0e10cSrcweir 71cdf0e10cSrcweir @see XRepository 72cdf0e10cSrcweir */ 73cdf0e10cSrcweirinterface XNamedGraph : XURI 74cdf0e10cSrcweir{ 75cdf0e10cSrcweir 76cdf0e10cSrcweir //------------------------------------------------------------------------- 77cdf0e10cSrcweir /** returns the name of the graph. 78cdf0e10cSrcweir 79cdf0e10cSrcweir <p> 80cdf0e10cSrcweir The name is unique within the repository. 81cdf0e10cSrcweir </p> 82cdf0e10cSrcweir 83cdf0e10cSrcweir @returns 84cdf0e10cSrcweir the name of the graph 85cdf0e10cSrcweir */ 86cdf0e10cSrcweir XURI getName(); 87cdf0e10cSrcweir 88cdf0e10cSrcweir //------------------------------------------------------------------------- 89cdf0e10cSrcweir /** removes all statements from the graph. 90cdf0e10cSrcweir 91cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 92cdf0e10cSrcweir if this graph does not exist in the repository any more 93cdf0e10cSrcweir 94cdf0e10cSrcweir @throws RepositoryException 95cdf0e10cSrcweir if an error occurs when accessing the repository. 96cdf0e10cSrcweir */ 97cdf0e10cSrcweir void clear() 98cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException, 99cdf0e10cSrcweir RepositoryException ); 100cdf0e10cSrcweir 101cdf0e10cSrcweir //------------------------------------------------------------------------- 102cdf0e10cSrcweir /** adds a RDF statement to the graph. 103cdf0e10cSrcweir 104cdf0e10cSrcweir <p> 105cdf0e10cSrcweir Note that the ODF elements that can have metadata attached all 106cdf0e10cSrcweir implement the interface <type>XMetadatable</type>, which inherits 107cdf0e10cSrcweir from <type>XResource</type>, meaning that you can simply pass them 108cdf0e10cSrcweir in as arguments here, and it will magically work. 109cdf0e10cSrcweir </p> 110cdf0e10cSrcweir 111cdf0e10cSrcweir @param Subject 112cdf0e10cSrcweir the subject of the RDF triple. 113cdf0e10cSrcweir 114cdf0e10cSrcweir @param Predicate 115cdf0e10cSrcweir the predicate of the RDF triple. 116cdf0e10cSrcweir 117cdf0e10cSrcweir @param Object 118cdf0e10cSrcweir the object of the RDF triple. 119cdf0e10cSrcweir 120cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 121cdf0e10cSrcweir if any parameter is <NULL/> 122cdf0e10cSrcweir 123cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 124cdf0e10cSrcweir if this graph does not exist in the repository any more 125cdf0e10cSrcweir 126cdf0e10cSrcweir @throws RepositoryException 127cdf0e10cSrcweir if an error occurs when accessing the repository. 128cdf0e10cSrcweir */ 129cdf0e10cSrcweir void addStatement([in] XResource Subject, 130cdf0e10cSrcweir [in] XURI Predicate, 131cdf0e10cSrcweir [in] XNode Object) 132cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException, 133cdf0e10cSrcweir com::sun::star::container::NoSuchElementException, 134cdf0e10cSrcweir RepositoryException ); 135cdf0e10cSrcweir 136cdf0e10cSrcweir //------------------------------------------------------------------------- 137cdf0e10cSrcweir /** removes matching RDF statements from the graph. 138cdf0e10cSrcweir 139cdf0e10cSrcweir <p> 140cdf0e10cSrcweir Note that the ODF elements that can have metadata attached all 141cdf0e10cSrcweir implement the interface <type>XMetadatable</type>, which inherits 142cdf0e10cSrcweir from <type>XResource</type>, meaning that you can simply pass them 143cdf0e10cSrcweir in as arguments here, and it will magically work. 144cdf0e10cSrcweir </p> 145cdf0e10cSrcweir 146cdf0e10cSrcweir <p> 147cdf0e10cSrcweir Any parameter may be <NULL/>, which acts as a wildcard. 148cdf0e10cSrcweir For example, to remove all statements about myURI: 149cdf0e10cSrcweir <code>removeStatement(myURI, null, null)</code> 150cdf0e10cSrcweir </p> 151cdf0e10cSrcweir 152cdf0e10cSrcweir @param Subject 153cdf0e10cSrcweir the subject of the RDF triple. 154cdf0e10cSrcweir 155cdf0e10cSrcweir @param Predicate 156cdf0e10cSrcweir the predicate of the RDF triple. 157cdf0e10cSrcweir 158cdf0e10cSrcweir @param Object 159cdf0e10cSrcweir the object of the RDF triple. 160cdf0e10cSrcweir 161cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 162cdf0e10cSrcweir if this graph does not exist in the repository any more 163cdf0e10cSrcweir 164cdf0e10cSrcweir @throws RepositoryException 165cdf0e10cSrcweir if an error occurs when accessing the repository. 166cdf0e10cSrcweir */ 167cdf0e10cSrcweir void removeStatements([in] XResource Subject, 168cdf0e10cSrcweir [in] XURI Predicate, 169cdf0e10cSrcweir [in] XNode Object) 170cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException, 171cdf0e10cSrcweir RepositoryException ); 172cdf0e10cSrcweir 173cdf0e10cSrcweir //------------------------------------------------------------------------- 174cdf0e10cSrcweir /** gets matching RDF statements from a graph. 175cdf0e10cSrcweir 176cdf0e10cSrcweir <p> 177cdf0e10cSrcweir Note that the ODF elements that can have metadata attached all 178cdf0e10cSrcweir implement the interface <type>XMetadatable</type>, which inherits 179cdf0e10cSrcweir from <type>XResource</type>, meaning that you can simply pass them 180cdf0e10cSrcweir in as arguments here, and it will magically work. 181cdf0e10cSrcweir </p> 182cdf0e10cSrcweir 183cdf0e10cSrcweir <p> 184cdf0e10cSrcweir Any parameter may be <NULL/>, which acts as a wildcard. 185cdf0e10cSrcweir For example, to get all statements about myURI: 186cdf0e10cSrcweir <code>getStatements(myURI, null, null)</code> 187cdf0e10cSrcweir </p> 188cdf0e10cSrcweir 189cdf0e10cSrcweir @param Subject 190cdf0e10cSrcweir the subject of the RDF triple. 191cdf0e10cSrcweir 192cdf0e10cSrcweir @param Predicate 193cdf0e10cSrcweir the predicate of the RDF triple. 194cdf0e10cSrcweir 195cdf0e10cSrcweir @param Object 196cdf0e10cSrcweir the object of the RDF triple. 197cdf0e10cSrcweir 198cdf0e10cSrcweir @returns 199cdf0e10cSrcweir an iterator over all RDF statements in the graph that match 200cdf0e10cSrcweir the parameters, represented as an 201cdf0e10cSrcweir enumeration of <type>Statement</type> 202cdf0e10cSrcweir 203cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 204cdf0e10cSrcweir if this graph does not exist in the repository any more 205cdf0e10cSrcweir 206cdf0e10cSrcweir @throws RepositoryException 207cdf0e10cSrcweir if an error occurs when accessing the repository. 208cdf0e10cSrcweir 209cdf0e10cSrcweir @see Statement 210cdf0e10cSrcweir */ 211cdf0e10cSrcweir com::sun::star::container::XEnumeration/*<Statement>*/ getStatements( 212cdf0e10cSrcweir [in] XResource Subject, 213cdf0e10cSrcweir [in] XURI Predicate, 214cdf0e10cSrcweir [in] XNode Object) 215cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException, 216cdf0e10cSrcweir RepositoryException ); 217cdf0e10cSrcweir 218cdf0e10cSrcweir//FIXME reification: addReifiedStatement(Statement)... 219cdf0e10cSrcweir}; 220cdf0e10cSrcweir 221cdf0e10cSrcweir//============================================================================= 222cdf0e10cSrcweir 223cdf0e10cSrcweir}; }; }; }; 224cdf0e10cSrcweir 225cdf0e10cSrcweir#endif 226