176 JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012

Content Adaptation For Context-Aware Service

Jui-Fa Chen Department of Computer Science and Information Engineering, Tamkang University, New Taipei City, Taiwan Email: [email protected]

Ying-Hong Wang, Jingo Chenghorng Liao, Chen-An Wang Department of Computer Science and Information Engineering, Tamkang University, New Taipei City, Taiwan Email: [email protected], [email protected], [email protected]

Abstract—The current and developing trend for consumers used. In the fact, the other problem is all computational is to access web contents and applications anytime, overheads are shifted to the client in the system. anywhere, and on any devices. Most of Internet services and In server-based adaptation, the functionalities of the most of web contents have been designed for desktop web server are enhanced on content adaptation. computers, and often contain rich medias, such as images, Transmission time is reduced because the contents have audios, and videos. However, some devices are different from network connectivity, processing power, storage already been adapted. Traditionally, some variants of the capacity, display size, and formative handling capability. In same content are stored on the server, and it selects to many cases, the content designed for computers is not match the client identification. A common way for suitable for new (and often mobile) devices. Therefore, providing content to different devices is to store the content adaptation is needed in order to optimize the service content in Extensible Markup Language (XML) and uses for different devices and access methods. This research Extensible Style Language Transformation (XSLT) to discusses the context issues for web content adaptation. The convert the content to the appropriate makeup language. CC/PP and UAProf are two related standards that define In the proxy-based adaptation approach, a proxy server the format to describe the capabilities of devices for analyzes and transcodes the contents before sending the accessing content. A context-aware environment should allow adaptive access to context information. In this paper, results to the client. Content servers and proxies need to first we proposed an inference mechanism for context-aware know what kind of device from the request in order to service. Through this inference mechanism, users using send the right contents different devices can get appropriate contents based on Context is the information that characterizes the inference results. Second, we can demonstrate the interactions between humans, applications and the correlation between classes and individuals, and provide surrounding environments [3]. Many researchers have better scalability by means of building ontologies. Lastly, tried to define context, such as Schilit et al. who assigned SWRL depends on ontology based rule languages. Rules context to three categories [4]: computing context, user written based on SWRL can directly use an established context, and physical context. Muldoon et al. defined object relationship from ontology. context as an aggregation of the user’s location, previous Index Terms—Context-Aware, Adaptation, SWRL, activities, and preferences [5]. J. Sun adopted the same Inference, UAprof, Web Services definition and even added physiological information to user context [6]. Huang et al. defined the context of an entity as a collection of semantic situation information I. INTRODUCTION that characterized the entity’s internal features or operation and external relations under a specific situation. Adaptation means a process of selection, generation, or Context-aware computing, as discussed by Dey and modification of contents (texts, images, audios and videos) Abowd, refered to the ability of computing devices to to suit the user’s computing environment and usage detect and sense, and interpreted and responded to aspects context. In general, web pages incorporate a variety of of a user’s local environment and the computing devices media types and when using a PC connected to a website, themselves [7]. Context-aware content adaptation it is possible to see the original web page (without dynamically adapts behavior to the user’s current adaptation) with headings, photos, texts and videos. situation without user intervention. When accessing the same service with a mobile device, In this paper, we address a content adaptation approach the image is compressed. The text is summarized to one for a proposed context-aware architecture. The next paragraph and the video is delivered as text or an image, section offers a survey of related researches about this depending on bandwidth and the capabilities of the approach. Section 3 describes the context-aware system device. architecture. Content adaptation is presented in section 4. Adaptation can take place on a client, a server or an And the final section is conclusions and future research intermediate proxy [1][2]. In a client-based adaptation that we presented. approach, the client needs to receive the same media encoding in different versions although only one will be II. RELATED WORK

© 2012 ACADEMY PUBLISHER doi:10.4304/jsw.7.1.176-185 JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012 177

With the development of network technology, the web constrain conforming XML documents to a specific content can offer more and more abundant. However, vocabulary and a specific hierarchical structure. There are there are certain limitations among mobile devices and two types of documents, a schema document and multiple we are unable to fill all information in these devices. instance document, that conform to the schema. A Context-aware technology can perceive the status of schema can play two roles [20]: mobile devices and can adapt the contents for better z Template for a form generator to generate presentation, especially for the limitations on network instances of a document type. connectivity, processing power, storage capacity, display z Validator to ensure the accuracy of documents. size, and formative handling capability. RDF: The Resource Description Framework (RDF) is an XML-based language to describe resources. While the A. The Semantic Web definition of “resource” can be quite broad, let’s begin Most meaning on the web today is inferred by users with the common understanding of a resource as an who read web pages. The semantic web is supposed to electronic file available via the web. Such a resource is make data on the web readable and understandable, both accessed via a Uniform Resource Locator (URL). In RDF to users and to machine. [18]. Figure 1 illustrated model, a statement is often called a “triple” because it has semantic web stack. three parts. Those three parts are described in terms of the grammatical parts of a sentence: subject, predicate, and object. In common, the predicate is called the property of the triple. And the object is called the value of the triple. Figure 2 displays the elements of the tri-part model.

