A context-sensitive conceptual framework for activity modeling

: Human motion trajectories, however captured, provide a rich spatiotemporal data source for human activity recognition, and the rich literature in motion trajectory analysis provides the tools to bridge the gap between this data and its semantic interpretation. But activity is an ambiguous term across research communities. For example, in urban transport research activities are generally characterized around certain locations assuming the opportunities and resources are present in that location, and traveling happens between these locations for activity participation, i.e., travel is not an activity, rather a mean to overcome spatial constraints. In contrast, in human-computer interaction (HCI) research and in computer vision research activities taking place “along the way,” such as “reading on the bus,” are signiﬁcant for contextualized service provision. Similarly activities at coarser spatial and temporal granularity, e.g., “holidaying in a country,” could be recognized in some context or domain. Thus the context prevalent in the literature does not provide a precise and consistent deﬁnition of activity , in particular in differentiation to travel when it comes to motion trajectory analysis. Hence in this paper, a thorough literature review studies activity from different perspectives, and develop a common framework to model and reason human behavior ﬂexibly across contexts. This spatio-temporal framework is conceptualized with a focus on modeling activities hierarchically. Three case studies will illustrate how the semantics of the term activity changes based on scale and context. They provide evidence that the framework holds over different domains. In turn, the framework will help developing various applications and services that are aware of the broad spectrum of the term activity across contexts.


Introduction
With the emergence of pervasive and mobile computing, and especially location-based services, there has been a growing interest in a theoretical framework facilitating the processing and sharing of activity information more effectively between human and computer [12,42,56,71,72].While individual disciplines have worked towards their own frameworks, we will demonstrate that they are incompatible, and an overarching framework is still lacking.
In principle, activity, and synonymously action, requires agency, or a purposeful, goaldirected performance that is available to awareness [89].Based on the usage of the word activity in natural language, WordNet [17] defines activity as any specific behavior or an action or bodily function.In this view, travel, which is understood here as any purposeful, goal-directed change of location, is an activity (or action).Furthermore, any complex travel can be composed of simpler activities, some of them forming travel activities themselves (such as "taking the bus on the way to work"), and others are non-travel or stationary activities (such as "reading the papers on the bus").In contrast to many other disciplines, human-computer interaction research (HCI) actually applies this understanding by modeling activity from a purely motivational, goal-oriented, and operational perspective [41,42,43] where the activity is motivational and oriented towards an objective.Actions (which are subsumed by activity) required to perform the activity are oriented towards goals and realization of the entire phenomena happens through operations.HCI assumes activity as interaction of a subject with an object to fulfill certain needs through mediation which may involve the process of externalization and internalization [42].Thus in HCI activity is characterized mostly by the why, what, and how, but less so by the where (location) and when (time), despite most activities being generally constrained by space or time or both.Obviously this understanding can cope with travel as well as non-travel activities.
In pervasive computing, the common subject of research into activity recognition are human motion trajectories [82], whether captured, for example, from diaries [84], social networks [13], checkpoints or cordons [15], GPS [92,95], or CCTV cameras [76].Accordingly, a variety of disciplines, from geography over data mining [29,61,78,81,93] to computer vision [3], provide tools for motion analysis.But across these disciplines activity remains an ambiguous term, to the point of direct contradiction.For example, in (urban) transport research activity generally bears semantics related to times spent at home, work, restaurants, or shops [40,52,91], and is the cause for travel between the locations of these activities [40].In this view, travel is not considered as an activity, rather an undefined mean to overcome spatial constraint [79].In contrast, pervasive and mobile computing (e.g., in its desire to provide context-aware travel support) and similarly computer vision (in its desire of scene recognition) consider motion central: here activity generally refers to locomotion defined at a finer granularity such as walking, running, or moving body parts [3,5,80,69].Trajectory data mining (from the data end, e.g., [95]) and time geography (from the conceptual end, e.g., [30]), both taking a space-time approach to modeling, accept motion as well as stationary activities, and structure behavioral patterns by disruptive changes in the motion trajectory.
Furthermore, most, but not all disciplines share an understanding that more complex activities are composed of simpler activities [3].The daily home-work commute, for example, which is for travel demand modeling an atomic activity with no further need for differentiation, is an aggregated (complex) activity in other disciplines.Time geography as www.josis.orgwell as HCI would see this commute trip as a concatenation of locomotion activities such as walking, taking a bus, and then a train, especially since HCI aims to provide purposeful information for each of these commuting segments.This argument can be carried forward for an even finer level of granularity.There are other activities being part of the commute, such as buying a ticket for the public transport, buying and drinking a coffee while transferring from bus to train, waiting for the train at the platform, or reading a newspaper on the train.Again, HCI research is keen to capture these activities as well in order to provide appropriate information services, such as smart ticketing, recommendations of coffee places, or newsfeeds related to places of interest.
These examples illustrate a semantic gap in the notion of activity between the disciplines involved with human mobility in the city.This gap exists despite the vagueness inherent in all definitions.For example, whether a worker going out for lunch, a tourist strolling in a city, or a person jogging in the evening, is "traveling" or "pursuing an activity" is not clear in travel demand modeling.From an HCI perspective it is hard to decide whether a transfer between bus and train, or grabbing a coffee-to-go between, is an activity.
In the above examples, it is evident that the concept of activity depends on the context within which the analysis takes place.The context determines an appropriate (default) level of granularity in space and time-always allowing for abstraction (zooming out) or refinement (zooming in) should a change of context require so.A closely related property of activities revealed by the examples above is their nestedness.A person can do a number of activities in sequence that form an aggregate activity (e.g., the above described commuting trip as a sequence of walking and taking the bus), and even two activities at the same time (e.g., traveling by bus and reading a newspaper as part of the commute).Although Word-Net does not draw any distinction between activity and action, there is a semantic gap in the conceptualization of activity structure in different domains including HCI, transportation science, cognitive science, public health research, mobile computing, and context-aware location based services.This calls for a hierarchical approach to modeling activities, which we will provide by activities that consist of actions in one context, and in another context these actions becoming activities themselves consisting of actions.
Assuming a trajectory indicates the intention of the agent to participate in different spatio-temporal setups to fulfill certain needs, it is possible to model or retrieve activities from a given trajectory or parts thereof.However, this process is determined by context, which defines the semantics of need (and hence of the activity).In addition, there is no precise correspondence between the concept of activity and the mobility patterns extracted from motion trajectories.Hence, in this paper we present a conceptual analytical framework that aims to bridge the semantic gap between trajectories and activities on one hand, and the disciplines' understanding of activity on the other, the latter through integration of activity theory and space-time concepts in an urban environment.With our distinction of activity as an abstract concept oriented towards certain needs and actions defined at concrete granularities of space and time, we hypothesize that the semantics of activity depend on the spatial and temporal granularity suggested by context.Shifts in granularity will enable processing motion trajectories and representing activity knowledge in various contexts facilitating flexible, i.e., appropriate and relevant information representation or provision.Here granularity relates to the concept of scale in space and time and also level of details in contextual perspective.In this paper we will explore the following research questions.
• What is an activity and what is an action in human behavior at urban scale?
• Is travel an activity?
• How can activity knowledge be represented at different contexts?
• Can a raw trajectory be used for activity modeling at urban scale?
This research work contributes to the existing knowledge in the following ways, such as: • Currently there exists a trajectory ontology [35] that represents the knowledge of a trajectory conceptualization.There also exists few activity ontology in indoor [50] or based on its components [47].But there is no attempt made so far to model activities on trajectories at different contexts and how that can maintain a smooth and connected knowledge flow from one contextual level to another contextual level.Thus the proposed framework is novel and improving the existing work not by replacing them, rather by enriching them with more structured way.• This research also goes beyond the existing trajectory ontology [35] by extending a trajectory ontology to activity ontology with actor as the key concept.Unlike earlier work [35] this paper illustrates the entire ontology and its knowledge base through instantiating the relevant concepts and using few SPARQL queries.• This research incorporates the concept of a set of needs defined in human-scale development [54], and the notion of space and time in the existing activity theory in HCI.
Thus the framework bridges the gap between the notion of activity in spatial science, transport geography, HCI, and other domains.
The rest of the paper is organized as follows.After introducing the research questions, hypothesis, and objective in Section 1, a thorough literature review in Section 2 on motion analysis, activity recognition in mobile computing and activity modeling from the perspective of cognitive science is followed by Section 3. Section 3 is based on the conceptual framework that governs how activities can be modeled from a trajectory at different contexts through formal semantics and a reasoning scheme.Section 4 implements the model and illustrates different contexts as a function of granularity.Section 5 discusses the framework and its efficacy in different contexts followed by conclusions and future research direction in Section 6.

