Device Description Repository Simple API 1g

Editors' Draft 20 March 2008

This version:
http://www.w3.org/2005/MWI/DDWG/drafts/api/080320
Latest version:
http://www.w3.org/2005/MWI/DDWG/drafts/api/latest
Previous version:
http://www.w3.org/2005/MWI/DDWG/drafts/api/080228
Editors:
Jo Rabin, dotMobi (mTLD Top Level Domain)
José Manuel Cantera Fonseca, Telefónica I+D
Rotan Hanrahan, MobileAware
Ignacio Marín, Fundación CTIC

Abstract

Web content delivered to a mobile context usually benefits from being tailored to take into account a range of factors such as device form factor, input capabilities, browser markup language support and image format support. Data about such information is stored in proprietary databases called "Device Description Repositories" (DDR).

This document describes a simple API for access to DDRs, in order to ease and promote the development of Web content that adapts to its Delivery Context.

Status of this Document

This document is an editors' copy that has no official standing.

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is an Editorial Draft of a possible future W3C Recommendation.

Publication as an Editorial Draft does not imply endorsement by the Device Description Working Group or the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document is published as part of the W3C Mobile Web Initiative (MWI) by the Device Description Working Group. It is a deliverable as defined in the Charter of that group.

Please send comments to public-ddwg@w3.org. This list is archived at http://lists.w3.org/Archives/Public/public-ddwg/.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

Summary of Methods

1 Introduction
    1.1 Background to the need for Device Description Repositories
    1.2 Scope
2 Reading the Recommendation
    2.1 Normative and Informative Parts
    2.2 Normative Language for Conformance Requirements
3 Vocabularies
4 Interface
    4.1 Interface Definitions
    4.2 Supporting Interfaces
        4.2.1 Evidence
            4.2.1.1 Methods
        4.2.2 PropertyName
            4.2.2.1 Methods
        4.2.3 PropertyRef
            4.2.3.1 Constants
            4.2.3.2 Methods
        4.2.4 PropertyValue
            4.2.4.1 Methods
        4.2.5 PropertyValues
            4.2.5.1 Methods
    4.3 Service Interface
        4.3.1 Factory Methods
            4.3.1.1 Create Evidence
            4.3.1.2 Create PropertyName
            4.3.1.3 Create PropertyRef
        4.3.2 Query Methods
            4.3.2.1 Return Known Values
            4.3.2.2 Return the Values of a Specific List
            4.3.2.3 Return the Value of a Single Property
        4.3.3 Information Methods
            4.3.3.1 Get Version Information
            4.3.3.2 List Available Properties
        4.3.4 Initialization
    4.4 Exceptions
    4.5 Instantiation
5 Conformance

Appendices

A Java Bindings
    A.1 org.w3c.ddr.simple.Evidence
    A.2 org.w3c.ddr.simple.PropertyName
    A.3 org.w3c.ddr.simple.PropertyRef
    A.4 org.w3c.ddr.simple.PropertyValue
    A.5 org.w3c.ddr.simple.PropertyValues
    A.6 org.w3c.ddr.simple.Service
    A.7 org.w3c.ddr.simple.ServiceFactory
B Normative References
C IDL Definitions for Simple API (Non-Normative)
D WSDL Language Binding (Non-Normative)
E Informative References (Non-Normative)
F Acknowledgements (Non-Normative)


Summary of Methods

Need to fill this in

InterfaceMethod
EvidenceString get(String key)
Boolean exists(String key)
void put(String key, String value)
PropertyNameString getLocalPropertyName()
String getNamespace()
PropertyNameString getLocalPropertyName()
String getAspectName()
String getNamespace()
PropertyValuedouble getDouble() long getLong() String getString() boolean getBoolean() int getInteger() String[] getEnumeration() float getFloat()
boolean exists()
PropertyRef getPropertyRef()
PropertyValuesPropertyValue[] getAll()
PropertyValue getValue(PropertyRef prop)
ServiceEvidence newHTTPEvidence()
Evidence newHTTPEvidence(java.util.Map<java.lang.Object,java.lang.Object> map)
PropertyName newPropertyName(String localPropertyName)
PropertyName newPropertyName(String localPropertyName, String vocabularyIRI)
PropertyRef newPropertyRef(String localPropertyName)
PropertyRef newPropertyRef(PropertyName propertyName)
PropertyRef newPropertyRef(PropertyName propertyName, String localAspectName)
PropertyValues getPropertyValues(Evidence evidence)
PropertyValues getPropertyValues(Evidence evidence, String localAspectName)
PropertyValues getPropertyValues(Evidence evidence, String localAspectName, String aspectIRI)
PropertyValues getPropertyValues(Evidence evidence, PropertyRef[] propertyRefs)
PropertyValue getPropertyValue(Evidence evidence, PropertyRef propertyRef)
PropertyValue getPropertyValue(Evidence evidence, PropertyName propertyName)
PropertyValue getPropertyValue(Evidence evidence, String localPropertyName)
PropertyValue getPropertyValue(Evidence evidence, String localPropertyName, String localAspectName, String vocabularyIRI)
String getAPIVersion()
String getDataVersion()
PropertyRef[] listPropertyRefs()
void initialize(String defaultVocabularyIRI, java.util.Properties props)

