On 09/03/12 09:35, David Byrden wrote:

Sorry if this is a simple question, but I have looked for
examples without success...

I want Jena to read N3 with literal XML values,
possibly including namespaces. Then write them out
as RDF, preserving the XML and its namespaces.

An example of my input:

<THING> dc:description
"Text and a <link to='place'>complex element</link>."^^rdf:XMLLiteral .

I think it's because that is not a legal XML Literal. XML literals must be canonical to be valid and valid to be output as parseType-literal.

The rules are there to trip you up.

http://www.w3.org/TR/rdf-concepts/#section-XMLLiteral

In this case it's a simple matter of using " not ' in the attribute.

"riot --validate" does checking but it only tells you if it's right or wrong, not why it's wrong.

But the RDF output is escaped XML; the angle brackets
are replaced by escape sequences. I want to process the output
with XSLT, so I would prefer the XML to remain as such.

This happens when the lexical for is illegal - it outputs the content as if it were a string in the XML, making any XML characters safe.

Is this even supposed to be possible?

Oddly enough, if I use very simple XML (no attributes, no
namespaces) it does approximately what I want!

Thank you.
David

(You may have guessed I'm not a big fan of rdf:XMLLiterals. Far too complicated for practical use.)

        Andy


Reply via email to