Background
The interest in activities of this paper is driven by the challenges of motion analysis to model activity out of trajectories under different contexts, as studied by various disciplines.Hence there is a need to revisit all the conceptualizations of activities prominent in these different disciplines, and bring them together on a common ground.This section discusses the state of the research in the various disciplines.

Activity in time geography
Many activities on an urban scale are bound by location and time (the where and the when), which determine opportunity, and shape of the located object, which determines affordance.Shopping is possible only where a shop is, when the shop is open, and whether there is a potential customer (to perceive and realize the affordance).In time geography [30] this located object would be a space-time station, and shopping would be characterized by the bundle of the space-time station and the trajectory of a person over a period of www.josis.orgtime.Constraints such as opening hours can be represented by interrupting the space-time station over periods.Other activities are linked to change of location ("travel" on urban scale), which is similarly linked to opportunity and affordance.
In time geography this is represented by non-stationary segments of a person's trajectory; a mediated travel, on board a vehicle, would be represented by a non-stationary bundle of the person's and the vehicle's trajectory, although there exists some amount of space-time uncertainties in one's movement behaviour [90].Again other activities do not depend on location and time: interaction with systems, in terms of ubiquitous computing, can happen anywhere, anytime.With the emergence of information and communication technology (ICT) the concept of time geography has been extended from a physical space to a virtual space, and this transformation led to change in activity pattern in urban environment [79].For example, in order to buy an air ticket people no longer need to go to the airline's office (located in a physical space); rather people can purchase the ticket online (in a virtual space).Golledge and Stimson [25] explained collective activities in terms of two space-time paths and their relationships such as whether the space-time paths are meeting over a certain time window (co-location in time), whether the paths are meeting over a certain geographical space (co-location in space), or whether the two space-time paths meet over a given space and time window (co-existence).The idea can be extended for multiple individuals and their collective activity pattern through space-time bundle [59].Couclelis discussed how ICT influences a gradual transformation in activity pattern through fragmentation and reorganization of activity over a given space [11].
However, there is still physical interaction with a tangible part of the world: be it a physical space or virtual space.An activity in physical space requires interaction with different objects and at the same time an activity in a virtual space requires at least an internet enabled smartphone or computing device to enter in that virtual space and perform different activities (such as e-banking, teleconference) [79].In all these cases especially, during the interaction with the smartphone, e.g., to start an app and to browse through the "pages," and all this while the individual is somewhere at some time.Thus, activities are generally oriented towards certain objects in the world, and hence the properties of the given object are an important facet, especially its availability and its affordance.These properties can be expressed as spatio-temporal constraints by time geography.But time geography lacks guidance on the level of granularity with which these space-time constraints should be formulated for a particular analysis, and it also lacks the notion of the cognitive constraints what objects in space facilitate to offer [73].

Situated action modeling, activity theory, and distributed cognition
The concept of activity has also been reflected in situated action modeling where the basic unit of analysis is "the activity of person-acting in setting" [62].The focus of situated action modeling is the person and the setting.A setting is conceptualized as the relation between the person and the arena within which the person is acting (the concept of arena is equivalent to the concept of environment or world in activity theory and affordance theory).Lave [49] mentioned arena as a stable institutional framework.If a person is shopping in a supermarket, then the particular supermarket is an arena of the institution supermarket.
According to activity theory [62], an activity is not a monolithic concept; rather it is a hierarchical concept consisting of activity at the top layer, action in the middle layer, and operation in the bottom layer.In activity theory the unit of analysis is an activity, which consists of subject, object, actions, and operations.Each of these layers can be broken down into finer layers with growing complexity of expressiveness.For example, an activity can be broken down into actions, which can be broken down into subactions, which can again be broken down into sub-subactions, and so on.A subject in activity theory can be a person or a group of persons or an organization having an objective that motivates them to perform an activity in relation to the environment [49,51].Hence, actions are goaldirected: they contribute to performing an activity.However a goal can be achieved by different actions.For example, a person can eat food at a restaurant or at home in order to achieve the activity "having a meal."On the other hand operations are unconscious.An action becomes an operation over routine execution, and vice versa, an operation may be lifted to an action if there is a sudden change in the condition or the environment such that a routine is interrupted and conscious decisions have to be made.Thus the constituents of activity can change their semantics.In the HCI literature [65] as well as in wayfinding and navigation [31,62,86] actions are termed "tasks."However, here we will use consistently the term action.
The concept of activity has also been explored in distributed cognition.In distributed cognition, the unit of analysis is a cognitive system which consists of individuals and artifacts with which the individuals interact [36,62].Distributed cognition considers individuals, artifacts and the environment as a system, unlike traditional cognitive science that concentrates on an individual's cognitive aspects [63].Distributed cognition analyses how individuals coordinate and share their actions to perform a goal.
None of these three theories looks at activity in the light of space, time, and context.Thus, in this paper we explore different activities based on location, time, needs, and context.We further set our scope to an individual's interactions with systems in an urban sphere, i.e., we neglect activities that go beyond urban scale (e.g., traveling a country), or are confined to the private space (e.g., house cleaning), or to the own body (e.g., gesturing).An elementary activity in the urban sphere is traveling from one location to another location to fulfill certain need(s).An earlier work by Hirtle and colleagues [31] discussed how granularity impacts on the conceptualization of an action or activity in the context of navigation.We use a similar concept to explore travel activities in urban context at different granularities.From the perspective of context-aware computing, the word context can defined as "any information that characterizes a situation of an entity where the entity could be a person or a physical object at a different spatial scale (including a location) which are relevant to the interaction between a human user and the application" [14].The entities also include the user and the application as well.
Activity theory does not specify or define human needs.Therefore we will use the fundamental human needs defined by Max-Neef and colleagues [54,55] stretching across all spheres including urban environments.Unlike Maslow's hierarchy of needs [41] Max-Neef's nine fundamental human needs are not hierarchical; rather they exhibit properties of simultaneousness and complementarity.We choose Max-Neef's needs as this categorization is finite, classifiable, and constant throughout different human culture and historical time periods.What has changed over time is only the mediation of satisfying a given need through varying artifacts.Each need is attributed by four properties such as being (qualities), having (things), doing (actions), and interacting (settings).In summary, activity is a hierarchical, qualitative, and contextual concept.Activity can be reasoned and explained from different perspectives such as situational action modeling, distributed cognition, and activity theory.However activity is always oriented towards an objective to fulfill a need.

