[Mulgara-general] IRI parsing flakiness

Gregg Reynolds dev at mobileink.com
Sun Sep 20 02:14:33 UTC 2009


On Sat, Sep 19, 2009 at 7:53 PM, Paul Gearon <gearon at ieee.org> wrote:

> Hi Greg,
>
> It took me a while to track it all down, but I finally got all the
> references I need.  :-)
>
> The problem is with your N3. It turns out that what you've been trying
> are not valid QNames. You'll find that if you go back to using URIs
> then it will work just fine. So the following N3 will load fine:
>

Aarrggh!   I thought I had slogged through all the relevant standards but
obviously not.  (I should rename the thread to "W3C Standards flakiness",
but there's probably an excellent reason for it all.)

The "local" part of a QName accepts the same characters as an XML
> name, minus the ":" character.
> http://www.w3.org/TR/REC-xml-names/#NT-NCName
>
> Of course, good ol' NCNames.  (I was on the W3C XSL WG years ago, so I
should know this stuff.)


> So you can have dots, dashes and underscores, but no + or commas. So
> you'll have to keep your QNames simple, or else just use URIs (which
> are delimited by angle brackets).
>

Hmm.  Just ran some tests with dots, dashes and underscores.  All ok except
for dots, e.g.

@prefix test:  <http://example.org/test/> .
test:Test-dot    test:uri    test:U06.2F .

UF6.2  - unexpected char F
UF.62 - ok
U0F6.2 - unexpected char F

Works ok if F is replaced by a number, but if F is in there it's rejected.
Any final the dot is rejected, as in "test:U0620." and "test:U062F."

Just for kicks I generated test cases for the other NameChars, 0xB7
(middot), a few combining chars (0x0300-0x0036F), undertie (0x203F), tie
(0x2040) and a few illegal ones (0x203E, 0x2041).  All worked as expected.
I'll push the testcases to mulligan if bitbucket.org ever comes back on
line. ;)

Sorry about the false alarm.  Looking on the bright side of things, this
will make for a useful piece of documentation.

gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mulgara.org/pipermail/mulgara-general/attachments/20090919/4383ccb0/attachment.htm>


More information about the Mulgara-general mailing list