Java, RDF, and Wireless Computing
The Resource Description Framework (RDF) is a metadata standard that was designed by the World Wide Web Consortium (W3C) to enable Web applications that depend on machine-understandable metadata and to support interoperability between such applications. It targets a number of important areas that include dynamic syndication and personalization, mobile devices, resource discovery, intelligent agents, content rating, intellectual property rights, and privacy preferences. RDF uses XML to encode and transport RDF models but may also use alternative mechanisms in the future.
Applying RDF to redesigning the syndication process makes it possible to model content subscriptions. Instead of having to receive scheduled distributions of content, subscribers can direct their customers to syndicators' sites, while syndicators use the subscription models to recognize subscriptions (e.g., based on
HTTP-Referer HTTP headers) and dynamically tailor content to subscribers' profiles. RDF-based syndication models can be naturally extended from targeting different content channels to enabling the exploding variety of wireless devices.
Emerging commercial products support multiple devices by building libraries of device-specific XSLT stylesheets to transcode XML content. Such stylesheets may be fairly efficient when compiled into Java bytecode (Sun distributes the XSLT compiler). The problem is in maintaining stylesheet libraries for the growing variety of new and evolving devices. The solution is to change the level of granularity of transformations and design them for individual features rather than devices. Using RDF models to implement device and user agent profiles, it is possible to design software that constructs stylesheets by adapting and combining feature-based components, making it unnecessary to build and maintain ever-expanding libraries of complex device-specific stylesheets.
W3C, in coordination with the Wireless Access Protocol (WAP) Forum, is developing the Composite Capabilities/Preference Profiles (CC/PP) specification as the standard for setting device and user agent preferences. The upcoming RDF-based specification would allow defining a device by its screen size, keyboard (if any), display characteristics, etc. Next-generation servers that target multiple devices would combine device and user agent profile information with connection bandwidth and use it to construct XSLT stylesheets. An efficient server would optimize stylesheet construction by caching components, as well as intermediate composites. For example, caching device-specific stylesheets that are constructed based on device profiles and combining them with stylesheet components that are determined by the operating system, user agent software, and connection bandwidth.
Consider the XML-encoded RDF specification describing a handheld device "xyz":
<type resource="http://www.xyz-mobile.com/profiles/Schema#Hardware" />
uaprof prefixes are bound to URIs for "RDF Syntax", "CC/PP", and the WAP Forum's "User Agent Profile" namespaces, correspondingly. Prefixes are used throughout the RDF specification to disambiguate elements and attributes. The first element of the specification is
rdf:Description with an attribute defining
http://www.ia.com/xyzProfile as the subject of the description. Next, the
rdf:type element identifies the subject resource,
uaprof:CPU defines the default CPU, and
uaprof:Screen defines the default screen size.
Consider also the user agent specification:
<type resource="http://www.xyz-mobile.com/profiles/Schema#UserAgent" />
Here, the subject of the description is
rdf:type element identifies the subject resource, the
uaprof:BrowserName identifies the browser name as Mozilla,
uaprof:BrowserVersion identifies the browser version as Symbian, and
uaprof:CcppAccept defines MIME types supported by the browser.
Individual devices and user agents are likely to differ from default configurations. For example, my xyz device may have an optional screen, and I may have configured my browser to support
HTML in addition to plain text and WML. However, it is possible to incorporate default configurations by reference. My profile would have the following form:
<rdf:type resource="http://www.xyz-mobile.com/profiles/Schema#Hardware" />
<ccpp:Defaults rdf:resource="http://www.ia.com/xyzProfile" />
<rdf:type resource="http://www.xyz-mobile.com/profiles/Schema#UserAgent" />
<ccpp:Defaults rdf:resource="http://www.mozilla.org/wap/profiles/Mozilla" />
ccpp:Defaults elements reference default profiles while
uaprof:BrowserVersion override default properties of the device and user agent correspondingly. The resulting profile, when interpreted by the server-side transformation agent, would control automated assembly of an XSLT stylesheet that get compiled into Java bytecode and cached on the server.
A component-based approach to constructing device and user agent profiles further promotes automating targeted transformations of XML content. A new and unknown device may be analyzed and mapped to a known device with the closest set of features. The resulting specification, similar to the one above, gets stored in the device database (or databases) and serves as input to the transformation agent that is responsible for combining device-specific, feature-specific, and user agent-specific transformations into a single XSLT stylesheet. As in the example above, this stylesheet gets compiled into Java bytecode and stored on the server.
RDF is emerging as the foundation for next-generation frameworks that enable automated construction of Java applications. Such applications are composed of networks of metadata objects implementing RDF models and Java classes that use metadata objects as processing context. Using RDF for wireless applications opens up opportunities for building next- generation mobile services that don't depend on costly maintenance to keep up with new, evolving, and personalized devices. In other words, properly designed applications that are built in the era of cell phones and palm devices would still work for future microwave ovens that connect to the Internet to download cooking instructions.
The future direction of RDF, CC/PP, and related standards has immediate implications on design and development of wireless applications. This includes building separate classes responsible for content assembly and transformation, and imlementing feature-based XSLT stylesheets that may be assembled into device-specific and user agent-specific transformations even if automated transformation agents are not available. It is important to select wireless application development products that do not make use of proprietary formats and protocols and that establish a clear path for supporting W3C and WAP Forum standards.
- Composite Capabilities/Preference Profiles, Work in Progress, W3C.
- Resource Description Framework Model and Syntax Specification, W3C, 1999.
- Resource Description Framework Schema Specification 1.0, W3C, 2000.
- Java, RDF, and the "Virtual Web" Part three: Content aggregation, EarthWeb, 1999.
- User Agent Profile Specification, WAP Forum, 2000.
About the Author
Leon Shklar holds a Ph.D. in Computer Science from Rutgers University, New Brunswick, N.J. He is the CTO of Information Architects Corporation (IA), Hoboken, N.J. IA's SmartCode is the first commercial product that employs RDF models to construct sophisticated content aggregation, syndication, and transformaion solutions for the Internet.