www.josis.org
In this paper, we will extend the concept of activity from activity theory and develop a conceptual framework to model activity out of a trajectory that explains an agent's movement behavior and activity knowledge from a given trajectory.

Granularity in movement behavior
Since traveling is an important facet in daily life as travel embeds various activities (or actions) we will look into previous work on how travel has been modeled at different spatial and temporal granularity.Traveling is a type of movement hence we will use travel and movement interchangeably to indicate changing location in some urban context.Movement is a continuous phenomenon.However, movement history is captured in a discretized way, whether recorded by sensors or by human reports post-travel.The recording is by waypoints.The movement can be perceived at different level of details and thus can represent varying information.This level of detail at which the world is perceived at a given context is known as granularity: a certain grain size at which a phenomenon is perceived [32].
"Our ability to conceptualize the world at different granularities and to switch among these granularities is fundamental to our intelligence and flexibility."J. R. Hobbs (1985) The time-ordered set of waypoints of an agent and its interaction with its environment can be refined by additional waypoints, or coarsened by thinning out.Structurally equivalent to space-time paths in time geography [58], lifelines, or in their discrete form, lifeline threads, have been suggested in order to model movement behaviour in terms of precisely defined geometrical structures with varied granularity [58].A lifeline is a time-ordered set of waypoints an individual has passed through or occupied for a given time period [34].Similarly, lifeline beads are equivalent to space-time prisms, and a lifeline necklace is equivalent to sequence of space-time prisms [34,58].On a coarser granularity a lifeline bead can be transformed into a lifeline trace that contains only starting point and ending point.A necklace can be transformed into a convex hull that connects all the rim points and generalizes the movement behaviour of an individual over a time period [34].
Since activity is contextual and depends on the details of analysis and any occurrence is a function of time, temporal granularity plays an important role in defining an activity.Hornsby developed a set of temporal zoom operators to shift the temporal granularity over the identity states of an object and other objects that links during any transitional change [34].There are also instances of work on spatial granularities for place descriptions [75].Hornsby and Egenhofer showed how a refinement operation can enhance the granularity and explores more information on temporal, spatial, and speed aspects whereas an abstraction operation does the opposite and reduces the information content [34].A fine grained lifeline model reveals more activity or action information as more relevant timestamps and locations that were otherwise unknown.At the same time a coarser grained representation can simplify the knowledge and give a general trend or high level activity knowledge.
The role of granularity has also been studied in wayfinding and navigation.Fonseca and colleagues proposed a model to explore spatial information at different granularity in order to disseminate varied level of details [19].Generally the choice of granularity in wayfinding depends on previous knowledge of the agent in the environment.Tenbrink and Winter proposed a framework for variable granularity in wayfinding and navigation.They have considered linear (1D) and areal (2D) granularities, and elaboration [85].In the framework developed by Tenbrink and Winter, they have represented 1D granularity as a line with segments of varying lengths.2D granularity has been represented by polygons.Both 1D and 2D granularities are finite and discrete since network structure and zoom levels are finite and discrete, whereas elaboration is infinite since a route description can be enumerated at infinite level.They also discussed how route directions and descriptions can vary with varied details depending on person's knowledge of the environment, travel direction, location and more specifically pragmatic information needs.They have drawn a comparison on flexibility in providing direction information by humans and machines.The granularity of human-provided route descriptions is more adaptable to the information need than that of a machine.Machine generated route directions do not consider varied information needs based on travel direction and a-priori knowledge of the environment.Motivated by the works of Norman [64] and Kuipers [48], Timpf has studied the notion of granularity on spatial knowledge representation on a mobile device depends on the existing knowledge in the world (in terms of signage, landmarks, spatial cues), knowledge in the head (cognitive map of a place), and knowledge in the pocket (information contained in a mobile device in terms of maps and other spatial information) [31,86].Timpf has developed a threefold framework for any wayfinding activity such as wayfinding from place A to place B and this activity consists of three tasks (actions) such as planning, tracking, and assessing.Each of these tasks can be implemented through different operations such as operations that implement planning task include information gathering, finding routes, determining constraints, producing instructions.Operations that implement the tracking task include orientations, tracking locations, and comparisons to plan.Operations that implement the assessing task include assessing instructions and determining complexity of routes [86].
With technological advancement recently there is a growing need of incorporating HCI in urban context for providing information to mobile information seekers for various location-based services (LBS).The information can be related to route recommendation [44] or activity recommendation [12].In both the cases spatio-temporal granularity and relevance play vital role in disseminating the information in the user's context [31,33,70].Hirtle and colleagues explored the influence of activities on relevance and granularity of route information by analysing different lexical indicators corresponding to certain activity types.They argued the concept of activity is a relative notion [31].Hirtle and others showed an example (Table 1) where taking a friend to an emergency room in a hospital is an activity that forms different actions (tasks) such as drive the car as fast as possible or call an ambulance, park the car next to the emergency room, and take the friend to the emergency room.Whereas at a finer granularity if "driving the car to the hospital" is considered as an activity then this can be broken down into different tasks such as "planning the fastest route," "tracking the position," and assessing the movement behavior of oneself to reach the destination effectively and quickly.
Hirtle and colleagues also mentioned routine navigation (traveling) can be assumed as action to fulfill a purpose of an activity whereas in some cases navigation itself can be seen as an activity such as hiking, sailing, or jogging [31].
In summary, activity can be associated to travel or movement or navigation from one location to another location.The activity knowledge can be explored at different granularity www.josis.orgthat depends on the nature of analysis or the problem at hand.Based on the activity and its granularity relevant route directions and wayfinding information can be disseminated that would influence certain travel based actions at decision points or at planning, tracking or assessing phase during a travel.It turns out that the linguistic ambiguity between activity and action in Section 1, already addressed in the hierarchies of activity theory in Section 2.2, can further be supported by the concept of granularity.

