semantic space: an infrastructure for smart spacesdongjs/papers/pervasive04.pdfto address these...

8
32 PERVASIVE computing Published by the IEEE CS and IEEE ComSoc 1536-1268/04/$20.00 © 2004 IEEE UBIQUITOUS SYSTEM SOFTWARE Semantic Space: An Infrastructure for Smart Spaces C urrent pervasive computing research tries to merge the material and digi- tal worlds by incorporating physical and computing entities into smart spaces. Homes, workplaces, class- rooms, vehicles, and other spaces use embedded sensors, augmented appliances, stationary com- puters, and mobile handheld devices to gather information about users’ loca- tions, companions, and other aspects of their activities. Appli- cations in such environments must be context aware so that they can adapt to rapidly chang- ing conditions as users move about in their environments. 1,2 The dynamic nature of smart spaces poses several challenges in developing context-aware applications. For example: Rachel wishes to contact her friend Joey, so she instructs her mobile phone to arrange a call. Upon request, Joey’s mobile phone checks the calendar and realizes he’s currently attend- ing a seminar. The phone determines on his behalf that he shouldn’t be interrupted and schedules a call back when the seminar ends. Soon after the seminar, Professor Geller asks Joey to have a discussion in his office. Before the phone reminds Joey of the missed call as scheduled earlier, it wants to know whether his current situation is suitable for receiving the call. Based on contextual information (Where are you? Who are you with? What is the noise level? Is the door open or closed?) gathered in the smart space, the phone infers that Joey is in a conversation with his supervi- sor and decides to postpone the call until he’s available. A few minutes later, when the con- versation ends and Joey leaves the office, the phone finally reminds him of the missed call. Building smart spaces relies on many different technologies, some of which we discuss in the “Related Work” sidebar. We focus here on three key issues: Explicit representation. Raw context data ob- tained from various sources comes in hetero- geneous formats, and applications without prior knowledge of the context representation can’t use the data. So, an interoperable smart space requires a way to explicitly represent con- text meanings (or semantics) so that indepen- dently developed applications can easily under- stand them. Context querying. A smart space maintains many contexts, and applications might need to selectively access a subset of them. The smart space should be able to answer expressive con- text queries—for example, who is in the room with Joey? When will the seminar he is attend- ing or presenting end? • Context reasoning. Higher-level contexts (What is the user doing? What is the activity in the room?) augment context-aware applica- tions by providing summary descriptions about a user’s state and surroundings. Although sen- sors can’t recognize such contexts, they pro- vide information that lets applications infer basic contextual information. Semantic Space is a pervasive computing infrastructure that exploits Semantic Web technologies to support explicit representation, expressive querying, and flexible reasoning of contexts in smart spaces. Xiaohang Wang, Jin Song Dong, ChungYau Chin, and Sanka Ravipriya Hettiarachchi National University of Singapore Daqing Zhang Institute for Infocomm Research, Singapore

Upload: others

Post on 14-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

32 PERVASIVEcomputing Published by the IEEE CS and IEEE ComSoc ■ 1536-1268/04/$20.00 © 2004 IEEE

U B I Q U I T O U S S Y S T E M S O F T W A R E

Semantic Space: An Infrastructure forSmart Spaces

Current pervasive computing researchtries to merge the material and digi-tal worlds by incorporating physicaland computing entities into smartspaces. Homes, workplaces, class-

rooms, vehicles, and other spaces use embeddedsensors, augmented appliances, stationary com-puters, and mobile handheld devices to gather

information about users’ loca-tions, companions, and otheraspects of their activities. Appli-cations in such environmentsmust be context aware so thatthey can adapt to rapidly chang-ing conditions as users moveabout in their environments.1,2

The dynamic nature of smartspaces poses several challengesin developing context-aware

applications. For example:

Rachel wishes to contact her friend Joey, soshe instructs her mobile phone to arrange acall. Upon request, Joey’s mobile phone checksthe calendar and realizes he’s currently attend-ing a seminar. The phone determines on hisbehalf that he shouldn’t be interrupted andschedules a call back when the seminar ends.Soon after the seminar, Professor Geller asksJoey to have a discussion in his office. Beforethe phone reminds Joey of the missed call asscheduled earlier, it wants to know whetherhis current situation is suitable for receivingthe call. Based on contextual information(Where are you? Who are you with? What isthe noise level? Is the door open or closed?)gathered in the smart space, the phone infers

that Joey is in a conversation with his supervi-sor and decides to postpone the call until he’savailable. A few minutes later, when the con-versation ends and Joey leaves the office, thephone finally reminds him of the missed call.

Building smart spaces relies on many differenttechnologies, some of which we discuss in the“Related Work” sidebar. We focus here on threekey issues:

• Explicit representation. Raw context data ob-tained from various sources comes in hetero-geneous formats, and applications withoutprior knowledge of the context representationcan’t use the data. So, an interoperable smartspace requires a way to explicitly represent con-text meanings (or semantics) so that indepen-dently developed applications can easily under-stand them.

• Context querying. A smart space maintainsmany contexts, and applications might need toselectively access a subset of them. The smartspace should be able to answer expressive con-text queries—for example, who is in the roomwith Joey? When will the seminar he is attend-ing or presenting end?

• Context reasoning. Higher-level contexts(What is the user doing? What is the activity inthe room?) augment context-aware applica-tions by providing summary descriptions abouta user’s state and surroundings. Although sen-sors can’t recognize such contexts, they pro-vide information that lets applications inferbasic contextual information.

Semantic Space is a pervasive computing infrastructure that exploitsSemantic Web technologies to support explicit representation, expressivequerying, and flexible reasoning of contexts in smart spaces.

Xiaohang Wang, Jin Song Dong,ChungYau Chin, and SankaRavipriya Hettiarachchi National University of Singapore

Daqing Zhang Institute for Infocomm Research,Singapore

Page 2: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

To address these issues, we developeda context infrastructure called SemanticSpace. We were inspired by the Seman-tic Web, which helps computers and peo-ple work better together by giving con-tent well-defined meanings.3 Usingstandards to represent machine-inter-

pretable information (including RDF(resource description framework)4 andOWL (Web Ontology Language)5), theSemantic Web offers a united approachto knowledge management and infor-mation processing. We explored OWL,RDF and their supporting tools by build-

ing a pervasive computing infrastructurewith an ontology-based context modeland a context infrastructure.

The context modelContext presentation is an important

part of pervasive computing environ-

JULY–SEPTEMBER 2004 PERVASIVEcomputing 33

M any context-aware computing projects in the past decade

have studied feature-oriented approaches to context-aware

systems. AT&T Laboratories at Cambridge built a dense network of

location sensors to maintain a location model shared between users

and computing entities.1 Microsoft’s EasyLiving focuses on a smart

space that is aware of users’ presence and adjusts environment set-

tings to suit their needs.2 Hewlett Packard’s CoolTown provides

physical entities (people, places, and things) with “Web presence”

and lets users navigate from the physical world to the Web by pick-

ing up links to Web resources using various sensing technologies.3

Other relevant projects include Stanford University’s iRoom,4 the

Massachusetts Institute of Technology’s Oxygen,5 and Carnegie

Mellon University’s Aura,6 to name a few. These projects have

greatly contributed to smart space research by exploiting different

pervasive computing features.

A few projects specifically address the scalability and flexibility

of context-aware applications by providing generic architectural

supports. The seminal work of Context Toolkit7 provides an object-

oriented architecture for rapid prototyping of context-aware appli-

cations. Context Toolkit gives developers a set of programming

abstractions that separate context acquisition from actual context

usage and reuse sensing and processing functionality. Jason Hong

and his colleagues8 proposed an open-infrastructure approach

that encapsulates underlying technologies into well-established

services that can be used as a foundation for building applications.

The European Smart-Its project proposed a generic layered archi-

tecture for sensor-based context computation, providing a pro-

gramming abstraction that separates layers for raw sensor data,

features extracted from sensors (cues), and abstract contexts

derived from cues.9,10

Our work resembles these projects in providing a reusable archi-

tecture to ease application development. However, previous work

doesn’t provide adequate support for organizing contexts in a for-

mal structured format. An independently developed application

can’t easily interpret contexts that have no explicitly represented

structure. Moreover, previous work provides no generic mechanism

for context querying and reasoning. Some models use only simple

matching mechanisms to support selective context access, and

developers must often perform low-level programming to develop

components that derive higher-level contexts.

Our work differs from and perhaps outperforms previous work

in several respects. Using the Semantic Web standards RDF and

OWL to define context ontologies provides a foundation for build-

ing interoperable smart spaces where computing entities can eas-

ily exchange and interpret contexts based on explicit context rep-

resentations. Using the Semantic Web technologies for knowledge

base, query, and inference, we developed the context infrastruc-

ture with a generic mechanism for querying contexts using a

declarative language and inferring higher-level contexts based on

rules. This facilitates developers’ work because they can realize

expressive context querying and flexible context reasoning with-

out programming.

REFERENCES

1. A. Harter et al., “The Anatomy of a Context-Aware Application,” Proc.5th Ann. ACM/IEEE Int’l Conf. Mobile Computing and Networking (Mobi-Com 99), ACM Press, 1999, pp. 59–68.

