Alex’s Weblog

My personal blog

Why my ontology is full?

If you have read some about OWL you know there is three sublanguages of OWL Lite, DL and full, being the Lite the less expressive, and the FULL the most expressive[1]. So why we don’t use the OWL FULL? The problem is OWL FULL isn’t decideable, so we can’t use reasoners, this is a problem, a big problem, so in this posts I will try to say what are the features or restrictions that makes our Ontology FULL.

Metaclass: Metaclass is a class whose instances are classes. This feature can be useful in many applications, but if you use it you can’t use a reasoner. When I have to use metaclass I try to separate my models, this is an important tip, like in other disciplines in Computer Science separation of concers is always a good idea.

/\

Import

Import

\/

What I can do when I need the metaclasses and at the same time I like to preserve decidability of Model, is to create metaclasses and classes in different OWL files and later create another file that import both and create the relation of instantiation. In this way you can use some reasoner capacity over the Model that contain the classes if is needed, but you can track the metaclasses it is instantiating usingn the three OWL files.

Transitive and Functional Relations:

Another feature that can leads to OWL-FULL is the transitive relations. You CANNOT restrict cardinality of a transitive relations or its inverse. Hence we can’t neither set a relation as transitive and Functional at the same time nor set a restriction for a class that set a cardinality for that property.

Let-me explain why:

Let’s assume instances A, B and B, and properties P and its inverse IP.

P(A,B) and P(B,C), than IP(B,A) and IP(C,B)

If we say that P is transitive than we are also defining:

P(A,C) and IP(C,A).

Remember, defines the P(A,B) or IP(B,A) is the same, hence why it is not possible define the relation cardinality nor its inverse.

If this information it’s useful for you but think it’s not clear, let me know.

[1] – http://www.w3.org/TR/owl-features/

Dezembro 6, 2008 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

Difference Between Frames and Description Logic

This post has the goal to discuss in few lines the differences between Frames Technology and Description Logic Based Languages. For the ones that don’t know these terms, OO languanges are Frame based, and OWL is a Description Logic Language. The differences between this two worlds are important because when we are working with ontologies it is a common practice model in a O.O. modeling language (UML) and later translate it to a Description Logic Language (OWL-lite or OWL-DL). If we aren’t aware of the differences between the two worlds we can have some problems when doing the mapping between the model and its implementation.

A DL terminology includes a set of primitive concepts and roles(properties) as well as definitions of complex concepts and roles. The definitions of complex concepts and roles are given via descriptions that are built using a set of constructors, which vary from one DL to another. The strength of DLs is that they are associated with algorithms for subsumption checking, automatic classification and instance recognition.[1]

Frame logic (FL) accounts in a clean, declarative fashion for most of the structural aspects of object-oriented and frame based languages[3]. F-logic stands in the same relationship to the object oriented paradigm as classical predicate calculus stands to relational programming. Although the Frames Technology most well known example is the OO programming languages, there are some ontology languages based on Frames, one example is F-Logic, and the Protégé itself one of the most known ontology editors is based on frames. There is also a reasoner to F-Logic called Florida[2].

  • DLs rely on the ontological distinction between concepts and elements. FL blows away this distinction.
  • FL: closed-world and domain-closure assumptions. DL: open-world and open-domain assumptions.
  • FL: class definition necessary and sufficient.
  • DL don’t uses the unique name assumptions[4] whereas FL includes term equality.
  • DL don’t provides control knowledge. The user it is only able to provide declarative knowledge.

I need to do some research yet to understand how protégé works since it is a frame based editor, but OWL more used is the OWL-DL.

[1] D. Fensel, M.-C. Rousset and S. Decker – Workshop on Comparing Description and Frame Logics

[2] http://en.wikipedia.org/wiki/F-logic

[3] Logical Foundations of Object Oriented and Frame Based Languages – Michael Kifer, Georg Lausen and James Wu

[4] http://en.wikipedia.org/wiki/Description_logic

Novembro 18, 2008 Publicado por alexpinheiro | Modelling, Uncategorized | , , | Sem comentários ainda

Constructor Class

Today I was trying to create na standard Factory design pattern to a bunch of classes that I created. Using JAVA reflection classes I have designed some cool stuff:

 

    protected IGenClass createObject (Class objClass) throws NoSuchMethodException, Exception{

        Constructor constructors = null;

        try {

            constructors = objClass.getConstructor();

        }catch (NoSuchMethodException e) {

            // TODO Auto-generated catch block

            e.printStackTrace();

        }

        return constructors.newInstance(sIndividual);

    }

 