1 Introduction

This section is informative.

1.1 Background to the need for Device Description Repositories

The need for Device Descriptions (information about the properties of various aspects of the Delivery Context [definition]) is not confined to the mobile Delivery Context. It is common practice for Web sites to detect the type of user agent ("browser sniffing") to determine possibly small but important differences between various desktop Web browsers and adapt content to accommodate those differences.

In the desktop Delivery Context, the number of different properties that affect the usability of the resulting content is limited, when compared with the number of different properties of the mobile Delivery Context that affect usability of content. Examples of such properties include screen dimensions, input methods, memory and CPU constraints. There are also differences between mobile Web browsers including markup languages supported and image formats supported.

As discussed in [Landscape] and [Ecosystem], historically, it has been difficult or impossible to upgrade Web browser software on mobile devices or to add support for features not present in the Web browser originally shipped with the device. This leads to a very wide variation not only of hardware related features but also of features determined by software and firmware. As a result of this, although the need for content adaptation is a general requirement of the Web as a whole, the need for a more systematic approach is seen as being most urgent in the mobile Delivery Context.

As a result, Device Description Repositories (DDRs) have become essential components of development of content targeted at the mobile Delivery Context. A number of proprietary implementations exist, each with its own API and method of describing the properties of the Delivery Context.

The Device Descriptions Working Group (DDWG), a Working Group of the W3C Mobile Web Initiative, was chartered to create a single API though which Property values can be retrieved, and a "Core" Vocabulary [Core Vocabulary] that identifies a small number of such properties.

1.2 Scope

Various use cases for DDRs are detailed in [Requirements]. In summary, the uses fall into two main classes: design time and run time. The design time use case relates to the activities of the planning, UI prototyping, market research and so on for mobile Web applications. By contrast, the run time use case involves determining the actual values of properties that are relevant to a particular application for the delivery of Web content.

The W3C DDR Simple API supports only the run time use case. It provides read-only functionality to allow an adapting application to provide Evidence [in the form of HTTP headers] that identifies the Delivery Context (DC) and allows it query the DDR for values of properties of the DC identified. In addition, it provides access to basic catalog information that allows an application to find out which properties are supported.

The run-time use case consists, in general, of two logically (though not necessarily in practice) distinct activities: Device Recognition and Property Value Retrieval. The simple API does not expose these two activities as distinct to the user of the API.

The there are many different types of components that compose a specific Delivery Context (known as its Aspects). Different Vocabularies (sets of Properties) recognize different Aspects of the Delivery Context that are "essential" to implementing adaptive mobile content. For example, the Core Vocabulary [Core Vocabulary] recognises the Aspects of "device" and "Web browser". Other Aspects of the Delivery Context may be supported other Vocabularies.

There are an indefinite number of possible Properties that are descriptive of the Delivery Context. The simple API does not define any Properties nor mandate the use of any particular Vocabulary of such Properties. The DDWG strongly recommends that its Core Vocabulary is supported by all DDRs.

The requirements of Vocabularies supported by the DDR Simple API are documented in 3 Vocabularies.

This Recommendation provides a normative definition of the Simple DDR API in Java [Java] and provides informative IDL and WSDL versions derived from the Java definition.

2 Reading the Recommendation

This section is normative.

3 Vocabularies

This section is normative.

From the point of view of the DDR Simple API:

[Definition: An Aspect of the Delivery Context typically represents a category of hardware or software that participates in delivering a Web experience.] Browsers, proxies and handsets are all examples of Aspects. Aspects can also represent things other than hardware and software, such as end-users and mobile network operators.

[Definition: A Property is a characteristic of an Aspect that can affect the Web experience.] "Screen Width", "Image Formats Supported", "Color Depth" and "Audio Codecs Supported" are all Properties. Properties have names and data types for their values (Boolean, integer and so on).

Property names and Aspect names are namespaced to allow independent naming and evolution of sets of Properties. In the simple API they exist in the same namespace.

