1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_XDocumentRepository_idl__
21 #define __com_sun_star_rdf_XDocumentRepository_idl__
23 #include
<com
/sun
/star
/beans
/Pair.idl
>
24 #include
<com
/sun
/star
/rdf
/XMetadatable.idl
>
25 #include
<com
/sun
/star
/rdf
/XRepository.idl
>
29 module com
{ module sun
{ module star
{ module rdf
{
31 /** extends XRepository with document-specific functionality.
34 This subclass of XRepository provides some methods which
35 only make sense for repositories that are attached to a document.
36 For example, the methods allow for manipulating in-content metadata,
37 which is stored as RDFa.
42 @see XRepositorySupplier
43 @see XDocumentMetadataAccess
45 interface XDocumentRepository
: XRepository
48 /** update the RDFa statement(s) that correspond to an ODF element in the
52 This method will do the following steps:
54 <li>Remove all previously set RDFa statements for the Object parameter
55 from the repository</li>
56 <li>If the RDFaContent parameter is the empty `string`,
57 for every Predicate in the given list of Predicates,
58 add the following RDF statement to an unspecified named graph:
60 <li><code>Subject Predicate
61 XLiteral(Object->getText()^^RDFaDatatype)</code></li>
64 <li>If the RDFaContent parameter is not the empty `string`,
65 for every Predicate in the given list of Predicates,
66 add the following RDF statement to an unspecified named graph:
69 <code>Subject Predicate XLiteral(RDFaContent^^RDFaDatatype)</code>
77 RDFa statements are handled specially because they are not logically
78 part of any named graph in the repository.
79 Also, they have rather unusual semantics;
80 just using XNamedGraph::addStatement() would be
82 if the object is a XMetadatable, do we insert
83 the object itself (URI) or its literal content (RDFa)?
87 the subject of the RDF triple(s).
90 the predicates of the RDF triple(s).
93 the object of the RDF triple(s) is the text content of this
97 the <code>rdfa:content</code> attribute (may be the empty
101 the <code>rdfa:datatype</code> attribute (may be `NULL`)
103 @throws com::sun::star::lang::IllegalArgumentException
104 if any parameter is `NULL`, Predicates is empty,
105 or Object is of a type that can not have RDFa metadata attached.
107 @throws RepositoryException
108 if an error occurs when accessing the repository.
110 void setStatementRDFa
(
111 [in] XResource Subject
,
112 [in] sequence
<XURI
> Predicates
,
113 [in] XMetadatable
Object,
114 [in] string RDFaContent
,
115 [in] XURI RDFaDatatype
)
116 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
117 RepositoryException
);
119 /** remove the RDFa statement(s) that correspond to an ODF element from the
123 RDFa statements are handled specially because they are not logically
128 the element whose RDFa statement(s) should be removed
130 @throws com::sun::star::lang::IllegalArgumentException
131 if the given Element is `NULL`, or of a type that can not have
132 RDFa metadata attached.
134 @throws RepositoryException
135 if an error occurs when accessing the repository.
137 void removeStatementRDFa
([in] XMetadatable Element
)
138 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
139 RepositoryException
);
141 /** find the RDFa statement(s) associated with an ODF element.
144 the ODF element for which RDFa statements should be found
148 <li>if the element has no RDFa meta-data attributes:
149 the empty sequence.</li>
150 <li>if the element has RDFa meta-data attributes:
152 <li>a sequence with the RDFa-statements corresponding to the
154 <li>a flag indicating whether there is a xhtml:content
160 @throws com::sun::star::lang::IllegalArgumentException
161 if the given Element is `NULL`, or of a type that can not have
162 RDFa metadata attached.
164 @throws RepositoryException
165 if an error occurs when accessing the repository.
169 com
::sun
::star
::beans
::Pair
< sequence
<Statement
>, boolean >
170 getStatementRDFa
([in] XMetadatable Element
)
171 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
172 RepositoryException
);
174 /** gets matching RDFa statements from the repository.
177 This method exists because RDFa statements are not part of any named
178 graph, and thus they cannot be enumerated with
179 XNamedGraph::getStatements().
183 Any parameter may be `NULL`, which acts as a wildcard.
184 For example, to get all statements about myURI:
185 <code>getStatementsRDFa(myURI, null, null)</code>
189 the subject of the RDF triple.
192 the predicate of the RDF triple.
195 the object of the RDF triple.
198 an iterator over all RDFa statements in the repository that match
199 the parameters, represented as an
200 enumeration of Statement
202 @throws RepositoryException
203 if an error occurs when accessing the repository.
206 @see XRepository::getStatements
207 @see XNamedGraph::getStatements
209 com
::sun
::star
::container
::XEnumeration
/*<Statement>*/ getStatementsRDFa
(
210 [in] XResource Subject
,
213 raises
( RepositoryException
);
222 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */