Re: names for resources

On Fri, Nov 11, 2005 at 09:40:32AM -0600, Dan Connolly wrote:
> 
> On Fri, 2005-11-11 at 09:52 -0500, Eric Prud'hommeaux wrote:
> > I took a while to get back to this as I was on vacation. Apologies.
> > 
> > On Sun, Oct 30, 2005 at 08:18:44AM -0600, Dan Connolly wrote:
> > > 
> > > On Sun, 2005-10-30 at 04:59 -0500, Eric Prud'hommeaux wrote:
> > > > SPARQL differentiates between IRIs, Literals and Blank Nodes. A term
> > > > for IRI shows up in the definition of the isIRI test. STR, as well the
> > > > return type of DATATYPE. Originally, I used terms like "RDF URI" and
> > > > "RDF literal" to define the semantics and return types of functions.
> > > > At some point, I thought it would be a good idea to switch to
> > > > rdfs:Resource and rdfs:Literal. But rdf:Resource is EVERYTHING, so I
> > > > needed another term.
> > > > 
> > > > DanC suggested xsd:anyURI. This promotes all strings of type
> > > > xsd:anyURI to RDF resource.
> > > 
> > > Everything is an RDF resource. So there's no "promotion".
> > 
> > AGG! We need 2 different terms here. There are things that the RDF
> > Model calls URIrefs, and there are resources:
> > 
> >          Resources
> >        /    |     \
> > URIrefs  literals  bNodes
> 
> Yes, that's an accurate picture, where the lines
> represent rdfs:subClassOf.
> 
> Note that the term "URIref"
> is obsolete in favor of IRI. SPARQL is defined in terms
> of IRIs.

Yes, I am ready to commit a version that uses a term type "IRI" and
defines it right next to the term type "numeric".

> > We specifically need a name for URIrefs because it:
> >   1. is the return type of DATATYPE()
> 
> yes, xsdt:anyURI works well there.
> 
> >   2. defines the semantics of isIRI()
> 
> well, isIRI is a function of *terms*, not what
> the terms denote. It doesn't really depend on what URI we
> use for the class of URIrefs/IRIS.

It's not specifically required that we use the same type in our
function definition and our return type, but it certainly clarifies
that
  isIRI(DATATYPE("asdf"^^foo:bar))
is true for any foo:bar. Perhaps you want to propose alternate
definitions for isIRI() ...

> >   3. defines the semantics of STR()
> 
> I don't see any connection to STR().

... and STR()?

currently [[
Returns the lexical form of literal (an rdf:literal); returns the
codepoint representation of iri (an IRI). This is useful for examining
parts of an IRI, for instance, the host-name.
]]

