Friday, 3 May 2013

Querying against your ontology – an IT infrastructure scenario


Fluent Editor 2 allows you to edit ontologies that are compatible with OWL2 and SWRL and are expressed with Controlled Natural Language (e.g. English CNL).


Simple model for IT infrastructure

Let’s consider a scenario where the knowledge engineer wants to model simple IT infrastructure:
  • there are servers that hosts applications (in other words applications are hosted on the servers) 
  • applications serves different customers 
  • our customers have different severity (critical, medium, low) 
  • moreover, we want to make sure that every application will be assigned to some server in our ontology

His CNL ontology may look like below:

Ontology:
Comment: 'Sample IT ontology'.

Server-1 is a server and hosts Application-1.
Server-2 is a server and hosts Application-2.

Application-1 is an application that serves Customer-1 and serves Customer-2.
Application-3 is an application that serves Customer-3.

Customer-1 is a customer and has-severity critical.
Customer-2 is a customer and has-severity medium.
Customer-3 is a customer and has-severity low.

X is-hosted-on Y if-and-only-if Y hosts X.
Every application must be-hosted-on server.

In Fluent Editor grammar each instance name begins with capital letter (“Server-1”), concept name begins with lowercase (“server”) as well as relation name (“hosts”).

There is no need to explicitly “define” a relation beforehand – you simply use it for instance definition. It will automatically appear on the Taxonomy Tree while editing.

Last two lines introduces a symmetric relation (“is-hosted-on”) and a requirement with modal expression (“must”) to enforce every application must be-hosted-on a server. Symmetric relation makes this expression more convenient (not every server must host an application).

Asking questions

OK. Now we can start asking queries against our ontology. E.g. what hosts applications that serves customers that has-severity critical?

CNL question shall be entered to the reasoner question-box:
Query:
Who-Or-What hosts application that serves customer that has-severity critical?

The answer is (as expected):
Answer:
<?>: Server-1

What’s interesting, the above example can be expressed in much shorten way – by abandon concept designation (assuming we only want ask similar questions as above):
Ontology:
Comment: 'Sample IT ontology'.

Server-1 hosts Application-1.
Server-2 hosts Application-2.

Application-1 serves Customer-1 and serves Customer-2.
Application-3 serves Customer-3.

Customer-1 has-severity critical.
Customer-2 has-severity medium.
Customer-3 has-severity low.

With this shorten ontology we can still ask the same question, but regarding “something” rather than particular concepts (servers and applications):
Query:
Who-Or-What hosts something that serves something that has-severity critical?

And the answer again:
Answer:
<?>: Server-1


Enforcing requirements with modal expressions

Modal expressions are nice way to express requirements for the knowledge. In the above example we express a requirement that every application must be-hosted-on a server:
CNL:
X is-hosted-on Y if-and-only-if Y hosts X.
Every application must be-hosted-on server.

How does work? When the ontology (or its part) is validated, e.g. before committing changes to the knowledge server. Fluent Editor has built-in validator for the ontology being edited (will be available with May release). 
Validating the first example will show these results:
Ontology (validated):
Comment: 'Sample IT ontology'.

Server-1 is a server and hosts Application-1.
Server-2 is a server and hosts Application-2.

Application-1 is an application that serves Customer-1 and serves Customer-2.
Application-3 is an application that serves Customer-3.

Customer-1 is a customer and has-severity critical.
Customer-2 is a customer and has-severity medium.
Customer-3 is a customer and has-severity low.

X is-hosted-on Y if-and-only-if Y hosts X.
Every application must be-hosted-on server.



All instances that were subject to validation (there is some expression with “must”, “can” or “shall” – they differ by the interpretation by the end-user application. Fluent Editor differentiate them by color of the warning) are highlighted. Green means all requirements are fulfilled. Red means there is some requirement not met. Requirements expressed with “shall” will be warned with yellow, when not met. End-user application may forbid committing changes to the database, when some requirements are not met.

In the above example:
·         Application-1 is-hosted-on the Server-1 (validated),
·         Application-2 is-hosted-on the Server-2 (but nowhere denoted as an application concept, thus not being subject to validation) and
·         Application-3 is not assigned to any server – thus marked as red.