Concept of affordance
Objects in the environment offer different degrees of action potential which is contextual and often assessed by the agent or subject given the specific action.These offerings for action potential are considered as affordance of given object in the environment.The concept of affordances is rooted in affordance theory [22,23] which was motivated by the propositions of Gestalt psychology that governs perception as a whole rather than through its constituents [45].Gibson linked the affordance of an object in the environment with the properties of both the object and the agent who needs to carry out a given action [83].His initial concept of affordance was centred purely on visual spatial perception [23].Some researchers put more emphasis on properties of the environment rather than agent's part [87].Overall, this concept is similar to the motive with the object in activity theory.Affordance theory does not decompose or construct activity in a top-down or bottomup approach, but it helps to model the suitability of an object in order to perform an action within the scope of an agent's capability.The concept of affordance has been used in many action-oriented scenarios starting from assessing the ability of a person on climbing stairs where the affordance depends on the ratio of the height of stair steps and the person's leg [88].It also has been used in wayfinding and navigation in an unfamiliar environment where the agents need to perceive the affordance of different objects in support of their decision making [72].Affordance theory is not only limited to objects but also this has been used in modeling the suitability of places or locations for certain facilities.Considering the fact that different locations provide different degree of affordance which is perceived differently by the agents, a suitability model for a restaurant has been studied depending on different actions it may offer such as eating, reading, socializing [39].Affordance theory has also been used to evaluate the suitability measure for urban networks for pedestrians [38].
Inspired by Gibson's affordance theory of agent-environment mutuality, Zaff argued affordance can be characterized with respect to an agent and its context and its properties.This enables affordance to be viewed as a measurable aspect only in the context of an agent [94].Norman explored affordance of everyday things such as telephones, radios, or doors [64].On the other hand Gaver viewed affordance from the perspective of agent's sociocultural and intentional aspects [21].
Raubal and Moratz developed a relational functional model for affordance-based agent framework by extending the traditional affordance theory through integration of cognitive aspects, situational aspects, and social constraints [74].In this model they have categorized affordances into three classes such as physical affordance, social-institutional affordance, and mental affordance.Their model is based on abstract functional representation of different affordance aspects and operational aspects of an agent.In this model, physical affordance is characterized by physical structure of the agent and the object, spatial cognitive capability of the agent, and a goal.Physical affordance is constrained by social-institutional affordance.However, in a spatio-temporal environmental setup an agent chooses certain affordances based on its requirements and decision strategy, which gives rise to third category of affordances called mental affordances which are manipulated and processed mentally.Based on the action and environmental condition the agent perceives different affordances and performs an internal operation which depends on the agent's historical experience with the object.This results in an internal outcome.Following this stage, an agent executes an external operation (we would say: an action) that results in an external outcome through some changes in the external environment [74].
Affordance theory reasons the usability of an object to fulfill certain need(s) at a given context which can be connected to activity theory, namely the mean that satisfies an objective of an activity or a goal of an action.In the framework of this paper affordance has a place in relationship to the needs of a person and the properties of a location at a particular time, in the spirit-but not at the detail-of Raubal and Moratz [74].

Concept of activity in travel demand modeling
In the field of transport engineering a long-standing challenge is predicting transport demand.Methodologically two approaches can be distinguished: the (still prevalent) fourstep model of trip generation, trip distribution, mode choice and route choice, and the (substantially more complex) activity-based travel demand models [57].Unlike the fourstep model, the activity-based approach in transportation science estimates travel demand by assuming the activity has to be performed, instead of locations have to be visited, in order to satisfy economical, physical, and social needs.The needs can be of two types [37]: a) Subsistence needs: basic needs such as clothing, food, income from work or school; and b) Socio-cultural and user defined needs: various needs based on leisure and recreation.
Travel demand models consider activities throughout a day, determining their level of granularity.Some of the activities can be performed at home, or without travel.Some activities need to utilize some resources and opportunities (which is equivalent to affordance in affordance theory [23] or motives in activity theory in HCI [42]).However resources and www.josis.orgopportunities are dispersed at different locations and for certain time duration.Hence in order to use a particular resource an individual should change their position, giving rise to travel from one location to another location in order to use certain resources and opportunities.Thus in activity-based travel demand models travel is viewed as a derived demand for activity participation in space and time.
Existing activity-based travel demand models consider activities are constrained by location (resources, opportunities) and needs.However, such models are not specific about the granularity of the location or time of an activity.The models mainly consider activities for longer duration at a given location such as home, office, school, or shops since they describe activities over the course of a day.The needs for travel depend on several factors such as activity type, individual role and responsibilities in the family, life style, space time and budget constraint, individual demographic profile [40].The activities themselves are modeled through activity patterns.But activity-based travel demand models cannot reason about the modeling of activity through actions.In this paper we explore and model activities at different granularities, which supplements activity-based travel demand models through more reasoning capability and more flexibility to extract activity knowledge at different level of detail.

Concept of activity in pervasive and mobile computing
Existing research in pervasive or mobile computing or even public health research generally aims at recognizing activities at a micro level using low level sensor signals.Since these activities are ubiquitous hence in some literature these activities are also termed as activities of daily living (ADL).The concept of ADL is generally concerned with physical activities involving body part movements.Understanding such activities and behaviour from users' perspective can allow computing systems to help the users to perform given tasks [1].Humans are always active in some sense to some extent and understanding their active state is important in a number of situations, such as in public health research.Medical science has focused on a patient's needs and their emergency situations based on their activities and modeling the rehabilitation task [8], understanding individual lifestyle such as brushing teeth [9], hand washing or taking food [4], medication intake [66].In urban analytics it is important to understand a person's mobility state [7].Understanding and recognizing activity is also important in many entertainment and sports scenarios to respond based on user's need.For example, in gesture based gaming models, such as Nintendo Wii, Microsoft Kinect, Philips DirectLife, or Nike's context-aware shoes, can improve user interaction with the environment and improve physical fitness by providing feedback especially in sports activities [6].
Activity recognition research used to be performed in a constrained research environment, for example, using still images and video cameras through image processing and analysis [3,60].In order to address more realistic, there has been a shift to exploring ADL using different sensors on smart-phones or sensors worn on body parts.
Nowadays, smart-phones come with several sensors on board (such as GNSS, accelerometer, gyroscope, proximity sensor, magnetic compass, microphone, and camera) and these can be used to track people's indoor and outdoor movements for a variety of purposes such as health monitoring, extracting contextual information, or behavioural information.In the mobile computing and biomedical domain, activities are generally modeled around ambulatory movement, i.e., locomotion.Choudhury and colleagues showed how smart-phone based accelerometer and microphones can be used to detect micro-activities such as walking, sitting, running, climbing stairs, jumping, or talking [9].Bao and colleagues used accelerometers at different parts of the body to understand different activities [5].However, this sensor data is subject to significant noise caused by varying position and orientation in relation to the body.In addition, it is still a challenge to distinguish different concurrent activities (e.g., walking while talking over phone).
Based on the notion of location-based services and ADL in mobile computing, activities can be categorized into two types: a) high level activity based on location and stay time such as work; and b) the micro-level activities based on body movements such as walking, running, or climbing stairs.This distinction is relevant for interpreting trajectories at different levels of granularity.Even adaptive sampling can be implemented in order to better manage the battery resources [10,68].
Until 1990, activity recognition research was mainly focused on gesture detection.A more recent classification of activities, based on the complexity of the activity, shows four different levels: gestures, actions, interactions, and group activities [3].Aggarwal and Ryoo discussed the methodological framework to model and detect activities at different layers, such as single layer and multiple layers.Aggarwal and Ryoo also highlighted different approach-based perspectives to address activity at different levels, such as from a spacetime perspective, a sequential approach, and a hierarchical approach.This can further be broken down into space-time volume, trajectories, different space-time feature based, exemplar-based, state-based, statistical, syntactic, and descriptive [3].
Single layer approaches are simple in the sense that the active state is recognized based on sequence of images.Multiple layer (hierarchical) approaches consists of simple actions for modeling complex activities.Aggarwal and Ryoo demonstrated different categorization schemes for taxonomic activity classification, such as statistical approaches and syntactic approaches based on grammar syntax involved with sequential notion.Aggarwal and Ryoo aim at classifying activities at all levels, starting from individual bodily movement (gestures), individual simple activities (actions), engagement of an individual with another individual or an object (interactions), or coordinating among themselves (group activities) [3].However the model developed by Aggarwal and Ryoo is more focused on activity recognition, not activity modeling per se at different contexts.Hence the distinction between activity and action is blurred.They also do not address the conceptualization of needs and goals.Their work is also targetted towards computer vision research, where analysis of an activity can be performed from images or videos.
In another work, Aggarwal and Park worked on articulated motion analysis and understanding high-level activities from video and still images [2].They have modeled a high-level activity based on low-level simple actions, which are dependent on movement of body parts.However, the authors did not clearly define the semantics of activity and action in their model.An activity is composed of actions, but the model cannot explain the hierarchical structure of activity and action based on context.Aggarwal and Park developed their model on four basic components: a) human body modeling in the image, b) level of detail needed to address the human action, c) high-level recognition scheme, and d) domain knowledge [2].Aggarwal and Park demonstrate activity recognition can be based on an "object-based" perspective (specific to a model) or an "appearance-based" perspective (ad hoc basis).Thus, Aggarwal and Park developed two activity recognition schemes such as recognition by reconstruction and direct recognition with varied level of www.josis.orggranularity in activity knowledge.However the work cannot explain activity and action from need-based, goal-based, and contextual perspectives.
Figo and colleagues explored different techniques used in activity recognition [18].Their focus was on low-level bodily movement, such as jumping, running, and walking.Their main focus was to detect the activities in order to enable different context-aware services based on user's active state.Figo and colleagues have compared the activity detection performance of different features either captured in the time domain, frequency domain, or symbolic representation.In order to correctly detect a user's active state, Figo and colleagues have discussed the efficacy of using different features computed from accelerometer data, such as root mean square metric, signal correlation coefficient, sample difference, zero-crossings, DC component, spectral energy, information entropy, Euclidean, and non-Euclidean distance [18].Their results demonstrate in three-activity situations that frequency domain techniques are more robust than time domain techniques.
Bulling and colleagues gave an overview on activity recognition research with a focus on low level physical activities.They discussed specific challenges in activity recognition such as a proper definition of activity and diverse nature of activities.Bulling and colleagues pointed out taxonomic classification of activities based on different aspects, such as metabolic activities which are widely used in the medical sector [6], as well as time use pattern [67].Bulling and others also discussed the low-level implementation of the models and class imbalance problems during the training phase along with the diverse nature of sensor signals, and the trade-off between sampling duration and accuracy [6].
In order to detect activities at different levels, there has already been a significant thrust on integrating various sensors to generate a rich movement and activity data to understand travel behavior.However, there is no clear definition of activity in the field of mobile computing or public health research so far.In this paper, the ontological framework that has been designed can address the different levels of activity in activity recognition research.

