RDF Parser
table of contents
- This document is a quick writeup of the Eric Prud'hommeaux's
RdfParser module and its interaction with other module in the W3C Perl
libraries.
- Any releases of this document and the accompanying code constitute
alpha releases and do not constitute W3C reference code.
- Code examples in this document are in C++ syntax as I will port
this to C/C++ next.
I made some effort to divy the state betweeb the RdfParser
and the RdfDB. The RdfParser
maintains only that state that is associated with how the triples are
serialized in XML.
The elements of state that need to be stored are:
- mode
- whether we are expecting a
Description, propertyElt, member, etc.
- trusting
- whether we are trusting
encountered triples. This is part of the Attributions that I'm sketching out.
- container
-
- type
- The type of a [6.13]
typedNode. This will be NULL for a [6.3]
description that is not a typedNode.
The mode changes at the start and end of each
XML element. container, type and trusting change each
time a description is encountered. Because nested RDF statements
alternate between [6.13]
typedNode and [6.3]
description, every other tag in a tag stack has a description
associated with it. I stuck all of these into a single stack. The
parsing steps in RDF-ImpNotes show how
these were set and used for each tag.