Figure 2. The RDF Triple

To play its role of describing data and meta data, RDF needs to include the following capabilities [21]: z Able to describe most kinds of data that will be available. z Able to describe the structural design of data sets.

Figure 1. Semantic Web Stack z Able to describe relationships between bits of data. XML: XML is not a language. It is actually a set of RDF defines three special resource types to group syntax rules for creating semantically rich markup resources or literal [19] [21] [20]: languages in a particular domain. The first key principle z Bag: The element is used to describe a list of of XML is markup and is separated from content. An values that does not has to be in a special order. XML element is an XML container, consisting of a start Duplicates are allowed in the collection. tag, content (other elements, text, or both), and an end tag z Sequence: The element is used to describe an (except for empty elements), which use a single tag ordered list of values. Duplicates are allowed in denoting both the start and end of the element. Elements the collection. A reason to use a sequence would maybe have zero or more attributes, each with its be to preserve the alphabetical order of elements. associated value. The second key principle of XML is z Alternate: The element is used to describe a that a document is classified as a member of a type by choice of multiple values or resources. This is dividing its parts, or elements, into a hierarchical referred to as a choice in XML. Some examples structure known as a tree [19][20]. would be a choice if image format (JPG, GIF, A well-formed XML document must satisfy the PNG, GMP). following requirement [20]: There are multiple reasons that RDF has been weak z It must be a tree with a single root. [21]: z Every start tag must have a matching end tag. z RDF does not yet play well with XML z All attributes must be quoted. documents. z Empty tags must have a trailing slash. z Parts of RDF are complex. z All entities must be declared. z Early RDF examples are weak. z Child elements must be properly nested. There are five primary reasons that RDF’s adoption The validity of an XML document can be determined will grow [21]: by comparing it to a specified Document Type Definition z Improved tutorials (DTD) or a specified XML Schema document. XML z Improved tool support schema is a definition language. That enables you to z Improved XML schema integration

© 2012 ACADEMY PUBLISHER 178 JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012

z Ontologies z Generic or common sense ontology: aim at z Non-contextual modeling capturing general knowledge about the world. RDF schema is used to define vocabularies. It used z Representational ontology: do not commit RDF to define a standard set of predicates that enable themselves to any particular domain. simple semantic relationships to be captured [20]. The Ontological engineering is concerned with the data model for RDF schema allows you to create classes principled design, modification, application, and of data. A class is defined as a group of things with evaluation of ontologies. Ontologies can be adopted in common characteristics and a template for an object situations where the capability for representing semantics composed of characteristics and behaviors. Because a is important to overcome XML’s disadvantages in terms class is the template, you can create many instances. An of maturity. One well-known ontology language, OWL object is one instance of a class. Section 2.6 displays the (Web Ontology Language), is designed to process Protégé Editor developed by Stanford University. It information instead of just presenting information to allows you to easily describe classes and class hierarchies. humans. OWL facilitates greater machine interpretability It allows also you to generate both the RDF schema and of web content by providing additional vocabulary along RDF document if you create instances of the schema [19]. with formal semantics. Ontology: Ontology is a popular research issue in OWL has three increasingly-expressive sublanguages: various communities such as knowledge engineering, OWL Lite, OWL DL, and OWL Full. OWL is used when natural language processing, intelligent information the information is contained in documents and needs to integration and knowledge management. Singh and be processed by applications. It also opposes to situations Huhns define that an ontology is a kind of a knowledge in which the content only needs to be presented to representation describing a conceptualization of some humans. OWL can be used to explicitly represent the domain [20]. Ontology specifies a vocabulary including meanings of terms in vocabularies and the relationships the key terms, their semantic interconnections, and some between those terms. This representation of terms and rules of inference. It provides a shared and common their interrelationships is called “Ontology”. OWL has understanding of a domain that can be communicated more facilities for expressing meaning and semantics than between people and heterogeneous and widely spread XML, RDF, and RDF-S do; Thus, OWL goes beyond application systems. Ontology has been developed in AI these languages in its ability to represent machine to facilitate knowledge sharing and reuse. Ontology interpretable content on web. OWL is a revision of the provides an explicit conceptualization that describes the DAML+OIL web ontology language and incorporates semantics of the data. [22] [23]. lessons learned from the design and application of Currently computers are changing from single isolated DAML+OIL. device to entry points into a worldwide network of An ontology includes the following [19]: information exchange. Therefore, support in the exchange z Classes (general things) in the many domains of of data, information and knowledge is becoming the key interest. issues in communication technology. It can communicate z Instances (particular things). between people and application systems. Providing z Relationships among those things. shared and common domain structure is becoming z Properties(and property values) of those things. essential, and it uses to describe the structure and z Functions of the processes involving those things. semantic of information exchange. Now, Internet z Constraints on and rules involving those things. technology and WWW are the main technology B. Methods of Client Capability Recognition infrastructure for on-line information exchange. It is not surprising to see that a number of initiatives are arising in The hardware resource of mobile devices is very limit. this area to provide notations for data structures and We can not expand the desired information arbitrarily. So, semantics. For example: we have to select the most useful information rather than z The resource description framework (RDF). all the information. In order to deliver suitable content for z The Extendible Markup Language (XML). different devices and user profiles, a website needs to be z XML schemes provide a standard for describing able to differentiate between the capabilities of different the structure and semantics of data. devices. The following possible methods are for z The transformation language of XSL (XSL-T). providing device recognition. z Various querying language for XML (XQL, Web clients identify themselves when they send XML-QL). requests to web servers. The current HTTP/1.1 standard Depending on their generality level, different types of uses four Accept header fields to describe the capabilities ontologies may be identified that fulfill different roles. and preferences of the client: Accept, Accept-Charset, We can distinguish the following ontology types: Accept-Encoding, and Accept-Language. The Accept z Domain ontology: capture the knowledge valid field describes the MIME types which are accepted by a for a particular type of domain. browser. The other Accept header fields describe z Metadata ontology: like Dublin Core [24] preferences for the character set, encoding, and language. provide a vocabulary for describing the content Information in HTTP headers is limited and hard to of on-line information sources. extend. It was designed for browser descriptions and lacked the meaning for context and device capability.