> > > >  For instance, if I write some XML:
> > > >   <foo bar="4" baz="http://www.w3.org/"/>
> > > > , validate it by some W3C XML Schema:
> > > >   <xs:element name="foo">
> > > >     <xs:complexType>
> > > >       <xs:attribute name="bar" type="xs:integer"/>
> > > >       <xs:attribute name="baz" type="xs:anyURI"/>
> > > > and write out the PSVI as RDF, I am making an assertion about the
> > > > resource <http://www.w3.org/> (didn't look up the *real* PSVI
> > > > projection in to RDF here):
> > > >   [ a Element; 
> > > >     hasAttribute [ 
> > > >       name "bar", 
> > > >       value 4 ] ,
> > > >     hasAttribute [ 
> > > >       name "baz", 
> > > >       value <http://www.w3.org/> ] ]
> > > 
> > > no, it would be: value "http://www.w3.org/"
> > 
> > I can imagine justifications for either <http://www.w3.org/> or
> > "http://www.w3.org/"^^xsd:anyURI , but "http://www.w3.org/" makes
> > no sense at all to me. Why does the thing with the lexical form "4"
> > and the type xs:integer turn into an integer, but the thing with
> > the lexical form "http://www.w3.org/" and the type xsd:anyURI not
> > turn into at least one of those?
> 
> OK, "http://www.w3.org/"^^xsd:anyURI .
> 
> I didn't catch the subtlety of the value property; I thought
> it gave the/a lexical representation. I read too quickly.
> 
> 
> > > > However, this approach require a couple exceptions that I'm not
> > > > comfortable with:
> > > > 
> > > > In general, datatypes can be transformed with
> > > > STR:
> > > >   STR("asdf"^^foo:bar) = "asdf"
> > > > DATATYPE:
> > > >   DATATYPE("asdf"^^foo:bar) = foo:bar
> > > > and ^^ casting:
> > > >   "asdf"^^xsd:integer = "asdf"^^xsd:integer
> > > > 
> > > > This (I believe, though this merits a test case) holds for SPARLE terms:
> > > >   STR(4) = "4"
> > > >   DATATYPE(4) = xsd:integer
> > > >   "4"^^xsd:integer = 4
> > > > 
> > > > Some of these functions still work for URIs:
> > > >   STR(<http://www.w3.org/>) = "http://www.w3.org/"
> > > > and maybe DATA
> > > >   DATATYPE(<http://www.w3.org/>) = xsd:anyURI
> > > 
> > > no; the datatype of W3C's homepage isn't xsd:anyURI. Use/mention bug.
> > > 
> > > The xsd:anyURI datatype works just like all the others:
> > 
> > "just like"?
> > I don't think you're arguing constructively here. We need to figure
> > out exactly what you think xsd:anyURI is.
> 
> I think it's what the W3C XML Schema recommendation says it is.

RDF Concepts specifies the RDF graph in terms of URIrefs and some
other things. 
  http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-URI-Vocabulary
[[
A node may be a URI with optional fragment identifier (URI reference,
or URIref), a literal, or blank (having no separate form of
identification). Properties are URI references. (See [URI], section 4,
for a description of URI reference forms, noting that relative URIs
are not used in an RDF graph. See also section 6.4.)
]]

XML Schema defines an xsd:anyURI
  http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#anyURI
[[
[Definition:]   anyURI represents a Uniform Resource Identifier
Reference (URI). An anyURI value can be absolute or relative, and may
have an optional fragment identifier (i.e., it may be a URI
Reference). This type should be used to specify the intention that the
value fulfills the role of a URI as defined by [RFC 2396], as amended
by [RFC 2732].
]]

This says to me that a node has a datatype of xsd:anyURI . However,
you've said three things that countermand that:
  1. "http://www.w3.org/"^^xsd:anyURI != <http://www.w3.org/>

  2. The PSVI for the thing with the lexical value
  "http://www.w3.org/" and the datatype xsd:anyURI was specifically
  not the same as <http://www.w3.org/>

  3. You picked {SPARQL can't distinguish ...} below

Basically, I see three choices:
  xsd:anyURI is a symbol. All typed literals of type xsd:anyURI are
  the same node as the URIref with the same lexical form. You can
  construct a URI by any means that will affix that type
    "http://www.w3.org/"^^xsd:anyURI ==> <http://www.w3.org/>
    schema validation affixing the type="xs:anyURI" to the lexical
    value "http://www.w3.org/" => <http://www.w3.org/>

  xsd:anyURI is a literal. We need another identifier for the type
  of a symbol. "http://www.w3.org/"^^sp:symbol ==> <http://www.w3.org/>

  we don't know. I can commit my version that just has "IRI" for the
  datatypes of the return of DATATYPE. We just don't give the world
  a URI to identify this type.

I expect the best answer is the "we don't know". You feel that the
answer is "xsd:anyURI is a symbol" but haven't explained to me why
I can't apply that datatype to something to a lexical form to get
a URIref.


> >  Either you are conflating
> > two nodes that are distinct in RDF semantics:
> >   the URIref <http://www.w3.org/>
> >   the typed literal "http://www.w3.org/"^^xsd:anyURI
> > or you are saying that
> >   the typed literal "http://www.w3.org/"^^xsd:anyURI
> > doesn't exist, or you are saying that SPARQL does not allow you to
> > distinguish the difference.
> >   DATATYPE(<http://www.w3.org/>) = DATATYPE("http://www.w3.org/")
> 
> Indeed, SPARQL doesn't assign any meaning to
>   DATATYPE(<http://www.w3.org/>)
> 
> and hence doesn't really allow you to distinguish the difference
> between DATATYPE(<http://www.w3.org/>) and anything else.

Right, that was an poorly chosen shorthand for
    DATATYPE(DATATYPE("4"^^xsd:integer))
This is derived from what I believe you are proposing:
    DATATYPE("4"^^xsd:integer) = xsd:integer
    the return type of DATATYPE is xsd:anyURI
    the type of xsd:integer is xsd:anyURI
    DATATYPE(<http://www.w3.org>) = xsd:anyURI *
    DATATYPE(<http://www.w3.org>) = DATATYPE("http://www.w3.org/"^^xsd:anyURI)
    STR(<http://www.w3.org>) = STR("http://www.w3.org/"^^xsd:anyURI)
    "http://www.w3.org/"^^xsd:anyURI and <http://www.w3.org/> have the
       same lexical form and datatype, therefor they are the same node.
    "http://www.w3.org/"^^xsd:anyURI = <http://www.w3.org/>

* This isn't in SPARQL, but the interpretation is obvious.

> > > DATATYPE("http://www.w3.org/"^^xsd:anyURI) = xsd:anyURI
> > > and
> > > str("http://www.w3.org/"^^xsd:anyURI) = "http://www.w3.org/"
> > 
> > > > but we don't really "know" the lexical form for URIs
> > > 
> > > We know the lexical form for URI literals. URI literals
> > > are self-denoting;t hey work differently from <xyz> symbols.
> > > 
> > > >  so
> > > >   "http://www.w3.org/"^^xsd:anyURI != <http://www.w3.org/>
> > > > 
> > > > 
> > > > I don't think it's a good idea to invent a term or syntax for this, so
> > > > I'm in favor of going back to a term that's not a URI (RDF Resource).
> > > 
> > > Which do you mean? URI or Resource? Remember, _everything_ is a
> > > resource.
> > 
> > URIref
> 
> xsd:anyURI is the W3C Recommended URI for the class/datatype of IRIs.
> (well, the class is actually a bit larger; it includes relative URI/IRI
> references too. But it's close enough for our purposes.)
> 
> > > > There is a precedent for this in SPARQL ("RDF term", "blank node") and
> > > > in XPath Functions and Operators ("numeric").
> > > > 
> > > > 
> > > > I'm on vacation this week in Italy. I'd like to resolve this when I
> > > > get back.
> > > 
> > > What is it that you'd like to resolve?
> > > 
> > > > 
> > > > 
> > > > Earlier thread:
> > > >   http://www.w3.org/mid/20050911103218.GF17622@w3.org
> > 

-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +81.90.6533.3882

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Friday, 11 November 2005 17:41:38 UTC