W3C home > Mailing lists > Public > www-webont-wg@w3.org > January 2003

OWL datatyping and example

From: Mike Dean <mdean@bbn.com>
Date: Thu, 09 Jan 2003 01:06:48 -0800
Message-Id: <200301090906.BAA23694@escher.SD.BBN.COM>
To: www-webont-wg@w3.org

This messages cites the discussion of datatypes in the RDF Core WG
last call candidate working drafts, and gives an example of their
possible use in OWL.

The normative description of RDF datatypes is at [1] (not quoted
here).

[[
rdfs:Datatype is the class of datatypes. All instances of rdfs:Datatype
correspond to the RDF model of a datatype described in the RDF Concepts
specification [RDF-CONCEPTS]. rdfs:Datatype is both an instance of and
a subclass of rdfs:Class. Each instance of rdfs:Datatype is a subclass
of rdfs:Literal.
]] [2]

rdfs:Datatype should replace daml:Datatype in OWL.

Since rdfs:Datatype is a subclass of rdfs:Class, its instances can be
used in an rdfs:range statement to indicate the class associated with
a given property (as in DAML+OIL), however

[[
Because the schema describes the range of this property as an xsd:integer,
the value of the property must be a typed literal of that datatype in order
to match the range description (i.e., the range declaration does not "assign"
a datatype to a plain literal)
]] [3]

rdfs:range specifies a global restriction.  Hopefully we haven't done
anything in OWL to break the use of local datatype restrictions in
DAML+OIL:

[[
A toClass element defines the class of all objects for whom the values of
property P all belong to the class expression. In other words, it defines
the class of object x for which it holds that if the pair (x,y) is an
instance of P, then y is an instance of the class-expression or datatype;
]] [4]

My own preferred style is to use local Restrictions exclusively for
both datatype and object properties rather than global rdfs:range
constraints.

One of my colleagues, Michael Cook, has been marking up the Periodic
Table in DAML+OIL.  Converting one of his instances to OWL with
datatypes yields:

<table:Element rdf:ID="He">
  <table:name rdf:datatype="&xsd;string">helium</table:name>
  <table:symbol rdf:datatype="&xsd;string">He</table:symbol>
  <table:atomicNumber rdf:datatype="&xsd;integer">2</table:atomicNumber>
  <table:atomicWeight rdf:datatype="&xsd;float">4.002602</table:atomicWeight>
  <table:group rdf:resource="#group_18"/>
  <table:period rdf:resource="#period_1"/>
  <table:block rdf:resource="#p-block"/>
  <table:casRegistryID rdf:datatype=&xsd;string">7440-59-7</table:casRegistryID>
  <table:standardState rdf:resource="#gas"/>
  <table:color rdf:datatype="&xsd;string">colorless</table:color>
  <table:classification rdf:resource="#Non-metallic"/>
  <table:description rdf:datatype="&xsd;string"></table:description>
  <table:isolation rdf:datatype="&xsd;string"></table:isolation>
</table:Element>

assuming that xsd has been defined as an XML entity for
http://www.w3.org/2001/XMLSchema# (note that this is different than
the http://www.w3.org/2000/10/XMLSchema# namespace used in DAML+OIL).

Note the use of the rdf:datatype attribute above to identify typed
literals [5].  It has been suggested that simple literals (without
rdf:datatype) could be used for the string values, but this precludes
specifying rdfs:range or local restrictions on these properties
(i.e. conveying the datatyping intentions of the ontology writer), so
I don't find that good practice.

Note that RDF provides for use of XML Schema datatypes, but also
allows other type systems to be used:

[[
XML Schema datatypes have a "first among equals" status in RDF. They
are treated no differently than any other datatype, but they are
expected to be the most widely used, and therefore the most likely
to be interoperable among different software. As a result, it is
expected that many RDF processors will be programmed to recognize
these datatypes. However, RDF software could be programmed to process
other sets of datatypes as well.
]] [5]

DAML+OIL supported only XML Schema datatypes.

Several additional notes:

[[
RDF provides no mechanism for defining new datatypes. XML Schema Datatypes
[XML-SCHEMA2] provides an extensibility framework suitable for defining new
datatypes for use in RDF.
]] [1]

[[
Certain XML Schema built-in datatypes are not suitable for use within
RDF. For example, the QName datatype requires a namespace declaration
to be in scope during the mapping, and is not recommended for use in RDF.
]] [1]

[[
This semantics for datatypes is minimal. It makes no provision for
associating a datatype with a property so that it applies to all
values of the property, for example, and does not provide any way
of explicitly asserting that a blank node denotes a particular value
under a datatype mapping. We expect that semantic extensions and future
versions of RDF will impose more elaborate datatyping conditions.
Semantic extensions may also refer to other kinds of information about
a datatype, such as orderings of the value space.
]] [6]

	Mike

[1] http://www.w3.org/2001/sw/RDFCore/TR/WD-rdf-concepts-20030117/#section-Datatypes

[2] http://www.w3.org/2001/sw/RDFCore/TR/WD-rdf-schema-20030117/#ch_datatype

[3] http://www.w3.org/2001/sw/RDFCore/TR/WD-rdf-primer-20030117/#properties

[4] http://www.w3.org/TR/daml+oil-reference#2

[5] http://www.w3.org/2001/sw/RDFCore/TR/WD-rdf-primer-20030117/#typedliterals

[6] http://www.w3.org/2001/sw/RDFCore/TR/WD-rdf-mt-20030117/#dtype_interp
Received on Thursday, 9 January 2003 04:07:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:57:56 GMT