© 2012 ACADEMY PUBLISHER JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012 179

In addition to Accept headers, clients send a User- insufficient. The Composite Capability/Preference Agent header to identify themselves. It is very simple but Profiles (CC/PP) [8] recommendation from the W3C enough to provide some client-specific information, such describes a method for using the Resource Description as browser, operating system and sometimes hardware Framework (RDF) of the W3C to provide a way for user information. However, a User-Agent header only works agents and browsers to specify metadata about device for nearly static device properties. With hundreds of capabilities and user preferences. This information can be different browsers in use today, it gets tricky to support provided by the user to servers and content providers. everyone by relying on the User-Agent field. The servers can use this information describing user The User-Agent header contains information about the preferences to customize the services or contents. CC/PP browser and the operating system via the request and is an extensible framework that can be used for sometimes hardware information (see Table 1 for communicating the delivery context (screen size, audio examples). capabilities, bandwidth, etc) from a device or a web Table I shows examples of the request header fields server, resulting in the delivery of web content usable on produced by different browsers: a given device. CC/PP allows different devices to specify their capabilities in the some way. Table I. There are several implementations of the CC/PP Examples Of User-Agent Headers standard. Below is a list of a few of the current IE7 in Windows Mozilla/4.0 (compatible; MSIE 7.0; XP Windows NT 5.1; ozilla/4.0(compatible; MSIE implementations: 6.0; Windows NT 5.1; SV1);.NET CLR z Activ Server 1.1.4322;.NET CLR 2.0.50727;.NET CLR z Cysive Cymbio Interaction Server (Cysive) 3.0.04506.30;.NET CLR 3.0.04506.648; z Aligo M-1 Mobile Application Server (Aligo) InfoPath.2) z DELI (HP laboratories Open Source CC/PP server API) [9] Firefox 3.0.1 in Mozilla/5.0 (Windows; U; Windows NT 5.1; z Wokup! Server and Studio (Wokup) windows XP zh-TW; rv:1.9.0.1) Gecko/2008070208 z J2EE CC/PP Processing Reference Firefox/3.0.1 Implementation (Sun) Nokia 6230 Nokia 6230/2.0 (03.06) Profile/MIDP-2.0 built-in browser Configuration/CLDC-1.1 z Device Independence Access for the World Nokia 6600 Nokia 6600/1.0 (3.42.1) SymbianOS/7.0s Wide Web (W3C Greece Office) built-in browser Series60/2.0 Profile/MIDP-2.0 DELI is an open-source library developed from HP Configuration/CLDC-1.0 Labs. It allows Java Servlet to resolve HTTP requests containing user context information from CC/PP or A resource might have many diverse presentation types, UAProf capable devices and query the resolved profile. It such as different languages, media types or versions. And also provides to support for legacy devices so that the we usually select the best method that provides an index proprietary user context descriptions currently used by for desired data that we want. But some browsers can applications. It can be replaced by standardized CC/PP only provide the specific header information by itself descriptions. In this paper, DELI is used to acquire user when requesting. Then the server will acquire these context information. information directly from the browser. It’s important to User Agent Profile (UAProf): The User Agent Profile note that none of these browsers correctly obeys the (UAProf) specification developed by the Open Mobile HTTP/1.1 content negotiation standard. Because a Alliance (OMA, former WAP Forum) is a concrete browser obeys the standard, the server will be hard to CC/PP vocabulary dedicated to description, acquire the information of browser from these headers. and defines an efficient transmission of the CC/PP We mention again there are two kinds of content descriptions over wireless networks. Mobile phones negotiations in HTTP: server-driven negotiation and complying with the UAProf specification provide CC/PP agent-driven negotiation, these two kinds of negotiations descriptions of their capabilities to servers. Content are orthogonal and thus may be used separately or servers, gateways, and proxies can use this information combinatively. So when the client sends a request, the and optimize the content for the device and the user. server will acquire these information. UAProf consists of description blocks for the following Scripting languages such as JavaScript, VBScript, key components: Jscript, and WMLScript can provide device–specific z Hardware Platform: the type of device, model information. ActiveX components can also report the number, display size, input and output methods, browser device and connection characteristics. color capability, etc. C. The Standard of Context Extraction z Software Platform: operating system software, mine type, character sets, transfer encoding, Several standards have been defined and also address video and audio encoders supported by the the interoperability problems. A few of these standards device, etc. are described here. z BrowserUA: browser info, HTML/XHTML, Composite Capability/Preferences Profiles (CC/PP): Java, JavaScript, frames and tables capability. As some variety of devices grows on Internet, we need to z Network Characteristics: GSM/GPRS capability, tailor the contents specifically for the different devices. security support, support. The User-Agent header information discussed earlier is