Editorial Note : A sentence and a Note added here for clarity.

[Definition: A Vocabulary is a set of Properties and the Aspects with which the Properties are associated.] Vocabularies must declare a default Aspect for each Property (the Aspect to be used when using the Vocabulary in an abbreviated convention that does not specify the Aspect).

Note:

This Recommendation does not specify a standard representation (such as an XML serialization) for Vocabularies.

Property and Aspect names must be unique in their namespace and must conform to the syntax defined in "Namespaces in XML" [XML Namespaces]. The value __NULL ('_','_','N','U','L','L') is reserved as the null Aspect name.

Editorial Note : We resolved that the data type definitions are defined by the language binding but that would seem to be overtaken by events, hence the following

Vocabularies also define the data types of values associated with their Properties. The data types supported are Boolean, Integer, Long, Float, Double, String and Enumeration. The meaning of the data types is defined in [Java].

The DDWG has published a suggested "Core" Vocabulary for essential Properties for Web content adaptation [Core Vocabulary]. It is anticipated that implementations will extend the Core Vocabulary, which may be used as an example for such extensions. Properties that extend the Core Vocabulary must be in a different namespace to the Core Vocabulary.

The DDWG anticipates that further work on standardization of Properties and Aspects will take place alongside development of the Delivery Context Ontology (see [Delivery Context Ontology]).

4 Interface

4.1 Interface Definitions

This Recommendation describes the DDR Simple API in Java [Java].

Interfaces are identified in the text in the following way:

public Example exampleMethod();

A full Java definition is provided as an Appendix (see A Java Bindings). Informative IDL and WSDL versions are also provided (see C IDL Definitions for Simple API and D WSDL Language Binding).

4.2 Supporting Interfaces

A number of supporting interfaces are defined for various types of data that are used in the DDR Simple API. They are described in the following sections.

The principal interface of the DDR API, Service, is defined in 4.3 Service Interface, it is this interface that contains the factory methods for creating instances of the interfaces discussed here.

4.2.1 Evidence

When querying Property values (see 4.3.2 Query Methods), Evidence is the general term applied to providing information to the DDR to allow it to determine the Delivery Context. In the simple API implementations must support Evidence consisting of HTTP Header name and value pairs. Implementations must treat HTTP Header names in a case insensitive manner. HTTP Header values may be case sensitive, depending on the header concerned. Other types of Evidence may be supported by implementations. They are not defined in this Recommendation.

4.3 Service Interface

The Service interface is the core of the DDR Simple API. Using methods of Service the caller supplies Evidence representing the Delivery Context and an indication of the Properties of interest. These methods return PropertyValue objects which can then be queried to reveal the values of the Properties of interest.

The Service may be instantiated by a supplied factory class (see 4.5 Instantiation). The class invokes the initialize method to establish a Default Vocabulary and to pass implementation specific settings.

Whether or not the underlying implementation combines more than one source of data is opaque to the user of the API. The API makes no assumptions about the number of sources of data.

All implementations are required to support Evidence consisting of name/value pairs of HTTP headers.

The methods of the Service interface fall into the following categories, which are discussed in the subsequent sections:

4.3.2 Query Methods

Query methods return values for Properties of the Delivery Context represented by the supplied Evidence.

The following types of query method exist:

4.3.4 Initialization

  1. Initialize the Library

    Called by the instantiation class (see 4.5 Instantiation) to initialize the implementation. Implementation specific initialization parameters may be passed using the props parameter.

    Note:

    Note that the props parameter is of the class java.util.Properties and is not related to Properties of Vocabularies discussed in this document.

5 Conformance

This section is normative.

A conforming implementation of this Recommendation must implement all the normative sections of this document.

A Java Bindings

The code can be browsed at http://www.w3.org/2005/MWI/DDWG/drafts/api/simple/java/org/w3c/ddr/simple/

A.1 org.w3c.ddr.simple.Evidence

package org.w3c.ddr.simple;

/**
 * An interface representing evidence that is to be supplied to getPropertyValue 
 * or getPropertyValues methods of {@link Service}.
 * The purpose of Evidence is to represent available information with which to identify the delivery context.
 * The DDR Simple API is specifically designed to support, at a minimumn, representing Evidence as HTTP headers.
 * 
 * <br/></br>
 * <b>Note</b>:
 * This interface was designed in Java with the intention of being capable of easy binding to other languages.
 * The Java source code that produced this documentation is the official binding to this interface
 * for Java 5 and Java 6. (Compatibility with future versions, while likely, cannot be assured.)
 * An IDL binding, if provided, is derived from this Java-based definition.
 * Other valid language bindings may derive from the IDL, this Java-based definition, or other valid bindings.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 * @see Service#newHTTPEvidence()
 */

