W3C NOTE-rdf-uml-19980804

A Discussion of the Relationship Between RDF-Schema and UML

W3C Note 04-Aug-1998

Status of this Document
This document:
http://www.w3.org/TR/1998/NOTE-rdf-uml-19980804
Author:
Walter W. Chang, Advanced Technology Group, Adobe Systems

Status of This Document

This document is a NOTE made available by W3C for discussion only. This indicates no endorsement of its content, nor that W3C has had any editorial control in its preparation, nor that W3C has, is, or will be allocating any resources to the issues addressed by the NOTE.

Comments may be sent to www-rdf-comments@w3.org. All mail is archived and available for review.


Introduction

This note summarizes the relationship between RDF-Schema and UML, the generic industry standard object-oriented modeling framework for information systems modeling. This note will briefly describe these systems then relate them to each other.

RDF-Schema

RDF-Schema specifies information about classes in a schema, including properties (attributes) and relationships between classes. RDF-Schema provides a typing system: informally, it is a basic set of nodes and relations that can be used to express properties of classes of the schema. RDF-Schema includes a facility to indicate that certain classes are subclasses of others, and provides a small number of basic classes. Finally, it contains a facility for specifying a small number of constraints such as the cardinality (number of occurrences) required and permitted of properties of instances of classes.

"RDF-Schemas are specified using a declarative representation language influenced by ideas from knowledge representation, e.g., semantic nets, frames, and predicate logic, as well as database schema representation models such as binary relational models ([NIAM], etc.) and graph data models. The RDF schema specification language is less expressive, but simpler, than full predicate calculus languages such as CycL [CycL] and KIF [KIF]."

UML

The Unified Modeling Language (UML) is a framework for describing a set of models that capture the functional and structural semantics of any complex information system. UML defines the following models for representing such systems:

1. A use case model that states the requirements of the user
2. A class model that captures the static information structure of objects
3. A state model that describes the dynamic behavior of objects
4. An activity implementation model that describes work unit actions
5. An interaction model that models scenarios and message flows
6. A deployment model that describes how software subsystems are allocated
to actual hardware components

How RDF and UML Relate to Each Other

Web-based and non-Web based applications can be described by a number of schema specification mechanisms, including RDF-Schema. The RDF-Schema model itself is equivalent to a subset of the class model in UML. RDF-Schema uses a DLG (Directed Labeled Graph) model for describing schemas.

Class schemas expressed in UML can be viewed also as DLGs. If a DLG is used for a class model schema in UML, the RDF-Schema DLG can be shown to be isomorphic to a subgraph of the UML class schema DLG. This is possible because RDF-Schema elements map directly into UML class model elements.

In addition, the DAG formed by considering RDF-Schema subClassOf class inheritance structures maps directly to UML class generalization DAGs, RDF class properties map to UML class attributes, and RDF properties and property cardinality constraints map to UML associations and association
constraints.