© 2012 ACADEMY PUBLISHER 180 JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012

z WAP Characteristics: WAP/WML support, deck and to extend Jess with additional functions for size. communication with Protégé. z Push Characteristics: push content types, push F. Protégé message size. UAProf files are quite comprehensive and they tend to Protégé Ontology Editor is a free, open source grow large. That is why only the URL of the device ontology editor and knowledge-base framework [12]. The profile is transmitted from the mobile terminal to the Protégé platform supports two main ways of modeling server. The content server fetches the profile from the ontologies via the Protégé-Frames and Protégé-OWL device profile repository and may store it in its own editors. Protégé ontologies can be exported into a variety database for further use. The WAP gateway or HTTP of formats including RDF, OWL and XML Schema. proxy must support UAProf header forwarding. Protégé is based on Java and is extensible. Protégé also provides a plug-and-play environment that makes it a D. Semantic Web Rule Language (SWRL) flexible base for rapid prototyping and application Semantic Web Rule language (SWRL) is based on a development. combination of the OWL DL and OWL Lite G. Agent sublanguages of the OWL. Web Ontology Language with the Unary/Binary Datalog RuleML sublanguages of the Agent technique is one of the important technologies Rule Markup Language [10][11]. SWRL includes a high- developed to support Internet applications. Especially, level abstract syntax for Horn-like rules in both the OWL Internet and WWW technologies break the limitation of DL and OWL Lite sublanguages of OWL. A model- space for enterprise marketing, and the agent techniques theoretic semantics is given to provide the formal solve the problems of temporality. Even though the users meaning for OWL ontologies, including rules written in are off-line, the agents can still work in the network and this abstract syntax. The rules are of the form of an play the pre-defined scenarios. Agent is software that implication between an antecedent (body) and consequent assists the behavior of users in the network. (head) [10]. In the book titled, Programming and Deploying Java SWRL’s structure is composed of four parts: Imp, Mobile Agents with Aglets [25], the authors, Danny B. Atom, Variable and Building, as explained below: Lange and Mitsura Oshima, define agent into two z Imp: the head and body of the rules, consisting viewpoints: of Atoms. z End-User Perspective: An agent is a program z Atom: descriptions of the head and body. that assists people and acts on their behalf. z Variable: the variables used in recording rules. Agents function by allowing people to delegate z Building: records the logic comparison work to them. relationship that can be used by SWRL. z System Perspective: An agent is a software object that: E. Jess „ Is situated with an execution environment. Jess is a rule engine and scripting environment written „ Processes the following mandatory: entirely in Java language [10][12][13][14]. Jess is small, ‹ Reactive: senses changes in the light, and one of the fastest rule engines available. Jess is environment and acts according to fast rule engine and its powerful scripting language gives those changes. the access to all of Java APIs. Jess can solve the difficult ‹ Autonomous: has control over its many-to-many matching problem. In Jess, a rule consists own actions. of a left-hand side(LHS) and a right-hand side(RHS). ‹ Goal-Driven: is proactive. Jess is a reimplementation of a subset of Clips in Java. ‹ Temporally continuous: is Jess implements some additional functionality, not continuously executing. provided by Clips. Like Clips, reasoning in Jess is based „ And many posses any of the following on a list of known facts and a set of rules that try to match orthogonal properties: on these facts in its fact base. ‹ Communicative: able to Facts are basically a list of known values. The rule’s communicate with other agents. preconditions are patterns with wild cards and conditional ‹ Mobile: can travel from one host to expressions, which match such facts. Rules can assert another. new facts when they fire, which in turn could result in In the book titled, Mobile-Agent Systems [26], the other rules firing. Jess uses the Rete algorithm to ensure authors, Jacques Ferber, defines agent as follows: efficient pattern matching and rule activation. Integrating An agent is a physical or virtual entity: Jess with other Java programs is easy because it has a z Which is capable of acting in an environment, well-defined API for controlling the reasoning engine z Which can communicate with each other from Java. For example, Java programs can send z Which is driven by a set of tendencies, expressions to the Jess engine for evaluation. In addition, z Which possesses resources of its own, we can define new Jess functions in Java. The JessTab z Which is capable of perceiving its implementation takes advantage of the Jess API to map environment(but to a limited extent), information in the Protégé knowledge base to Jess facts z Which has only a partial representation of this environment(and perhaps none at all),

