MyMobileWeb logo

Device Information Simple API

Implementation Report

MYMW Working Draft — 06 October 2008

This version:
http://mymobileweb.morfeo-project.org/reports/ddr/WD-ddr-20081006
Previous version:
This is the first version
Latest version:
http://mymobileweb.morfeo-project.org/reports/ddr/
Date:
10/06/2008
Editors:
Cristian Rodríguez de la Cruz, Telefónica I+D, crdlc@tid.es
Authors:
José Manuel Cantera Fonseca, Telefónica I+D, jmcf@tid.es
Cristian Rodríguez de la Cruz, Telefónica I+D, crdlc@tid.es
Contributors:
See Acknowledments

You are granted a license to use, reproduce and create derivative works of this document.


Abstract

This implementation report explains technical aspects about the implementation of the Reference Implementations of Device Description Technologies.

Status of this document

This is work in progress! This document is changing on a daily if not hourly basis. Comments are very welcome, please send them to mymobileweb-develop. Thank you.

Table of Contents

1. Introduction
2. DDR Core Vocabulary
3. Device Description Repository Simple API
4. Architecture Overview
5. Implementation Description
5.1. Identification Module
5.2. DDR Service Module
6. User Manual
Normative References
Informative References
A. Glossary
B. Acknowledgments

1. Introduction

This document reports on implementation of W3C’s DDR Simple API that explains technical aspects about it. Key features:

  • Supports the following vocabularies:

    • W3C’s Core Vocabulary. The namespace is http://www.w3.org/2008/01/ddr-core-vocabulary.

    • MyMobileWeb. The namespace is http://morfeo-project.org/mymobileweb.

    • WURFL. The namespace is http://wurfl.sourceforge.net.

  • Implementation based on WURFL and UAProf data sources.

  • Flexible enough to incorporate other data sources if available o vocabularies.

2. DDR Core Vocabulary

DDR Core Vocabulary is an essential vocabulary of properties for adaptation in the Mobile Web envorionment. Not intended to represent an exhaustive set of properties for content adaptation and the DDR implementations might require additonal properties and vocabularies.

This vocabulary defines two aspects:

  • device: apparatus through which user can interact with de Web (default aspect).

  • webBrowser: a user agent for Web pages.

The list of properties in the DDR Core Vocabulary can be to look up from here.

3. Device Description Repository Simple API

Device Description Repository Simple API is a minimal API for retrieving device properties needed for content and application adaptation. Promote the development of Web content that adapts to its Delivery Context.

From the point of view of the DDR Simple API:

  • Aspect: represents a category of hardware or software that participates in delivering a Web experience.

  • Property: characteristic of an aspect that can affect the Web experience.

  • Vocabulary: set of properties and the aspects with which the properties are associated.

The next chart describes the DDR Simple API

4. Architecture Overview

This section describes the modules more important of the implementation:

Identification Module

Implements the identification process of the context. See Section 5.1, “Identification Module”

DDR Service Module

Represents the core of the Device Information Simple API based on WURFL and UAProf data sources and supports the W3C’s Core Vocabulary, MyMobileWeb and WURFL vocabularies. Furthermore it is flexible enough to incorporate other data sources if available. See Section 5.2, “DDR Service Module”

5. Implementation Description

This section describes the implementation.

The lastest version can be downloaded from here.

For further details about the implementation you can see the Javadoc.

5.1. Identification Module

5.1.1. Relevant classes

Identification

Main interface that deals with context identification.

IdentificationImpl

This class is the entry point of the implementation. This class tries to recover the WURFL identifier, javax.ccpp.ProfileFragment objects (represents information about UAProf) and the user agent.

ContextKey

Represents a context key.

ContextKeyImpl

Implements the ContextKey interface and holds the related information with a context recovered of the identification process.

5.2. DDR Service Module

5.2.1. Relevant classes

ServiceFactoryExt

This class extends org.w3c.ddr.simple.ServiceFactory and implements a method to create a new default Service. The default Service is initialized by the implementation, depending on the context, by first checking the value of the environment variable org.w3c.ddr.simple.Service.default. If this environment variable is not defined this method checks the content of the file META_INF/services/org.w3c.ddr.simple.Service. This content is a class that implements the org.w3c.ddr.simple.Service interface.

EvidenceImpl

Helps implementations to deal with information with which to identify the delivery context.

PropertyNameImpl

Represents a org.w3c.ddr.simple.PropertyName (local name and namespace).

PropertyRefImpl

Implements org.w3c.ddr.simple.PropertyRef interface which represents a property name plus the aspect to which applies.

PropertyValueImpl

Implements org.w3c.ddr.simple.PropertyValue interface which represents a property value.

PropertyValuesImpl

Implements org.w3c.ddr.simple.PropertyValues interface which represents a collection of org.w3c.ddr.simple.PropertyValue instances.

ServiceAbstract

Implements the common methods for all services.

WURFLService

This class implements a DDR service, via which you retrieve property values for different vocabularies based on WURFL data source. It knows the mappings between properties of http://wurfl.sourceforge.net vocabulary an others vocabularies.

See Section 5.2.2, “Vocabulary Descriptor” and Section 5.2.3, “Vocabulary Mappings”.

UAProfService

This class implements a DDR service, via which you retrieve property values for different vocabularies based on UAProf data source. It knows the mappings between properties of UAProf an others vocabularies.

See Section 5.2.2, “Vocabulary Descriptor” and Section 5.2.3, “Vocabulary Mappings”.

DeviceAtlasService

This class implements a DDR service, via which you retrieve property values for different vocabularies based on DeviceAtlas data source. It knows the mappings between properties of DeviceAtlas an others vocabularies.

