Examples

#1

It is quite clear (and has been for several years now) that in a semantic sense, OML ontologies correspond quite closely to DTDs (document type definitions). Here are some starter analogies.

XML

OML

document type definition (DTD)

ontology

document (instance of a DTD)

collection

document type declaration

declaration that a collection

uses an ontology

Here is the an example from The X ML Handbook of an internal DTD declaration for a mailing label.

XML

 

<!DOCTYPE label[

    <!ELEMENT label (name, street, city, state, country, code)>

    <!ELEMENT name    (#PCDATA)>

    <!ELEMENT street  (#PCDATA)>

    <!ELEMENT city    (#PCDATA)>

    <!ELEMENT state   (#PCDATA)>

    <!ELEMENT country (#PCDATA)>

    <!ELEMENT code    (#PCDATA)>

]><label>

<name>Rock N. Robyn</name>

<street>Jay Bird Street</street>

<city>Baltimore</city>

<state>MD</state>

<country>USA</country>

<code>43214</code>

</label>

 

Compare this with its analogous OML collection, which is written partially in (1) internal (2) object-oriented (3) abbreviated form for purposes of closer comparison. Note that the instance code is exactly identical.

OML

 

<Collection ontology=“<![CDATA[

  <Ontology>

    <extends ontology=“http://www.oml.org/ontology/"/>

    <Type.Object name="Label">

      <Type.Function name=“name”   target.Type=“String”/>

      <Type.Function name=“street” target.Type=“String”/>

      <Type.Function name=“city”   target.Type=“String”/>

      <Type.Function name=“state”  target.Type=“String”/>

      <Type.Function name=“name”   target.Type=“String”/>

      <Type.Function name=“code”   target.Type=“String”/>

    </Type.Object>

  </Ontology>

]]>” genus=“Label”>

  <Label>

    <name>Rock N. Robyn</name>

    <street>Jay Bird Street</street>

    <city>Baltimore</city>

    <state>MD</state>

    <country>USA</country>

    <code>43214</code>

  </Label>

</Collection>

 

#2

The following example appears on the OML Examples page. There it was described in abbreviated form. Here we use the long (unabbreviated) form for it. Note that we have no explicit representation for ontologies and collections, nor for ontology extension or the “use” connection between a collection and an ontology. A namespace without a specified prefix is the default namespace; there can be at most one of these in any context. In this example the default namespace is associated with the OML ontology. It contains the following elements and attributes.

 

Elements:

OML, Ontology, Type.Object, Type.BinaryRelartion, Type.Function, subtype, Collection, Instance.Object, Instance.BinaryRelation, Instanc.Function, classification.

Attributes:

ontology, prefix, name, source.Type, target.Type, specific, generic, id, source.Instance, target.Instance, instance, type.

 

Note that although an Intel Corporation namespace is implied, it is not used in this long (unabbreviated) form, since ontological types are not used for tags. In the abbreviated form the Intel namspace would contain the following elements and attributes. Function type names occur as both elements and attributes in the ontological namespace.

 

Elements:

Person, ExecutiveOfficer, position, birth.year, .

Attributes:

birth.year, .

 

Ontology

at location http://www.intel.com/ontology/

 

 

<OML>

  <Ontology>

    <extends ontology=“http://www.oml.org/ontology/"/>

    <extends ontology=“http://www.dc.org/ontology/” prefix=“DC”/>

    ...

    <Type.Object name="Person"/>

    <Type.Object name="ExecutiveOfficer"/>

    <Type.BinaryRelation name="position"

      source.Type=“Person” target.Type="String"/>

    <Type.Function name="birth.year"

      source.Type=“Person” target.Type=“Natno”/>

    <subtype

      specific=“ExecutiveOfficer” generic=“Person”/>

    ...

  </Ontology>

</OML>

 

Collection

 

 

<OML>

  <Collection ontology=“http://www.intel.com/ontology/” prefix=“INTC”>

    ...

    <Instance.Object id="Andrew_S_Grove"/>

    <Instance.BinaryRelation id=“position1”

      source.Instance=“Andrew_S_Grove” target.Instance="Chairman"/>

    <Instance.Function id=“birth.year1”

      source.Instance =“Andrew_S_Grove” target.Instance="1936"/>

    <classification

      instance=“Andrew_S_Grove” type=“ExecutiveOfficer”/>

    <classification

      instance=“position1” type=“position”/>

    <classification

      instance=“birth.year1” type=“birth.year”/>

    ...

  </Collection>

</OML>

 

 

é

Please send questions, comments and suggestions about this page to: Robert E. Kent rekent@ontologos.org

Copyright © 1999 TOC (The Ontology Consortium). All rights reserved.