The Story About Contexts, in the Age of Internet:

Need for Standards in Describing Context

Before internet came amongst us we were living in a confined world. The world was defined by concepts and structures that took a long time to change. Some genius ,persistent and possibly heroic people amongst us managed to break some of those concepts and structures in a revolutionary way like Einstein,Carl Marx, Darwin or William James pointing to our brain plasticity that allows us to look at ourselves in a brand new way .

When some one break the established concepts around which a whole society moves every thing changes. The thing these genius do is give us a whole new context in which to breathe and live. Thus our context of every day life is determined by concepts and structures or context we live in.

Although Context is more or less a cognitive entity, in the age of internet we build our context over night. We are exposed and attracted to multitude of happenings around the world. Some of them unexpected and some come from totally different context and culture unknown to us.

Our computing system on which we depend on every day, handles millions of contexts every day. We are familiar with URL which is doing the job now, in a very limited fashion. It possibly tells you which country and company name the information is coming from. With coming of internet of things the volume of contexts is set to explode -and I am only talking about contexts i.e the cognitive aspect we use to manage information, and not the information itself.

A definition of Context in the computing sense points at a convention about confining things in something we can reuse conveniently ,defined as :

  • you have a map containing all your variables
  • you pass it around to whoever needs it, so that you won’t have to send all the variables as method parameters

The trouble with this approach is it can quickly become problematic once the size of the collection of variables increases. Further I believe it does not give any importance to the semantic component, why the contexts become useful for the human in the first place.

I believe we need a way to represent context that make use of the semantic leverage that we humans use to build contexts to start with. A typical JSON type file, widely used in internet and social platforms, actually has some very definite contexts built in. However we do not use them as ‘contexts’, because they are familiar to us as data structures.

This has prompted me to write some simple algorithms which allow us to represent context in a standard way so that multitude of computing systems can follow the same convention.

Like any thing a standard way of representing context would require us to follow some convention , much like the URL string is a way to specify the context or address of a page. There is an implicit progression of narrowing the focus of your attention e.g schholkids.edu.au the progression is in reverse order from the end of the string . This is the cognitive bit in representing context. Within computation field we generally narrow our focus down in a “top down” fashion. This is because we tend to see complexity as an inverted tree starting for the root or overview at the top.

The convention I am following is the dots from left to right progressively narrows the focus.

If you are not familiar with JSON , A JSON is normally treated as a name value pair with possible nesting and inclusion of array of values in terms of JSONArray within the JSON and can represent lot of information about our life style, friends and people around us. The context representation will allow us to use a single string, much like the URL to get a little piece of data in a particular contextual detail.

The convention I followed are :

{“name”:”value”} is represented as name.@value, i.e. each value is preceded by “@” in the context path ;nesting is done by dots e.g. {“name1”:{name2:”value2"}} will be presented as name1.name2.@value2, JON array is represented by numbers; thus {“myjson” :[“run”,”play”,”behappy”]}
is represented by the three context paths: myjson.0.@run, myjson.1.@play ,
 myjson.2.@behappy .

This convention allows any valid JSON structure to be treated like a unique collection of contexts. Simple dots separates the strings as names, and numbers within dot signifies position within a JSONArray and a string with “@” as the first character signifies the value of the name preceding or the value in position of a JSONArray that integer before the dot gives. This allows me to translate a JSON String to collection of contexts and also bring them back to the original JSON. This very basic or similar convention will allow to extend the power of context to any data structure. There will be issues dealing with dot being present as part of the data and there comes the standardizations, e.g we can fix some unicode character to deal with those in the context strings.

The benefit of using contexts as part and parcel or rather the first class citizens in web and mobile computing can be many, e.g we do not have to treat the whole visual element of a device or the web page as a single context but a collection of multitude contexts giving a new kind of freedom for modelling the web and small devices. There are other benefits like ability to write micro services which are effective in a very narrow context and thus keep things isolated within a proper context. More than that it gives us a space to design things within a particular context while at the same time ensures at run time they maintain context boundaries. With the current state of affairs designer can not play with context in a way that will help in the design because contexts are assumed to be useful for machines.

The algorithms I have put in git hub: https://github.com/spicecoder/infoJSON allows e.g. take a twitter feed as below and translate that into bunch of context and then rebuild the data structure back from the context. This way we can deal directly with context and do not worry about structures. The algorithms however will not help in bringing standards ,however, they just show contexts can be the driving entities rather than the overwhelming data structures being our driving entities. Standards have to be in terms of defining standard domains as a collection of context every one in the domain can use. Simple example of domains can be an Android visual system,performance or any specialised topic like global warming where context can change the whole implication of a small statistics or a graph.

Thus following is a tweeter JSON structure from tweeter .

{
 “results”: [
 {
 “text”: “@twitterapi http://tinyurl.com/ctrefg",
 “to_user_id”: 396524,
 “to_user”: “TwitterAPI”,
 “from_user”: “jkoum”,
 “metadata”: {
 “result_type”: “popular”,
 “recent_retweets”: 109
 },
 “id”: 1478555574,
 “from_user_id”: 1833773,
 “iso_language_code”: “nl”,
 “source”: “twitter< /a>”,
 “profile_image_url”: “http://s3.amazonaws.com/twitter_production/profile_images/118412707/2522215727_a5f07da155_b_normal.jpg",
 “created_at”: “Wed, 08 Apr 2009 19:22:10 +0000”
 },
 {
 “since_id”: 0,
 “max_id”: 1480307926,
 “refresh_url”: “?since_id=1480307926&q=%40twitterapi”,
 “results_per_page”: 15,
 “next_page”: “?page=2&max_id=1480307926&q=%40twitterapi”,
 “completed_in”: 0.031704,
 “page”: 1,
 “query”: “%40twitterapi”
 }
 ]
}

Context Displayed:
results.0.created_at.@Wed, 08 Apr 2009 19:22:10 +0000
results.1.page.@1
results.0.metadata.recent_retweets.@109
results.1.next_page.@?page=2&max_id=1480307926&q=%40twitterapi
results.0.iso_language_code.@nl
results.0.from_user_id.@1833773
results.1.max_id.@1480307926
results.0.profile_image_url.@http://s3.amazonaws.com/twitter_production/profile_images/118412707/2522215727_a5f07da155_b_normal.jpg
results.0.from_user.@jkoum
results.1.query.@%40twitterapi
results.1.completed_in.@0.031704
results.0.metadata.result_type.@popular
results.1.results_per_page.@15
results.0.text.@@twitterapi http://tinyurl.com/ctrefg
results.1.since_id.@0
results.0.to_user.@TwitterAPI
results.1.refresh_url.@?since_id=1480307926&q=%40twitterapi
results.0.id.@1478555574
results.0.source.@twitter< /a>
results.0.to_user_id.@396524

And can be converted back to the original JSON.

By the look of it ,it does not appear as great improvement or of relevance , but the point is the context representation helps in dealing with big amount of data in small chunks and proper use of the words between the dot will make them more relevant to people’s design needs and atomic concerns.