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

ACTION 2001-11-02#02: Datatyping use-cases from CC/PP

From: Graham Klyne <GK@NineByNine.org>
Date: Mon, 05 Nov 2001 11:31:50 +0000
Message-Id: <>
To: RDF core WG <w3c-rdfcore-wg@w3.org>
[I hope this is timely.  I fear the whole datatyping debate is going off 
the rails.]

CC/PP [1] (and UAProf [2], a CC/PP compatible vocabulary), are existing 
specifications that use RDF, and make heavy use of implied datatyping for 
literals -- both in the sense of indicating a value space for literals and 
indicating the interpretation of literal strings denoting literal values.

CC/PP uses RDF properties to describe a user agent (client) system to an 
information provider (server), so that appropriately contextualized 
information can delivered to the user agent.  Each such property is used to 
describe a CC/PP client attribute, and they constitute a CC/PP 
vocabulary.  Associated RDF schema indicate the value type of each property 
used to describe a CC/PP attribute;  in most cases the attribute value is 
expressed as a literal, and the value type also indicates a mapping from 
lexical space to value space.

NOTE:  folks may disagree with details of how things have been done, BUT 
the point is that CC/PP demonstrates some ways of using RDF that have been 
devised by reasonable people trying in good faith to use RDF as 
described.  Also, CC/PP has been implemented at least twice to my knowledge 
and maybe more.

There are three levels at which the CC/PP specification invokes literal 
data types:

     it specifies some preferred simple data values and encodings for use 
as CC/PP client attribute values, with lexical mapping rules for 
each.  Most (but not all) of these are based on XSD data types.  e.g.

[[[ Integer number

Integer numbers may be positive, zero or negative. They are represented by 
a string containing a sequence of decimal digits, optionally preceded by a 
'+' or '-' sign. Leading zeros are  permitted and are ignored. The number 
value is always interpreted as decimal (radix 10). It is recommended that 
implementations generate and support integer values in the range 
-2147483647 to +2147483647, or -(2^31-1) to (2^31-1); i.e. integers whose 
absolute value can be expressed as a 31-bit unsigned binary number.

     it imports a (very) basic vocabulary for web clients from earlier IETF 
work (CONNEG).  An RDF schema for this vocabulary is in appendix C.

'pix-x' is an example of an integer-valued attribute:
   <ccpp:Attribute rdf:ID='pix-x'>
     <rdfs:label xml:lang="en">Pixel display width</rdfs:label>
     <rdfs:domain rdf:resource='&ns-ccpp;Component'/>
     <rdfs:range  rdf:resource='&ns-xsdt;integer'/>
     <rdfs:comment xml:lang="en">
       For raster displays, the width of the display in pixels.

'color' is an example of a string-valued attribute:
   <ccpp:Attribute rdf:ID='color'>
     <rdfs:label xml:lang="en">Color display capabilities</rdfs:label>
     <rdfs:domain rdf:resource='&ns-ccpp;Component'/>
     <rdfs:range  rdf:resource='&ns-xsdt;string'/>
     <rdfs:comment xml:lang="en">
       For display or print devices, an indication of the color
       rendering capabilities:
       binary  - indicates bi-level color (black-and-white, or similar).
       grey    - indicates gray scale capability, capable of sufficient
                 distinct levels for a monochrome photograph.
       limited - indicates a limited number of distinct colors, but
                 not with sufficient control for displaying a color
                 photograph (e.g. a pen plotter, high-light printer or
                 limited display).
       mapped  - indicates a palettized color display, with enough
                 levels and control for coarse display of color
       full    - indicates full color display capability.

And here is an example that uses these attributes:

   <?xml version="1.0"?>
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      <rdf:Description rdf:about="http://example.com/WebDisplay">
        <rdf:type rdf:resource="http://example.com/Schema#WebDisplayPlatform"/>

     WAP forum have created UAPROF, a vocabulary for CC/PP that uses 
literals in various ways (some of which I don't agree with).  CC/PP was 
designed to be compatible with the existing deployment of UAPROF.  Here's a 
simple example:

   <?xml version="1.0"?>
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      <rdf:Description rdf:about="http://example.com/HWDefault">
        <rdf:type rdf:resource="http://example.com/Schema#HardwarePlatform"/>

The literal value associated with the RDF property 'prf:cpu' encodes a 
member of an enumerated set in a literal string.

The value associated with the RDF property 'prf:display' encodes two 
integer values in a literal string.

     IETF work on content negotiation work (CONNEG) has created an IANA 
registry of media features [3].  (This isn't strictly part of CC/PP, but I 
am working on a proposal to allow all IANA registered media feature tags to 
be usable as CC/PP attributes -- by giving them a URI

The goals of the CONNEG work were in some ways more ambitious than CC/PP, and
(I think) overlap some of the description logic (DL) background that is 
informing the DAML+OIL
work.  Feature matching is based on something like a DL subsumption 
calculation.  A fixed interpretation of literal strings was a simple way to 
make this work.  Certainly, *some* way to interpret and appropriately 
compare literal strings was needed.

I draw the following conclusions:

(a) given a literal string, there needs to be some way to decide how it 
should be interpreted as a literal value.

(b) applications should be able to perform basic RDF handling without 
knowing how to interpret the literal strings.

(c) there is an existing base of RDF usage in which interpretation of a 
literal string depends upon knowledge of and about a property that 
references it.

(d) if we are to support existing RDF applications, interpretation of 
literal strings cannot be confined to a single defined scheme of data 
typing and interpretation.  Flexibility to accommodate things like 
prf:display is needed.

(e) insistence on having complete information about data typing and 
representation embedded in
any single piece of RDF is not an option.  In some cases, full knowledge 
may be embedded in a specific application that processes the 
RDF.  (Yes:  such information will not be accessible to generic RDF 
processors.  Tough luck.  We can encourage future RDF application designers 
to do better -- that was my goal in specifying preferred simple attribute 
types for CC/PP, based on my CONNEG work.)


[1] http://www.w3.org/TR/CCPP-struct-vocab/
     (public version)
     (Near-final WG working draft with revisions - needs W3C member access)

[2] http://www.w3.org/Mobile/CCPP/Group/Drafts/uaprof-099.doc
     (This may need W3C member access --
      a public version can also be obtained from WAP forum site)

[3] http://www.iana.org/assignments/media-feature-tags
     See also:
     http://www.isi.edu/in-notes/rfc2506.txt -- describes the registry and 
     http://www.isi.edu/in-notes/rfc2533.txt -- describes an expression 
format and
       how literal data types are interpreted.

Graham Klyne
Received on Monday, 5 November 2001 07:05:13 EST

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