The various constructs and elements in the class models of UML (#2.) and RDF-Schema readily map between each other. While currently the RDF-Schema work does not have counterparts to the other 5 remaining UML modeling areas, RDF-Schema could be extended to support these models as well.

Given that an application schema can be described by RDF-Schema (or UML), how do RDF-Schema and UML actually relate to each other? The remainder of this note describes the relationship between the elements of the class models for RDF-Schema and UML. An outline is presented below to show how a given schema represented by the RDF-Schema model can be transformed into an equivalent UML class schema representation.

Further, given any UML class schema representation, we can specify an equivalent RDF-Schema representation.

Comparison of Models

Outlined below are the steps for showing that class schema representations using RDF-Schema and the class model subset of UML are equivalent.

 Step

 Description
 1. Show that RDF-Schema and UML classes map between each other. 
 1a. Show that single and multiple class inheritance constructs in each system maps to the other. 
 1b. Show that the class inheritance DAGs for RDF-Schema and UML (using RDF-Schema subClassOf and UML subclass relationships respectively) are isomorphic. 
 1c. Note that RDF-Schema does not explicitly support the notion of operations or methods, We ignore this for now. When RDF-Schema supports this, map these methods into UML operations.
 2. Show that RDF-Schema properties and UML attributes can be directly mapped between each other. Extensions can be added later to support this if necessary. 
 3. Show that any UML associations can be expressed as RDF-Schema properties. 
 3a. Show that UML multiplicity constraints on associations are equivalent to a subset of RDF-Schema cardinality constraints
 3b. Show that property naming and reification in RDF-Schema maps to UML association names and attributes. 
 4. Show that while currently missing from RDF-Schema, a generalized constraint model can be created by extending RDF-Schema using reification allowing it to map into the general UML Class constraint model. 
 5. Having accomplished 1,2, and the portion of 3 relevant to the RDF-Schema, we can then show that the full RDF-Schema DLG can map into a proper subgraph of the UML class model DLG. 


As noted, because UML contains additional modeling constructs not found in RDF-Schema, full specification using UML may result in a DLG model that is a superset of the model specified by RDF-Schema. However, as indicated earlier, extensions to the RDF-Schema model could be made to support these class model constructs as well as other UML system models as needed by future application schemas that use RDF-Schema.

How RDF-Schema Properties and UML Roles Relate

We note that RDF-Schema properties can correspond to UML roles, and when a PropertyType actually names a range that is another RDF-Schema class, one way this can be viewed is that the RDF-Schema property is in fact being used as an association in the UML sense. More precisely, an RDF-Schema property corresponds to a named role within an unnamed association. UML has some facilities here (such as naming associations and associating roles) that RDF-Schema does not. [Layman,1]

[Wickstead] has presented several good examples of this in the context of RDF-Schema WG discussions about non-Web resource identifiers: he suggests that instead of introducing database Primary/Foreign Keys, we let properties name actual classes. This would cause the property to be used as an association to other objects constrained by whatever cardinality constraint was specified.

Conclusion

A class of application schemas can be described by RDF-Schema. RDF-Schema in turn can be shown to map into a subset of the UML framework through inheritance schema DAG isomorphism and isomorphism of RDF-Schema DLGs to a subgraph of UML full schema DLGs using the procedure outlined above.

Thanks to Ron Daniels for his careful review of earlier draft versions of this document and his comments and suggestions.

Appendix 1

Summary of Schema Model Differences Between RDF-Schema and UML

The table below summarizes how the two different schema modeling systems support specific object constructs.

Construct RDF-Schema UML
Classes Y Y
- Members Properties Attributes
- Methods N Operations
- Generalization Y, S.I., M.I. Y, S.I., M.I.
- Visibility of Attr/Meth. Public Public (1), Protected (2), and Private (3)
- Interfaces N Y
- Template Classes N Y
- Utility Classes N Y
Associations Y Y
- Assoc. Naming via Properties Y
- Role Naming via Properties Y
- Cardinality   (6)
- - - One ExactlyOne 1
- - - Zero or One ZeroOrMore 0..1
- - - From 0 to N ZeroOrMore 0..N
- - - From 1 to N OneOrMore 1..N
- - - From M to N No M..N
- General Constraints N Y
- Association Classes N Y
- N-ary Associations reification Y
- Association Qualifiers N Y
Aggregation Y (4) Y
Navigation Y Y (5)
MetaModel Y Y (7)

Table Notes:

(1) Public - the element is visible to all clients of the class.
(2) Protected - the element is visible only to the subclass of the class.
(3) Private - the element is visible to only the class itself.
(4) UML distinguishes between aggregation and composition: aggregation is an abstract modeling, composition is a containment model that can correspond to the RDF-Schema collection, bag, or sequence constructs.
(5) RDF-Schema can use directed arcs, UML uses directed associations.
(6) RDF-Schema cardinality constraints are a subset of UML multiplicity constraints. UML allows specification of multiplicity information at both ends of an association. RDF-Schema currently does not directly support cardinality constraints besides the 4 listed. Supporting arbitrary cardinalities e.g., 2-100 times would be useful, as well as intervals e.g., 3..5,17..23 would be useful. In the table, M and N are integers > 1.
(7) While both RDF-Schema and UML have MetaModels, it is worth pointing out that the UML meta model is both substantially more elaborate and different than that of RDF-Schema meta model. [Layman,2]
(8) We note that the intended usages for RDF-Schema and UML may differ. While both systems can describe schemas, each system may be better suited for a particular application. Eg., databases are described by schemas defining tables, views, referential integrity constraints, and other database mechanisms; models of tree-structure grammars such as XML are described by schemas such as XML DTDs; models of entities and relations are described in E-R schemas such as UML; models of nodes and arcs are described by node-and-arc schemas such as RDF schemas. While there is substantial overlap between RDF and UML, we anticipate that each will be used to describe somewhat different entities. [Layman,2]

References:

[Rumbaugh et. al.] Jim Rumbaugh, Ivar Jacobson, and Grady Booch, Unified Modeling Language Reference Manual, ISBN: 0-201-30998-X, Addison Wesley, est. publication December 1997.

[RDF M+S] Resource Description Framework, (RDF) Model and Syntax, W3C Working Draft 16 Feb 1998, http://www.w3.org/TR/WD-rdf-syntax ,
Ora Lassila <ora.lassila@research.nokia.com>, Nokia Research Center
Ralph R. Swick <swick@w3.org>, World Wide Web Consortium
et. al.

[RDF-Schema] Resource Description Framework, (RDF) Schemas, W3C Working Draft 1 May 1998, http://www.w3.org/RDF/Group/WD-rdf-schema ,
Dan Brickley, University of Bristol, R.V. Guha, Netscape, Andrew Layman,
Microsoft.

[UML-Tk] Hans-Erik Eriksson and Magnus Penker, "UML Toolkit", John Wiley &
Sons, New York, 1997.

[IUML] Pierre-Alain Muller. "Instant UML", Wrox Press Ltd., Birmingham,
UK, 1997. Original French Edition: "Modelisation objet avec UML",
Editions Eyrolles, Paris France, 1997.

[NIAM] G. M. Nijssen and Terry Halpin, Conceptual Schema and Relational
Database Design, (Prentice Hall, Sydney:1989)

[CycL] CycL: The CYC Representation Language;
http://www.cyc.com/tech.html#cycl

[KIF] Knowledge Interchange Format (KIF);
http://logic.stanford.edu/kif/kif.

[Wicksteed] Charles Wicksteed, Reuters.
Working Group mail archive (member only)

[Layman], Andrew Layman. Microsoft Corporation.
Working Group mail archive (member only)