© 2012 ACADEMY PUBLISHER JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012 181

z Which possesses skills and can offer services, component of the Oracle Application Server [16]. It z Which may be able to reproduce itself, includes Multi-Channel Server which abstracts the z Whose behavior tends to towards satisfying its underlying networks, protocols, devices and gateways to objectives, allowing for the resources and skills one protocol and one language, namely HTTP and XML. available to it and depending on its perception, The server enables applications to be accessed through its representations and the communications it multiple delivery methods and devices such as 2-way receives. pagers, devices with SMS, MMS, voice, or WAP In the book, “Programming and Deploying Java capabilities, and handheld computers. The server Mobile Agents with Aglets” [25], the basic properties of automatically translates applications written in Oracle agents are “Reactive, Autonomous, Object-Oriented, Wireless XML, XHTML Mobile Profile, or Communicative, Mobile, Learning, and Believable”. XHTML+XForms for any device and network. For A mobile agent is an agent, which has the capability of example, an XHTML+XForms application passed mobility in the network. Danny B. Lange lists several through the Multi-Channel Server will be translated to advantages of mobile agent technologies are applied on VoiceXML if a phone is accessing the application network: [25] through a voice interface or to WML if a WAP phone z They can reduce the network load. issues the request. The tools to support the most popular z They can overcome network latency. devices are maintained and regularly updated by Oracle. z They can encapsulate protocols. As new devices come to the market, support is added to z They execute asynchronously and autonomously. the Multi-Channel Server. The framework also supports z They adapt the changes dynamically. session management, service linking, and location z They are heterogeneous and fault-tolerant. awareness. Agents are pieces of software that work autonomously IBM WebSphere Transcoding Publisher is server- and proactively. Conceptually they evolved out of the based software that dynamically translates Web content concepts of object-oriented programming and and applications into multiple markup languages and component-based software development. A personal optimizes it for delivery to mobile devices- based on user agent on semantic web will receive some tasks and preferences and device capabilities [17]. Content preferences from the person, seek information from web adaptation for many devices and languages eliminates the sources, communicate with other agents, compare need to maintain multiple versions of a web site. The information about user requirements and preferences, product can convert images to links to retrieve images, select certain choices, and give answers to the user. convert tables to lists, and remove comments and features not supported by the device. H. Examples of Content Adaptation System

Cocoon is an open-source Java server framework that III. CONTEXT-AWARE SYSTEM ARCHITECTURE allows dynamic multi-channel Web publishing of XML content using XSLT transformations [15]. By relying on The context-aware system architecture is presented in XML to describe content, and XSLT as a means of this section. Figure 3 shows the proposed context-aware transforming that content into multiple formats, Cocoon system architecture. provides a platform for building applications with separation between content, logic, and presentation. Cocoon can also serve static files as well as dynamically generated responses with wide variety of output formats including XML, XHTML, PNG, JPEG, SVG, and PDF. Support multiple clients, layouts and languages without code duplication. Cocoon includes CC/PP and UAProf support through another open-source product called DELI, which is a library that provides an API to allow Java servlets to resolve HTTP requests containing user context information from CC/PP or UAProf enabled devices and query the resolved profile. DELI is an open-source library originally developed at HP Labs that allows Java servlets to resolve HTTP requests containing delivery context information from CC/PP or UAProf capable devices and query the resolved profile [9]. It also provides support for legacy devices so that the proprietary delivery context descriptions currently used by applications can be replaced by standardized CC/PP descriptions. DELI allows Cocoon to determine the user context of a client device, for example a UAProf enabled device. Oracle is better known for its database products. Figure 3. System Architecture Oracle Application Server Wireless is the mobile

© 2012 ACADEMY PUBLISHER 182 JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012

In this system, there are five main agents, as follows: properties. Using the UAProf base on the CC/PP, the z Context-Management Agent (CMA): CMA is framework establishes a more effective mechanism for the system administrator. When a user send gathering dynamically changing context information on request to the server, the server forwards a the server. However, UAProf only provides a common request to CMA. The CMA can also cancel, vocabulary for WAP devices, but most of the vocabulary modify, or renegotiate context because of can be adopted for other non-WAP devices like normal environmental changes. The CMA also stores Web browsers on PCs, notebooks, or PDAs. relevant information in a knowledge base In this way, the mechanism illustrated in Figure 4 repository for future inference and knowledge distinguishes between UAProf enabled devices, the sharing. devices provide the user agent and support for client side z Inference Agent (IA): IA manages the inference code like JavaScript, JScript and Java (combinations are process. It uses context captured from CMA and possible). The client side code directly gathers the device users as facts in the context inference process. It properties of the client. uses these facts to build a system knowledge base repository for reasoning new context information. The IA also reasons user preferences from user history. z Content Agent (CA): CA selects the most appropriate content according to user context and user preferences. z Hypertext Agent (HA): HA organizes the hypertext structure of the web interface. When the bandwidth is limited, it decomposes a large volume of content into linked pages. z Presentation Agent (PA): PA builds an adequate layout for the web pages according to the layout capabilities of the device. In this paper, CMA and IA are the main roles for context inference. When user sends a request to server, the server forwards the request to CMA. CMA negotiates the context and requests header. IA requests the context from context repository for reasoning new context information. The context-aware system adapts the behavior to user context without user intervention.