See Section 5.2.2, “Vocabulary Descriptor” and Section 5.2.3, “Vocabulary Mappings”.

ServiceImpl

This class implements a DDR service based on the previous org.w3c.ddr.simple.Service classes. It knows the data source where to retrive values given a vocabulary, aspect and property (the sources are sorted by priority). If one service can not continue with the request or doesn't know the value of the property, the following service will be query according to the priority.

See Section 5.2.4, “Vocabulary Sources”

5.2.2. Vocabulary Descriptor

5.2.2.1. Description

There is one file for each vocadulary.

  • Authors might define the namespace of the vocabulary (target attribute).

  • Authors might enumerate the aspects defined by the vocabulary.

  • Authors might define all properties with their datatypes, set of aspects for which they're defined and the default aspect.

This implementation supports:

  • W3C’s Core Vocabulary. The namespace is http://www.w3.org/2008/01/ddr-core-vocabulary.

  • MyMobileWeb. The namespace is http://morfeo-project.org/mymobileweb.

  • WURFL. The namespace is http://wurfl.sourceforge.net.

5.2.2.2. Example

This snapshot represents part of DDR Core Vocabulary Description file:

5.2.2.3. DTD Implementation

This section is normative.

<?xml version="1.0" encoding="UTF-8" ?>

<!ELEMENT VocabularyDescription (Aspects*, Properties*)>
<!ATTLIST VocabularyDescription
          xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"	     
	  target CDATA #REQUIRED
>                

<!ELEMENT Aspects (Aspect*)>

<!ELEMENT Aspect EMPTY>
<!ATTLIST Aspect	      
	  name ID #REQUIRED	      
>                

<!ELEMENT Properties (Property*)>

<!ELEMENT Property EMPTY>
<!ATTLIST Property
          name CDATA #REQUIRED
          datatype CDATA #REQUIRED
	  aspects CDATA #REQUIRED
          defaultAspect IDREF #REQUIRED
>

5.2.3. Vocabulary Mappings

5.2.3.1. Description

These files describe the mappings of properties between the vocabularies that the implementation knows and the vocabulary of the data source. E.g. WURFLService implies three mappings between WURFL's vocabulary and all vocabularies supported by this implementation (W3C’s Core Vocabulary, MyMobileWeb and WURFL (the identity)).

5.2.3.2. Example

This snapshot represents the mapping between DDR Core Vocabulary and WURFL:

5.2.3.3. DTD Implementation

This section is normative.

<?xml version="1.0" encoding="UTF-8" ?>

<!ELEMENT VocabularyMappings (TargetProperty*)>
<!ATTLIST VocabularyMappings
          xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
	  source CDATA #REQUIRED
  	  target CDATA #REQUIRED
>                

<!ELEMENT TargetProperty (Match*)>
<!ATTLIST TargetProperty 
	  name CDATA #REQUIRED	      
>                

<!ELEMENT Match (SourceProperty)>
<!ATTLIST Match 
          aspect CDATA #REQUIRED
	  value CDATA #IMPLIED
>

<!ELEMENT SourceProperty EMPTY>
<!ATTLIST SourceProperty 
          name CDATA #REQUIRED
          datatype CDATA #REQUIRED
          value CDATA #IMPLIED
          decorator CDATA #IMPLIED
>

5.2.4. Vocabulary Sources

5.2.4.1. Description

These files describe which service(s) must be invoked by org.morfeo.devinfo.simple.ServiceImpl to retrive the value of a property given an aspect and vocabulary. There are so many files as the number of vocabularies known by the implementation (target attribute). If one service can not continue with the request or doesn't know the value of the property, the following service will be query according to the assigned order (priority attribute).

5.2.4.2. Example

This snapshot represents part of DDR Core Vocabulary Sources file:

5.2.4.3. DTD Implementation

This section is normative.

<?xml version="1.0" encoding="UTF-8" ?>

<!ELEMENT VocabularySources (Sources*, Mappings*)>
<!ATTLIST VocabularySources
          xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"	     
	  target CDATA #REQUIRED
>                

<!ELEMENT Sources (Source*)>

<!ELEMENT Source EMPTY>
<!ATTLIST Source
          name ID #REQUIRED
          class CDATA #REQUIRED
>

<!ELEMENT Mappings (TargetProperty*)>

<!ELEMENT TargetProperty (Match*)>
<!ATTLIST TargetProperty 
	  name CDATA #REQUIRED	      
>                

<!ELEMENT Match (PropertySource*)>
<!ATTLIST Match 
          aspect CDATA #IMPLIED		  
>

<!ELEMENT PropertySource EMPTY>
<!ATTLIST PropertySource
          name IDREF #REQUIRED
          priority CDATA #REQUIRED
>>

6. User Manual

For further details about how to use this implementation, you can see the user manual .

Normative References

[DDRCoreVocabulary]
Device Description Repository Core Vocabulary, , 14 April 2008, , (See http://www.w3.org/TR/2008/NOTE-ddr-core-vocabulary-20080414/)
[DDRSimpleAPI]
Device Description Repository Simple API, , 17 September 2008, , (See http://www.w3.org/TR/2008/PR-DDR-Simple-API-20080917/)

Informative References

[IntroDDRSimple]
Introduction to DDR Simple API RI, José Manuel Cantera FonsecaTelefónica I+D jmcf@tid.es , 08 August 2008, , (See http://mymobileweb.morfeo-project.org/wp-content/uploads/2008/07/ddr_simple_api_ri_morfeo_mymobileweb.pdf)

A. Glossary

Common Glossary

B. Acknowledgments

This document was produced with the participation of the MyMobileWeb project Consortium: