Re: Test cases: format of input and output(uri/node/resource/entity too)

Aaron Swartz wrote:
> 
> Jan Grant <Jan.Grant@bristol.ac.uk> wrote:
> 
> > Fine. How do I name anonymous "thing"s in n3? It wasn't on the WG
> > reading list :-)

Actually, that smiley-point is well-made: this testing format
shouldn't depend on all the RDF/n3 specs, code, and
tutorials, which are in flux...

> I believe that it's:
> 
> <#name> :- [ anonymous node ] .

Well, that sort of achieves the relevant effect, but
it's complex to an extent that's not motivated for
this usage. I was just chatting with TimBL, and
I convinced him to add support for

	_:name

While he's hacking on that, I'll re-state this proposal,
independent of the N3 code and docs.

We've got terms of the form
	_:name		for "anonymous" terms
	<absURIref>	for URIs
	"lskdjf"	for string literals.

and statements of the form
	S P O.
where S, P, and O are terms (S and P can't be literals
in the expected results from any RDF 1.0
document.)

I wrote a little perl hack to parse the
format I'm proposing and, modulo
string quoting cruft, turn it into triple(a(x), r(http:...), l("xyz"))
format.

  http://www.w3.org/2000/10/swap/n3-simple.pl

given the test input from
  http://www.w3.org/2000/10/swap/test/animal.rdf

the expected results are in:
  http://www.w3.org/2000/10/swap/test/animal-simple.n3

which, when fed thru n3-simple.pl, produces:

triple(r(http://www.w3.org/2000/10/swap/test/animal.rdf#Animal),
r(http://www.w3.org/1999/02/22-rdf-syntax-ns#type),
r(http://www.w3.org/2000/01/rdf-schema#Class))
triple(r(http://www.w3.org/2000/10/swap/test/animal.rdf#Animal),
r(http://www.daml.org/2000/12/daml+oil#restrictedBy), a(a))
triple(a(a), r(http://www.w3.org/1999/02/22-rdf-syntax-ns#type),
r(http://www.daml.org/2000/12/daml+oil#Restriction))
triple(a(a), r(http://www.daml.org/2000/12/daml+oil#onProperty),
r(http://www.w3.org/2000/10/swap/test/animal.rdf#parent))
triple(a(a), r(http://www.daml.org/2000/12/daml+oil#cardinality),
l("2"))
triple(a(a), r(http://www.w3.org/2000/01/rdf-schema#label), l("Animal"))

which shows what we all knew: we can use either the n3-simple
format or the prolog-ish triple() format.

The interesting bit is to see which format is backed by a
"do these graphs match?" code first. Preferably two independent
implementations. cwm already does it
for N3, modulo the _:name syntax (and modulo cwm bugs ;-)

Jos, I gather your code can almost do the comparison too.

Jan, have you hacked an implementation of graph matching
for the triple() format yet? It seems like it should
be about 50 lines of prolog. Maybe I'll take a whack at it...

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

Received on Wednesday, 30 May 2001 17:38:37 UTC