Rss Categories
Info Add Comment
Nickname: Email (will not be shown): Subject: Question:

7.2 Value and Entity Types
Tools Add

Author: Clovis Six Reference Number: AA-00148 Views: 2383 Created: 2009-07-21 23:00 Last Updated: 2009-07-23 10:42 0 Rating/ 0 Voters

A value type is a type for something which can have an utterable value, such as words and numbers. For example the name of a person is a value type. The person is an entity because when we point to a person, we have no articulable value for it. His age, name and weight however, are.

Types of Mappings

The mappings can be very advanced, mapping application queries on conceptual queries. There are three kinds of mappings:

  • Value type mappings where the XPath that is mapped represents a value.
    map /Delivery/ID on ID of Delivery.
    map /Delivery/@TotalQuantity on count(Good contained in Delivery).
  • Entity type mappings where the XPath that is mapped represents a structural node.
    map /Delivery on Delivery.
    map /Delivery/Pallet on Pallet stores Good on Delivery.
  • Constant mappings where there is no XPath mapped, but a string or a number.
    map /Delivery/@Sender on "Collibra".

Mapping on Calculations

When you encountered derived values in XML, such as total quantities, averages or summations, try to map these on a calculation that indicates how this value was calculated. You can use the sum, count and average built-in functions in Ω-RIDL. For example:

map /Delivery/@TotalQuantity on count(Good contained in Delivery).


Handling Qualifiers

You can handle qualifiers just the same way as you would normally do in XPath. For example, you would have conceptually differentiated between different types of Pallets (e.g. Big Pallet, Small Pallet). If this is also qualified in your XML, then you an handle this the following way:

map /Delivery/Pallet[@type="Big"] on Big Pallet stores Good contained in Delivery.
map /Delivery/Pallet[@type="Small"] on Small Pallet stores Good contained in Delivery.


Similarly, use the same qualifiers for your value type mappings:

map /Delivery/Pallet[@type="Big"]/@ID on ID of Big Pallet stores Good contained in Delivery
map /Delivery/Pallet[@type="Small"]/@ID on ID of Small Pallet stores Good contained in Delivery.


Virtual Entities

Usually, the most granular concepts are not present in an XML file. For example in the Delivery case, the Goods, which is what is actually being delivered, are not present. It only speaks about the Product which is the type classifying the Good. It would neither make sense to list 1000s of Good lines in XML if there is no additional information.

When dealing with semantics, however, you want to be as explicit as possible. There are no individual Goods listed in the XML file, but it is an important concept that relates the Product to the Pallet and the Delivery. In the XML there are calculations listed that represent the number of Goods on the Delivery, specified in their totality, per Pallet or Product. To make it clear that this calculation is indeed about the Goods, this concept needs to be present. Although no individual goods are mapped, Ω-RIDL can handle this and infers derived calculations.

For example:

map /Delivery/@TotalQuantity on count(Good contained in Delivery).
map /Delivery/Pallet/@TotalQuantity on count(Good stored on Pallet) and (Good contained on Delivery).


Navigation
  Previous
 Table of Contents
Next


Rss Comments
  • There are no comments for this article.
© Collibra nv/sa 2008 - All rights reserved. - Privacy Policy - Disclaimer - Contact