1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir#ifndef __com_sun_star_rdf_XNamedGraph_idl__ 29*cdf0e10cSrcweir#define __com_sun_star_rdf_XNamedGraph_idl__ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 32*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 33*cdf0e10cSrcweir#endif 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 36*cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 37*cdf0e10cSrcweir#endif 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir#ifndef __com_sun_star_container_XEnumeration_idl__ 40*cdf0e10cSrcweir#include <com/sun/star/container/XEnumeration.idl> 41*cdf0e10cSrcweir#endif 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir#ifndef __com_sun_star_rdf_RepositoryException_idl__ 44*cdf0e10cSrcweir#include <com/sun/star/rdf/RepositoryException.idl> 45*cdf0e10cSrcweir#endif 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir#ifndef __com_sun_star_rdf_XURI_idl__ 48*cdf0e10cSrcweir#include <com/sun/star/rdf/XURI.idl> 49*cdf0e10cSrcweir#endif 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir//============================================================================= 53*cdf0e10cSrcweir 54*cdf0e10cSrcweirmodule com { module sun { module star { module rdf { 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir//============================================================================= 57*cdf0e10cSrcweir/** represents an RDF named graph that is stored in an RDF Repository. 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir <p> 60*cdf0e10cSrcweir Note that this interface inherits from <type>XResource</type>: the 61*cdf0e10cSrcweir name of the graph is the string value of the RDF node. 62*cdf0e10cSrcweir This is so that you can easily make RDF statements about named graphs. 63*cdf0e10cSrcweir </p> 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir <p> 66*cdf0e10cSrcweir Note that instances may be destroyed via 67*cdf0e10cSrcweir <member>XRepository::destroyGraph</member>. 68*cdf0e10cSrcweir If a graph is destroyed, subsequent calls to <member>addStatement</member>, 69*cdf0e10cSrcweir <member>removeStatements</member> will fail with an 70*cdf0e10cSrcweir <type scope="com::sun::star::container">NoSuchElementException</type>. 71*cdf0e10cSrcweir </p> 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir @since OOo 3.2 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir @see XRepository 76*cdf0e10cSrcweir */ 77*cdf0e10cSrcweirinterface XNamedGraph : XURI 78*cdf0e10cSrcweir{ 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir //------------------------------------------------------------------------- 81*cdf0e10cSrcweir /** returns the name of the graph. 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir <p> 84*cdf0e10cSrcweir The name is unique within the repository. 85*cdf0e10cSrcweir </p> 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir @returns 88*cdf0e10cSrcweir the name of the graph 89*cdf0e10cSrcweir */ 90*cdf0e10cSrcweir XURI getName(); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir //------------------------------------------------------------------------- 93*cdf0e10cSrcweir /** removes all statements from the graph. 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 96*cdf0e10cSrcweir if this graph does not exist in the repository any more 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir @throws RepositoryException 99*cdf0e10cSrcweir if an error occurs when accessing the repository. 100*cdf0e10cSrcweir */ 101*cdf0e10cSrcweir void clear() 102*cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException, 103*cdf0e10cSrcweir RepositoryException ); 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir //------------------------------------------------------------------------- 106*cdf0e10cSrcweir /** adds a RDF statement to the graph. 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir <p> 109*cdf0e10cSrcweir Note that the ODF elements that can have metadata attached all 110*cdf0e10cSrcweir implement the interface <type>XMetadatable</type>, which inherits 111*cdf0e10cSrcweir from <type>XResource</type>, meaning that you can simply pass them 112*cdf0e10cSrcweir in as arguments here, and it will magically work. 113*cdf0e10cSrcweir </p> 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir @param Subject 116*cdf0e10cSrcweir the subject of the RDF triple. 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir @param Predicate 119*cdf0e10cSrcweir the predicate of the RDF triple. 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir @param Object 122*cdf0e10cSrcweir the object of the RDF triple. 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 125*cdf0e10cSrcweir if any parameter is <NULL/> 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 128*cdf0e10cSrcweir if this graph does not exist in the repository any more 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir @throws RepositoryException 131*cdf0e10cSrcweir if an error occurs when accessing the repository. 132*cdf0e10cSrcweir */ 133*cdf0e10cSrcweir void addStatement([in] XResource Subject, 134*cdf0e10cSrcweir [in] XURI Predicate, 135*cdf0e10cSrcweir [in] XNode Object) 136*cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException, 137*cdf0e10cSrcweir com::sun::star::container::NoSuchElementException, 138*cdf0e10cSrcweir RepositoryException ); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir //------------------------------------------------------------------------- 141*cdf0e10cSrcweir /** removes matching RDF statements from the graph. 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir <p> 144*cdf0e10cSrcweir Note that the ODF elements that can have metadata attached all 145*cdf0e10cSrcweir implement the interface <type>XMetadatable</type>, which inherits 146*cdf0e10cSrcweir from <type>XResource</type>, meaning that you can simply pass them 147*cdf0e10cSrcweir in as arguments here, and it will magically work. 148*cdf0e10cSrcweir </p> 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir <p> 151*cdf0e10cSrcweir Any parameter may be <NULL/>, which acts as a wildcard. 152*cdf0e10cSrcweir For example, to remove all statements about myURI: 153*cdf0e10cSrcweir <code>removeStatement(myURI, null, null)</code> 154*cdf0e10cSrcweir </p> 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir @param Subject 157*cdf0e10cSrcweir the subject of the RDF triple. 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir @param Predicate 160*cdf0e10cSrcweir the predicate of the RDF triple. 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir @param Object 163*cdf0e10cSrcweir the object of the RDF triple. 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 166*cdf0e10cSrcweir if this graph does not exist in the repository any more 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir @throws RepositoryException 169*cdf0e10cSrcweir if an error occurs when accessing the repository. 170*cdf0e10cSrcweir */ 171*cdf0e10cSrcweir void removeStatements([in] XResource Subject, 172*cdf0e10cSrcweir [in] XURI Predicate, 173*cdf0e10cSrcweir [in] XNode Object) 174*cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException, 175*cdf0e10cSrcweir RepositoryException ); 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir //------------------------------------------------------------------------- 178*cdf0e10cSrcweir /** gets matching RDF statements from a graph. 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir <p> 181*cdf0e10cSrcweir Note that the ODF elements that can have metadata attached all 182*cdf0e10cSrcweir implement the interface <type>XMetadatable</type>, which inherits 183*cdf0e10cSrcweir from <type>XResource</type>, meaning that you can simply pass them 184*cdf0e10cSrcweir in as arguments here, and it will magically work. 185*cdf0e10cSrcweir </p> 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir <p> 188*cdf0e10cSrcweir Any parameter may be <NULL/>, which acts as a wildcard. 189*cdf0e10cSrcweir For example, to get all statements about myURI: 190*cdf0e10cSrcweir <code>getStatements(myURI, null, null)</code> 191*cdf0e10cSrcweir </p> 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir @param Subject 194*cdf0e10cSrcweir the subject of the RDF triple. 195*cdf0e10cSrcweir 196*cdf0e10cSrcweir @param Predicate 197*cdf0e10cSrcweir the predicate of the RDF triple. 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir @param Object 200*cdf0e10cSrcweir the object of the RDF triple. 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir @returns 203*cdf0e10cSrcweir an iterator over all RDF statements in the graph that match 204*cdf0e10cSrcweir the parameters, represented as an 205*cdf0e10cSrcweir enumeration of <type>Statement</type> 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 208*cdf0e10cSrcweir if this graph does not exist in the repository any more 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir @throws RepositoryException 211*cdf0e10cSrcweir if an error occurs when accessing the repository. 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir @see Statement 214*cdf0e10cSrcweir */ 215*cdf0e10cSrcweir com::sun::star::container::XEnumeration/*<Statement>*/ getStatements( 216*cdf0e10cSrcweir [in] XResource Subject, 217*cdf0e10cSrcweir [in] XURI Predicate, 218*cdf0e10cSrcweir [in] XNode Object) 219*cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException, 220*cdf0e10cSrcweir RepositoryException ); 221*cdf0e10cSrcweir 222*cdf0e10cSrcweir//FIXME reification: addReifiedStatement(Statement)... 223*cdf0e10cSrcweir}; 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir//============================================================================= 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir}; }; }; }; 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir#endif 230