Adaptation requires for sense changed in user context, Figure 4. The Mechanism Of Acquiring User Context inference about the change of user context, and they react appropriately. Figure 5 illustrates flow chart of user context data. The process of the user context on the server depends on the IV. CONTENT ADAPTATION obtained request. Adaptation means a process of selection, generation, or z If the request only includes the User-Agent modification of content to suit the user’s context. Each parameter, this parameter is mapped to the web page depending on its contents has a different layout according device profile in a device repository that requires adaptation to match device capabilities. z If a UAProf enabled device sends a User-Agent Before content adaptation, the system needs to first profile within the request, the information is acquire user context information. Then, the system selects handled by DELI on the server side, which the most appropriate content according to the user context provides an API for Java servlets to determine and user preferences. client capabilities using CC/PP and UAProf. z When the devices don't support UAProf, this A. Acquiring Context Information system collects the context of the devices via Wherever adaptation takes place, it must be based on client side code. The gathered context information about the user context. This can include the information on the client is sent within the HTTP device’s capabilities about the network characteristics, request header. The server processes that user preferences and other parameters, such as users’ information and merges it with an existing preferred language or their location. profile or generated by a DELI device. In section 2, several strategies for acquiring user z When the client sends the request to the server, context were mentioned. The most popular method is to the request includes user context information. analyze the HTTP User-Agent parameter that comes with The HTTP agent forwards the request to the the HTTP request header, and map this parameter to a Ontology agent. Because companies responsible device or browser repository on the server side. However, for authoring profiles are often different to those the User-Agent header works only for nearly static device creating CC/PP processors, there may be

© 2012 ACADEMY PUBLISHER JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012 183

disagreements when interoperability problems ontologies and SWRL rules. Racer is for reasoning with occur. The Ontology agent validates CC/PP OWL ontologies, and the Jess inference engine is for profiles. reasoning with SWRL rules. In this paper, we build z The CMA then acquires user context data and ontologies and rules by Protégé [12]. Protégé is a free negotiates with the context repository. After the Java-based, open source ontology editor and knowledge- CMA acquires context information, it modifies base framework. Protégé is extensible and provides a the profile and forwards it to IA. The IA uses the plug-and-play environment that makes it a flexible base information to build a system knowledge base for rapid prototyping and application development. repository for reasoning new context information. Figure 6 illustrates how to build an individual and his The IA also reasons user preferences from the class. To bridge between Protégé SWRL and Jess, we user history. used the Protégé plugin JessTab, allowing us to integrate Protégé and Jess.

Figure 5. Flowchart Of User Context Data Figure 6. Building Individual And Classes

B. Building SWRL Rules Figure 7 illustrates the inference architecture for IA. The main tasks here can be broken down into the SWRL rules can be directly tied together with following four steps: Ontology using Ontology’s description of relationships 1. Representing OWL Concepts as the JESS Fact and words. Due to this advantage of SWRL [11], the Base. correlations between classes don’t need extra rule 2. Representing SWRL Rules as Jess Rules. descriptions, and so this research used SWRL to develop 3. Combining the Fact Base and Rules Base to rules. execute JESS Inference. The following two correlations need to be described 4. Executing Jess Rules and updating the OWL when developing the rules: Knowledge Base according to inference results. z Correlations within the same domain. z Correlations between different domains. For example, when determining whether a device supports full color images or not, we can describe as follows: SWRL rule: device(?d)ΛColorCapable(?d,?boolean) Λ hasImageCapable(?d,?boolean) Λ SWRLb:equal(?boolean, “ Yes") → hasColorfulImg(?d, “Yes") C. Executing Jess Inference and Updating the OWL Knowledge Base Using rules in conjunction with ontologies is a major challenge for the semantic web. We first achieved an Figure 7. Inference Architecture implementation of SWRL using the Protégé OWL plugin. We used the Protégé OWL plugin for editing OWL

© 2012 ACADEMY PUBLISHER 184 JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012