Ontologies in trajectory modeling and activity reasoning
Ontologies are an efficient way to represent domain knowledge in a formal way.Ontology has been defined as "explicit specification of conceptualization" [27,28].Ontologies can be of different types by the nature of their knowledge representation.There are several top level ontologies developed through logical design patterns such as DOLCE [20] and BFO [26] which are independent of any particular domain.On the other hand ontologies are also developed with a domain specific focus based on content patterns, such as the above mentioned semantic trajectory ontology [35].With the emergence of Linked Data and Semantic Web (web 3.0) enormous amounts of trajectory data sets are now generated, processed based on semantic relations between different entities and their properties over time [35,47].
However while modeling a context-aware computing system with a focus on movement behaviour of an agent it is important to understand its context and the intention of the movement.That can only be understood from the activity (and actions) the agent performs at a given location and time.Additional information, such as a road network or a point-of-interest database, is often used to enrich the trajectory to extract the activity information [82].
Lee and colleagues developed an indoor activity based ontology model to support shopping related information search based on a user's location [50].They have developed their model in four stages.In the first stage a geocoding operation was performed based on character matching followed by shopping activity ontology development.In the third stage inferencing rules are defined for semantic query followed by a 3D topological model.However the model developed by Lee and others cannot model activity from different contexts in a hierarchical approach.Thus, the model fails to address different situations at different granularity.
In the activity modeling domain, Kuhn developed an ontology based on the semantics of natural language in terms of activities and actions and different entailment relations among the verbs [47].Scheider and Janowicz suggested a framework for a place reference system where the authors mentioned the actions agents perform to refer to a given place [77].
To the best of authors' knowledge there has been no attempt made so far on modeling and formalizing activity from a semantic trajectory.There has, however, been work presented on a general content-based trajectory ontology [35], on which we will base our framework.Their flexible, self-contained, and reusable semantic trajectory ontological design pattern is based on the atomic unit of fixes or spatio-temporal points.We will extend [35] by fusing with an activity ontology, introducing the concept actor as a connecting concept.

Conceptual framework
In this paper a semantic trajectory based activity ontology framework has been developed with activity as the central concept.The conceptual framework consists of an activity layer and a semantic trajectory layer with actor being the common concept between two layers.The concept actor used in this paper is same as the concept subject used in HCI.
The framework has been developed based on a content-based ontology pattern which involves two independent ontologies: an activity ontology and a semantic trajectory ontology.The semantic trajectory ontology is based on the design pattern of [35] which is extended in this paper, and applied not on trajectory semantics as such, but on activities.And also [35] develops rather a general content-based trajectory ontology that was not instantiated in different context.In our model we have instantiated each concept with data properties and object properties and fused it with an activity ontology and developed a more complex ontology.In order to model any ontology, typical queries are considered that capture generic use cases (GUC) and guide the ontology design.The GUCs are assumed to be optimal for developing an ontology with a possibility of inferring new facts during reasoning phase.Here, the competency questions are as follows: 1. What activity actor X has participated in context C i ? 2. What action(s) actor X has performed from time stamp t 1 to t 2 at a context C i ? 3. Extract the actions (AN k j ) involved in an activity AY j at a context C i ? 4. Extract the trajectories that have at least one transfer at context C i ? 5. Extract the action(s) that are not spatially or temporally constrained?6.What action(s) have been performed over a segment S i ? 7. Extract the object(s) involved in an activity AY j at a context C i ?8. What are the action(s) embedded in a given semantic trajectory?www.josis.org

Context-based recursive activity model
The semantics of activity depends on a context.Hence by changing the context the semantics of activity also changes recursively and represents a nested structure at different granularity.By changing a situation or shifting through granularity (hence changing the context completely or partially), the object(s) of interests also changes vis-a-vis an activity structure.Action plays an important role in activity modeling.An activity (AY) is characterized by its objective (O), and an action (AN) is characterized by its goal (G).A shift in granularity or change in situation can transform an objective to goal(s) at finer granularity or a goal to an objective at a coarser granularity (Figure 1).