public interface Evidence {
	/**
	 * Add a key / value pair.
   * 
	 * @param key The unique key that identifies an element of the evidence.
	 * @param value The value of the identified element.
	 */
	public void put(String key, String value);
	
	/**
	 * True if a key exists.
   * 
	 * @param key The unique key that identifies an element of the evidence.
	 * @return True if the identified element has a value that can be retrieved.
	 */
	public Boolean exists(String key);
	
	/**
	 * Get the value corresponding to the key.
   * 
	 * @param key The unique key that identifies an element of the evidence.
	 * @return The value of the identified element.
	 */
	public String get(String key);
}

A.2 org.w3c.ddr.simple.PropertyName

package org.w3c.ddr.simple;

/**
 * This class represents the name of a property, drawn from a particular vocabulary.
 * The vocabulary is identified by a unique namespace.
 * It is not necessarily the case that the namespace is a dereferenceable URL, though this would be a common case.
 * The vocabulary must list the terms, give unique IDs (names) and describe semantics for each property term.
 * 
 * <br/></br>
 * <b>Note</b>:
 * This interface was designed in Java with the intention of being capable of easy binding to other languages.
 * The Java source code that produced this documentation is the official binding to this interface
 * for Java 5 and Java 6. (Compatibility with future versions, while likely, cannot be assured.)
 * An IDL binding, if provided, is derived from this Java-based definition.
 * Other valid language bindings may derive from the IDL, this Java-based definition, or other valid bindings.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 * @see PropertyRef
 * @see Service#newPropertyName(java.lang.String)
 */
public interface PropertyName {
	/**
	 * The name of the property term from a vocabulary of property terms.
	 * 
	 * @return A term from a vocabulary.
	 */
	public String getLocalPropertyName();

	/**
	 * The namespace of the vocabulary containing the property term.
	 * 
	 * @return An IRI.
	 */
	public String getNamespace(); 	//TODO Worry about whether an IRI class is needed

}

A.3 org.w3c.ddr.simple.PropertyRef

package org.w3c.ddr.simple;

/**
 * Represents a Property / Aspect combination.
 * The Property is as defined by the PropertyName class, comprising a term from a vocabulary and a namespace for that vocabulary.
 * In this API, it is assumed that the namespace of the Aspect coincides with the namespace for the Property.
 * 
 * <br/></br>
 * <b>Note</b>:
 * This interface was designed in Java with the intention of being capable of easy binding to other languages.
 * The Java source code that produced this documentation is the official binding to this interface
 * for Java 5 and Java 6. (Compatibility with future versions, while likely, cannot be assured.)
 * An IDL binding, if provided, is derived from this Java-based definition.
 * Other valid language bindings may derive from the IDL, this Java-based definition, or other valid bindings.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 * @see Service#newPropertyRef(org.w3c.ddr.simple.PropertyName)
 * @see Service#newPropertyRef(org.w3c.ddr.simple.PropertyName, String localAspectName)
 * @see PropertyName
 */
public interface PropertyRef {
	
  /**
   * This constant is to be used for properties whose underlying source does not have a (known) aspect.
   * 
   * <br/><br/>The value of this constant shall be "__NULL" but developers should not rely on this.
   * Instead, use this constant by name rather than value.
   */
	public static final String NULL_ASPECT = "__NULL";

	/**
	 * The name of the property, according to a vocabulary of property terms.
	 * 
	 * @return A term from a vocabulary (for use as a property identifier).
	 */
	public String getLocalPropertyName();

	/**
	 * The name of the aspect, according to a vocabulary of aspect terms.
	 * 
	 * @return A term from a vocabulary (for use as an Aspect identifier).
	 */
	public String getAspectName();

	/**
	 * The namespace of the property and aspect terms.
   * In the Simple API, the namespace of the Aspect is determined by the namespace of the Property.
   * Future APIs are expected to relax this relationship to permit Aspects from other namespaces.
	 * 
	 * @return An IRI.
	 */
	public String getNamespace();
	
}

A.4 org.w3c.ddr.simple.PropertyValue

package org.w3c.ddr.simple;

import org.w3c.ddr.simple.exception.ValueException;