To fulfill our requirement we shall designed somehow that Application-3 is hosted on some server, e.g.:
CNL:
Application-3 is-hosted-on Server-2.

or:
CNL:
Server-2 hosts Application-3.

or even indirectly (with SWRL rules in this particular example):
CNL:
If X hosts something that contains Y then X hosts Y.

Group-A contains Application-3.
Server-2 hosts Group-A.


The above example is as simple, as possible, but gives a quick insight how this kind of semantic technology can be used for a very practical problem.

If want to learn more about Fluent Editor CNL-EN grammar, visit this link.


*) FluentEditor 2, ontology editor, is a comprehensive tool for editing and manipulating complex ontologies that uses Controlled Natural Language. Fluent editor provides one with a more suitable for human users alternative to XML-based OWL editors. It's main feature is the usage of Controlled English as a knowledge modeling language. Supported via Predictive Editor, it prohibits one from entering any sentence that is grammatically or morphologically incorrect and actively helps the user during sentence writing. The Controlled English is a subset of Standard English with restricted grammar and vocabulary in order to reduce the ambiguity and complexity inherent in full English.


Thursday, 18 April 2013

Automated testing in the cloud

Overview

Modern enterprise organization usually maintains at least one web application or Intranet system.  Critical issue for organization is to ensure that critical business functions will be available to customers, suppliers, regulators, and other entities that must have access to those functions.
Maintaining business continuity requires system test execution, in particular functional tests, performance tests, stress tests and continuously monitoring of services. The traditional approach to testing emerges a number of problems and the need to incur the necessary costs. Requires the ongoing commitment and maintain the validation team, infrastructure, tools and licenses to plan and execute testing and reporting, as in any organization meets the requirements of a limited budget, tight deadlines to provide tested solutions. If you also count the cost of a single test, the number of tests needed for a full test cycle, the need for regression testing, poor reusability and the lack of testing in a distributed environment with multiple locations then we find that is not possible to carry out some tests using traditional methods. Human resources and infrastructure costs are too high. Maintaining system continuity requires performing continuous actions for testing team, in particular functional tests, performance tests, stress tests and continuously monitoring of services.


Solution

Testing platform is the solution for all these problems. Let's imagine that you have a team of hundreds or even thousand validation engineers. Then imagine that your team executes for all day and the night, during several weeks, a lot of testing scenarios using various operating systems, browsers from distributed localization. Cognitum provides flexible automated cloud testing platform based on Microsoft Azure. Platform shifts testing of applications into virtual infrastructure and simulates real world user traffic from different location, operating systems, browsers and test cases.  Scalability of infrastructure gives possibility to employee hundreds or even thousand virtual computers on demand. Flexibility manages number and configurations of those virtual machines. Distributed testing environment allows simulating users, maintaining business continuity and executing almost all testing types as a cost-effective solution. The solution is scalable according to the needs of the company, to the maximum capability of infrastructure, database or Azure cost plan.

Customer’s issue

Blue chip company from energy sector which has a number of internal systems, websites and web portal for their customers. The company must deliver continuous operation of internal systems for proper operation of the accounting department, electric grid monitoring, HR system and the client department. In addition, continuous monitoring is required website, because informs about company, prices and urgent messages about failures, and network maintenance. In other site, the company has system for individual and business customers, which allows them to log on anywhere and control over their bills and payments.
In case of internal systems testing services we are using virtual network (based on Microsoft Azure), which allows secure access to the local network. Connecting via VPN gateway provides corporate data security, which is very important for any organization. Thus, our test platform has access to a live system and data in a production environment which cause solution more reliable and effective.
In case of websites and web applications, testing platform can simulate a massive user’s traffic, examine continuous system availability, and perform regression testing after each update.
Moreover, the company require duplicate production environment for testing purposes. Applications and system are moved and launched as a testing environment in the cloud. For security reasons, sensitive data are anonymized and reproduced by a statistical model of production data. In this environment, the testing can be performed using traditional methods, but using a testing platform in the cloud, both methods can be combined together. Test platform running in the cloud carries previously designed test scenarios. Execution of the test scenarios is managed by the special tool called Test Manager. In this way, the test scenarios can perform testing on duplicated applications in a virtual environment. It completely frees the company from having a physical test infrastructure.