OWL formalization
The ontology has been formalized and encoded in Web Ontology Language (OWL) which is based on description logic (DL).OWL has been successfully used in semantic web for knowledge representation and developing ontologies that can share information between humans and machines.OWL is standardized by the World Wide Web Consortium (W3C).OWL-DL has been used in previous literature as to improve the readability, reasoning ability, and compactness of concepts and relationships.
DL provides the formal semantics to specify the meaning of an ontology [46].The basic building blocks in DL are three entities: concept, role, and individual.A concept is a collection of individuals.A role is a binary relation between two individuals (or concepts).An individual is an instantiation of a respective concept.A DL ontology does not manifest the complete knowledge of the world.Rather, it represents a partial knowledge of the world through a set of statements that must hold in a given situation [46].Those statements are called axioms.In order to model a knowledge base, DL provides three types of axioms: A-Box axioms, R-Box axioms, and T-Box axioms.A-Box axioms assert knowledge about the individuals and their concepts.R-Box axioms relate individuals through a binary role.T-Box axioms provide knowledge about the concepts through concept equivalence or concept inclusion.In this framework, the different boxes (namely A-Box, R-Box, and T-Box) are not explained in detail, in order to focus on the contextual model rather than the intricacies of DL.Interested readers can refer to [46] for further background to DL.
In order to address the competency questions above, basic relations (roles) are developed based on any two entities from a set of concepts CS (see Table 2).Some of the key concepts are formalized as follows: CS = {Actor, Activity, Objective, Need, Action, Object, Affordance, Constraint, Objective, Semantic trajectory, Segment, Fix, Device} Table 2: Basic relations and their entity types.

Actor
Actor is an agent that has an objective to fulfill, at least one need, and interacts with at least one object by performing respective actions that in turn enable the actor to participate in an activity.Actor can be instantiated by a specific person or a vehicle in an urban environment.The concept actor can be defined as a subclass of some agent having some need and objective and performs some actions and participating in an activity.The concept of actor can be formalized as follows: Axiom 1.

Activity
Activity is a contextual phenomenon in which an actor participates to fulfill its need(s).An activity consists of actions and motivated by an objective to satisfy the need(s) of the respective actor.Activity can be defined as having some action is motivated by some objective.A simple DL formalization of an activity concept can be expressed as follows: Activity ⊑ ∃hasAction.Action ⊓ ∃isMotivatedBy.Objective

Action
Action is one of the atomic units of the semantic trajectory based activity model.An action is contextual phenomenon that is embedded in an activity at a given context which is performed by an actor and directed by a goal and generally achieved by affordance.Actions involve a complex interaction of an actor to its surrounding objects and hence an action is generally mediated by a given object.An action can be defined as something that is performed by some actor and is directed by exactly one goal and mediated by objects and achieved by corresponding affordance.

Context
Context is any information that characterizes a situation that is relevant to the interaction of an actor with the objects in its environment in order to participate in a given activity.In this research a context must have exactly one actor and exactly one activity and one or more than one actions.The notion of context will be used to instantiate each concepts at different situations.Context can be expressed as something that has exactly one unique actor and an activity.

Object
Object is an entity of physical or cognitive existence that is perceived at a given context through at least one of its affordances.An object can be constrained in a given space or time or both.Following the definition of actor, the significance of an object is subjectively perceived through an interaction with an actor who is performing some action(s).An object can be defined as something that offers a unique affordance and which may be constrained by some constraints.An agent (OtherAgent) can be an object if it is relevant in a given context when an agent offers certain affordances for an actor to perform certain action(s): Object ⊑ ∃!offersAffordance.Affordance ⊓ isConstrained{(true), (f alse)} ⊓∃isConstrainedBy.Constraint

Semantic trajectory
A semantic trajectory consists of temporally indexed fixes in terms of (x i , y i , t i ) that represent an agent's (actor's) movement history supplemented by additional background information and domain knowledge.The definition of semantic trajectory varies in different research with additional knowledge to enrich the semantics.However the basic representation of a semantic trajectory involves a set of fixes and having an actor and activity.Here having an actor and activity means the semantic trajectory is the movement record of an actor in terms of fixes who is shifting its position in order to perform some activity.But in order to make the formalization simple, the concept semantic trajectory is formalized as follows: Semantic trajectory ⊑ ∃!hasActor.Actor ⊓ ∃hasFix.Fix ⊓ ∃!hasActivity.Activity

Segment
A segment is a part of a semantic trajectory that is traversed by an actor.A segment is represented by a starting fix (x i−n , y i−n , t i−n ) and an ending fix (x i , y i , t i ) where ∀n, t i−n < t i .The starting fix of segment i is the ending fix of segment i−1 if there is no semantic gap or hole (a deliberate gap) between i and i-1.A deliberate gap happens when the user turns off the GPS by her own from the concerns related to privacy or battery drainage or any other reason.A semantic gap is generally considered in this research when there is a signal loss in urban canyon or indoor environment such as a tunnel.The following formalization of a segment can be encoded as follows

Fix
A fix is another atomic unit in a semantic trajectory based activity model.A fix can be defined by its data property in the form of a spatio-temporal point (x i , y i , t i ), and in a more abstract but understandable form such as a semantic name (home, restaurant, office) and a unique identification for a given semantic trajectory.A fix can be captured by a location or positioning sensor or by manual reporting.The formalization of a fix can be encoded as follows: Axiom 8.

Implementation and evaluation
The ontology has been implemented in Protege, an ontology editor supporting OWL-DL.
The model has been encoded in Java with each concept as a class.Unlike a functional language (such as Haskell) Protege provides more expressiveness in terms of DL and flexibility through its graphical user interface and object-oriented paradigm.Protege also offers a distributed environment to share and query a knowledge base using Jena-Fuseki web server.
In order to develop the model, first a high-level content based ontology is developed through some concepts and object properties (Figure 2).The model is then instantiated in three different contexts (see illustration section).In this research each context is modeled separately.We assume if a given query cannot generate a satisfactory result in one context then it will assess the next context until all the contexts are evaluated (without any conflict) or a search result is found.The ontology has been checked through HermiT Reasoner in Protege [24].HermiT provides a subsumption checking and logical consistency checking in order to validate an ontology.
The raw trajectory collected for this framework is first preprocessed in two steps a) noise removal, and, b) coordinate transformation.A raw trajectory can give only geometrical information.In order to semantically enrich the raw trajectory and convert it to a semantic trajectory, infrastructure information (route network), domain knowledge (opening time of market), and other situational aspects (focus of analysis at a given granularity) are considered.Figure 3 shows a flow chart how a raw trajectory is transformed into a semantic trajectory.
Figure 4 illustrates the implementation in terms of all the entities in the ontology.Each panel contains a set of entities (concepts, object properties, data properties, and individuals).The arrow annotated with an alphabet shows the direct connection between different entity types.For example, connection a signifies a concept (in class hierarchy panel) may have individual(s).Connection b and c signify each concept is related to another concept or an individual by an object property.Connection d shows each individual and their data properties.