/**
 * Represents the value of a property.<br/><br/>
 * 
 * <b>NOTE</b>:
 * The underlying data type of a property is determined by its vocabulary.
 * The programmatic determination of a property type from a vocabulary is out of scope for this API.
 * Therefore, the only practical way to determine the appropriate getX() method for an arbitrary instance of this class
 * is to obtain the name details via the getPropertyRef() method and compare the property information against
 * externally available vocabulary information.
 * Under the normal use cases for this API, the usage of an instance of this class will such that
 * the data type is already known, and the developer will take steps to use the appropriate getX() method.
 * 
 * <br/></br>
 * <b>Note</b>:
 * This interface was designed in Java with the intention of being capable of easy binding to other languages.
 * The Java source code that produced this documentation is the official binding to this interface
 * for Java 5 and Java 6. (Compatibility with future versions, while likely, cannot be assured.)
 * An IDL binding, if provided, is derived from this Java-based definition.
 * Other valid language bindings may derive from the IDL, this Java-based definition, or other valid bindings.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 */
public interface PropertyValue {

	/**
	 * 
	 * Returns the double value of the property, in the default units specified in its vocabulary.
   * 
	 * @throws ValueException Thrown if the property is not a double according to its vocabulary definition.
	 */
	public double getDouble() throws ValueException;

	/**
	 * 
	 * Returns the long value of the property, in the default units specified in its vocabulary.
	 * 
	 * @throws ValueException Thrown if the property is not a long according to its vocabulary definition.
	 */
	public long getLong() throws ValueException;

	/**
	 * Returns the Boolean value of the property.
	 * 
	 * @throws ValueException Thrown if the property is not a Boolean according to its vocabulary definition.
	 */
	public boolean getBoolean() throws ValueException;

	/**
	 * 
	 * Returns the integer value of the propertyr, in the default units specified in its vocabulary.
	 * 
	 * @throws ValueException Thrown if the property is not an integer according to its vocabulary definition.
	 */
	public int getInteger() throws ValueException;

	/**
	 * 
	 * Returns the value of the property as a a list of strings.
	 * 
	 * @throws ValueException Thrown if the property is not an enumeration according to its vocabulary definition.
	 */
	public String[] getEnumeration() throws ValueException;

	/**
	 * 
	 * Returns the float value, in the default units specified in its vocabulary.
	 * 
	 * @throws ValueException Thrown if the property is not a float according to its vocabulary definition.
	 */
	public float getFloat() throws ValueException;

	/**
   * Returns the PropertyRef that identifies the property to which this PropertyValue instance applies.
   * 
	 * @return The corresponding PropertyRef instance.
	 */
	public PropertyRef getPropertyRef();

	/**
	 * 
	 * Returns the string value of the property, or a string version of the property.
   * 
   * @return The string value of the property or an implementation-specific string version of the property if the underlying data type is not a string.
	 */
	public String getString();

	/**
   * Returns True only if a value is available from the repository.<br/>
   * Returns False if a value is not available from the repository.<br/><br/>
   * If this method returns True, then the getX() methods will return valid
   * data if type X is appropriate to the data stored in the repository.
   * If this method returns False, an attempt to retrieve a value via a getX()
   * method (other than getString) will cause a ValueException to be thrown.
   * 
	 * @return True if a value for the property is available in the repository.
	 */
	public boolean exists();
}

A.5 org.w3c.ddr.simple.PropertyValues

package org.w3c.ddr.simple;

import org.w3c.ddr.simple.exception.NameException;
import org.w3c.ddr.simple.exception.SystemException;

/**
 * Represents a collection of PropertyValue instances.
 * 
 * <br/></br>
 * <b>Note</b>:
 * This interface was designed in Java with the intention of being capable of easy binding to other languages.
 * The Java source code that produced this documentation is the official binding to this interface
 * for Java 5 and Java 6. (Compatibility with future versions, while likely, cannot be assured.)
 * An IDL binding, if provided, is derived from this Java-based definition.
 * Other valid language bindings may derive from the IDL, this Java-based definition, or other valid bindings.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 */
public interface PropertyValues  {
	
  /**
   * Obtain all of the PropertyValue instances as an array.
   * The order of the array is implementation-specific.
   * 
   * @return An array of PropertyValue instances, some of which may not have values.
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
	public PropertyValue[] getAll() throws SystemException;
	
  /**
   * Obtain an identified PropertyValue instance from the collection, using a PropertyRef as the identifier.
   * It is not guaranteed that the returned PropertyValue will have a usable value associated with it.
   * To test if a usable value is available, use the exists() method of {@link PropertyValue}.
   * 
   * @param prop An identifier of the PropertyValue to be returned.
   * @return The identified PropertyValue.
   * @throws org.w3c.ddr.simple.exception.SystemException
   * @throws org.w3c.ddr.simple.exception.NameException
   */
	public PropertyValue getValue(PropertyRef prop) throws SystemException, NameException;
}

