W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > May 2001

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

From: Dan Connolly <connolly@w3.org>
Date: Wed, 30 May 2001 16:38:27 -0500
Message-ID: <3B156853.B0A31376@w3.org>
To: Aaron Swartz <aswartz@upclink.com>
CC: Jan Grant <Jan.Grant@bristol.ac.uk>, timbl@w3.org, RDFCore Working Group <w3c-rdfcore-wg@w3.org>
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 EDT

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:35:55 EDT