In this simple case would be the same that wrote the code

IGenClass obj = new ImplGenClass();

 

I know this is not a great thing, but use some imagination, this can be a great thing to make easy to create a bunch of factories.

I hope this can be useful.

Novembro 13, 2008 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

Reading …

Nowadays I am reading a lot, I have to read some articles and some chapter books. I am trying to achieve acquire knowledge, understanding the information being informed to me, but also understanding the structure of the text.

This is being a good exercise to me. I need to write well, because I will have to write a thesis in my master program. I think the better way is understanding how the others write. I have to learn to criticize others texts too. I think if I am able to criticize (able to see strong and weak points)I will be able to write better.

My next challenge will be to write an article about ontologies URML and ONTOUML, I think will be a great experience. Even if I fail I will improve myself in many skills.

I think is time to do my better and get my goals.

Abril 22, 2008 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

Recomeço – Restart

I think that is time to start again, there is a long time since my first and unique post. Somethings have changed since. Now I am a engineer. It was a good time my graduation, when I started I was a young trying to be someone, now I am someone trying to get a space in this great world. I have faced many challenges to get to end my course. They were worth to my formation and to me become who I am. I know more what I can do how much I can stand, but I know there is a lot to learn and change yet. I am trying to improve myself!

Ahh one of challenges faced to get finish my course was the final project. What I have done? It was a modeling program using URML and OntoUML. OntoUML is a ontology language, created by Giancarlo(my professor) from a review from UML( This is a long story, I explain this better later), and URML you can read about it in my last Post.

But I am not free from university. I have started my master program with Giancarlo, probably in Rule Based Systems. I like this area there is a lot of things to discover. Although I think I have a lot to learn first.

  1. Write ( English\Portuguese): I have to learn how to express myself, how to structure a phrase and a text. I will write some articles too, so I will have to write scientific texts.
  2. Concentration: When I start to study something I have to be able to have focus, and priority.
  3. Search. What is to search a subject, and where to find what is need.

I think if I learn this in this first year it will be a good beginning. Write this blog Is also an exercise to me too to improve my write skills. Hum a last news I am learning german too, so don’t think I am crazy if you find some unintelligible expressions in my text. It is german only.

Auf Wiedesehen!

Abril 21, 2008 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

PDF Printer

Pdf Printer

Today I stayed a lot of time trying to find a good PDF printer that works on my O.S., Windows x64 Vista. I tried the CutePDF and the PrimoPDF but none of them works, eventually I tried the BullzipPDFPrinter and it was my salvations it works fine on my system, without add-ons and is a freeware software.

Even thought I haven’t understood yet why the others softwares don’t works on my system. The installation process run ok, but they can install the printer. When I tried install by myself the printer I get a error when I tryed to add a special port to use the pdf Printer software. I will understand this later.

Novembro 24, 2007 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

URML – Derivation Rules Example

Documentation

Author: Alex Pinheiro das Graças

Introduction

This documentation will show the use of derivation rules using concrete examples, through modeling of real rules, showing the symbols used and the correspondences between them and the URML meta-model.

The URML is a rule visual language, conceived to make easier the modeling of rules

Derivation Rule

Derivation rules specify how certain logical sentences may be derived from others. They consist of one or more conditions and one or more conclusions. For specific types of derivation rules, such as definite Horn clauses or normal logic programs, the types of condition and conclusion are specifically restricted.

In the URML a derivation rule is instanced by a circle with the acronym DR of derivation Rule. The conditions are represented by an incoming arrow and conclusion by a outgoing arrow. The symbols are shown below with their respective description.

 

Symbols

Description

This represents a derivation rule(DR).

A outgoing arrow represents a conclusion

A incoming arrow represents a condition

A crossed incoming arrow represents a denied condition

 

These are the symbols used in this document, beyond the usual UML notation.

 

 

 

 

 

Examples

In this section there are examples modeled using URML language will be exposed. The example was chosen trying to show different instances from URML concepts.

The examples are going to follow this structure:

  1. The URML model;
  2. The rule in natural language;
  3. The rule in Prolog;
  4. A correspondence between the URML meta-model and the example exposed or an explanation of model.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. Example

 

 