Illustration
In this paper, three contexts are considered based on three different situations on a same trajectory.Since these three sets of contextual information are extracted from the same trajectory, each context shows a given level of granularity.
A trajectory (Fig. 5) shows Joe's movement history from his home to market (00:00:00 AM to 11:48:00 AM), a part of his movement trajectory of the day.However the same approach can be used for an entire trajectory with defined context.Table 3 shows Joe's travel diary on 13th June, 2015 from 00:00:00 AM to 11:48:00 AM.
In each context the key concepts are instantiated by respective individuals with their data property, data type, and value.Hence, for three different contexts, three different sets of instantiations are made to develop three sets of knowledge base with a focus on activity.The examples illustrate how an action in one context is transformed to an activity in another context (Tables 4-6) at a finer granularity.The same has also been depicted in Figure 6 which shows contextual recursive transformation of action into activity and vice versa (Figure 6).The model has also been tested by issuing SPARQL queries at different contexts.The queries are kept simple, for illustration purposes, but can easily be made more complex and nested based on information needs at a finer granularity and situations which is subject to the design of knowledge base in a given context.
In Figure 6 AY indicates activity and AN indicates action.The Figure 6 shows how a singular (atomic) action (AN 1 0 ) in context layer C 1 (in Figure 6a) becomes activity (AY 0 ) in context layer C 2 which is broken down into four new actions AN 0 k where k ranges from 0 www.josis.orgTable 3: A portion of travel diary.
to 3 (in Figure 6b).One of the singular actions in C 2 (in Figure 6b) is again transformed to activity in C 3 with four new actions (in Figure 6c).In order to make the activity (AY) and action (AN) defined in each context easily identifiable by the readers, the following notations are used.6a) reflects a travel survey type knowledge base captured for travel demand analysis, where time spent at a particular location (or place) is considered as an activity, which are home and market respectively in this case ("Where have you been today?"-"First at home, then I went to the market").Travel demand analyses assume travel as a derived demand for activity participation.Hence, travel influences the chance of taking part in an activity which is not otherwise possible at a current location.However travel demand models do not consider travel as an activity or an action.Hence it grossly ignores time spent at certain locations during travel (such as transfer or having coffee or buying tickets) and does not give much emphasis on travel-based activities (activities embedded in a travel) or travel as action (Table 4).Conforming with the travel demand models, in Context 1 travel is a phenomenon of changing location from home to market over a given route network.Thus, in Context 1 two activities are presented in the knowledge base such as (being at) home (C 1 AY 0 ) and (shopping at) market (C 1 AY 1 ) without giving any treatment to travel, with an assumption that there is no other activity embedded in this travel and left it as a singular (atomic) action (C 1 AN 1 0 ). Figure 6a also shows some possible actions ) in the market place such as shopping at two different shops )and changing the location from one shop to another within the market (C 1 AN 1 2 ).However actions such as ) are not furnished in Table 4 for as these are not relevant from travel demand perspective.Generally, travel demand modeling focuses on significant time spent at a given location, not on the actions performed within that location.Context 3 (Figure 6c, Table 6) demonstrates human movement behavior during transfer which is analyzed in order to support any potential non-travel activities along.A transfer involves at least disembarking from a vehicle, walking a given distance from point of arrival to point of departure, waiting for next connecting vehicle, and embarking on that vehicle.

www.josis.org
In order to test the model, SPARQL queries are issued at different contexts.In Context 2, all the activities and corresponding action information are retrieved from the knowledge base (Figure 7).Since Context 2 contains only one activity hence the output produces only one activity (travel from home to market) with corresponding five actions that are required to perform that activity.In context 3, a more complex query is issued to extract all the actions along Segment 0 (Figure 8).From these illustrations it can be seen that Context 1 conforms with the transportation domain, where understanding the causes behind people's travel behavior has been a long standing research endeavor (which is generally addressed by travel surveys in different sorts).Context 2 purports the domain of mobile computing and context-aware computing (along with transportation science) where one may be interested to know a person's current active state in terms of modality and movement behavior and customize different location based and context-aware services.Context 3 aligns with public health research where one is more interested in a person's low level movement behavior such as whether standing or walking or running.
Thus the model will work in all the domains based on the situational aspects, needs, and goals set by the actor.The model will also work in ambient assisted environment where the main focus lies in indoor activities such as brushing teeth, bathing, having coffee, watching television, cooking, talking on a phone-all can be addressed based on a need and corresponding actions with their goals defined at a given context and a granularity (level of details and space-time scale).For example, the activity eating can be modeled with need as subsistence, component actions such as taking food from bowl, using forks and spoons, chewing.This activity structure also involves different objects with given affordances such as bowl for containing the food, fork for cutting the food, and spoon for lifting the food from the plate to mouth.The space-time information can also be populated in this case The main interest of this paper lies in trajectory based activity modeling in urban environment.Hence, the three case studies shown with their corresponding knowledge bases use a single trajectory in different contexts can easily be extended or shrunk at different spatial and temporal scope.

Discussion
In this research, a framework of activities has been developed, implemented as an ontology, and tested for three different contexts.The three contexts illustrate that activity can be modeled for different contexts with different semantics, or level of spatial and temporal granularity.The contexts presented in this paper are all related to each other in terms of a common need.We have shown how action in one activity layer (in one context) can be transformed to an activity in another layer (in another context).In terms of refinement of granularity the presented contexts are ordered in terms of space and time from coarsest to finest granularity (see Figure 6): The symbol "≺" indicates a binary granularity relationship between two contexts in terms of situational relevance.Context 3 represents knowledge within a smaller spatial and temporal scope, with more detailed information on mobility phase than that of Context 1.

www.josis.org
Hence, Context 3 can be viewed at a finer granularity than that of Context 1.The three contexts show how on refining the granularity more information is revealed at a given segment.For example, in Context 1, the most relevant information required is time spent at a given location (such as home or market) which is characterized as activity and hence any more detailed information pertaining to travel (such as modes and transfers) is irrelevant and is presented as single (atomic) action in the knowledge base (Figure 6a, knowledge base for Context 1).Whereas in Context 2, since the way of movement is now relevant, detailed information about transport modes and transfers are presented in the knowledge base, together with further object and affordance information (Figure 6b, knowledge base for Context 2).Context 3 shows again more details but here only for a shorter movement segment (within a constrained spatial and temporal scope), such as transfer (Figure 6c, knowledge base for Context 3).
This research started out with four research questions (see Section 1), reviewed below.