2. B. Brumitt et al., “EasyLiving: Technologies for Intelligent Environments,”Proc. 2nd Int’l Symp. Handheld and Ubiquitous Computing (HUC 2000),LNCS 1927, Springer-Verlag, 2000, pp. 12–29.

3. T. Kindberg et al., “People, Places, Things: Web Presence for the RealWorld,” Proc. 3rd IEEE Workshop Mobile Computing Systems and Applica-tions (WMCSA 2000), IEEE CS Press, 2000, p. 19.

4. B. Johanson, A. Fox, and T. Winograd, “The Interactive Workspaces Pro-ject: Experience with Ubiquitous Computing Rooms,” IEEE PervasiveComputing, vol. 1, no. 2, 2002, pp. 67–74.

5. M. Dertouzos, “The Future of Computing,” Scientific Am., Aug. 1999.

6. D. Garlan et al., “Project Aura: Towards Distraction-Free Pervasive Com-puting,” IEEE Pervasive Computing, vol. 1, no. 2, 2002, pp. 22–31.

7. A.K. Dey, Providing Architectural Support for Building Context-Aware Appli-cations, doctoral dissertation, Georgia Inst. Technology, 2000.

8. J.I. Hong and J.A. Landay, “An Infrastructure Approach to Context-Aware Computing,” Human-Computer Interaction, vol. 16, nos. 2–4,2001, p. 97.

9. H. Gellersen et al., “Multi-Sensor Context-Awareness in Mobile Devicesand Smart Artifacts,” Mobile Networks and Applications (MONET), vol. 7,no.5, 2002, pp. 341–351.

10. H. Gellersen et al., “Physical Prototyping with Smart-Its,” IEEE PervasiveComputing, vol. 3, no. 3, 2004, pp. 74–82.

Related Work

Page 3: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

ments. Because context-aware applica-tions must adapt to changing situations,they need a detailed model of users’activities and surroundings that letsthem share users’ perceptions of the realworld.6

An ontology approach to contextmodeling

Within the domain of knowledge rep-resentation, the term ontology refers tothe formal, explicit description of con-cepts, which are often conceived as a setof entities, relations, instances, functions,and axioms.7 Among Semantic Web stan-dards, OWL defines and instantiates Webinformation ontologies that let Webagents exchange and interpret informa-tion based on a common vocabulary.Using ontologies to model contexts inpervasive computing environments offersseveral advantages:

• By allowing pervasive computing enti-ties to share a common understandingof context structure, OWL ontologiesenable applications to interpret con-texts based on their semantics.

• Ontologies’ hierarchical structure letsdevelopers reuse domain ontologies

(for example, of people, devices, andactivities) in describing contexts andbuild a practical context model with-out starting from scratch.

• Because contexts described in ontolo-gies have explicit semantic represen-tations, Semantic Web tools such asfederated query, reasoning, and knowl-edge bases can support context inter-pretation. Incorporating these toolsinto smart spaces facilitates contextmanagement and interpretation.

Designing the context modelSmart spaces cover a range of envi-

ronment types such as homes, offices,workplaces, classrooms, and vehicles.Rather than try to completely model allcontexts in different kinds of smartspaces, we define an upper-level contextontology (ULCO) to provide a set ofbasic concepts common across differentenvironments.8 Among various contexts,we identify three classes of real-worldobjects (user, location, and computingentity) and one class of conceptualobjects (activity) that characterize smartspaces. Linked together, these objectsform the skeleton of a contextual envi-ronment. They also provide primary

indices into other associated contexts.For example, given a location, we canacquire related contexts such as noise,weather, and the number of people insideif we model these objects as top-levelclasses in ULCO.