Rule:
If Person plays bass then he is a Bass Player

Prolog: musician(X) :- player(X)

This example is a very simple model where a sub-concept is defined by means of a derivation rule. The condition is defined by a role condition. It is necessary for the instance of class Person to be a player to it be considered a musician.

The conclusion of this rule instantiates the object as a musician, hence it is a classification conclusion.

An interesting point of this example is that the rule doesn’t suppose anything about the instance of objects from class Instrument. The creation of the sub-concept musician is done on knowledge inferred over the role of the super class.

 

 

 

 

 

 

  1. Example

Rule: If Person is born at a country whose name is Brazil then this person is a Brazilian.

Prolog: brazilian( X ):- person( X ) ,country( Y ) ,bornAt( X , Y ), countryName(Y,’Brazil’)

 

This is a simple model, it infers if a person is Brazilian or not. The conditions needed to make it true are that he or she are born at a country whose name is Brazil. This is an example where a sub-concept is defined by a derivation rule.

This rule is using two types of condition: a binary association condition, to testif there exists an association between the two object terms; and a classifier condition with a OCL filter, testing if a object term is an instance of a class In addition, the OCL filter creates a filter to the conditions instanced with the conditions described in the OCL expression.

 

 

 

 

 

 

 

 

 

 

 

 

  1. Example

 

Rule: If the car last maintenance was more than 90 days or the service reading greater than 5000, then this car is scheduled for service.

Prolog:

rentalCarScheduledForSevice( Y ) :- rentalCar( Y ) , lastMaintenanceDate(Y , Date) , serviceReading( Y, SR ) , ( Date > 90 ; SR > 5000 )

 

Above it is shown a simple example in which it is wanted to know if a rental car is scheduled for service. To achieve this, it is used a classifier condition with an OCLFilter. Below there is a model depicted from the URML metamodel shown the relationships between the condition, the OCLFilter, and the ClassificationAtom.

As it is seen in the meta-model every condition has a filter, in this example an OCLFilter. The OCL is a acronym for Object Constrain Language and its specification can be found at the Object Management Group OMG.

www.omg.org/docs/ptc/03-10-14.pdf

 

  1. Example

    

Rule:
If a car is stored in a branch, it is not assigned for rent and it is not scheduled for service, thus that car is available at the Branch.

Prolog:

isAvaliable(X,Y) :- isStored(X,Y), not isAssigned(X,Z),rental(Z),not rentalCarScheduledForService(X)

 

This example shows a far more complex rule than the others shown in the former examples, as this example has three conditions, and two of them are denied, and furthermore a conclusion that instantiate an association instead of a classifier.

As you can see in the meta-model of this condition has a property saying if condition is negated. As it was shown in the table above, negation is shown with a cross at the condition arrow.

The conclusion in this example is different from other examples shown until now, it instantiate a binary association between two classes.

 

 

 

  1. Example

 

Rule: If a person is a woman and a mother, then she is a mother. If a person is a father and a man, then he is a father.

Prolog: mother(X) :- woman(X), isParent(X);

    father(X) :- man(X), isParent(X).

 

This model is composed by two Rules that infer similar knowledge. These derivation rules consist of a role and a classification condition. The results include a classification conclusion, creating a sub-concept of a super class.

 

 

 

 

  1. Example

 

Rule:
If a Person plays an Instrument and this instrument is a Bass than this person is a bassist.

Prolog: bassist(X) :- person(x),plays(X,Y),bass(Y)

This rule is refinement from musician example shown before. Now the objective is to know more than if he plays an instrument or not. It is a specific instrument, a bass. To achieve it, this rule is using a binary and a classifier condition. The classifier condition test if an instance is from the class expressed in the condition. The binary conditions test if there exists or not an association between a instances from class Personand and class Instrument.

 

 

 

 

 

 

 

 

 


 

Novembro 24, 2007 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

First Post

I will use this blog like a log and a knowledge base. When I when writing this Post I was studying this thecnologies:

  • MDA
  • GMF
  • EMF
  • OCL
  • UML
  • QTopia

The last one I am using at my employ, the others to my graduation project. I hope this blog be useful to somebody.

Agosto 25, 2007 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Agosto 25, 2007 Publicado por alexpinheiro | Uncategorized | | Sem comentários ainda