The Inference Engine acquires the data from Rule Base video framerate (resolution) reduction, or format and Fact Base, through the Pattern Matcher to do conversion. comparison. If there is compliance with the rules and The adapted content is forwarded to the HA. The HA conditions, the Agenda will arrange the priority of the defines the hypertext structure according to user context rules and conditions. Eventually, we will trigger the by introducing links, and decomposes large pages to take events of these rules by the Execution module. into account the display limitations of the device. Then, z Rule Base: It stores the relevant inference rules, the PA builds an adequate layout for the web pages. to present the knowledge and experience. z Fact Base: it stores the relevant facts of V. CONCLUSION reasoning process. The Jess template provides a mechanism for In this paper, first we proposed an inference representing the OWL class hierarchy. A Jess hierarchy mechanism for context-aware service. Through this can be used to model an OWL class hierarchy using a inference mechanism, users using different devices can Jess slot. get appropriate content based on inference results. z Define Jess template to represent the owl:Thing Second, we can demonstrate the correlation between class: classes and individuals and provide better scalability by - (deftemplate OWLThing (slot name)) means of building ontologies. Lastly, SWRL depends on ontology based rule language. Rules written based on z A class “device" so that a direct subclass of SWRL can directly use an established object relationship owl: Thing could then be represented as follows from ontology. in Jess: How to build the content recommendation according to - (deftemplate device extends OWLThing) user context is the future work. And a better content z The OWL individual can be asserted as a decomposing is necessary by Hypertext Agent to ensure member of the class Model : the content sizes won’t exceed device capabilities. - (assert(device(name Nokia7610))) z The property of the individual Nokia7610: REFERENCES - (assert (colorCapable Nokia7610 Yes)) [1] Y. W. Kao, T. H. Kao, C. Y. Tsai, S. M. Yuan, “A personal web page tailoring toolkit for mobile devices”, Computer Standards & Interfaces, Vol. 31, Issue 2, pp. 437-453. [2] P. Salomoni, S. Mirri, S. Ferretti, M. Roccetti, “A multimedia broker to support accessible and mobile learning through learning objects adaptation”, ACM Transactions on Internet Technology (TOIT), vol.8, Issue 2, pp. 9:1-9:23. Figure 8 Presenting SWRL Rules As A Jess Rule [3] P. Brézillon, “Focusing on context in human-centered computing”, IEEE Intelligent Systems, vol. 18, pp. 62-66, Figure 8 illustrates how to present a SWRL Rule as a 2003. Jess Rule. The following SWRL atom indicates that the [4] B. Schilit, N. Adams, R.Want, “Context-Aware Computing Boolean variable must be Yes or No: Applications”, Proc. of IEEE Workshop on Mobile [Yes,No](?boolean) Computing Systems and Applications, Santa Cruz For example, the following SWRL rule determines if a California, USA, 1994, pp. 85-90. [5] C. Muldoon, G. O’Hare, D. Phelan, R. Strahan, R. Collier, device supports full color images. It reasons new context “ACCESS: An Agent Architecture for Ubiquitous Service information from existing context information. Delivery”, Proc. of The Seventh International Workshop device(?d) Λ ColorCapable(?d,?boolean) Λ on Cooperative Information Agents. (CIA’2003), Helsinki, hasImageCapable(?d,?boolean) Λ Finland, 2003, pp. 1-15. SWRLb:equal(?boolean, “ Yes") → hasColorfulImg(?d, [6] J. Sun, “Information Requirement Elicitation in Mobile Commerce”, Communications of ACM, 46, 12, pp 45-47, “Yes") December 2003. The above rule can be represented in Jess as follows: [7] A. K. Dey, G. D. Abowd, ”Towards a Better (defrule aRule (device(name ?d)) (ColorCapable ?d Understanding of Context and Context-awareness.”, Proc. “Yes”) (hasImageCapable ?d ”Yes”) => (assert of the CHI’2000 Workshop on Context-Awareness, The (hasColorfulImg ?d “Yes”)) Hague, Netherlands, April 2000, pp. 304-307. [8] G. klyne, F. Renolds, C. Woodrow, H. Ohto, J. Hjelm, D. Providing Appropriate Content to Users Based on M.H. Butler, L. Tran, ”Composite Capability/Preference Inference Results Profiles (CC/PP): Structure and Vocabularies”, W3C When a CA acquires the reasoned context from CMA, Working Draft (January 2004), it requests the content based on user context. It selects the http://www.w3.org/TR/2004/REC-CCPP-struct-vocab- 20040115/ most appropriate content according to user context and [9] M. Butler, ”DELI: A Delivery context Library for CC/PP user preferences. The CA decides which content will be and UAProf”, HP External Technical Report HPL-2001- adapted. The video adaptation may be removal, substitute, 260, 2002.

© 2012 ACADEMY PUBLISHER JOURNAL OF SOFTWARE, VOL. 7, NO. 1, JANUARY 2012 185

[10] M.O. Conner, H. Knublauch, T. Samson, Jui-Fa Chen received his PhD, MS, and M.Musen, ”Writing Rules for the Semantic Web Using BS degrees in the department of SWRL and Jess”, 8th International Protégé Conference, Computer Science and Information Protégé with Rule Workshop, Madrid, Spain, SMI-2005- Engineering from Tamkang University 1079, 2005. (TKU), Tamshui, Taipei, Taiwan, in [11] V. Ricquebourg, D. Durand, D.Menga, B.Marhic, L. 1998, 1992, and 1990, respectively. Delahoche, C. Loge, A.Jolly-Desodt, ”Context Inferring in He is an assistant professor in the the Smart Home : An SWRL Approach”, Advanced Department of Computer Science and Information Networking and Applications Workshops, Information Engineering of Tamkang 2007, AINAW 2007. 21st International Conference. University (TKU). His research interests Volume 2, 21-23 May 2007, pp. 290-295. include intelligent avatar, wireless sensor network, and cyber [12] C. Golbreich, A. Imai, “Combining SWRL Rules and physical system. OWL Ontologies with Protégé OWL Plugin, Jess and RACER”, 7th International Protégé Conference, Bethesda, MD, 2004, from Ying-Hong Wang received the B.S. http://protege.stanford.edu/conference/2004/abstracts/Golb degree in Information Engineering reich.pdf. from Chung-Yuan University, [13] Jess Rule Engine: http://herzberg.ca.sandia.gov/jess/ Taiwan, in 1986 and the M.S. and [14] E. Friedman-Hill (2002). Jess in Action -Java Rule-based Ph.D. degrees in Information (In Action series) Systems. Manning Publications Co., Engineering from the Tamkang from University, in 1992 and 1996, http://www.amazon.com/exec/obidos/redirect?tag=citeulik respectively. e07-20&path=ASIN/1930110898 From 1988 to 1990, he worked in [15] N. Dimitris, A. Kanellopoulos, “Adaptive multimedia the Product Development Division of systems based on intelligent context management”, Institute of Information Industry (III). International Journal of Adaptive and Innovative Systems, From 1992 to 1996, he was a lecturer vol. 1, No. 1, pp. 30-43. in the department of computer science and information [16] Oracle Application Server, Oracle Corporation, from engineering of Tamkang University. From August 1st, 1996 to http://www.oracle.com/appserver/index.html January 31, 2008, he was an associate professor in the [17] IBM. WebSphere Transcoding Publisher, from department of computer science and information engineering of http://www.ibm.com/software/webservers/transcoding/ Tamkang University. From August First, 2004 to July 31, 2008, [18] J. Hendler, T. Berners-Lee, E. Miller, “Integrating he served as the Chair of Department of Computer Science and Applications on the Semantic Web”, 2002 Journal of the Information Engineering, Tamkang University. Beginning Institute of Electrical Engineers of Japan, vol. 10, no. 122, February 1st, 2008, he promoted to be a professor of the pp. 676-690. department of computer science and information engineering, [19] M. C. Daconta, L. J. Obrst, K. T. Smith, “The Semantic Tamkang University. Web: A Guild to the Future of XML, Web Services, and He has over 100 technological papers published on Knowledge Management”, Wiley 2003, ISBN: 978-0-471- International journals and International conference proceedings, 43257-9. he also join many International activities been program [20] M. P. Singh, M. N. Huhns, “Service-Oriented Computing: committee, workshop chair, session chair and so on. He had Semantics, Processes, Agents”, Wiley 2005, ISBN-10: 0- been invited as Visiting Researcher in The University of Aizu, 470-09148-7. Japan, from January to March 2002. He is also an Adjunct [21] T. B. Passin, “Explorer’s Guide to the Semantic Web”, Professor of Beijing Jiaotong University, China, starting from Manning 2004, ISBN:1-932394-20-6. April 2007 and an Adjunct Professor of Shanghai University, [22] D. L. McGuinness, F. V. Harmelen, “OWL Web Ontology China, starting from September 2010. Language Overview”, W3C Recommendation, form His current research interests are Software Engineering, e- http://www.w3.org/TR/owl-features. Learning, Wireless Communication, and Mobile Agent. [23] Y. Labrou, T. Finin, “As An Ontology-Using Yahoo! Categories to Describe Documents”, 8th International Conference on Information and Knowledge Management”, Jingo Chenghorng Liao is now a New York, USA, ACM Press, 1999, pp.180-187. doctoral student of Department of [24] S. Weibel, J. Gridby, E. Miller, “OCLC/NCSA Metadata Computer Science and Information Workshop Report”, Dublin, EUA, Retrieved 1995, From Engineering, Tamkang University since http://www.oclc.org:5046/oclc/research/conferences/metad 2005. He received the M.B. degree in ata/dublin_core_report.html. Department of Computer Science and [25] D. B. Lange, Mitsuru Oshima, “Programming and Information Engineering from Tamkang Deploying Java Mobile Agents with Aglet”, Addison- University in 2004, and B.S. degree in Wesley 1998, ISBN:0-201-32582-9. Information Management of Chinese [26] J. Ferber, “Multi-Agent Systems: An Introduction to Culture University in 2003, respectively. Distributed Artificial Intelligence”, Addison-Wesley 1999, He is a Senior IT Engineer at E-Lifemall Corporation in Taiwan ISBN:0-201-36048-9. since 2000. And he is an adjunct lecturer at Tamkang University since 2006.

© 2012 ACADEMY PUBLISHER