A.6 org.w3c.ddr.simple.Service

package org.w3c.ddr.simple;

import java.util.Map;
import java.util.Properties;

import org.w3c.ddr.simple.exception.NameException;
import org.w3c.ddr.simple.exception.SystemException;

/**
 * This is the 'simple' interface to a DDR service, via which you retrieve properties of the delivery context based on available (HTTP) evidence.
 * 
 * <br/></br>
 * <b>Note</b>:
 * This interface was designed in Java with the intention of being capable of easy binding to other languages.
 * The Java source code that produced this documentation is the official binding to this interface
 * for Java 5 and Java 6. (Compatibility with future versions, while likely, cannot be assured.)
 * An IDL binding, if provided, is derived from this Java-based definition.
 * Other valid language bindings may derive from the IDL, this Java-based definition, or other valid bindings.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 */
public interface Service {
	/**
	 * Called to initialize the API following construction.
   * In the Java binding, this is called by {@link ServiceFactory}.
	 * 
	 * @param defaultVocabularyIRI The IRI of the default vocabulary namespace
	 * @param props Implementation dependent properties
	 * @throws SystemException
	 */
	public void initialize(String defaultVocabularyIRI, Properties props)
			throws SystemException;

	/**
	 * A informative implementation-specific method to determine the version of the implementation of the API.
   * This is for use in cases where the service has been constructed via a factory,
   * or similarly determined at run-time.
   * 
	 * @return A string indicating the revision level of the API
	 */
	public String getAPIVersion();

	/**
	 * An informative implementation-specific method to indicate the revision level of the underlying data, if known.
   * The information provided by this method, where information is returned, shall not be required
   * to reveal any details of the nature of the underlying data, including any source(s).
   * Whether or not the underlying implementation combines more than one source of data is opaque to 
   * the user of the API which makes no assumptions about the number of sources of data
   * 
	 * @return A String indicating the revision level of the data,
   * which will be different to any previously returned value if the
   * underlying implementation cannot guarantee that the data has not
   * changed since the last time this method was called.
   * @throws SystemException Thrown if the underlying repository does not support the notion of data versions.
	 */
	public String getDataVersion() throws SystemException;

	/**
	 * List all the PropertyRefs the API knows about.
	 * 
	 * @throws SystemException
	 */
	public PropertyRef[] listPropertyRefs() throws SystemException;

