RDFXML round-trip test cases

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

RDFXML round-trip test cases

Ian McKellar
When tracking down some assertions in our use of RDF I noticed there are
some problems round-tripping data through the Mozilla RDFXML serializer
and parser. I put together a little script that I'd love some feedback
on. I'm going to be creating bugs for these issues and attaching
proposed patches if I can work out how to fix them as I go along.

Ian

_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf

signature.asc (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RDFXML round-trip test cases

Axel Hecht-2
Ian McKellar wrote:
> When tracking down some assertions in our use of RDF I noticed there are
> some problems round-tripping data through the Mozilla RDFXML serializer
> and parser. I put together a little script that I'd love some feedback
> on. I'm going to be creating bugs for these issues and attaching
> proposed patches if I can work out how to fix them as I go along.

There is no requirement in RDF/XML to be roundtripping. I personally
gave up on tests like that a while ago. I didn't dive into your js too
much, but it looks like you're testing quotes and stuff. Make sure to
test a slightly recent tree (IIRC, 1.8 is ok), as I fixed some of that.

I'd rather see you attaching just a rdf/xml file that has problems with
either rdfcat or triplescat (both built in the tests phase), that is
likely going to be easier than to reverse engineer a js test harness.

Axel
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf
Reply | Threaded
Open this post in threaded view
|

Re: RDFXML round-trip test cases

Ian McKellar
Axel Hecht wrote:
> There is no requirement in RDF/XML to be roundtripping.

There isn't? Why not? This would seriously limit RDF's usefulness as a
metadata store. As far as I can see the RDF/XML spec makes it possible
to do round-tripping.

> I didn't dive into your js too
> much, but it looks like you're testing quotes and stuff. Make sure to
> test a slightly recent tree (IIRC, 1.8 is ok), as I fixed some of that.

Bug #231548 contains some fixes that aren't in the 1.8 branch (or at
least weren't in Firefox2, Beta 1. The Flock tree I'm primarily working
in is taken from the 1.8 branch at Firefox2 beta tags, but I'll file
bugs and patches in mozilla bugzilla against a trunk build.
>
> I'd rather see you attaching just a rdf/xml file that has problems with
> either rdfcat or triplescat (both built in the tests phase), that is
> likely going to be easier than to reverse engineer a js test harness.

Ok. I'll file them in that form.

Ian


_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf

signature.asc (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RDFXML round-trip test cases

Axel Hecht-2
Ian McKellar wrote:
> Axel Hecht wrote:
>> There is no requirement in RDF/XML to be roundtripping.
>
> There isn't? Why not? This would seriously limit RDF's usefulness as a
> metadata store. As far as I can see the RDF/XML spec makes it possible
> to do round-tripping.

Possible, yes, but not a requirement. There is no unique mapping of a
graph to RDF/XML, thus, if you talk in terms of graphs, yes, that should
roundtrip, but then you have to match anonymous nodes, which is tricky.

Roundtripping based on the RDF/XML file is going to be hard, if it
reliably works depends largely on testcase and tested implementation.
You could always randomly replace single chars with numeric entities,
but nobody goes to that extreme. But attribute values containing ' are
totally ambiguous and may be serialized as "'" or as '&..;'.

Axel

>> I didn't dive into your js too
>> much, but it looks like you're testing quotes and stuff. Make sure to
>> test a slightly recent tree (IIRC, 1.8 is ok), as I fixed some of that.
>
> Bug #231548 contains some fixes that aren't in the 1.8 branch (or at
> least weren't in Firefox2, Beta 1. The Flock tree I'm primarily working
> in is taken from the 1.8 branch at Firefox2 beta tags, but I'll file
> bugs and patches in mozilla bugzilla against a trunk build.
>> I'd rather see you attaching just a rdf/xml file that has problems with
>> either rdfcat or triplescat (both built in the tests phase), that is
>> likely going to be easier than to reverse engineer a js test harness.
>
> Ok. I'll file them in that form.
>
> Ian
>
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf
Reply | Threaded
Open this post in threaded view
|

Re: RDFXML round-trip test cases

Ian McKellar
Axel Hecht wrote:

> Ian McKellar wrote:
>> There isn't? Why not? This would seriously limit RDF's usefulness as a
>> metadata store. As far as I can see the RDF/XML spec makes it possible
>> to do round-tripping.
>
> Possible, yes, but not a requirement. There is no unique mapping of a
> graph to RDF/XML, thus, if you talk in terms of graphs, yes, that should
> roundtrip, but then you have to match anonymous nodes, which is tricky.
>
> Roundtripping based on the RDF/XML file is going to be hard, if it
> reliably works depends largely on testcase and tested implementation.
> You could always randomly replace single chars with numeric entities,
> but nobody goes to that extreme. But attribute values containing ' are
> totally ambiguous and may be serialized as "'" or as '&..;'.
Ahh okay - round-tripping rdfxml->in-memory->rdfxml isn't guaranteed or
probably even desirable, but I feel that round-tripping
in-memory->rdfxml->in-memory is desirable and shouldn't be guaranteed.

Ian


_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf

signature.asc (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RDFXML round-trip test cases

Axel Hecht-2
Ian McKellar wrote:

> Axel Hecht wrote:
>> Ian McKellar wrote:
>>> There isn't? Why not? This would seriously limit RDF's usefulness as a
>>> metadata store. As far as I can see the RDF/XML spec makes it possible
>>> to do round-tripping.
>> Possible, yes, but not a requirement. There is no unique mapping of a
>> graph to RDF/XML, thus, if you talk in terms of graphs, yes, that should
>> roundtrip, but then you have to match anonymous nodes, which is tricky.
>>
>> Roundtripping based on the RDF/XML file is going to be hard, if it
>> reliably works depends largely on testcase and tested implementation.
>> You could always randomly replace single chars with numeric entities,
>> but nobody goes to that extreme. But attribute values containing ' are
>> totally ambiguous and may be serialized as "'" or as '&..;'.
>
> Ahh okay - round-tripping rdfxml->in-memory->rdfxml isn't guaranteed or
> probably even desirable, but I feel that round-tripping
> in-memory->rdfxml->in-memory is desirable and shouldn't be guaranteed.
>
> Ian
>

Up to containers and <rdf:li>, for which I'm not sure if there's a
requirement to reproduce the integers in rdf:_1,2,3. And of course,
anonymous nodes have to be identified, which may be computationally
badly complex.

But yes, basically, graph -> RDF/XML -> graph should round trip under
some measure of graph equality.

Axel
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf