.

Tuesday, April 2, 2019

Construction of Information Engine

Construction of schooling EngineCoiza Making moxie of schooling1. IntroductionI more or less mellow my life directed by cultivation from the Internet. I admit the weather, check the traffic, look for places to go, look for re turn overs for the places, modernize updates from my friends and work and browse lots of information from some(prenominal) former(a) sources. The information I am elicit in depends on mevery factors including the m of the day, my location, whether it is a work day or a weekend, whether I am at home or on vacation. Indeed many times the information I am interested is prompted by information I have already discovered. For exercising, on a work day I might check the weather and, if it looks the a exchangeable(p) rain, check the avail king of trains to get me home (well I wouldnt hope to get wet).Technology like Google Now do a majuscule job of automating information assimilation by guessing what information relevant is relevant to me. The ch all to ldenge of this pillow slip of technology is that assimilation, posticularly across many information sources, potbelly be complex and non easy to guess. An alternate approach is to explicitly put the rules by which information is assimilated in a way that shadower whence be automatically processed by what I call Information Engines.In this article I want to talk about an Information Engine that I have constructed called Coiza. Coiza is make around information jobs that can be subscribe to and which vaunt information as feeds like those used by Facebook and Twitter. transmit whitethorn display raw information, for example a advanceds driveway (like the BBC), or may display information expirying from combining information, for example location and Wikipedia summaries for that location. transmit can produce any information including context information like location and time of day. The most interesting feature of Coiza is that it allows the definition of saucily guides based on existing take and rules on how the information from the existing valleculas gets used to produce information from a new distribution channel.2. Viewing ChannelsChannels can be subscribed to in spite of appearance Coiza. Depending on the channel it may be necessary to supply logical inclination values and/or authorisations for Coiza to access private information (e.g. Google Calendar) victimization the OAuth protocol. formerly carry have been subscribed to so information is displayed from that channel in a feed like format where the feed is hidden if there is no information to display.3. Creating ChannelsViewing channels is where most users leave behind spend the majority of the time, but the richness of channels available to view is enabled by ability to build new channels with relative ease. some(prenominal) user within Coiza can frame and publish channels by writing CoizaLang code. CoizaLang code consists of two primary constructsInfo A gravel of a piece of information that is either consumed or produced by a channel and can be rendered within feeds.Channel Consumes postcode or more info flows, emits a single info flow, and defines rules for producing the product flow. Channels may be nested within each other.3.1 Building Infos here(predicate) is an example of a CoizaLang info for Message illustrating the key features of infos. Firstly like all constructs, infos live within a namespace, or package, in this case coiza since it is supplied as part of the coiza platform. All infos (and for that matter channels) must live in a namespace beginning with the username of the coiza user that created it which in my case is jwillans.Infos can subtype, or extend, other infos which, as we shall see a bit later, allows the same instance of a type to play different roles depending on the channel using it. In this example Message subtypes TitledContent and, in addition to having the link and author field defined locally, surname and content f ields argon inherited through with(predicate) the sub type relationship. Fields can be typed using raw values or other info types.A get ahead principal(prenominal) feature of infos is the optional render block which defines how infos are turned into hypertext markup language for display within a feed. When a subscribed channel is displayed (see the screenshot in Section 2) the supplied feed is a result of turning infos into html using the render block. Render blocks support a subset of html on with the ability to reference and navigate info fields using a gauzy expression language.3.2 Building ChannelsChannels are the bread and butter of coiza. A CoizaLang channel has zero or more stimulant drug ports, a single output port, all of which are typed by infos. The job of a channel is to produce output infos often as a result of processing input infos. The resulting infos can then either be displayed as feeds, assuming the channel has being subscribed to, and/or used as the inpu t to a further channel. In this way networks of channels can be created building on unmatchable another.3.2.1 Getting the discussionHere is a simple example of a channel which does not do any processing directly but wraps the existing channel RSSFeedProvider to define a BBC intelligence information channel. I sometimes call these types of channels convention channels. RSSFeedProvider is virtuoso of a number of channels that hook in to foreignly supplied data, in this case getting information from an RSS feed. Other example of external data channels in coiza includes Google Calendar, IMAP email, LinkedIn, current location, Wikipedia, currency converters and the list is developing all the time. From a coiza point of view these behave exactly like any other (user defined) channel.Like infos, channels are named and live within a package namespace. A channel can have zero or more disputations which are declared in the parenthesis later the channel name (line 5). In the case of the BBC news channel no parameters are required. However RSSFeedProvider does have a single string parameter defining the RSS feed location, and the URL of the BBC news program feed is supplied as an argument to the RSS feed (line 7). This BBC News channel has no input ports but defines a single output port (line 9) which simply takes the output of RSSFeedProvider. By the way, although it cannot be seen from the above code, RSSFeedProvider produces infos of type Message which we covered in the previous section.3.2.2 Filtering the newsLets get more adventurous and explore some of the other features of CoizaLang. pronounce we wanted to filter the news by title, we could define a further channel as followsFilteredTitle demonstrates a parameterised channel, requiring a filter string, with both input (+) and output (-) ports and a body that does some processing. Note how the ports are typed as Titled infoswhich is the base type Message subtypes thereby enabling this channel to filter titles on any type that extends Titled including Messages. The body of the channel iterates over all the incoming infos from feed and filters them using a signifier (line 11) which essentially says that an info must be of type Titled and the title field must contain the value of filter. Any matching infos are emitted to the output port.Now that we have a filter channel we can create a new assembly channel to filter the BBC news leveraging the two channels we have created.Most of the features of this channel has been illustrated previously, the one new feature is the wire declaration (line 14) which, as you may guess, defines how output ports are connected to input ports. In this case how the output of the BBC news channel is the input of the filter title channel. The output of this channel is then the output of the assembly channel (line 12).3.2.3 Publishing the newsDuring developing a channel it is feasible to test the channel in order to guarantee it works as designed as shown below.For a user channel to be subscribable, and used outside of testing, then it is important to guarantee that it is not going to change. To do this, a channel must be print which then prevents change. Before publication can happen, all infos or channels that are referenced by the channel must also be published and the channel must not have any type checking issues (there is no sense in publishing a channel that riding habit work).Unpublishing can only take place if the construct being unpublished has no dependents either in the form of other constructs or user subscriptions. If a change is required to a published channel with dependents then the only approach is to create a new version of that channel (or indeed info).We have created a couple of channels BBC News and Filtered BBC News that once published can be subscribed to by any user. Rather than the user having to search for the CoizaLang channel name (i.e. BBCNews or FilteredBBCNews) it is possible to give the channel a user friendly name along with a description which are both used as part of the search for subscribable channels mechanism.3.2.4 Tell me in the morningYouve probably got a handle now on how coiza works and how anyone can build channels and those channels once published can either be subscribed to or used as a basis of further channels. By way of a final example, if Bob Brown publishes a channel to filter based on the time of day, then we can create another BBC News channel which filters both on the title and the time of day.4. SummaryI have talked about how Information Engines can attention bring information together into a form that is more clutch to what the users is interested in knowing, and I have walked through an example of an Information Engine I have constructed called Coiza. Hopefully Coiza looks useful and you will look becoming a subscriber to the rich array of channels that are beginning to be defined or indeed define one or more channel for yourself. Finally in case you were question why is Coiza called Coiza it comes from the Portuguese word coisa meaning thing

No comments:

Post a Comment