Re: Syntax-level typing (was Re: A data typing proposal)

On Tue, 2002-08-06 at 02:09, Patrick Stickler wrote:
> 
> On 2002-08-02 14:28, "ext Sergey Melnik" <melnik@db.stanford.edu> wrote:
[...]
> > The syntax-level typing sketched above does not require (but of course,
> > can leave with) untidiness. In fact, typed literals like (int)5 can be
> > mapped directly to say Java built-in types.
> > 
> > Sergey
> 
> Well, ahem, this was basically the URV idiom that I tossed on the table
> nearly a year ago.

Yes, very similar.

One says
	<age
rdf:resource="val:(http://www.w3.org/2001/XMLSchema%23integer)15"/>

and the other says
	<age xsi:type="integer">10</a>

A year ago, I thought that introducing literals other than strings
(and XML structures) was too big of a change.
Now, given requirements from WebOnt, feedback from the community,
various bits of implementation experience I didn't know about
then (but which did exist, as far back as '98, I gather),
etc., I suppose this change is cost-effective.

The feedback from the community is a big piece of new information,
to me. They really think adding xsi:type to RDF is straightforward.
I'm a little surprised by that, but more comfortable with
it as each day goes by.

By the way... I wrote my first piece of code using syntax-level
typing, and I'm pretty happy with it. It takes Apple property lists,
such as you get from iTunes...

	<key>Tracks</key>
	<dict>
		<key>67</key>
		<dict>
			<key>Track ID</key>
			<integer>67</integer>
			<key>Name</key>
			<string>Love To Hate You</string>
			<key>Artist</key>
			<string>Erasure</string>
			<key>Album</key>
			<string>Pop! - The First 20 Hits</string>

and turns them into RDF:

    <a:Tracks>
      <r:Description>
        <a:_67>
          <r:Description>
            <a:Track_ID xsi:type="integer">67</a:Track_ID>
            <a:Name>Love To Hate You</a:Name>
            <a:Artist>Erasure</a:Artist>
            <a:Album>Pop! - The First 20 Hits</a:Album>

Share and enjoy:
  http://www.w3.org/2000/10/swap/util/plist2rdf.xsl


As to why not URVs... peeking inside URIs to distinguish
literals from names was something I was never very
comfortable with, despite the precedent of the data: URI scheme.
I was never very happy with the idea that this WG should ask the IETF
community (who owns the URI scheme registry) for a
new URI scheme just to fill some holes in RDF.

> And it requires no changes to RDF whatsoever. Just use a URI to denote
> the typed literal which denotes the value in question. Done.

No, that's not the only change. It's critical that these expressions
act like literals in the model theory. i.e. you can tell, from the model
theory, that

  val:(http://www.w3.org/2001/XMLSchema%23integer)15
is not equal to
  val:(http://www.w3.org/2001/XMLSchema%23integer)16

> C.f. http://ietf.org/internet-drafts/draft-pstickler-val-01.txt
> 
> Yes, one may want to have some syntactic sugar in e.g. N3 to make
> typing easier, but that's a secondary issue.

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

Received on Tuesday, 6 August 2002 09:02:06 UTC