Ontology-Based Context Inference and Query for Mobile Devices

Embed Size (px)

Citation preview

  • 8/4/2019 Ontology-Based Context Inference and Query for Mobile Devices

    1/5

    Ontology-based Context Inference and Query forMobile DevicesSuparna De and Klaus Moessner

    Centre for Communication Systems ResearchUniversity of SurreyGuildford, United Kingdom{S.De, K.Moessner}@surrey.ac.uk

    Abstract-The VISIon of service personalization for mobilecommunication environments entails context sensitive serviceprovisioning. The realization of such customizable smart spacesnecessitates acquisition and processing of modality contextinformation from a variety of devices in the ambientenvironment. The heterogeneity of available device capabilitiesand descr ipt ion formats brings new challenges for a con textreasoning engine that formulates content delivery decisions.Specifically, to ensure interoperability with existing applicationlogic, the enabling components should support semantic queries.Secondly, situations where variously formatted context inputmaynot provide enough information to answer queries, should beintelligently handled. Towards this aim, this paper discusses acontext reasoning and query interface component as part of aService Context Manager (SCM) framework that supportssemantic querying and handles incomplete context informationthrough a rule-based mechanism. The validation of the approachis provided by showing the mapping of disparate UAProf andUPnP descriptions into the framework and querying ofsupported modality services.

    Keywords-context query; contextinference; ontology; SWRLI. INTRODUCTION

    The concept of dynamically available devices and servicesdrives the current paradigm of mobile communications. Arecent study [1] envisioning the future Web puts applicationinteroperability and service personalization in different planes;with ubiquitous computing purported to be focused ondisparate device interoperation and universal usability gearedtowards user-focused customization.Realization of such proactive systems brings up the relatedresearch issues of context definition, acquisition and reasoning.Multimodal device capability information modeling andprocessing is an important precursor to customized servicedelivery in such systems. The applicability of ontologies forcontext modeling and facilitating application reasoning hasbeen well researched [2] - [3]. Specifically, the OWL-DL (WebOntology Language - Description Logics) formalism, rooted inthe decidable fragment of first-order logic, provides a powerful

    platform for a formal and machine- processible structure tocontext information collated from diverse sources.With an ontology-based context model providing acommon, formalized structure, a number of interconnected

    This research has been funded by the Industrial Companies who areMembers of Mobile VCE, with additional financial support from the UKGovernment's Technology StrategyBoard (previously DTI).

    978-1-4244-2644-7/08/$25.00 2008 IEEE

    components are required to provide a generic mechanism forcontext querying and reasoning. This paper focuses on two keyissues: context querying - the framework should supportsemantic querying, which may be variously worded byapplication logic that uses the context model. For example, asearch query for image display capability could be expressed asa query for 'image modality' or 'image display service'.Moreover, as pointed out in [4], the diversity of contextinformation formats means that not enough information may beavailable to answer queries; and the framework must adjustaccordingly.To address these issues, this paper presents a contextreasoning and query interface component as part of a ServiceContext Manager (SCM) framework that supports a genericmechanism for querying contexts and handles incompletecontext information through a rule-based mechanism.The paper is organized as follows: enabling technologiesand the current state of the are analyzed in section II.Section lIT presents the SCM framework with its variousfunctional modules. The context reasoning and queryingmechanisms form the focus of sections IV and V, respectively.This is followed by showcasing of implementation aspects,with a reference application scenario, in section VI. I t alsoincludes a discussion of the results and mechanisms employed.The paper concludes with a summary and recommendations forfuture work in section VIT.

    II . RELATEDWORKOntologies and rules can be integrated to achieve dynamicservice oriented architectures [5]. With OWL-DL takingadvantage of the underlying DL logic for computationalcompleteness and expressiveness, the knowledge base can beextended with inference rules to enforce more general frrstorder logic constraints. The resultant semantics can facilitateprovisioning of dynamic services. Towards this end, SWRL(Semantic Web Rule Language) [6] is a W3C submissionaimed at combining OWL and an inference rules languagebased on RuleML (Rule Markup Language). SWRLmakes useof pattem-directed invocation of procedures from assertions[7]. It also provides a common language for the context modeland the inference mechanism. A comparison of SWRL andRuleML features is given in [5].

  • 8/4/2019 Ontology-Based Context Inference and Query for Mobile Devices

    2/5

    Enabling technologies for effective ontology query includeSPARQL (SPARQL Protocol and RDF Query language) [8]and SQWRL (Semantic Query-enhanced Web Rule Language)[9]. SPARQL is a RDF-based query language and offerslimited support for querying OWL models, as noted in [10].SQWRL is a library extension to SWRL. It is based on the factthat a rule antecedent can be viewed as a pattern-matchingmechanism, i.e., a query [10]. I t allows queries directed atOWL classes, individuals and properties and also honors theSWRLrules during query execution.Ontology-based context management approaches have beenemployed in research projects for various aims, includingmedia content recommendation [3], activity-based m-Iearning[11] and command and control systems for the batt lespacedomain [5]. The context information service architecture in [4]for managing distributed context sources employs an ontologydriven mechanism for answering application queries. Eachcontext-aware application provides its own ontology to thecontext service to describe its hosted services. The contextservice maintains an ontology mapping repository to translatebetween 'equivalent' words in submitted queries to generate aresponse from the registered services. Queries can beformulated in SQL, XQuery or RDQL (RDF Data QueryLanguage). However, this approach assumes that queries are

    expressed in terms of one of the registered ontology conceptsand does not account for incomplete context informationduring ontology formation.The e-Iearning repository implementation in [12] consists

    of a learning resource ontology and SWRL rules to offerrecommendations on study methods to learners. A semanticquery interface is designed by collecting synonyms of theontology concepts, calculating a similarity coefficient andstoring these in a 'synonymy list'. Learner's queries are parsedinto tokens that are associated with the ontology concepts usingthe synonym list, through a breadth-first or depth-first search.The research project presented in [7] aims to build a smarthome environment for its inhabitants. The context model isbased on an OWL ontology to provide a representation of thesmart home. The inference layer is implemented using SWRLrules to issue orders on the event-driven bus that drives theactuators.

    III. SCM ARCHITECTUREThe work presented in this paper forms part of the SCMframework. The SCM framework aims to facilitate contextsensitive service provisioning in mobile communicationenvironments. This section presents a brief overview of theSCM structure to provide a background for the contextreasoning module. A more detailed description of the SCMcomponents and implementation is presented in [13]. Fig. 1provides an illustration of the SCM architecture.The device and service discovery function detects devicepresence in the ambient environment through explicit discoverymessages and also by listening on the multicast channel fordevice advertisements. UPnP protocol is used for this discoverystep as well as for the retrieval of the XML device descriptions.The components within the Transformation Framework mapthe device modality context information into a common, formal

    structure based on the defined ontology stored in the OWLFacts Base. The OWL Facts Base represents the domainvocabulary in terms of classes and properties and thus formsthe TBox (concept box). The mapped descriptions constitutethe ABox (assertion component), embodying knowledge ofreal-world objects in TBox-compliant statements.

    /,'--------_

    ,~ ; : - 1 - -, ----t----

    Fig.l Service Context Manager architecture

    The generated ABox forms the input to the reasoningsubsystem that references the SWRL Rules base. The Reasonermodule performs the first stage of context inference byapplying rules from the Rule Base that assert missing contextinformation. This pre-processing step is transparent to the userand speeds up the next stage of context filtering. The ContextFiltering module then applies the rules relating to the storeduser preferences and matches incoming content metadata to theprocessed device modalities' ABox to facilitate contentpresentation with the best possible combination of modalities.The Service Repository Management module maintains aninterface to context-aware applications for updating andquerying semantic service information.

    IV. CONTEXTUAL INFERENCE RULESThe context reasoning module references the SWRL Rulesbase to infer facts from the ontology instance (ABox) that hasbeen populated from the device and service contextinformation. The rules have been designed to take into accountthe standard device-service context description templates. Dueto this heterogeneity of context information, there may be gapsin the generated ABox. Hence, at a first instance, the modeledrules assert links between the physical device and hostedsoftware services. The second stage of context filtering servesto filter out a subset of possible device modalities based on thedefined user preferences and content metadata. For instance,stored preferences may indicate which device the user wouldlike to 'see videos on'. The content metadata relating to contenttype and other factors such as resolution, frame rate (for mediacontent) etc. serve to match modalities to content.

  • 8/4/2019 Ontology-Based Context Inference and Query for Mobile Devices

    3/5

    SWRL is grounded in frrst-order logic and provides moreexpressive power than DL. SWRL provides only first orderlogic rules that make use of logical connectors such as(AND), --.(IMPLY) and (NEGATION). However,extensions have been proposed to make use of more advancedmathematical and string operators such as comparisonoperators (swrlb: lessThan) through the SWRL built-in library.Built-ins take any number or combination of OWL datatype orobject property values. The object property arguments are ineffect OWL individuals. A SWRL rule contains an antecedentpart, called the body and a consequent part called the head.This implies that if all the atoms in the antecedent are true, thenthe consequent must also be true,

    i.e., antecedent consequentThe rules can be written in terms of OWL classes,properties and individuals. Fig. 2 shows some of theforwardchain rules (that infer about axioms) defined on thedomain ontology.

    Rule-I:Device(?x) A ScreenOutputModality(?m) AcanbeInterfacedVia(?x, ?m) A graphicsEnabled(?m, true)A hasService(?x, false)hosts(?x, DisplayService) AisLinkedTo(DisplayService, ?m)Rule-2:Device(?x) A Speaker(?m) A canbeInterfacedVia(?x, ?m)A hasService(?x, false)hosts(?x, AudioService) AisLinkedTo(AudioService, ?m)Rule-3:Device(?x) A ScreenOutputModality(?m) AcanbeInterfacedVia(?x, ?m) A hasResolution(?m, ?r) Awidth(?r, ?w) A height(?r, ?h) A swrlb:add(?y, ?w, ?h)sqwrl:select(?x, ?y) A sqwrl:orderByDescending(?y)

    Fig. 2 SWRLforwardchain rulesRule 1 defines a device with a graphic-enabled screen tooffer a display service. The display service has already beendefined in the domain ontology to support text output, visualand image display service offerings. Rule 1 reads as: if there isa Device 'x', which can be interfaced through aScreenOutputModality 'm', where 'm ' is graphics-enabled,then Device 'x ' hosts a display service. In addition, the linkbetween this asserted display service and the screen modality isalso asserted in this rule for completeness. This rule alsoillustrates the work-around for the absence of atom negation inSWRL. Due to SWRL's monotonic ity, i t is not possible toquery directly the absence of a property assertion. So, since thepresence or absence of a hosted service cannot be ascertained, a

    Boolean valued hasService property is queried to aff irm thatthe rule applies to only those devices where the device-servicelink is not already present. This takes care of cases where thedevice description is available in [14] or UAProf [15]

    format, where only the hardware modality information isavailable.Rule 2 is similar to rule 1 and def ines a device with audiooutput modality to offeran audio service.Rule is an example of pre-processing of availablemodalities where the devices are ordered according todecreasing screen resolution. This rule also illustrates the use ofthe SQWRL query function for the actual ordering function.

    V. QUERY INTERFACESince SWRL is bui lt on top of OWL, i t shares OWL'sOpen World Assumption (OWA) where every fact can bethought of as true unless explici tly s ta ted to be false. Forinstance, two individuals cannot be assumed to beautomatically distinct unless explicitly stated to be so with theowl:differentFrom restriction. However, the SWRL Queryl ibrary (SQWRL) tha t functions as a query language on the

    SWRL rule-set has an approximation to Closed WorldAssumption (CWA). CWA follows the presumption that whatis not currently known to be t rue is false. This grounding inCWA allows the query to apply to the formalised TBox and theresultant ABox only and allows effective query of theknowledge base. This also prevents undecidability.

    With the context inference rules in place, the device-servicecontext of the discovered devices can be queried for availableservices. Fig. 3 shows some of the sample queries.Query-I:hosts(?x, ?s) A ModalityService(?s) AhasSType(?s, "image")sqwrl:select(?x)Query-2:hosts(?x, ?s) A ModalityService(?s)sqwrl:select(?x, ?s)

    Fig.3. SQWRLqueries

    Query 1 searches for devices tha t of fer an image displayservice. It can be read as: for the asserted property 'hosts' thatlinks a device 'x ' to its hosted service's', where 's ' is amodality-related service and the service type of 's ' is ' image',output all conforming 'x ' -s (or devices).Query 2 searches for all devices tha t host any manner ofmodality service (textlimage/audio/video) and outputs thehosted service as well.

    VI. IMPLEMENTATIONThis section presents the results of the implementation ofthe reasoning and query subsystem. To validate the approach,context sources available in two standardized formats, viz.

    UAProf and UPnP, were input into the SCM framework.Fig. 4 shows a sample UAProf prof ile of a mobile phone.The mobile phone is modeled to support a screen that is colorcapab le and graphics-enabled (image capable). Thus, this

  • 8/4/2019 Ontology-Based Context Inference and Query for Mobile Devices

    4/5

    Fig.6. Query-l execution result

    The SWRL plug-in to the Protege IDE was used for entryand editing of SWRL rules. To perform the actual inference,the Jess [17] rule-based inference engine was employed as aplug-in to the Protege SWRL tab. However, it should be notedthat the rules are represented independently of the inferenceengine. Moreover, all instances in the ABox get validatedagainst the rules during execution. The queries have beendesigned through the SQWRLbuilt-in library mechanism.The results of executing queries 1 and 2 are shown in the

    result pane snapshots in Figs. 6 and 7, respectively..p1:Query-1

    context source provides only hardware modality information,with no information on the related software service (formats, orsupported types).

    '?p1:x

    ?p1:x

    ?p1:sFig.4.UAProf RDF description

    The second context source models an extended UPnPdescription [16] of a mobile phone, specifying the offered'image display' service and associated screen modality. Theassociated context source file fragment is shown in Fig. 5.

    Fig.5. UPnP context description

    Fig.7. Query-2 execution resultA. Application ScenarioThe potential of the approach can be demonstrated with anexample scenario illustrating service personalisation. Thedevices in the environnent host their own descriptions in XMLformat, which are retrieved following device discovery. Theuse case consists of two devices: a UAProf mobile terminaloffering a display service (Fig.4) and a mobile phoneadvertising its image service through UPnP descriptions (Fig.5). The devices are discovered by the discovery module. Theuse case employs UPnP protocol for this step. The retrievedXML descriptions are processed and then transformed by thetransformation component into an ontology instance (ABox). Amore detailed breakdown of the implementation steps involvedin transformation is available in [13]. The generated ABoxforms the input to the reasoning subsystem. The result sets inFigs. 6 and 7 validate the working of Rule 1 which asserts theassociated modality service for physical device descriptions.This first stage of context inference thus handles incompletecontext information, which is not taken care of in [4]. Thesecond reasoning stage then applies rules to match incomingcontent metadata to the processed ABox. This serves to filterout a subset of possible device modalities. For an example casewhere the content type is audio, it does not match the offered

    modalities in the ambient environment (image display on bothavailable devices). This generated semantic information can bethen input to an Adaptation Manager functionality that decideswhat adaptation mechanisms may be applied based on thedelivered processed modality context. In this case, the

  • 8/4/2019 Ontology-Based Context Inference and Query for Mobile Devices

    5/5

    Adaptation Manager decides that an audio to text adaptation isnecessary and it is executed through the available adaptationmechanisms. The adapted content is then handed to a contentdelivery system that streams the content to the selected device.This scenario walk-through demonstrates the potentialapplications of the proposed approach. The framework thusforms a pluggable input to content adaptation and contentdelivery systems. When deployed as part of a wider ubiquitousenvironment, the end-user will thus be presented with a more

    automated and proactive system.B. DiscussionThe approach presented in this paper employs the SQWRLquery mechanism built on top of SWRL to formulate contextsensitive queries. Since SWRL itself is built on top of OWL,the query language offers the twin benefits of queryingontology terms directly and also being cognizantof the definedrules during query execution. On the other hand, queries can besaid to be constrained to the domain ontology terms. However,since queries are posed by the application logic that referencesthe common, formal structure of the domain ontology, naturallanguage queries need not be taken into account in the context

    of this work.The combination of OWL and SWRL offers an expressiveplatform for constructing a generic model of the domain andthen express particular behaviors. Also, Jess supports insertion

    of the inferred knowledge back into the OWL-DL ABox,which allows subsequent query answering. However, as alsoidentified in [5], extensions to model uncertainty andprobability in real-world contexts are needed.VII. CONCLUSION

    The proposed context inference approach indicates thatontologies and rule-based reasoning can help to achieveautomated and personalized service delivery in mobilecommunication environments. The rule base is easilyextensible to encompass varied context scenarios and supportssemantic querying through the developed query interface.A possible extension includes a learning mechanism thatcan serve to improve the reasoning quality for incompletecontext information.

    ACKNOWLEDGMENTThe work reported in this paper has formed part of theUbiquitous Services Core Research Programme of the VirtualCentre of Excellence in Mobile Personal Communications,Mobile VCE, www.mobilevce.com. Fully detailed technicalreports on this research are available to Industrial Members ofMobile VCE.

    REFERENCES[1] M. Strange and M. S o r e l l ~ "Gear up for C h a n g e ~ " lET Engineering and

    T e c h n o l o g y ~ vol. 3 pp. 4 2 - 4 4 ~ 2008.[2] T. Strang and C. L i n n h o f f - P o p i e n ~ "A context modelling s u r v e y ~ " in 1stInt'l Workshop on Advanced Context Modelling, Reasoning andManagement, 2 0 0 4 ~ pp. 34-41.[3] Y. Z h i w e n ~ X i n g s h e ~ D a q i n g ~ C. C h u n g - Y a u ~ W. X i a o h a n g ~ andM. J i "Supporting Context-Aware Media Recommendations for Smart

    P h o n e s ~ " IEEE Pervasive C o m p u t i n g ~ vol. 5 pp. 6 8 - 7 5 ~ 2006.[4] R. Power, D. L e w i s ~ D. O ' S u l l i v a n ~ O. C o n l a n ~ and W a d e ~ "A

    Context Information Service using Ontology-Based Quer ies, " inProceedings of The First International Workshop on Advanced ContextModelling, Reasoning, Management held in conjunction with The 6thInternational Conference on Ubiquitous Computing (UbiComp'2004).N o t t i n g h a m ~ E n g l a n d ~ 2 0 0 4 ~ pp. 7.

    [5] S. S t o u t e n b u r g ~ L. O b r s t ~ D. N i c h o l s ~ K. S a m u e l ~ and P. F r a n k l i n ~"Apply ing Semant ic Rules to Achieve Dynamic Serv ice Or ientedA r c h i t e c t u r e s ~ " in Proc. Second International Conference on Rules andRule Markup Languagesfor the Semantic Web, 2 0 0 6 ~ pp. 75-82.

    [6] W 3 C ~ "SWRL: A Semantic Web Rule Language Combining OWL andR u l e M L ~ " in W3C Member Submission, 2004.

    [7] V. Ricquebourg, D. Durand, D. M e n g a ~ B. M a r h i c ~ L. D e l a h o c h e ~ C.Loge, and A.-M. J o l l y - D e s o d t ~ "Context Inferring in the Smart Home:An SWRL A p p r o a c h ~ " presented at 21st International Conference onAdvanced Information Networking and Applications W o r k s h o p s ~(AINAW '07),2007.

    [8] W 3 C ~ "SPARQLQuery Language for R D F ~ " in W3C Recommendation,2008.[9] ProtegeWiki, ( 2 0 0 7 ~ November 19). SQWRL [Online].Available:http://protege.cim3.netlcgi-binlwiki.pl?SQWRL.[10] M. O ' C o n n o r ~ R. S h a n k a r ~ S. T u C. N y u l a s ~ Amar D a s ~ and M. M u s e n ~"Efficiently Querying Relational Databases Using OWL and SWRL," inWeb Reasoning and Rule S y s t e m s ~ vol. 4524/2007. Berlin: Springer,2007, pp. 361-363.[11] E. Basaeed, J. B e r r i ~ R. B e n 1 a m r i ~ and J. Zemerly, "M-LearningActivity-based Context Managemen4" in Proc. 2nd IEEE InternationalConference on Digital Information Management (ICDIM'07), volume 2.

    L y o n ~ F r a n c e , 2 o o 7 .[12] Z. Xin-juan, L. X i a n - F e n g ~ and G. Wei, "Ontology Based Sharing andServices in E-Learning R e p o s i t o r y ~ " presented at lAP InternationalConference on Network and Parallel Computing W o r k s h o p s ~ (NPC

    W o r k s h o p s ) ~ 2007.[13] S. and K. M o e s s n e r ~ "A Semantic Device and Service DescriptionFramework for Ubiquitous E n v i r o n m e n t s ~ " presented at 17th ICTMobile and Wireless Communications Summit, S t o c k h o l m ~ Sweden, 10

    12June 2008.[14] Composite Capabil ity/Preference Profiles (CC/PP): Structure andVocabularies, W3C Recommendation, 2002.[15] Open Mobile Alliance (2003). User Agent Profile [Online]. Available:http://www.openmobilealliance.org.[16] S. De and K. M o e s s n e r ~ "Device and Service Descriptions for PersonalDistributed E n v i r o n m e n t s ~ " in Proc. 2nd IEEE International Conferenceon Digital Information Management (ICDIM'07), volume 2. L y o n ~

    F r a n c e ~ 2007.[17] E. J. Fr iedman-Hi ll , "Jess, The Java Exper t Shell Sys tem," SandiaNational Laboratories, Livermore, C A SAND98-8206 November 1997.