Module RDFMessage.Parsers
Conversion of messages to and from RDF representations.
Copyright (C) 2006 Paul Boddie <paul@boddie.org.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
--------
To parse mailboxes, use the parse_mailbox function provided in this module:
resource = RDFMessage.Parsers.parse_mailbox(f, store)
In the above call, f should be a stream providing message data, and store
should be some kind of object which can understand the actions of the parsing
process; in the RDFMessage.Store module, some classes are provided for this
activity.
To interpret the contents of DOM documents, use the parse_document and
parse_document_fragment functions provided in this module.
Function Summary |
|
add_message(store,
attributes,
node_type,
uriref)
|
|
check_existing(store,
uriref)
|
|
find_uid(message)
|
|
parse_document (doc,
store,
uriref)
Parse the resource data found in the given DOM document 'doc', inserting the
information in the given 'store'. |
|
parse_document_fragment (doc,
root,
store,
uriref)
Parse the resource data found in the given DOM document 'doc' under the
'root' element, inserting the information in the given 'store'. |
|
parse_mailbox (f,
store,
uriref)
Parse the message data found through the use of the file object 'f', and
put the resource information in the given 'store'. |
parse_document(doc,
store,
uriref=None)
Parse the resource data found in the given DOM document 'doc', inserting the
information in the given 'store'. The 'uriref' must be specified to define
the identity of the root node.
-
|
parse_document_fragment(doc,
root,
store,
uriref=None)
Parse the resource data found in the given DOM document 'doc' under the
'root' element, inserting the information in the given 'store'. The
'uriref' must be specified to define the identity of the root node.
-
|
parse_mailbox(f,
store,
uriref)
Parse the message data found through the use of the file object 'f', and
put the resource information in the given 'store'.
The 'uriref' parameter must be used to set a unique reference to the
resource by defining a specific URI reference.
As a result of parsing the resource, the root node of the imported resource
is returned.
-
|