What is an activity and what is an action in human behavior at urban scale?
Based on a context, an activity is the interaction of an agent with its environment to satisfy some need(s).In order to satisfy a need, agent follows an objective.An objective is composed of goals set by the agent which are constrained by the affordances offered by object(s).Each activity contains one or more actions which are oriented towards an object (that offers affordance) to fulfill a given goal.However the concept of activity and action is highly context-sensitive.On spatial and temporal zooming and by changing the situation, the semantics, and role of an activity or action changes in a given context.Based on the illustration presented in this paper (Figure 6), the concept of "activity and action" is aligned with "process and event" in spatial information science.An activity resembles a process; an action contained in an activity resembles an event.But as established, context plays an important role in defining an activity or action.Hence, context would also affect the conceptualization of a process and event, both of which can be refined or simplified, changing the semantics (a process may transform into an event at a given context and vice versa).
Is travel an activity?It has been illustrated that the ambiguity lies in context-dependency.In Context 1 travel is not an activity (Table 4); rather it induces some activities that are not possible at a current location.Hence a travel can be viewed as an action in Context 1.This bridges the gap between the notion of activity in HCI and activity in travel demand modeling.
However, at a different situation, travel can be viewed as an activity with embedded actions (see Context 2 in Table 5, Figure 6b) that also conforms some of the earlier literature where travel has been considered as activity [31].On a coarser granularity and a different context, say, for an activity "holidaying in Melbourne" with a need of recreation, travel can also be considered as an action.However changing position in a same campus (university or office) or indoor environment (one terminal to another terminal in an airport or train station, one floor to another floor in a same building) are left for future work.
How can activity knowledge be represented at different contexts?Activity knowledge can be best represented and shared through activity ontology and a contextual knowledge base.In this paper, activity is modeled based on some key concepts (see Tables 4-6) in different contexts.However the main concepts are activity itself, an actor, a need for an activity, action(s), goal(s), and object(s).Each of the key concepts is instantiated with their respective data type, data property, and data value in a given context and linked together through an actor.
Figure 6 depicts how activity knowledge can also be represented visually on a temporal scale.Thus, a change in context and a shift in granularity in time (and space) can also affect activity knowledge representation with varying details and situational relevance.
Can a raw trajectory be used for activity modeling at urban scale?A raw trajectory encodes an agent's movement behaviour and state of activeness (doing something) in the form of spatial information (coordinate) and temporal information (timestamp) with additional sensor signals at different granularity across a wide range of urban scale (holidaying in Melbourne, traveling from home to office, movement history inside office campus, movement history inside the office building over a given time period).A trajectory can be collected through different sources such as check-in points, static sensors, or cordons laid in the environment [15], continuous recording through location and positioning sensors on-board a smartphone.A raw trajectory collected through different sources can be transformed to semantic trajectory by integrating number of domain specific information including route information [82] or indoor infrastructure information.Based on a given context, a semantic trajectory can then be segmented in a number of segments where each segment can be used to represent an action or activity with a starting and ending fix (spatial and temporal information).Hence, a raw trajectory can be used for activity modeling of a respective actor based on segmentation strategy and context at hand.This paper also demonstrates the extensible nature of an earlier version of a contentbased semantic trajectory ontology [35].In this research some of the concepts and relationships are borrowed from the earlier work while developing the semantic trajectory part such as "fix" and an extended version of "segment."However this context-sensitive activity model has extended the earlier trajectory ontology and developed different sets of knowledge base to represent activity knowledge from trajectory data through instantiation of different concepts.
The relevance of three contexts is based on the given situations.For example for Context 1, the relevance is to gain insight of time spent at a particular place over a considerable duration which is important for modeling travel demands.For Context 2, the relevance lies in understanding the modality information to reflect agent's preferences, location-based services, and route recommendations.In Context 3 the relevance is focused on the agent's movement behavior during transfer for various context-aware computing services.
In order to keep the model simple, the three contextual knowledge bases are rather basic.But the knowledge bases can be populated and extended with more detailed action information on getting more sensor signals especially indoor positioning sensors and inertial navigation sensors such as accelerometer, gyroscope, or proximity sensors that in turn can give information at a finer level of bodily movement, and thus can model semantic activity (at a high level) as well as physical activity (at a low level).
In addition to that, in this paper any atomic unit in the activity model is not discussed.However action is used as the fundamental building block for an activity.An action can be broken down into sub-actions.But in this paper, we limit ourselves into only action and do not break an action into its subsequent parts.This paper assumes a different context when an action is broken down into its components and the action then transforms into www.josis.organ activity in that given context.On the other hand, the concept of granularity is used in several places in this paper.The granularity can be user-defined (by relevance) or systemdefined (concerned with details of data-hardware and software configuration and external influences).In the same line, this research also admits the constraints involved with a given granularity.The constraints depend on the sampling frequency and the sensor configuration and also the level of details suited for the analysis.This work addresses structuring and building a common knowledge base for activities in different contexts from a generic point of view.It does not aim to develop a new predictive model for activity recognition.Hence, this research does not address the constraints on the granularity of the data.Granularity will affect the extraction of knowledge, but not the design of the model.
In this paper, the case studies (three contexts) are focused on different levels of activity knowledge discovery of an actor during its mobility phase.However, the idea can also be useful in indoor activities or activities performed in a virtual space [79,11].Currently the model addresses activity of a single actor, but the model can be further extended for a group of actors based on an activity system model [16], which is an extension of individualistic activity theory in HCI, and collective trajectory behaviour [59,15] to address multiple trajectories with the emergence of big data.

Conclusions
In this paper, a context-sensitive semantic trajectory based activity model has been developed at a conceptual level.A semantic trajectory based activity modeling will enable an efficient communication between human and machines and extracting relevant geographic information retrieval.This research demonstrates the notion of activity and action is contextual.A context defines a situation with a set of concepts, individuals, and their properties.An activity can be modeled based on a given context.An activity is mainly characterized by an objective and a need whereas an action is characterized by a goal.An activity consists of action(s).A semantic trajectory shows movement pattern of an agent.Hence it is assumed that a trajectory contains agent's activity information.In this paper, activity and action information are extracted from a portion of a given trajectory.In order to demonstrate the varied semantics of activity, three contexts are illustrated with three different situations.In the first context a travel survey type activity knowledge base is developed.In Context 2, a more detailed activity knowledge base is developed based on the same trajectory with action information and space time information in terms of fixes and segments.In Context 3, more detailed activity knowledge (transfer) is evaluated over a shorter time frame.
In order to demonstrate the validity of the hypothesis, an ontological framework is developed.The framework is implemented in Protege in OWL-DL.We also tested the model using simple SPARQL queries.The illustrations presented in this paper demonstrate that the contexts are related to each other in terms of the need (subsistence in three cases) on the same trajectory.In a more complex set up, the contexts can be entirely different such as reading newspaper (need: understanding), while traveling on the bus to work (need: subsistence).
In this research we have considered a trajectory captured by a GPS sensor on-board a smartphone in order to illustrate the working of the ontological framework across contexts and levels of granularity.The approach can be used for trajectories captured by different sources, such as trajectories of check-in points, generated by cordons, by static sensors, or from indoor tracking, where each method may have its own granularity and context.The model can also address complex activity models at any level of granularity.Thus, the approach presented in this paper can be expected to be both flexible and scalable.We also demonstrated the approach can be used to represent activity knowledge in different domains.
In this research the three different illustrative contexts are treated separately.Future research may especially connect different contexts in a single model (of variable granularity) based on situational relevance in order to structure more complex activities and extract different action and activity information (disjoint or joint) happening or overlapping on the same space-time window through temporal calculi [53] and context-sensitivity.

Figure 5 :
Figure 5: Joe's home to market travel record (Trajectory 13062015).The shift in position over time is from south to north.The figure shows on refining the granularity from (a → b → c), more action knowledge is discovered.In a walking action is not properly visible.In b and Figure c walking action (in green dots) is visible which took place while Joe was changing from bus mode to train mode.

Figure 6 :
Figure 6: Context based recursive activity layers on temporal zooming.

Figure 7 :
Figure 7: SPARQL query in Context 2: Extract all the activities and actions in Context 2.

Figure 8 :
Figure 8: SPARQL query in Context 3: Extract all the actions along Segment 0.

Table 1 :
[31]vity and actions for different activity targeted to a same location[31].

Table 5 -
Continued from previous page

Table 5 -
Continued from previous page

Table 5 :
Knowledge base schema for Context 2.

Table 6 -
Continued from previous page

Table 6 :
Knowledge base schema for Context 3.