	/**
   * Use the evidence provided to get the PropertyValue of the property
   * named by the propertyRef,
   * in the property vocabulary given by the propertyRef and
   * in the aspect given by the propertyRef.
   * The aspect IRI is determined by the propertyRef
   * (which means it is the same as the property vocabulary IRI).
   * If no aspect term is defined by the propertyRef,
   * use the default aspect term for the property as defined in the property vocabulary.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param propertyRef Identification of the property whose value is being queried.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyValue getPropertyValue(Evidence evidence, PropertyRef propertyRef)
      throws NameException, SystemException;

  /**
   * Use the evidence provided to get the PropertyValue of the property
   * named by the propertyName
   * in the vocabulary given by the propertyName and
   * in the default aspect of the property according to the property's vocabulary.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param propertyName Identification of the property whose value is being queried.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyValue getPropertyValue(Evidence evidence, PropertyName propertyName)
      throws NameException, SystemException;

	/**
   * Use the evidence provided to get the value of the property
   * named by the localPropertyName, which is a term
   * in the default property vocabulary defined during initialization and
   * in the default aspect for the property as defined in the default property vocabulary.
   * The namespace IRI of the aspect is the same as the IRI for the default vocabulary og properties.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param localPropertyName The local name (identifier) of the property as per the default vocabulary of properties.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
	public PropertyValue getPropertyValue(Evidence evidence, String localPropertyName)
      throws NameException, SystemException;

	/**
   * Use the evidence provided to get the value of the property
   * named by the localPropertyName, which is a term
   * in the given vocabulary of properties identified by a namespace IRI and
   * in the given aspect for the property.
   * The namespace IRI of the aspect is the same as the namespace for the given vocabulary of properties.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param localPropertyName The local name (identifier) of the property as per the vocabulary of properties whose namespace is given.
   * @param localAspectName The local name (identifier) of the aspect, whose namespace is the same as that of the vocabulary of properties.
   * @param vocabularyIRI The namesapce IRI for the vocabulary of properties.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
	public PropertyValue getPropertyValue(Evidence evidence, String localPropertyName, String localAspectName, String vocabularyIRI)
      throws NameException, SystemException;

	/**
   * Use the evidence provided to get all of the available values
   * of properties in the default property vocabulary.
   * This includes all property terms from all supported vocabularies,
   * and in each of the aspects supported by the property vocabularies,
   * and for every aspect IRI that is supported.
   * Combinations of property/aspect that are not supported are not returned in the PropertyValues collections.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyValues getPropertyValues(Evidence evidence)
			throws SystemException;

	/**
   * Use the evidence provided to get the value of each property in the array of PropertyRef instances.
   * The aspect term is determined by the individual PropertyRef instances.
   * Where the aspect term is undefined, use the default aspect term in the property's vocabulary.
   * As the order of elements obtained via {@link PropertyValues#getAll()} is implementation-specific
   * it is not correct to assume that the order of elements in propertyRefs will influence the order of
   * the array returned by {@link PropertyValues#getAll()}.
   * The {@link PropertyValues#getValue(PropertyRef)} method provides a more direct and interoperable 
   * means of inspecting the return value.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param propertyRefs Identification of the properties whose values are being queried.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyValues getPropertyValues(Evidence evidence, PropertyRef[] propertyRefs)
      throws NameException, SystemException;

	/**
   * Use the evidence provided to get all of the available values for all properties
   * in the default vocabulary whose aspect is the localAspectName.
   * The namespace of the aspect is the same as the default vocabulary IRI.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param localAspectName The name of the aspect, whose namespace is the same as the default vocabulary of properties.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyValues getPropertyValues(Evidence evidence, String localAspectName)
      throws NameException, SystemException;

  /**
   * Use the evidence provided to get all of the available values for all properties
   * in the given vocabulary whose aspect is the localAspectName.
   * The namespace of the aspect is the same as the given vocabulary IRI.
   * 
   * @param evidence Evidence with which to identify the delivery context.
   * @param localAspectName The name of the aspect, whose namespace is the same as the vocabulary of properties.
   * @param vocabularyIRI The namespace of the vocabulary of properties.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
	public PropertyValues getPropertyValues(Evidence evidence, String localAspectName, String vocabularyIRI)
      throws NameException,	SystemException;

	/**
   * Factory method to create a new PropertyName instance in the default property vocabulary.
   * 
   * @param localPropertyName The local name (identifier) of the property as given in the default vocabulary.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyName newPropertyName(String localPropertyName)
			throws NameException, SystemException;

	/**
   * Factory method to create a new PropertyName instance in the given property vocabulary.
   * 
   * @param localPropertyName The local name (identifier) of the property as given in its vocabulary.
   * @param vocabularyIRI The namespace of the property.
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyName newPropertyName(String localPropertyName, String vocabularyIRI)
			throws NameException, SystemException;

	/**
   * Factory method to create a PropertyRef instance in the default vocabulary.
   * The aspect is determined by the default aspect according to the vocabulary of the property.
   * If the property has no default aspect defined in the vocabulary, the NULL_ASPECT is used.
   * @param localPropertyName
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyRef newPropertyRef(String localPropertyName)
			throws NameException, SystemException;

	/**
   * Factory method to create a PropertyRef instance using the name and vocabulary of the PropertyName parameter.
   * The aspect is determined by the default aspect according to the vocabulary of the property.
   * If the property has no default aspect defined in the vocabulary, the NULL_ASPECT is used.
   * 
   * @param propertyName
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyRef newPropertyRef(PropertyName propertyName)
			throws NameException, SystemException;

	/**
   * Factory method to create a PropertyRef instance using the name and vocabulary of the PropertyName parameter.
   * The aspect name is given, and the namespace IRI of the aspect is the same as the IRI of the vocabulary of the PropertyName parameter.
   * 
   * @param propertyName
   * @param localAspectName
   * @throws org.w3c.ddr.simple.exception.NameException
   * @throws org.w3c.ddr.simple.exception.SystemException
   */
  public PropertyRef newPropertyRef(PropertyName propertyName, String localAspectName)
      throws NameException, SystemException;

	/**
	 * Factory method to create a new HTTPEvidence instance with no name/value pairs that represent HTTP headers.
	 */
	public Evidence newHTTPEvidence();

	/**
   * Factory method to create a new HTTPEvidence instance using name/value pairs from the Map parameter.
   * Evidence created by this factory is assumed to be aware of the case-insensitivity of HTTP headers.
   * <br/><br/>
   * 
   * <b>NOTE</b>:
   * In bindings to pre-Java1.5, <i>java.util.Map&lt;Object,Object&gt;</i> shall be represented by <i>java.util.Map</i>
   * <br/><br/>
   * 
   * <b>NOTE</b>:
   * In bindings to non-Java languages, the map parameter shall be of a type that (at a minimum) can
   * support mappings from Strings to Strings
   * 
   * @param map Mapping of names to values, assumed to represent HTTP headers.
   */
  public Evidence newHTTPEvidence(java.util.Map<Object,Object> map);

}

