RE: Alternative RDF/XML serializations

> 1. The inside of <MKR ...> ... </MKR> would be parsed by MKE or
> some equivalent parser.  The parsing is easy -- MKR's basic structure
> is comma-separated lists between keywords or punctuation marks.

Perhaps that could be parsed with XSLT's string parsing functions (and,
I think, with XSLT 2.0's RE functions too).  However, I consider the MKR
data structure as RDF serialized into a (tokenized) string, not an XML
serialization (although it is also a tokenized string).

> 2. What would qualify the inside as an XML serialization?

That is technically a serialization in XML; however, the graph is not
encoded in a XML-formatted data structure (only the MKR element
signifies it as a graph).  Subjects, predicates, and objects are not
identified by elements or attributes for instance.

Thus, I would encode your example as something like:

<MKR
  xmlns    ="http://rhm.cdepot.net/xml/MODIFIED"
  xmlns:ex ="http://www.example.com/terms/"
  xmlns:dc ="http://purl.org/dc/elements/1.1/"
>
  <resource>
    <name>Dave Beckett</name>
    <ex:homepage ref="http://purl.org/net/dajobe" />
  </resource>
  <resource>
    <name>document</name>
    <dc:title ref="RDF/XML Syntax Specification (Revised)" />
    <ex:editor>Dave Beckett</ex:editor>
    <ex:uri ref="http://www.w3.org/TR/rdf-syntax-grammar" />
  </resource>
</MKR>

Note that is just a hypothetical example.  That allows one to use XPaths
like:

1. "/MKR/resource/name/text()" to identify subjects,
2.
"/MKR/resource/*[namespace-uri()!='http://rhm.cdepot.net/xml/MODIFIED']"
   to identify predicate element-nodes (not RDF 'nodes', but XML
'nodes').
3. "@ref" (in above context) to identify predicate URIes.
4. "./text()" (in above context) to identify predicate literals.

You can use those (in XSLT stylesheets) rather than using regular
expressions or other string processing (necessary with your syntax).

> 3. Does XSLT allow me to hook my parser into its structure?

It depends.  Sorry for the vague answer; however, XSLT extensions are in
general not (very) standard.  MSXML.NET allows use of the C#, Jscript
and VBscript languages.  The Xalan-J application allows you to use Java
or JavaScript extensions.  I think Xalan also allows Perl/TCL, if you
have the appropriate plug-ins.

--
Jimmy Cerra

] "I have learned these days, never to limit
]  anyone else due to my own limited
]  imagination." - Dr. Mae C. Jemison

Received on Friday, 6 June 2003 22:33:48 UTC