Benefits

The implemented solution has brought a new quality to the issue of testing web and enterprise infrastructure. Based on test platform in the cloud, the organization has reduced employment of validation team and the total cost of system’s maintenance.


Cognitum cooperates with Microsoft under prestigious Azure Circle program, where technology partners are invited with experience in Windows Azure. It provides IT solutions in the area of Cloud and BigData for customers both in Poland and abroad. 
 

Sunday, 24 March 2013

Inconsistency Checking with Fluent Editor

One of the helpful features of Fluent Editor for knowledge engineers is an explanation mechanism for knowledge inconsistency checking. Whenever ontology you are editing is logically inconsistent (although it is correct in terms of grammar) you may be guided what are the logical paths that leads to this inconsistency.

How does it work? Let's see on the example.

Start Fluent Editor 2 Express. Click File menu ribbon, than New and select  African wildlife template.

Scroll to the end of file (in fact it doesn't matter where you put new sentences) and add new sentences for the purpose of this example:

First we'll state explicitly, that no herbivore eats neither animals nor parts of them:
No herbivore eats animal and-or eats thing that has-part animal.

Then we'll describe two pizzas: Tasty-Pizza and Vegan-Pizza (instances of concept pizza):
Tasty-Pizza is pizza and has-part an animal.
Vegan-Pizza is pizza and has-part a plant.

And at the end lets express that Sophie (giraffe from the African wildlife template) eats Tasty-Pizza:
Sophie eats Tasty-Pizza.

 Our sentences should look like below altogether (at the end of African wildlife template content):
No herbivore eats animal and-or eats thing that has-part animal.
Tasty-Pizza is pizza and has-part an animal.
Vegan-Pizza is pizza and has-part a plant.
Sophie eats Tasty-Pizza.


OK. Now let's ask about Sophie. In the Reasoner window (at the bottom of Fluent Editor, if it's hidden press CTRL+R to show it) write the question "Who-Or-What is Sophie?". Don't forget the question mark at the end:

Who-Or-What is Sophie?

Press ENTER to start reasoning. Notice, that you can use hints in this windows just as within the main editing window.


Fluent Editor has embedded reasoner service for Description Logic.
You can ask about instances (e.g. "Who-Or-What is Sophie?"), concepts (e.g. "Who-Or-What is giraffe?") or roles (e.g. "Who-Or-What eats?").

In our example, although it is correct in terms of grammar, it is inconsistent in terms of logic. Thus, when we ask about Sophie Inconsistent Knowledge Base window appear. Click explanations button to show more details:

It will show all logical paths that leads to inconsistency. First of one in this example looks like below:

Sophie is a giraffe.
Every twig is a plant-part.
Every giraffe eats nothing-but things that are leaves and-or are twigs.
Every plant-part is-proper-part-of a plant.
Every leaf is a plant-part.
If X is-proper-part-of Y then X is-part-of Y.
No herbivore eats an animal and-or eats something that has-part an animal.
Something is a herbivore if-and-only-if-it eats nothing-but plants and-or eats nothing-but things that are-part-of plant.
Sophie eats Tasty-Pizza.
Tasty-Pizza is a pizza and has-part an animal.

  
As you can see, this is very useful tool while editing even complex ontologies. It gives you helpful hints on how to make your ontology consistent.

 
Video: Inconsistency Explanations with Fluent Editor


*) FluentEditor 2 is a comprehensive tool for editing and manipulating complex ontologies that uses Controlled Natural Language. Fluent editor provides one with a more suitable for human users alternative to XML-based OWL editors. It's main feature is the usage of Controlled English as a knowledge modeling language. Supported via Predictive Editor, it prohibits one from entering any sentence that is grammatically or morphologically incorrect and actively helps the user during sentence writing. The Controlled English is a subset of Standard English with restricted grammar and vocabulary in order to reduce the ambiguity and complexity inherent in full English.