Knowledge reuse is one importantadvantage of ontologies.9 We integratedconsensus domain ontologies such asfriend-of-a-friend (FOAF, http://xmlns.com/foaf/0.1), RCAL Calendar (www.daml.ri.cmu.edu/Cal), and FIPA DeviceOntology (www.fipa.org/specs/fipa00091/XC00091D.html) into ULCO to modeluser, activity, and device contexts, respec-tively. These well-defined ontologies pro-vide generic vocabularies that suit con-text ontologies’ requirements—we needonly add additional properties useful tosmart spaces. For example, FOAF definessimple relationships between people(that is, friendOf), but we extend it to sup-port richer properties such as supervisorOf, studentOf, and colleagueOf.

To let developers customize the con-text model for a particular smart space,we designed it to complement the classesdefined in ULCO. A new applicationthat needs additional classes can obtainthem by inheritance from the ULCOclasses, forming an extended contextontology, as Figure 1 shows. This letsdevelopers easily build detailed contextmodels for new smart spaces. Moreover,by providing shared terms and defini-tions, an ULCO supports better inter-operability between extended contextontologies.

Marking up real-world contextsOur model represents contexts as on-

tology instances and associated proper-ties (context markups) that applicationscan easily interpret. Real-world contextsoften originate from diverse sources,leading to dissimilar approaches to gen-erating context markups. For example,in the smart phone scenario, some con-texts (such as a person’s name, relation-

34 PERVASIVEcomputing www.computer.org/pervasive

U B I Q U I T O U S S Y S T E M S O F T W A R E

Figure 1. An upper-level context ontologyand extended context ontologies.Context EntityC

ActivityC

ComputingEntityC

LocationC

UserC

BuildingC

PassagewayC

RoomC

C City

DistrictC

RegionC

. . .C

. . .C

AdHocActivityC

ScheduledActivityC

AgentC

ApplicationC

DeviceC

NetworkC

IndoorLocationC

OutdoorLocationC

. . .C

RoomC

Room_HomeC

BathRoomC

Bedroom

MasterBedroom

C

DiningRoomC

KitchenC

LivingRoomC

ReadingRoomC

StoreRoomC

C

GuestBedroomC

ChildrenBedroomC

RoomC

Room_OfficeC

LabRoomC

MeetingRoomC

OfficeRoomC

PantryC

PrintingRoomC

WashRoom

. . .

. . .

C

LoungeC

AdHocActivityC

AdHocDiscussionC

. . .CTakingPhoneC

ScheduledActivityC

InterviewC

SeminarC

WeeklyDiscussionC

. . .C

12R Workplace

12R Smart Home Prototype

Extended context ontologiesUpper-level context ontology

Page 4: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

ships, and scheduled seminar time) haverelatively slow change rates, and usersoften supply the information. Users alsousually generate markups of these con-texts. Our JavaScript application letsusers create online profiles based on theontology class User. The following exam-ple shows the context markup thatdescribes RossGeller. (Throughout the arti-cle, we assume www.i2r.a-star.edu.sg/SemanticSpace#as the default base namespace.)

<User rdf:about=”RossGeller”><name>Ross Geller</name><mbox>[email protected]</mbox><homepage rdf:resource=”www.i2r.

a-star.edu.sg/~ross”/><office rdf:resource=”#Room209”/><officePhone>1234</officePhone><mobilePhone>6789</mobilePhone><supervisorOfrdf:resource=

”#JoeyTribbiani”/><! —More properties not shown in this

example—></User>

Hardware and software sources usu-ally provide other contexts such as loca-tion, current time, noise level, or doorstatus. Automated programs must markup these contexts because they changefrequently. Consider the RFID (radio fre-quency identification) indoor locationsystem that tracks users’ location bydetecting the presence of body-worntags. When Ross Geller enters Room209, the RFID sensor detects his pres-ence and composes the following con-text markup:

<User rdf:about=”#RossGeller”> <locatedIn rdf:about=”#Room209”/> </User>

Each OWL instance has a unique URI,and context markups can link to externaldefinitions through these URIs. Forexample, the URI www.i2r.a-star.edu.sg/SemanticSpace#RossGeller refers to the user wejust defined, and the URI www.i2r.a-star.edu.sg/

SemanticSpace#Room209 refers to a specificroom defined elsewhere in the system.

The Semantic Spaceinfrastructure

By representing contexts as easily inter-preted semantic markups, the SemanticSpace context infrastructure lets appli-cations retrieve contexts using declara-tive queries and supports the inferenceof higher-level contexts from basic con-texts. One such infrastructure is main-tained in each smart space, which thephysical space often bounds in a nonre-strictive way. For example, we can jointwo or more rooms to form a smartspace or split a single room into multiplesmart spaces.

The context infrastructure consists ofseveral collaborating components: wrap-pers, an aggregator, a knowledge base,a query engine, and a reasoner (see Fig-ure 2).

Context wrappersContext wrappers obtain raw context

information from various sources suchas hardware sensors and software pro-grams and transform them into contextmarkups. Some context wrappers, in-cluding the location context wrapper, theenvironment context wrapper (which

gathers environmental information suchas temperature, noise, and light fromembedded sensors), and the door statuscontext wrapper (which reports the openor closed status of doors in each room),work with the hardware sensors de-ployed in our prototypical smart space.Software-based context wrappers includethe activity context wrapper, whichextracts schedule information from Out-look Web Access; the device contextwrapper, which monitors the status ofdifferent networked devices (such asvoice over IP or mobile phones); theapplication context wrapper, which mon-itors the status (idle, busy, closed) ofapplications such as JBuilder, MicrosoftWord, and RealPlayer from their CPUusage; and the weather context wrapper,which periodically queries a Weather WebService (www.xmethods.com) to gatherlocal weather information.

All context wrappers are self-config-uring components that support a unifiedinterface for acquiring contexts fromsensors and providing context markupsto consumers (applications and the con-text aggregator). We implemented thesewrappers as Universal Plug and Play(www.upnp.org) services that can dy-namically join a smart space, obtain IPaddresses, and multicast their presence

JULY–SEPTEMBER 2004 PERVASIVEcomputing 35

Contextknowledge

base

Semantic SpaceSmart space Semantic Web

Outlook WebAccess Service

Weather Web Services

Context-awareapplication

Contextqueryengine

Contextreasoner

Contextaggregator

Devicecontextwrapper

Environmentcontextwrapper

Locationcontextwrapper

Semantic annotations(user profile,

restaurant menus)

Activitycontextwrapper

Weathercontextwrapper

AprilS M T WT F S

Figure 2. The Semantic Space contextinfrastructure.

Page 5: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

for others to discover. Context wrappersuse the UPnP general event notificationarchitecture (GENA) to publish contextchanges as events to which consumerscan subscribe.

Context aggregatorThis component discovers context

wrappers and gathers context markupsfrom them. We implemented the contextaggregator as a UPnP control point thatinherits the capability to discover con-text wrappers and subscribe to contextevents. Once a new context wrapper isattached to the smart space, the contextaggregator will discover it, register it inthe service directory, and obtain contextmarkups from it. It asserts gathered con-text markups into the context knowl-edge base, which it updates whenever acontext event occurs.

Context knowledge baseResiding in each smart space, CKBs

provide persistent context knowledgestorage. A CKB stores the extended con-text ontology for that particular spaceand the context markups that are givenby users or gathered from context wrap-pers. The CKB links the context ontol-ogy and markups in a single semanticmodel and provides interfaces for thecontext query engine and context rea-soner to manipulate correlated contexts.

Contexts in smart spaces display veryhigh change rates, so the aggregator mustregularly update the CKB with fresh con-texts. The scope of contexts that the CKBmanages also changes depending on theavailability of wrappers. Developers canadd a new wrapper to expand the scopeof contexts in a smart space or removean existing wrapper when the contexts itprovides are no longer needed. Theaggregator monitors the wrappers’ avail-ability and manages the scope of contextsin the CKB. When a context wrapperjoins the smart space, the context aggre-

gator adds the provided contexts to theCKB, and when the wrapper leaves, theaggregator deletes the contexts it suppliedto avoid stale information.

Context query engineThe context query engine provides an

abstract interface for applications toextract desired contexts from the CKB. Tosupport expressive queries, we adoptedthe RDF Data Query Language10 as thecontext query language. RDQL supportsquerying over semantic models based ontriple (<subject, predicate, object>) patterns. Thislets applications selectively access con-texts using declarative statements. Thefollowing self-explanatory query state-ment asks, When will the ongoing sem-inar where Ross Geller is either anattendee or a speaker be over?

SELECT ?event, ?t2WHERE (?event, <rdf:type>, <Seminar>),

(?event, ?relation, <RossGeller>),(?event, <startDateTime>, ?t1),(?event, <endDateTime>, ?t2)

AND (t1 < currentDateTime() && t2 > currentDaytime()) &&

(?relation <eq> <attendee> || ?relation <eq> <speaker>)

Context reasonerThis component infers abstract,

higher-level contexts from basic sensedcontexts. Semantic Space explicitly rep-resents all contexts such that general-purpose reasoning engines can directlyprocess them, making it easy for devel-opers to realize application-specific infer-ences simply by defining heuristic rules.

Application-specific rules might gen-erate conflicting results, but the reasonerdoesn’t assert inferred contexts into theCKB, thus avoiding conflict in a singlemodel. When the application needs cer-tain higher-level contexts, it submits aset of rules to the context reasoner, whichapplies them to infer higher-level con-

36 PERVASIVEcomputing www.computer.org/pervasive

U B I Q U I T O U S S Y S T E M S O F T W A R E

Figure 3. Sample rules that infer a user’slikely situation based on context, activity,location, and computing entity.

type(?user, User), type(?event, Meeting), location(?event, ?room), locatedIn(?user, ?room),startDateTime(?event, ?t1),endDateTime(?event, ?t2), lessThan(?t1, currentDateTime()), greaterThan(?t2, currentDateTime())=>situation(?user, AtMeeting)

type(?user, User), type(?phone, Phone), owner(?phone, ?user), status(?phone, ?busy)=>situation(?user, TakingPhoneCall)

type(?user, User), type(?app, MicrosoftWord), registeredUser(?app, ?user), status(?app, ?busy)=>situation(?user, AtWriting)

type(?user, User), type(?app, JBuilder), registeredUser(?app, ?user), status(?app, ?busy)=>situation(?user, AtProgramming)

type(?user, User), locatedIn(?user, I2RCanteen), greaterThan(currentTime(), 12:00:00), lessThan(currentTime(), 13:30:00)

=>situation(?user, AtLunch)

type(?user, User), type(?room, Washroom), locatedIn(?user, Washroom) =>situation(?user, UsingWashroom)

type(?user, User), studentOf(?user, ?user2), office(?user2, ?room), locatedIn(?user, ?room), locatedIn(?user2, ?room),

doorStatus(?room, closed), noiseLevel(?room, ?x), greaterThan(?x, 60)=>situation(?user, MeetingSupervisor)

Page 6: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

texts on the application’s behalf, thenreturns newly inferred contexts withoutstoring them in the CKB.

Our current system uses the Jena2generic rule engine11 to perform for-ward-chaining reasoning over the CKB.Developers can write rules for a partic-ular application based on its needs. Forexample, the rules in Figure 3, related tothe original scenario we presented, infera user’s likely situation based on context(such as identity and relationships withothers), activity (such as type and timeinterval), location (such as location,office location, and others at the samelocation), and computing entity (such asstatus and ownership). The first ruleexamines whether a given person is cur-rently engaged in a meeting on the basisof location and schedule—if he’s in themeeting location and the current time(returned by currentDateTime()) is within themeeting’s scheduled interval, he’s likelyto be at the meeting.

Implementation and evaluationUsing our workspace in the Institute

for Infocomm Research (I2R) buildingas a test bed, we built a prototype of ourcontext infrastructure. We defined theULCO using OWL, based on which wedeveloped an extended context ontologyfor our workplace. We implemented theCKB, context reasoner, and contextquery engine using the Jena2 SemanticWeb Toolkit, and the discovery and eventnotification mechanism using SiemensUPnP SDK v1.01.

In addition to the general infrastruc-ture, we provided context wrappers forsensing and markup of various contextsincluding location, schedule, tempera-ture, noise, light, door status, device sta-tus, and application status. Figure 4ashows some of the networked sensorsand devices we used to provide context

information. Figure 4b shows the indoorlocation system we developed using Ti-RFID Serial 2000.

Pervasive computing systems provedifficult to evaluate because they oftenstress new functionality and usabilityover pure performance. We believe ourinfrastructure’s most important aspect iswhat it enables: representing contexts assemantic markups that applications caneasily interpret, retrieving contexts usingdeclarative queries, and supporting theinference of higher-level contexts frombasic sensed contexts. Encapsulatingthese features into the API helps devel-opers build applications that would oth-erwise be difficult to build.

We evaluated Semantic Space in twophases. First, we evaluated the infra-structure by building a real-world appli-cation using it. We then measured theresulting system’s performance.

Application developmentThe widespread use of mobile phones

raises social problems when, for example,phones ring during meetings or importantconversations. Users often have to changephone settings according to their cir-cumstances to avoid inappropriate usage.And frequent interactions with mobilephones impose significant user distrac-tions. To solve this problem, we devel-oped a context-aware application, Situ-AwarePhone (see Figure 4c), that adaptsmobile phones to changing situationswhile minimizing user distractions.

As described earlier, when SituAware-

Phone receives an incoming call, it firstinfers the user’s situation using a set ofrules, then automatically adapts itsresponse mode (for example, adjust vol-ume, set vibration, schedule a call back,send message, or forward to voice mail-box). SituAwarePhone also queries thesmart space for various contexts thathelp in adaptation. For example, it asksfor the end time of the seminar the owneris engaged in to schedule a callback, orit takes account of the caller’s identityand identities of other people in a con-versation to decide whether to let the callinterrupt it.

In a smart space, the context infra-structure supports the entire process ofgathering contexts from sources, man-aging contexts using the knowledgebase, handling application queries, andreasoning about contexts based on rules.The infrastructure’s simple client-sideAPI lets applications access its function-alities while hiding the complexity ofunderlying context processing. Applica-tions can use the following API methodsto deal with contexts:

SemanticSpace(String ServerURL) throws InstantiationException;

//Instantiate a client object of the context infrastructure

RDFModelSemanticSpace.ContextQueryEngine(String Query)

throws QueryException;//Query contexts from the context infrastructure

using the statement defined in Query

JULY–SEPTEMBER 2004 PERVASIVEcomputing 37

Figure 4. Building a prototype: (a) Networked sensors and devices; (b) the RFID indoor location system; and(c) a snapshot of SituAwarePhone, theGUI for configuring the response modein each situation.

Bluetoothphone

VolPphone

Bluetooth and WLANaccess point

Body-worn tag

Environmental sensors

Doorsensor

RFID reader

(a) (b) (c)

Page 7: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

38 PERVASIVEcomputing www.computer.org/pervasive

U B I Q U I T O U S S Y S T E M S O F T W A R E

RDFModel SemanticSpace.ContextReasoner(String RuleSet) throws ReasoningException

//Request Context Reasoner to perform inference using the rules defined in RuleSet

Using the client-side API, we built Situ-AwarePhone on top of the SonyEricssonP900 mobile phone (Figure 4c). Theimplementation amounts to approxi-mately 800 lines of Java code, most ofwhich deals with the MIDlet GUI anddifferent response modes. Only about 20lines of application-side code deal withcontexts (to import libraries, issue queries,perform reasoning, parse returned mod-els, and handle exceptions). This exam-ple shows how the context infrastructurecan greatly ease the development of con-text-aware applications.

PerformanceWe evaluated system performance by

measuring context querying and rea-

soning response times on a 2.4-GHz Pen-tium 4 workstation with 1.0 Gbyte ofRAM running Redhat 9.0. We used fivecontext data sets to test the system’s scal-ability. Among these, the one with 3,000triples (or 600 OWL classes and in-stances) is the real data set used in ourprototypical smart space, while the otherfour are synthetic data sets with uniqueclasses and instances.

We used the complex query statementdescribed earlier to measure context-querying performance, varying the num-ber of matched results from 1 to 10. Fig-ure 5a shows the results—we expectedthe response time to be loosely propor-tional to the size of the context data setand the number of matched results,which the experiment corroborated. Wethen used four rule sets to test the con-text reasoner’s performance, startingwith SituAwarePhone’s 10-rule set andusing it to create others with increasing

numbers of rules. The results (Figure 5b)show that rule-based reasoning is com-putationally intensive and the responsetime largely depends on the size of thedata set and rule set applied.

As the smart space’s scale increases,the reasoning response time will behuman perceivable. However, our per-formance evaluation suggests that, inpractice, rule-based context reasoningworks for a useful set of pervasive com-puting applications. Taking SituAware-Phone as an example, before the mobilephone responses to an incoming call, itmust reason about the callee’s situation.Context reasoning causes a perceivabledelay (about one second), which some-times matters to users. For example, thecallee might wish to answer the call fromhis supervisor as soon as possible, andthe caller always expects a quick response.But most of our invited evaluators, bothas callers and callees, found SituAware-Phone’s response time acceptable. Wealso believe the context infrastructurecan support many applications (such ashome control, meeting assistant, and cityguide) in pervasive computing environ-ments as long as their real-time require-ments are not stringent.

Semantic Space represents ourearly efforts to incorporate Se-mantic Web technologies intopervasive computing environ-

ments. Semantic Web technologies havehelped developers build smart spaces byproviding support for explicit contextrepresentation, expressive context query-ing, and flexible context reasoning.

We envision several enhancements toour infrastructure. Currently, the smartspace uses the local-area-network dis-covery protocol UPnP to dynamicallylocate and access context wrappers. Inpractical deployment, multiple smartspaces that belong to different users orparties with private contexts might share

(a)1,000

300

250

200

150

100

50

03,000 5,000

Size of context knowledge base (number of triples)

10 matches5 matches1 match

7,000 9,000

Quer

y re

spon

se ti

me

(ms)

(b)1,000

2,500

2,000

1,500

1,000

500

3,000 5,000Size of context knowledge base (number of triples)

7,000 9,000

Reas

onin

g re

spon

se ti

me

(ms)

10 rules20 rules30 rules40 rules

Figure 5. Query performance (a) and reasoning performance (b).

Page 8: Semantic Space: An Infrastructure for Smart Spacesdongjs/papers/pervasive04.pdfTo address these issues, we developed a context infrastructure called Semantic Space. We were inspired

JULY–SEPTEMBER 2004 PERVASIVEcomputing 39

the same local network. This presentsmany opportunities for context misusefrom both fraudulent context sources andmisbehaving applications. To address pri-vacy concerns, we’ll incorporate endpointauthentication into the context discoveryprocess.12 Each infrastructure componentis associated with a URI and public-keycertificate, which can be used to prove itsidentity to all other components. Smartspaces can specify both the context wrap-pers they trust and those they have accessto, thus restricting access of private con-texts to appropriate components.

We also plan to provide support foruncertain contexts, because source-basedcontexts aren’t always precise. Using theOWL ontology’s probabilistic exten-sion,13 we’re working on extending con-text ontologies to capture uncertainty andgive smart spaces the ability to handle it.Enhanced context ontologies will supportprobabilistic querying with respect to con-text quality and the reasoning of uncer-tain contexts using such mechanisms asprobabilistic logic, Bayesian networks,and fuzzy logic.

REFERENCES1. W.N. Schilit, A Context-Aware Systems

Architecture for Mobile Distributed Com-puting, doctoral dissertation, ColumbiaUniv., 1995.

2. A.K. Dey, Providing Architectural Supportfor Building Context-Aware Applications,doctoral dissertation, Georgia Inst. Tech-nology, 2000.

3. T. Berners-Lee et al., “The Semantic Web,”Scientific Am., May 2001.

4. G. Klyne and J.J. Carroll, eds., “ResourceDescription Framework (RDF): Conceptsand Abstract Syntax,” W3C Recommen-dation, 2004.

5. D.L. McGuinness and F. van Harmelen,“OWL Web Ontology Language Overview,”W3C Recommendation, 2004.

6. K. Henricksen, J. Indulska, and A. Rako-tonirainy, “Modeling Context Informationin Pervasive Computing Systems,” Proc. 1stInt’l Conf. Pervasive Computing (Pervasive

2002), LNCS 2414, Springer-Verlag, 2002,pp. 167–180.

7. T. Gruber, “A Translation Approach toPortable Ontology Specifications,” Knowl-edge Acquisition, vol. 5, no. 2, 1993, pp.199–220.

8. X. Wang et al., “Ontology-Based ContextModeling and Reasoning Using OWL,”Proc. 2nd IEEE Conf. Pervasive Comput-ing and Communications (PerCom 2004)Workshop on Context Modeling and Rea-soning, IEEE CS Press, 2004, pp. 18–22.

9. Y. Ding and D. Fensel, “Ontology LibrarySystems: The Key for Successful OntologyReuse,” Proc. 1st Semantic Web WorkingSymp. (SWWS 01), Stanford Univ. Press,2001, pp. 93–112.

10. L. Miller, A. Seaborne, and A. Reggiori,“Three Implementations of SquishQL, aSimple RDF Query Language,” Proc. 1st

Int’l Semantic Web Conf. (ISWC 2002),LNCS 2342, Springer-Verlag, 2002, pp.423–435.

11. J.J. Carroll et al., Jena: Implementing theSemantic Web Recommendations, tech.report HPL-2003-146, Hewlett PackardLaboratories Bristol, 2003.

12. S.E. Czerwinski et al., “An Architecture fora Secure Service Discovery Service,” Proc.5th Ann. ACM/IEEE Int’l Conf. MobileComputing and Networking (MobiCom99), ACM Press, 1999, pp. 24–35.

13. Z. Ding and Y. Peng, “A ProbabilisticExtension to Ontology Language OWL,”Proc. 37th Hawaii Int’l Conf. System Sci-ences (HICSS 04), IEEE CS Press, 2004.

For more information on this or any other comput-ing topic, please visit our Digital Library at www.computer.org/publications/dlib.

the AUTHORS

Xiaohang Wang is a graduate student at the National University of Singapore. Hisresearch interests include pervasive and context-aware computing, the SemanticWeb, and home networking. He received his BS in computer science from HuazhongUniversity of Science and Technology, China. Contact him at the Institute for Info-comm Research, MailBox #B097, 21 Heng Mui Keng Terrace, Singapore 119613;[email protected].

Daqing Zhang is head of the Context-Aware Systems Department at the Institutefor Infocomm Research, where he leads research in connected-home and context-aware systems. His research interests include pervasive computing, service-orientedcomputing, context-aware systems, and home networking. He received his PhDfrom University of Rome La Sapienza and University of L’Aquila, Italy. Contact him atthe Institute for Infocomm Research, 21 Heng Mui Keng Terrace, Singapore 119613;[email protected].

Jin Song Dong is a faculty member at the National University of Singapore. Hisresearch interests include formal methods, Web-based software design, and pro-gramming-language semantics. He received his PhD in computing from the Univer-sity of Queensland. Contact him at 10 Kent Ridge Crescent, Singapore 119260;[email protected].

ChungYau Chin is a graduate student in the Department of Electrical and Com-puter Engineering at the National University of Singapore. His research interestsinclude pervasive computing, context-aware systems, service discovery, the Seman-tic Web, and networking. He received his BEng in computer engineering from theNational University of Singapore. Contact him at 4 Amber Rd., Amber Tower #03-04, Singapore 439852; [email protected].

Sanka Ravipriya Hettiarachchi is an undergraduate student in the Department ofElectrical and Computer Engineering, National University of Singapore. His researchinterests include context-aware systems mobile computing, and smart-phone appli-cation development. Contact him at #14-249, Block 508, West Coast Dr., Singapore120580; [email protected].