Re: Test cases: format of input and output

Aaron Swartz wrote:
> 
> Dan Connolly <connolly@w3.org> wrote:
> 
> >>>> Something conforms wrt the test case iff it interprets the RDF as
> >>>> producing* a set of triples identical with the sample output, up to
> >>>> reordering and the global renaming of anonymous resources.
> >>> It's too bad there's no way to reduce that to some sort/diff
> >>> thingy, but there just isn't. It's inherently a graph-matching
> >>> thing.
> >> Ehh? What are the issues with sorting the triples and providing some
> >> algorithm for anonymous resource naming?
> > You're welcome to give it a try, but I don't see
> > any algorithm for naming the anonymous resources
> > that's any simpler than graph matching.
> 
> I don't know what graph matching is, but what's wrong with:
> 
> 1) Sort each anonymous node individually in form:
> 
> <#pred> <#obj> ;

I don't think you can do that in the general case;
sometimes anonymous nodes are objects; they're
not always subjects; see below...

> 2) Remove line breaks and surround each anonnode with "[ " and " ]."
> 
> 3) Combine with regular triples and sort
> 
> You end up with something like:
> 
> <#subj> <#pred3> "aaa" .
> [ <#pred1> "ob" ; <#pred2> <#obj> ; ].
> 
> Am I missing something?

I think you're not taking into account cases like...

	<#DanC> <#hasCousin>
		[ <#hairColor> <#brown> ].

i.e.

<!-- Processed by Id: cwm.py,v 1.48 2001/05/26 17:28:07 timbl Exp -->
<!--     using base file:/home/connolly/,ex.n3-->


<rdf:RDF xmlns="file:/home/connolly/,ex.n3#"
    xmlns:log="http://www.w3.org/2000/10/swap/log#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <rdf:Description rdf:about="#DanC">
        <hasCousin rdf:parseType="Resource">
            <hairColor rdf:resource="#brown"/>
        </hasCousin>
    </rdf:Description>
</rdf:RDF>

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Sunday, 27 May 2001 16:40:43 UTC