Power of content sharing

The more you share the more data can be mined; the more adverts can be targeted; the more money can be made. That's why Facebook's nudging you towards sharing more, and it's why Google is now personalising search for everybody whether they want it or not.

Source:
Read more

Introduction to SWRL

This slide explains what is SWRL and why we need it. It also shows how we write SWRL rule in Protege. Though the protege 3.2 editor shown in the slide, it can be used similarly in protege 4.0 as well ( View -> Ontology View -> Rules ). Below is a line that explains limitation of OWL and suggests use of rules to in ontology :

In OWL it is not possible to establish that a person is the boss of a secretary, only that a person is a boss.

SWRL Tips:
  • A SWRL rule contains an antecedent part, which is referred to as the body, and a consequent part, which is referred to as the head
  • Both the body and head consist of positive conjunctions of atoms. SWRL does not support negated atoms or disjunction.  Thus, a SWRL rule may be read as meaning that if all the atoms in the antecedent are true, then the consequent must also be true.
  • How to write rule like :  Prop1(?x,?y) V Prop2(?y,?x) -> Prop3(?y,?x) ?. Answer: As disjunction is not allowed in SWRL, we can break it down into two sub-rules. R1: Prop1(?x,?y) -> Prop3(?y,?x) and R2: Prop2(?y,?x) -> Prop3(?y,?x)
SWRL Tutorial 01

Operations on Ontologies

SourceOntologies and Semantic Web

Operations on ontology include Merging, Mapping, Alignment, Refinement, Unification, Integration and Inheritance. Not all of these operations can be made for all ontologies. In general, these are very difficult tasks that are in general not solvable automatically -- for example because of undecidability when using very expressive logical languages or because of insufficient specification of an ontology that is not enough to find similarities with another ontology. Because of these reasons these tasks are usually made manually or semi-automatically, where a machine helps to find possible relations between elements from different ontologies, but the final confirmation of the relation is left on human. Human then decides based on natural language description of the ontology elements or decides only based on the natural language names of the ontology elements and common sense.

Ontology Reasoning

Why do we need reasoning in ontology?
Reasoning in ontologies and knowledge bases is one of the reasons why a specification needs to be formal one. By reasoning we mean deriving facts that are not expressed in ontology or in knowledge base explicitly. Reasoners are used to reason the ontology.

Tasks of Ontology Reasoners
A few examples of tasks required from reasoner are as follows.
  • Satisfiability of a concept - determine whether a description of the concept is not contradictory, i.e., whether an individual can exist that would be instance of the concept.
  • Subsumption of concepts - determine whether concept C subsumes concept D, i.e., whether description of C is more general than the description of D.
  • Consistency of ABox with respect to TBox - determine whether individuals in ABox do not violate descriptions and axioms described by TBox.
  • Check an individual - check whether the individual is an instance of a concept
  • Retrieval of individuals - find all individuals that are instances of a concept
  • Realization of an individual - find all concepts which the individual belongs to, especially the most specific ones

OWL Reasoners
A reasoner is a key component for working with OWL ontologies. In fact, virtually all querying of an OWL ontology (and its imports closure) should be done using a reasoner. This is because knowledge in an ontology might not be explicit and a reasoner is required to deduce implicit knowledge so that the correct query results are obtained. The OWL API includes various interfaces for accessing OWL reasoners. In order to access a reasoner via the API a reasoner implementation is needed. There following reasoners (in alphabetical order) provide implementations of the OWL API OWLReasoner interface:
  • FaCT++.
  • HermiT
  • Pellet
  • RacerPro

OWL API hasKey problem

OWL doesn't allow datatype properties to be inverse functional one. One can assume an inverse functional property as a unique key in database. OWL2 comes with the concept of hasKeys.

Few days ago I tried to parse the owl file having hasKey using Jena. Unfortunately, I found that Jena doesn't have the parser for OWL2 yet. Next, I found that The OWL API supports OWL2. Today, I spent my whole day to use the hasKey feature of OWL2 specification. I tried to parse the owl file using this parser. It parses the owl. But when I print the hasKey axioms after parsing, I get only output in forms of genid* i.e. no property names that are used in hasKey are obtained.  To me it seems like a bug of the parser ... couldn't manage to get the keys :(. If anyone of you let me know how we get the properties specified in hasKey, I will give you a BIG thank you.

The portion of the owl is given below:
<owl:class rdf:about="#Conference">
<rdfs:subclassof rdf:resource="&amp;owl;Thing">
<owl:haskey rdf:parsetype="Collection">
<owl:datatypeproperty rdf:resource="#confName">
<owl:datatypeproperty rdf:resource="#confYear">
<owl:datatypeproperty rdf:resource="#confType">
</owl:datatypeproperty></owl:datatypeproperty>
</owl:datatypeproperty></owl:haskey>
</rdfs:subclassof></owl:class>

Code to print the hasKey :
private void printHasKeyAxioms(OWLOntology ontology, OWLClass cls) {
Set keySet=ontology.getHasKeyAxioms(cls);
System.out.println("\t Total hasKey: "+keySet.size());
if(keySet.size()>0)
{
Iterator
keyIter=keySet.iterator();
while(keyIter.hasNext()){
OWLHasKeyAxiom key=keyIter.next();
Set
exp=key.getPropertyExpressions();
for(OWLPropertyExpression p:exp){
System.out.println("\t - "+p+" ");
}
}
}


Output (for cls=Conference): (Some info. is correct: Conference class has a key which has has three properties ) 
Total hasKey: 1
- <http://leo.inria.fr/publication.owl#genid7>
- <http://leo.inria.fr/publication.owl#genid9>
- <http://leo.inria.fr/publication.owl#genid11>


However, I expect names of properties instead of genid* in the output ...

Visitor Design Pattern

Visitor Pattern is a type of behavioral design pattern. Wikipedia says: the visitor design pattern is a way of separating analgorithm from an object structure it operates on. A practical result of this separation is the ability to add new operations to existing object structures without modifying those structures.

Example:

Few useful Unix commands

Replace a text in a file by another using perl command.
perl -pi -e 's/nobal/nobal niraula/g' a.xml 
This command replaces "nobal" by "nobal niraula" in a.xml. we can do this task in multiple file. e.g. just give *.xml as argument if you want to replace in multiple xml file.

Find line(s) in a file containing a given text
grep "nobal" file.txt

Country Ranking by Internet Speed

RDF Revisited

Resource
The Resource Description Framework (RDF) is a standard (technically a W3C Recommendation) for describing resources.


Statements
Each arc in an RDF Model is called a statement. Each statement asserts a fact about a resource. A statement has three parts:
  • the subject is the resource from which the arc leaves 
  • the predicate is the property that labels the arc 
  • the object is the resource or literal pointed to by the arc 
A statement is sometimes called a triple, because of its three parts.

RDF Syntax
  • RDF/XML
  • N-triple
  • N3
  • Turtle
  • JSON
  • TRiX

How a cell phone call works

How Cell Phone Calls Work
Via: Cell Phones

h-index: An evaluation tool for scientific productivity

Wikipedia defines h-measure as an index that attempts to measure both the scientific productivity and the apparent scientific impact of a scientist. Watch this video to know how one calculates the h-index :


I found a document that presents a partial list of computer science researchers whose h-indices are greater than 40 (Click here). So they must be crazy guys, don't you think so ;) ?  Interestingly, one researcher in our team (LEO Team INRIA), Serge Abiteboul, is one of them. His current h-index is 49! Really interesting to know this. I would like to become crazy :)) ))) )))).