A.7 org.w3c.ddr.simple.ServiceFactory

package org.w3c.ddr.simple;

import java.util.Properties;

import org.w3c.ddr.simple.exception.NameException;
import org.w3c.ddr.simple.exception.SystemException;

/**
 * This factory creates a DDR Service instance.
 * 
 * <br/><br/>
 * <b>NOTE</b>:
 * This class is provided as part of the Java binding of the API, and is <b>not</b> part of the API definition itself.
 * 
 * @author Jo Rabin (dotMobi) 
 * @author <br/>Jose Manuel Cantera Fonseca (Telefonica I+D) 
 * @author <br/>Rotan Hanrahan (MobileAware) 
 * @author <br/>Ignacio Marin (Fundacion CTIC) <br/>
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
 * &copy; 2008 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup>
 * (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
 * <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
 * <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.<br/>
 * W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
 * and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
 * 
 */
public class ServiceFactory {
	/**
   * Factory method to take a class identifier and create a new Service instance.
   * @param clazz Class identifier
   * @param defaultVocabulary Passed to the Service.initialize method.
   * @param configuration Passed to the Service.initialize method.
   * @throws org.w3c.ddr.simple.exception.SystemException
   * @throws org.w3c.ddr.simple.exception.NameException
   */
  public static Service newService(String clazz, String defaultVocabulary, Properties configuration)
			throws SystemException, NameException {
		Service theService = null;
		try {
			// Instantiation
			theService = (Service) Class.forName(clazz).newInstance();

			// Initialization
			theService.initialize(defaultVocabulary, configuration);
		} catch (Throwable thr) {
			// TODO: Capture the exceptions properly
			throw new SystemException(SystemException.INITIALIZATION, thr);
		}

		return theService;
	}

}

B Normative References

WSDL
Web Services Description Language (WSDL) 1.1, W3C Note, Erik Christensen, Francisco Curbera, Greg Meredith, Sanjiva Weerawarana, 15 March 2001 (See http://www.w3.org/TR/wsdl)
RFC 2119
Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, March 1997 (See http://www.ietf.org/rfc/rfc2119.txt)
IDL
OMG IDL Syntax and Semantics, Object Management Group. (See http://www.omg.org/technology/documents/formal/corba_2.htm)
Java
The Java Language Specification, Third Edition (See http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html)
XML Namespaces
Namespaces in XML, W3C Recommendation, Tim Bray, Dave Hollander, Andrew Layman (eds.), 14 January 1999 (See http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName)

C IDL Definitions for Simple API (Non-Normative)

This appendix contains the OMG IDL [IDL] definitions for DDR-API. It may be used to create other language bindings.

Editorial Note Version 1g (JR): need new version

tbd

D WSDL Language Binding (Non-Normative)

This section is informative. It describes a WSDL [WSDL] language binding for DDR-API.

tbd

E Informative References (Non-Normative)

DIGLOSS
Glossary of Terms for Device Independence, W3C Working Draft, Rhys Lewis (ed.), 18 January 2005 (See http://www.w3.org/TR/2005/WD-di-gloss-20050118)
Core Vocabulary
Device Description Repository Core Vocabulary, W3C Working Draft, Andrea Trasatti, Jo Rabin, Rotan Hanrahan (eds.), 18 December 2007 (See http://www.w3.org/TR/ddr-core-vocabulary/)
Requirements
Device Description Repository Requirements 1.0, W3C Working Group Note, Kevin Smith (ed.), 17 December 2007 (See http://www.w3.org/TR/DDR-requirements/)
Landscape
Device Description Landscape 1.0, W3C Working Group Note, Eman Nkeze, James Pearce, Matt Womer (eds.), 31 October 2007, (See http://www.w3.org/TR/2007/NOTE-dd-landscape-20071031/)
Ecosystem
Device Description Ecosystem 1.0, W3C Working Group Note, Rotan Hanrahan (ed.), 31 October 2007 (See http://www.w3.org/TR/2007/NOTE-dd-ecosystem-20071031/)
Delivery Context Ontology
Delivery Context Ontology, W3C Working Draft, Rhys Lewis (ed.), 21 December 2007 (See http://www.w3.org/TR/dcontology/)

F Acknowledgements (Non-Normative)

The editors wish to acknowledge the contributions of members of the DDWG.

The editors wish to acknowledge the specific written contributions of: