Académique Documents
Professionnel Documents
Culture Documents
Description
The component KBFE is an ontological framework, a little framework of Knowledge Base. It is a jar, which is
usable in vary ways:
• ontological crawler
• ontological interface, to participate in environments such as home automation and network interface
devices on different HW
Each of Ontology technology involves products that are among those in the next figure.
1
Concepts
The Knowledge Base and Ontologies can represent an efficient design methodology that can exploit
ontological components easy to implement or implemented, and available on the palette editor (eg
Eclipse). Good tools makes easy to design, especially in conceptual mode, making the development of light
and with few errors and anomalies. It rapresents a methodology which is seen placed in the design
components and frameworks.
Definition
The most practical definitions on the ontology are:
it allows to classify / group objects in a domain and get inferences about them, through a
"reasoner" (an inference engine)
An ontology consists of:
o Classes
o Individuals (instances of classes, the exploitation of class)
o Object Property (binary relations between individuals)
o Property Data (binary relations between the individual and data)
o Properties chain
A working definition of Knowledge Base, is, however, what defines it as a set of ontologies, there behind
the concepts of the philosopher Russell and the axioms of mathematics, sets of sets etc., remember Peano
etc? The relational DB is a mathematical concept. The Knowledge base point to the same concepts of
Prolog and RDF: subject, predicate and object.
2
When will the knowledge base is more than one data base? If it relies on the generalization and fails with
the same "engine" to process a single 'class of problems. "A Knowledge Base is able to handle N ontologies,
regardless of names of DB schema, tables, columns, and regardless of the length of the columns, managing
to simultaneously interrogate them, even sharing the data. Ontologies are also useful to create metadata
and annotations also collaborative.
Often in a company that serves the customer can be configured with a single conceptual abstraction.
In many companies, large or small, regardless of the process of management, often serves only one thing:
"Given a topic and a key information, determine a list of related information is also not uniform, of any kind
(voice, video, e-mail, image, fax, phone number etc) and where to report the matter. "
This class of problems if you design correctly ontologies can be treated with a single engine of the
Knowledge Base.
The list of people who live in the palace and that employees who work in street Depretis and subscribe to
Sky and at the Naples soccer are at least four research on ontologies crossed by a single engine.
An ontology can also be provided with m files, each of which constitutes a partition, ordered by the key
information for research or more information, making it possible to mount on Engine for Information
Retrieval, a pre-search B-tree, the names of file, with an algorithm that depends on the logarithm.
For example, a white pages directory sort by type of work and in alphabetical order of last name
The partitioning of an ontology is a conceptual phenomenon, and it is a mistake leaving the physical
partitioning of the software or a subdivision of the engine later: just one search engine with pre-file
(essentially an index) and a partitioning of the ontology.
It should be an important aspect when working with large numbers; engine is more than saving memory.
Rules can be made of partitions (with use of other ontologies and SWRL SweetRules).
3
Rules Engine
A business rules engine is an ontological framework, for example, working on an ontology defined as
"systems subscribed to notifications ',' Notifications ',' Rules of application. " The problem is:
"A BPM system or an ESB, provided the notification wants to know the list of affected systems to
notifications and rules for each affected system or not to forward the notification to the subscribed
system». A rules engine is a general ontological framework with rules to infer a set of facts and return the
action to be performed.
o To use an engine that uses Pellet (as reasoner), which works in memory and allows inferences
(deductions) and SWRL; then KBFE allows partitioning of the conceptual data
o To use a Database as Oracle OWL (Oracle 11) if you are dealing with millions and millions of
records, but without the power of inference of Pellet
Use of KBFE
The engine KBFE allows you to read ontology files which are designed with Protegè 4.1 and with files sparql
associated (designed with Twinkle for example). The main advantage of engine is that it allows you to focus
on ontological design and the queries.
It permits an hot deploy of ontologies file and sparql files. The Ontology files can be partitioned with a
ontology partitioning, so that the performance are good.
For example with Tomcat, on the our machines we can use different Tomcat, each corresponding to the
same IP but with different port, while before them you can put a load balancer software (Apache) or
hardware that, in round robin, forwards a request to a Tomcat or another. Obviously you can have even
more type of server: Unix /Linux/Windows.
With BEA WebLogic Server (WLS) we can have on each machine, two Managed Server WLS in a cluster
software with a IP cluster, a WLS Administrator and a Node Manager.
Libraries dependencies
KBFE uses:
Development
We can use as IDE:
4
Eclipse Helios, Galyleo, Ganymede etc
Oracle Workspace 1.1 or higher
For development with an IDE we must add, at the Java Build Path and at the classpath of the server, the
external jars: kbe.jar and all the jars of Pellet-2-2-2 (lib) and the jars of jdom 1.1.1 (in lib and build).
We can use the source KBFE1Ontology.java as example to build a Webservices. If we use Tomcat then we
must add Axis2 for Web services on Java Build Path e classpath of the server.
BUILD
If we want, we can use the WebServices KBEWS.war, which is in folder build, for Tomcat 6.x or higher.
5
Archicture of KBFE
Tomcat
http://tomcat.apache.org/download-60.cgi
http://tomcat.apache.org/download-70.cgi
We can install in a folder or directory of our server Windows or Linux/Unix and we can set the variable
CATALINA_HOME
JDOM
http://www.jdom.org/downloads/index.html
PELLET
http://clarkparsia.com/pellet/download/pellet-2.2.2/
Configuration of Tomcat
Under %CATALINA_HOME%\apache-tomcat-6.0.32\conf we can modify tomcat-users.xml to add our user.
For example:
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
<!--
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
6
<user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>
Put KBFE.war in %CATALINA_HOME%\webapps. The engine works with the user.dir. So we must put in
user.dir (bin of Tomcat): directory dbquery with the scripts sparql, KBFE.properties, log4j.properties and
the ontologies files.
START TOMCAT
cd %CATALINA_HOME%
cd bin
startup
%CATALINA_HOME%\webapps\KBFEWS\WEB-INF\lib
Attention: we must copy here all the jars kbfe.jar, all jars of JDOM and PELLET without folder or directory.
Start Tomcat
If Tomcat è down:
cd %CATALINA_HOME%\bin
startup
We see the home page of Catalina. On the left we click on Tomcat Manager and insert username tomcat
and password tomcat.
7
We see the Tomcat Web Application Manager, where we can click on the link /KBFEWS and we will see
Axis2 page.
If we click on Service we obtain the page of endpoint e port and we can see the WSDL.
KBFE properties
See the examples.
We suggest use RDF/XML when you save your ontology, which is more stable than the standard OWL, and
OWL 2 Manchester that are in development. The RDF / XML allows you to create SQL script SPARQL-like
and more easily understood by those who have been using SQL. If set to true for all ontologies negotiable.
The ontology in examples are only some templates. You must create your ontology. It is important that you
save in RDF/XML and must use a own IRI_NAMESPACE for all the applications.
IRI_NAMESPACE
For example:
Once you create your ontology, you must use the same IRI_NAMESPACE in all ontology. We suggest that
you must always use the same IRI for all our applications, eg:
8
We can enable an ontology or disable:
<ontology>=YES or <ontology>=NO
Example
Notifiche=YES
Example
ESBE=YES
If there isn’t the default is TXT with separator ; which above the information. Once you set applies to all
ontologies. We suggest XML.
NUMV_SPARQL
It is the number of SPARQL variable that we use in our query. For default is 4. You must put the max of the
all cases.
CHARSET_XML
9
The default is UTF-8. Once you set applies to all ontologies
set PELLET_HOME=C:\pellet-2.2.2
set JDOM_HOME=C:\jdom
set AXIS2_HOME=C:\axis2
set KBFE_HOME=C:\kbfe
set CLASSPATH=%CLASSPPATH%;%PELLET_HOME%\lib\pellet-cli.jar;%PELLET_HOME%\lib\pellet-core.jar;%PELLET_HOME%\lib\pellet-
datatypes.jar;%PELLET_HOME%\lib\pellet-dig.jar;%PELLET_HOME%\lib\pellet-el.jar;%PELLET_HOME%\lib\pellet-
explanation.jar;%PELLET_HOME%\lib\pellet-jena.jar;%PELLET_HOME%\lib\pellet-modularity.jar;%PELLET_HOME%\lib\pellet-
owlapi.jar;%PELLET_HOME%\lib\pellet-owlapiv3.jar;%PELLET_HOME%\lib\pellet-pellint.jar;%PELLET_HOME%\lib\pellet-
query.jar;%PELLET_HOME%\lib\pellet-rules.jar;%PELLET_HOME%\lib\pellet-
test.jar;%PELLET_HOME%\servlet.jar;%JDOM_HOME%\lib\ant.jar;%JDOM_HOME%\lib\jaxen.jar;%JDOM_HOME%\lib\saxpath.jar;%JDOM_HOME%
\lib\xalan.jar;%JDOM_HOME%\lib\xerces.jar;%JDOM_HOME%\lib\xml-apis.jar;%JDOM_HOME%\build\jdom.jar;%AXIS2_HOME%\lib\activation-
1.1.jar;%AXIS2_HOME%\lib\antlr-2.7.7.jar;%AXIS2_HOME%\lib\axiom-api-1.2.10.jar;%AXIS2_HOME%\lib\axiom-dom-
1.2.10.jar;%AXIS2_HOME%\lib\axiom-impl-1.2.10.jar;%AXIS2_HOME%\lib\axis2-adb-1.5.4.jar;%AXIS2_HOME%\lib\axis2-adb-codegen-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-ant-plugin-1.5.4.jar;%AXIS2_HOME%\lib\axis2-clustering-1.5.4.jar;%AXIS2_HOME%\lib\axis2-codegen-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-corba-1.5.4.jar;%AXIS2_HOME%\lib\axis2-fastinfoset-1.5.4.jar;%AXIS2_HOME%\lib\axis2-java2wsdl-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-jaxbri-1.5.4.jar;%AXIS2_HOME%\lib\axis2-jaxws-1.5.4.jar;%AXIS2_HOME%\lib\axis2-jibx-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-json-1.5.4.jar;%AXIS2_HOME%\lib\axis2-kernel-1.5.4.jar;%AXIS2_HOME%\lib\axis2-metadata-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-mtompolicy-1.5.4.jar;%AXIS2_HOME%\lib\axis2-saaj-1.5.4.jar;%AXIS2_HOME%\lib\axis2-soapmonitor-servlet-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-spring-1.5.4.jar;%AXIS2_HOME%\lib\axis2-transport-http-1.5.4.jar;%AXIS2_HOME%\lib\axis2-transport-local-
1.5.4.jar;%AXIS2_HOME%\lib\axis2-xmlbeans-1.5.4.jar;%AXIS2_HOME%\lib\bcel-5.1.jar;%AXIS2_HOME%\lib\commons-codec-
1.3.jar;%AXIS2_HOME%\lib\commons-httpclient-3.1.jar;%AXIS2_HOME%\lib\commons-io-1.4.jar;%AXIS2_HOME%\lib\commons-logging-
1.1.1.jar;%AXIS2_HOME%\lib\geronimo-annotation_1.0_spec-1.1.jar;%AXIS2_HOME%\lib\axws_2.1_spec-1.0.jar;%AXIS2_HOME%\lib\geronimo-
jta_1.1_spec-1.1.jar;%AXIS2_HOME%\lib\geronimo-saaj_1.3_spec-1.0.1.jar;%AXIS2_HOME%\lib\geronimo-ws-metadata_2.0_spec-
1.1.2.jar;%AXIS2_HOME%\lib\httpcore-4.0.jar;%AXIS2_HOME%\lib\jalopy-1.5rc3.jar;%AXIS2_HOME%\lib\jaxb-api-2.1.jar;%AXIS2_HOME%\lib\jaxb-
impl-2.1.7.jar;%AXIS2_HOME%\lib\jaxb-xjc-2.1.7.jar;%AXIS2_HOME%\lib\jaxen-1.1.1.jar;%AXIS2_HOME%\lib\jettison-1.0-
RC2.jar;%AXIS2_HOME%\lib\jibx-bind-1.2.1.jar;%AXIS2_HOME%\lib\jibx-run-1.2.1.jar;%AXIS2_HOME%\lib\juli-6.0.16.jar;%AXIS2_HOME%\lib\log4j-
1.2.15.jar;%AXIS2_HOME%\lib\mail-1.4.jar;%AXIS2_HOME%\lib\mex-1.5.4-impl.jar;%AXIS2_HOME%\lib\neethi-
2.0.4.jar;%AXIS2_HOME%\lib\regexp-1.2.jar;%AXIS2_HOME%\lib\tribes-6.0.16.jar;%AXIS2_HOME%\lib\woden-api-
1.0M8.jar;%AXIS2_HOME%\lib\woden-impl-dom-1.0M8.jar;%AXIS2_HOME%\lib\wsdl4j-1.6.2.jar;%AXIS2_HOME%\lib\wstx-asl-
3.2.9.jar;%AXIS2_HOME%\lib\xalan-2.7.0.jar;%AXIS2_HOME%\lib\xercesImpl-2.8.1.jar;%AXIS2_HOME%\lib\xml-resolver-
1.2.jar;%AXIS2_HOME%\lib\xmlbeans-2.3.0.jar;%AXIS2_HOME%\lib\XmlSchema-1.4.3.jar;%KBFE_HOME%\kbfe.jar
Partitioning at Design
In the case of large number of ontology data, it is important the partitioning. The partitioning of the
domain is only part of the domain of the solution; it is an implementation that uses only the application to
get more speed, but not it doesn’t belong at the domain of the problem. This is the main reason why it is
preferable that the ontology of the partitioning of the ontology of the domain are separated, keeping the
problem domain clean by the technical details.
10
It is made with:
If an ontology is not partitioned, the engine needs to continue on that what has in input.
With the availability of the source KBEFE1Ontology.java is possible to change (add or remove) these
parameters but it must be kept in mind that two parameters are mandatory for kbfe.jar.
2. With Informations:
If TXT it returns the infos preceded by “;”
Example ;Info1;Info2;Info3
Example:
<LIST>
<ITEM>
<ELEMENT-PROPERTY>KENAN</ELEMENT-PROPERTY>
< ELEMENT-PROPERTY>NotDel1-0</ELEMENT-PROPERTY>
</ITEM>
<ITEM>
<ELEMENT-PROPERTY>ATOM</ELEMENT-PROPERTY>
<ELEMENT-PROPERTY>NotDel1-OR:(action=2,time=1)+AND(all=1,pres=3)</ELEMENT-PROPERTY>
</ITEM>
</LIST>
In this example, the notification NotDel1 interested KENAN with no rules on notification NotDel1 (no 0) and
the notification should besent , however, while Atom is the rule that notification be made although one of
the fields of OR and All fields leaving.
NB: The rules and their syntax to be agreed with the system and to interpret. A rule may also be an XSLT
transformation returned.
ERRORS
The list of errors is:
a. “ERROR SENDER ABSENT”
b. “ERROR TID ABSENT”
c. “ERROR NAME ONTOLOGY ABSENT”
d. “ERROR NAME INDIVIDUAL ABSENT”
e. “ERROR SYSTEM NOT AVAILABLE” (il sistema sender non è configurato e quindi non è
autorizzato)
f. “ERROR INDIVIDUAL - NOT PERMISSION” (corrisponde a Ontologia non configurata come
da accettare)
g. “ERROR INDIVIDUAL NOT AVAILABLE OR JAVA GENERIC ERROR” (si verifica per un errore
Java e quindi è necessario analizzare il log per comprendere o è assente lo script di query
oppure la richiesta non è prevista)
h. ERROR INTERNAL UTF-8 (corrisponde ad una errata configurazione del KBFE oppure a
caratteri non supportati introdotti con Protegè, tipicamente i caratteri accentati)
12
i. ERROR PARAMETER (può verificarsi in diversi situazioni: è tracciato però sul log di KBFE il
motivo)
<LIST>
<ERROR>
<DESC>ERROR NAME ONTOLOGY ABSENT</DESC>
</ERROR>
</LIST>
SELECT ?a ?b ?c
WHERE
?a ?b ?c .
This will also identify the correct PREFIX necessary. It is also important to understand that if you want to
collect the information of DataProperty, it is essential that the design is on Protege queries, which are
closely related. For example: we Protege on the Individual ATOM, which has the Object Property
haSottoscrizioneANotifica NotB1
haSottoscrizioneANotifica NotDel1
then we should create two DataProperty as RULE (even if the rules do not exist for NotB1)
NotB1-0
NotDel1-AND(action=2,fact=1), OR(all=3,istance=4,time=12)
At this point, if we find all systems that have subscribed to the notification NotDel1 and their associated
rules, we will make a script like this:
13
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?a ?b
WHERE
?a table:haSottoscrizioneANotifica table:NotDel1 .
?a table:RULES ?b .
The filter allows you to withdraw for a fact, only the rules relating NotDel1.
If you just want to know the list of affected systems to notify NotDel1 NotDel1.sparql the script should be
amended as follows:
SELECT ?xa
WHERE
?a table:haSottoscrizioneANotifica table:NotDel1 .
14
Important note:
KBFE as default uses 5 variables: a, b, c, d, e ; but you can configure max 26 variables for sparql on
KBFE.properties, from a to z [a-z]; they must write in lower case and in alphabetical order (a, then b, then c,
etc) [KBFE thinks as from 0 to 25 for the variables].
You must well configure PREFIX (as your ontology file contains) and FROM:
PREFIX table:<http://www.semanticweb.org/UniversityOntologies/MyOntology.owl#>
SELECT ?a
WHERE
{table:37509490 table:encripted_password ?b
FILTER regex(?b,"^-_SmquM~")
}.
{table:37509490 table:profile ?a
FILTER regex(?a,"^ATG:")
Simple Applications
Rules Engine
An example of Ontology is provided for systems subscribed to a reporter and interested in a list of
notifications.
The example shows the classification, Individuals (systems and Notifications) and the rules that the notifier
returns for that system compared to a notification. Ontology is Notifiche.owl.
The directory examples contains also the directory dbquery with examples of query about this problem.
The file KBE1Ontology.java is the main example of a WebServices which takes account of a sender, which
must be enabled in the configuration, and also requires substantial purpose of the keys to tracking:
BusinessID (optional) TransactionId (required) and MessageId (optional). The keys allow tracking of
whether or not particular requests were received from the notifier.
15
Cookbook
We can make a simple Autentication & Profiling User Server (sAPUS): the ontology contains Classes Person,
System. DataProperties contain username, encrypted_password, expiration_date and profile.
ObjectProperty isSubscidedTo links an Individual of Person with an Individual of System. The sAPUS returns
the profile of users for a system.
We can make a simple UDDI for Web Services: Ontology contains Classes WebServices, IpSystem. As
DataProperties the informations of binding, ObjectProperties isOn that links an Individual of WebService
with Individual of IPsystem.
Riferimenti
Protegè http://protege.stanford.edu/download/download.html
SPARQL http://www.w3.org/TR/rdf-sparql-query/
16