knowledge management through ontologies. web today: rich information source for human manipulation...

127
Knowledge Management through Ontologies

Upload: cesar-stoffer

Post on 15-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Management through

Ontologies

Page 2: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Web Today: Rich Information Source for Human Manipulation

/Interpretation

Human

Human

Page 3: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Web Tomorrow: Rich Information Source for Agent Manipulation /

Interpretation

Human

Agent

Agent

Page 4: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Semantic Web

Berners-Lee et al. [2001] envisioned Semantic Web.

“The Semantic Web is not a separate Web but an

extension of the current one, in which information is

given well-defined meaning, better enabling

computers and people to work in cooperation.”

Page 5: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Semantic Web :Single Stack Architecture

Berners-Lee et al. [2001]

Page 6: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

What is Ontology?

• Controlled vocabulary that describes objects and the relations between them.

Has grammar for using the vocabulary terms to express something meaningful.

Together with set of individual instances of classes constitutes a Knowledgebase.

Classes describe concepts in the domain.

Page 7: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontologies• Gruber [1993] defined ontology as “an explicit specification of a conceptualization”.

• Borst [1997] extended the Gruber’s definition in view of the reuse of ontologies as

“A formal specification of a shared conceptualization”.

• Arpirez [2000] combined the above two definitions to give the definition of ontology as

“A formal explicit specification of a shared conceptualization”

Page 8: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontologies

“An ontology is a formal, explicit specification of a shared conceptualization”

Abstract model and

simplified view of some

phenomenon in the world

that we want to represent

Concepts, properties

relations, constraints,

axioms, are explicitly

defined

Consensual KnowledgeMachine Readable

Page 9: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

XML• Allows users to define their own elements.• Primary purpose to help information

systems share structured data.• Clear, simple syntax and unambiguous

structure .• Offers many ways to check the quality of

document.• Basic syntax for one element is:• <el_name

attrname=“attr_value”>el_content</el_name>

Page 10: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF• Encoding knowledge for the semantic

web.

• Builds on existing XML and URI technologies.

• URIs used to identify resources and make statements about them.

• Statement consist of RDF triples.

Page 11: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF

• Machine-understandable information• Properties of WWW resources• Examples: resource discovery,

cataloging, content rating, intellectual property rights

• RDF statements specify the properties and values of Web resources

• RDF is encoded in XML

Page 12: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF Triple

[resource] [property] [value]

Department  has faculty

[subject] [predicate] [object]

Department has Faculty

Page 13: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF Tags• Defined triples can be encoded in RDF/XML.• RDF/XML syntax:

rdf:Description - define a Triple.rdf:about – define subject of triple.Properties are defined by their URI as tag using

xml namespace.Value of property tag can be plain/typed literal

or a resource.rdf:resource – defines value of a property if it is a

resource.rdf:datatype – defines data type of literals .

• Only for describing resources not for specifying the semantics

Page 14: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Web resources

• Real resources: anything named by an URL (HTML pages, email addresses, Telnet sessions)

• Proxy resources: electronic representations of Real World things (checking accounts, persons, books, workstations)

Page 15: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Properties

• The relationship between a Web resource and a value (which can be either a string or another resource)

• Properties of a book: author, title, publisher, copyright date, subject, length

• Properties of a bank check: account title, address, date, payee, amount, routing code, account number, check number, memo

Page 16: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF Terminology

• http://www.example.org/index.html has a creator whose value is John Smith

• the RDF terms for the various parts of the statement are:

• the subject is the URL http://www.example.org/index.html

• the predicate is the word "creator" • the object is the phrase "John Smith"

Page 17: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Machine Processable

• a system of machine-processable identifiers for identifying a subject, predicate, or object in a statement without any possibility of confusion with a similar-looking identifier - Uniform Resource Identifier (URI).

• a machine-processable language for representing these statements and exchanging them between machines - Extensible Markup Language (XML).

Page 18: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

The RDF Model

• how RDF uses URIs to make statements about resources :

• http://www.example.org/index.html has a creator whose value is John Smith could be represented by an RDF statement having:

• a subject http://www.example.org/index.html • a predicate http://purl.org/dc/elements/1.1/creator • and an object http://www.example.org/staffid/85740

Page 19: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Advantages of using URIrefs

• The identification of the statement's subject can be more precise

• Since there is a URIref to refer to John Smith, he is a full-fledged resource, and additional information can be recorded about him, simply by adding additional RDF statements with John's URIref as the subject

Page 20: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF's Graph Model

• Fundamental to RDF is the Graph Model of the statements • A statement is represented by:

– a node for the subject – a node for the object – an arc for the predicate, directed from the subject node to

the object node

Page 21: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF's Graph Model

• Objects in RDF statements may be either URIrefs, or constant values (called literals)

• Literals may not be used as subjects or predicates in RDF statements.

Page 22: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Alternative to Graph- Triples• Each statement in the graph is written as a simple triple of

subject, predicate, and object, in that order.• Each triple corresponds to a single arc in the graph, complete

with the arc's beginning and ending nodes Triples for Previous Graph:<http://www.example.org/index.html> <http://purl.org/dc/elements/1.1/creator> <http://www.example.org/staffid/85740> .

<http://www.example.org/index.html> <http://www.example.org/terms/creation-date> "August 16, 1999" .

<http://www.example.org/index.html> <http://purl.org/dc/elements/1.1/language> "en"

Page 23: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Structured Property Values

Page 24: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Typed Literals

• so far, all constant values that serve as objects in RDF statements have been represented by plain (untyped) literals, even when the intent is probably for the value of the property to be a number (e.g., the value of a year or age property) or some other kind of more specialized value.

Page 25: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

• In RDF, typed literals are used to provide this kind of information.

• An RDF typed literal is formed by pairing a string with a URIref that identifies a particular datatype

• <http://www.example.org/staffid/85740> <http://www.example.org/terms/age> "27"^^<http://www.w3.org/2001/XMLSchema#integer> . Or

• exstaff:85740 exterms:age "27"^^xsd:integer .

Page 26: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

• RDF has no built-in set of datatypes of its own, such as datatypes for integers, reals, strings, or dates.

• Instead, RDF typed literals simply provide a way to explicitly indicate, for a given literal, what datatype should be used to interpret it.

• The datatypes used in typed literals are defined externally to RDF, and identified by their datatype URIs.

• There is one exception: RDF defines a built-in datatype with the URIref rdf:XMLLiteral to represent XML content as a literal value

Page 27: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDF/XML<?xml version="1.0"?><rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exterms="http://www.example.org/terms/"> <rdf:Description rdf:about="http://www.example.org/index.html">

<exterms:creation-date rdf:datatype= http://www.w3.org/2001/XMLSchema#date >1999-08-16 </exterms:creation-date>

<exterms:editor rdf:nodeID="abc"/> </rdf:Description><rdf:Description rdf:nodeID="abc">

…</rdf:Description>

</rdf:RDF>

Page 28: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

28

RDF Namespaces

• RDF namespace uses “rdf” prefix by convention

• RDF Schema namespace uses “rdfs” prefix by convention

• Properties are declared in other namespaces, so they are Web-unique

Page 29: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Other RDF Tagsxml:base="http://www.example.com/2002/04/products">

<rdf:Description rdf:ID="item10245"> <rdf:type rdf:resource="http://www.example.com/terms/Tent"/>

…</rdf:Description>

Rdf:type - can also be implied by using a special element instead of a Description element like

<exterms:Tent rdf:ID="item10245">

Page 30: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

30

Attributes instead of elements

A property/value pair can be expressed as an attribute instead of a sub-element if:

• The value is a string• There is only one value for the

property<rdf:Description rdf:ID=“John_Cowan” email=“[email protected]”> <xx:homepage resource=“...”/></rdf:Description>

Page 31: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

31

Nested descriptions

• When a value is a proxy resource, it may be placed inside the property element

<rdf:Description about=“...”> <xx:author> <rdf:Description rdf:ID=“John_Cowan”> .. </rdf:Description> </xx:author></rdf:Description>

Page 32: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

32

Containers

• Proxy resources that hold one or more values (Web resources or strings)

• Bag: a simple collection with no ordering• Seq: a collection with implicit ordering• Alt: a set of alternatives (first one

preferred)• Elements are properties named _1, _2, _3,

etc.

Page 33: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

33

Container examples

• Bag: committee members, documents in a folder

• Seq: chapters in a book, items in an agenda

• Alt: document home and mirrors, translations of a document

Page 34: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

34

A Bag, the hard way

<rdf:Description ID=“committee”> <rdf:type resource=“http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag”/>

<rdf:_1>Jack Robinson</rdf:_1> <rdf:_2>John Doe</rdf:_2> <rdf:_3>Richard Roe</rdf:_3></rdf:Description>

Page 35: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

35

A Bag, the easy way

<rdf:Bag ID=“committee”> <rdf:li>Jack Robinson</rdf:li> <rdf:li>John Doe</rdf:li> <rdf:li>Richard Roe</rdf:li></rdf:Bag>

• Using an “rdf:Bag” element means the value of “type” is “http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag”

Page 36: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Collections

• Container limitation – no way to close them• describe groups containing only the specified

members by RDF collections

Page 37: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Collection<rdf:Description rdf:about="http://example.org/courses/6.001"><s:students rdf:parseType="Collection">

<rdf:Description rdf:about="http://example.org/students/Amy "/>

<rdf:Description rdf:about="http://example.org/students/Mohamed"/>

<rdf:Description rdf:about="http://example.org/students/Johann"/></s:students>

</rdf:Description>

Page 38: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

38

Reified statements

• We reify statements so that we can talk about them rather than asserting them

• “Charles Dickens is the author of Bleak House” asserts a property of Charles Dickens

• “Jack believes that Charles Dickens is the author of War and Peace” asserts a property of Jack, not Charles Dickens

Page 39: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

39

Reification properties

<rdf:Description about=“...”> <xx:creator>Charles Dickens</xx:creator></rdf:Description>

reifies as:<rdf:Statement> <rdf:subject resource=“...”/> <rdf:predicate resource=“...#creator/> <rdf:object>Charles Dickens</rdf:object></rdf:Statement>

Page 40: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

40

RDF Schemas

• provides a type system for RDF • Are expressed in RDF• Are not to be confused with XML

Schemas (eventual DTD replacements)

Page 41: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDFSDescribe groups of related RDF resources

and the relationships between themDefines allowable properties that can be

assigned to RDF resourcesAllows creating classes of resources that

share common propertiesResources defined as instances of classesClass is a resource Any class can be a subclass of another

41

Page 42: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

42

RDF Classes

• Are groups/categories of Web resources• Have URIs to identify them• The special class “rdfs:Literal” consists of

all possible RDF string values• In typical, each class specifies completely

what properties it has and what their types are

• In RDF classes, each property specifies what classes of subjects and objects it relates

• Therefore, new properties can be added to a class without modifying the class

Page 43: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

43

Specifying Classes and Properties

• To specify a class, create an RDF resource of type rdfs:Class

• To specify a property, create an RDF resource of type rdfs:Property

Page 44: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

<rdfs:Class rdf:ID="Person"/><rdf:Property rdf:ID="registeredTo"> <rdfs:domain rdf:resource="#MotorVehicle"/>

<rdfs:range rdf:resource="#Person"/> </rdf:Property>

<rdf:Property rdf:ID="rearSeatLegRoom"> <rdfs:domain rdf:resource="#PassengerVehicle"/> <rdfs:range rdf:resource="&xsd;integer"/> </rdf:Property>

<rdfs:Datatype rdf:about="&xsd;integer"/>

Page 45: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

45

Useful properties

• “rdf:type” relates any resource to its class

• “rdfs:subClassOf” relates a subclass to its superclass (multiple inheritance is OK)

• “rdfs:subPropertyOf” relates a subproperty to its superproperty

Page 46: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

46

Useful properties

• “rdfs:seeAlso” relates a resource to another resource explaining it (use a subproperty to specify the nature of the explanation)

• “rdfs:isDefinedBy” is a subproperty of “rdfs:seeAlso” and relates a resource to its definition, typically an RDF schema

Page 47: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

47

Useful properties

• “rdfs:domain” specifies the domain of a property (the classes of its subjects); if unknown, anything can be a subject

• “rdfs:range” specifies the range of a property (the single class of its objects); if unknown, anything can be an object

Page 48: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

48

Useful properties

• “rdf:subject” is the property relating a reified statement to its subject (resource)

• “rdf:predicate” is the property relating a reified statement to its predicate (property)

• “rdf:object” is the property relating a reified statement to its object (value)

Page 49: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

49

Useful properties

• “rdfs:label” specifies a human-readable name for this Class, Property,etc.

• “rdfs:comment” specifies human-readable documentation

• Multiple values are useful for specifying multiple languages

Page 50: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

50

Useful classes

• “rdfs:Resource” is the class of all resources

• “rdfs:Literal” is the class of all strings• “rdfs:Class” is the class of all classes• “rdfs:Property” is the class of all

properties• “rdf:Statement” is the class of all

asserted RDF statements

Page 51: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

51

Useful classes

• “rdfs:Container” is the superclass of all container classes

• “rdf:Bag”, “rdf:Seq”, “rdf:Alt” are the classes of Bags, Seqs, and Alts

• (Any other class that is a subclass of “rdfs:Container” can be used in RDF syntax in place of a standard container)

Page 52: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

RDFSRDFS tags:

rdfs:Class : define a class in RDFS.rdfs:subClassOf : assign a class its

parent class.rdf:Property :define a property .rdfs:subPropertyOf : assign a property

its parent property.rdfs:domain and rdfs:range : schema

properties to describe application specific properties.

rdfs:Resource : RDFS defines all the classes as subclass of this class

52

Page 53: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Web Ontology Language (OWL)

Builds upon RDF and RDFSUses XML to indicate hierarchies and

relationships between different resourcesHas three sub languages: OWL Lite, OWL

DL, and OWL Full

Page 54: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Need for OWL over RDFSClasses can be defined as Boolean

combinations of other classes .

It can be stated that the two classes (with different URI) are same.

Cardinality restrictions can be specified for properties.

It can be specified that a property is transitive, symmetric, Functional, inverseOf, or InverseFunctional Property.

Page 55: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Protégé• Free, open-source platform which provides tools to

construct domain models and knowledge-based

applications .

• Supports the creation, visualization, and

manipulation of ontologies .

• Protégé-OWL is tightly integrated with Jena.

Page 56: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Protégé•Protégé platform supports two main ways of

modeling ontologies.

•The Protégé-Frames editor enables users to build and populate ontologies that are. frame-based.

•The Protégé–OWL editor enables users to build ontologies for the Semantic Web in particular in the W3C's Web Ontology Language (OWL).

Page 57: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

ProtégéThe Protégé-OWL editor enables users to:

Load and save OWL and RDF ontologies.

Edit and visualize classes, properties, and

restrictions .

Define logical class characteristics as OWL

expressions.

Edit OWL individuals.

Page 58: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Crop Ontology

Crop Ontology is the Knowledgebase of the presented Expert System.

It contains various classes, properties, restrictions and individuals related to

Crop Names

Varieties

58

Page 59: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Window showing class hierarchy

Page 60: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

CROP Ontology…class and sub - class

Class is simply a name and collection of properties that describe a set of individuals and individuals are the members of those sets.

60

Page 61: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Creating a subclass ( Cereals ) of owl:Thing.

Page 62: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Crop Ontology…properties

Properties, assert general facts about the members of classes

and specific facts about individuals.

Datatype properties: relations between instances of classes and

RDF literals and XML Schema datatypes (like xsd:integer,

xsd:string etc.).

Object properties: relations between instances of two classes.

To restrict the relationship between classes or between classes

and RDF literals the domain and range can be specified for

the property. 62

Page 63: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Window showing Data Property

Page 64: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

All the Object properties defined for crop ontology

Page 65: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Window showing object properties

Page 66: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontology…properties

Fig 4. An Example of Datatype Property66

Page 67: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontology…properties

Fig 3. An Example of Object Property 67

Page 68: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Crop Ontology…

68

Page 69: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Crop Ontology…individuals

• An individual is introduced by declaring it to be a member of a class. Individuals have properties of their class.

Fig 2. Individuals of class Variety in Crop Ontology69

These are all individuals of class Variety

Page 70: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Crop Ontology…

Common Classes with Individuals for Variety Selection

• Sequence (3)

• Tree (3)

• Question (15)

• Crops

• Cereals

• Maize (1)

• Picture (361)

70

Page 71: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Crop Ontology…

Classes with Individuals for Variety Selection

• Variety (39)

• Location

• State (29)

• Other_locations (8)

• Union_Territories (7)

• Grain_type (4)

• Grain_color (4)

• Maturity_type (4)

71

Page 72: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

SPARQL

SPARQL is a recursive acronym stands for SPARQL Protocol and RDF Query Language.

SPARQL is a syntactically-SQL-like language for querying RDF graphs.

It provides facilities to: extract information in the form of URIs,

blank nodes, plain and typed literals. extract RDF sub-graphs. construct new RDF graphs based on

information in the queried graphs. 72

Page 73: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

SPARQL Query

SPARQL query to find the orders in soil ontology is:

SELECT ?order

WHERE {?order rdfs:subClassOf :Order }

SELECT clause identifies the variables to appear in the query results, and the WHERE clause provides the basic graph pattern to match against the data graph.

73

Page 74: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Other QueriesSL No.

Query SPARQL Syntax Result

1Find the sequence or sequences under the class tree.

SELECT ?tree WHERE {?tree :has_sequence ?sequence. ?tree :has_language "english"}

Disease_diagnosisVariety_SelectionPest_Identification

2Find the number of questions in pest_sequence.

SELECT ?num ?sequence WHERE{:Pest_Identification :has_sequence ?sequence. ?sequence :no_of_ques ?num}

5

3

Find out the parts that the flowering Stage of maize has.

SELECT distinct ?Parts_AffectedWHERE { ?probable_pest :attacks:Maize.:Maize :has_stage:Flowering.:Flowering:hasParts?Parts_Affected.?Parts_Affected :has_language "english".}

StemsLeavesStalkRootEar

74

Page 75: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Adding restrictions for class diseases

Page 76: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Creating an individual of class Nematodes

Page 77: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

JENA• Java framework for building Semantic

Web applications.

• It provides a programmatic environment

for RDF, RDFS and OWL, including a rule-

based inference engine.

• An ontology model is an extension of the

Jena RDF model.

Page 78: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

JENA Interface• Model: a set of statements.

• Statement: a triple of {R,P,O}.

• Resource: subject, URI.

• Property: “characterstic” of resource.

• Object: may be a resource or a literal.

• Literal: non-nested “object”.

• Container: special resource, collection of things.

Page 79: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

JENA APIClass : ModelFactoryPackage: com.hp.hpl.jena.rdf.modelpublic class ModelFactory extends

ModelFactoryBaseMethods:

1. Model createDefaultModel () Answer a fresh Model with the default specification

and Standard reification style.

Page 80: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

2. Model read(java.lang.String url, java.lang.String base, java.lang.String lang)

Read into this model the RDF at url, using baseURI as the base URI if it is non-null.

3.createMemModelMaker() Answer a ModelMaker that constructs memory-based Models that do not persist past JVM termination

Page 81: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Class : QueryPackage: com.hp.hpl.jena.rdql.Query

public class Query extends java.lang.ObjectThe data structure for a query. Once a query is

built, it can be passed to a query engine.Methods:

1.Void setSource(Model m)     The data target for the query as a Jena model. 2. QueryResults exec()

Executes a query.

Page 82: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Interface : QueryExecutionPacakage: com.hp.hpl.jena.rdql

Interface for query execution engines. The normal sequence is: QueryExecution qe = new .... ;qe.init() ; QueryResults qres = qe.exec() ; .... qres.close() ; qe.end() ;  Methods:

execSelect() Execute a SELECT query.

Page 83: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Interface: QueryResultsPackage: com.hp.hpl.jena.rdql

public interface QueryResults extends java.util.IteratorResults from a query in a "ResultSet"-like manner. Each row corresponds to a set of bindings which fulfillthe conditions of the query. Access to the results is by variable name. Method:Void close()

Close the results iterator and stop query evaluation as soon as convenient.

Page 84: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Class : QueryFactoryPackage: com.hp.hpl.jena.query.QueryFactory

public class QueryFactory extends java.lang.Object

Method :create (java.lang.String queryString) Create a SPARQL query from the given string by calling the parser.

Page 85: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Class : QueryExecutionFactoryPackage:com.hp.hpl.jena.query.QueryExecutionFactory

public class QueryExecutionFactory extendsjava.lang.Object Place to make QueryExecution objects from Query objects or a string.

Method :create (java.lang.String queryStr,

com.hp.hpl.jena.rdf.model.Model model) Create a QueryExecution to execute over the Model.

Page 86: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Comparing Reasoners

Page 87: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

FaCT• Implements DIG Interface which prescribes a

simple communication protocol through the exchange of XML requests and responses over HTTP.

• FaCT implements optimized complete and sound algorithms to solve the subsumption problem in the DL.

• FaCT’s lack of support for inference in the ABox renders it inappropriate for OWL.

• Besides the lack of support for ABox and data types, the system is also syntactically incompatible with OWL.

Page 88: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

FaCT++• It is a re-implementation of FaCT in C++,

featuring however greater expressivity, aiming ultimately to support OWL DL.

• Full support for concrete domains is added.

• FaCT++ document version could only run in Linux and provides no communication

interface with other applications.

Page 89: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Racer• Inference engine for very expressive DLs.

• First system in its category to support reasoning in ABox as well as TBox.

• Process ontology written in XML, RDF, RDFS, DAML+OIL and OWL.

• Deals with the main problem that prevents

full compatibility with OWL DL.

• RACER deals with nominals by creating a new concept for each of them.

Page 90: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Pellet• Pellet has been the first reasoner to

support all of OWL-DL.

• It offers panoply of features including conjunctive query answering, rule support etc.

• Pellet seems to be closer to the expressiveness needed by the OBES.

Page 91: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Pellet as an OWL-DL Reasoner • A complete and capable OWL-DL Reasoner with

acceptable to very good performance.

• It is the first implementation of the full decision procedure for OWL-DL (including Instances)

• Queries about instances that are written in languages such as RDQL or SPARQL.

• Pellet also implements the reasoner interfaces defined in those toolkits to answer queries.

• Pellet includes different sub modules that can load ontologies from these different representations.

Page 92: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

KM Tool for Development of Online Expert Systems for Crops

Sudeep Marwaha, Hari Om Agarwal, Pal Singh, V.K. Yadav

Page 93: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Introduction AgriDaksh is an online tool for developing crop based expert systems. It provides information and expert advice to the farmers and extension workers at Krishi Vigyan Kendra’ s according to their needs & available resources. For example: - •On the basis of symptoms supplied by the farmer, diseases affecting the crop can be detected •According to the geographical locations or climate, best variety can be suggested etc.

Page 94: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontology Based Expert System

• In earlier systems, a vast amount of knowledge was stored in the knowledgebase as rules.

• Rules were extracted manually and stored in the expert system.

• In our OBES, domain knowledge is stored in ontology, which is easy to create using available GUI editors.

Page 95: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

N-tier Architecture of OBESUSER INTERFACE

(Web Browser)

WEB SERVER

JSP (Web Container)

Internet

OWL

PELLET

JENA

KNOWL-EDGE BASE

KNOWL-EDGE BASE

LOGIN INFORMAT-

ION

LOGIN INFORMAT-

ION

DATABASE SERVER

Page 96: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

OBES contd..• OBES have the advantage of distributive

development and maintaining of knowledgebase over traditional expert systems.

• The application has been implemented in Java and Java Server Pages (JSP).

• The application allows users to: Classify the crop ontology and checking its Consistency.

Page 97: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Disease Diagnosis module

Page 98: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Structure of an Expert System

USER

Knowledge Acquisition

Knowledgebase

Inference Engine

Explanatory Interface

EXPERTDatabases

Page 99: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Acquisition Process

Knowledge Engineer

Text Books

Domain ExpertKnowledge-base

Research

Findings

Knowledge, Concepts, Solutions

Structured Knowledge

Technical & Extension Bulletins

Facts

Data, Problems, Questions

Page 100: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

N-Tier System Architecture

ClientClient

Request

Response

Web ServerApplication Server

JSP JENA

Knowledgebase

JESS

Page 101: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

N-Tier System ArchitectureSoftware Requirements

At Server Side• Net Beans IDE 6.0 onwards• Server – Tomcat 5.0 onwards or Glassfish Application Server• Back End – SQL Server 5.0 onwards• Browser – Internet Explorer 6.0 or above, Firefox etc.• Protégé / WebProtégé • JENA API• JESS API

At Client Side• Any O.S.• Any Browser, full compatibility with Internet Explorer 6.0 or

above

Page 102: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

N-Tier System Architecture

Hardware Requirements

At Server Side• A server class machine with windows/Unix/Linux O.S. as

a web server.• A server class machine with SQL Server 2005 or above at

windows 2003 Server or above• Suitable backup mechanism

At Client Side

• A desktop machine / laptop / mobile with GPRS (General Packet Radio Service) capability

• RAM – 256 MB or above

Page 103: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

N-Tier SYSTEM ARCHITECTURE

Application Logic Layer 

• Java Server Pages (JSP)• Java Servlets• JDBC• Java Bean• Java Expert System Shell (JESS)• JENA

Page 104: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

AgriDaksh Features• One system for all crops with ability to create

knowledge models for new crops• Location specific variety information with the ability

to add multiple pictures for each variety• Comprehensive plant protection sub module with

– Diseases – Insects– Weeds– Nematodes – Physiological disorders

Page 105: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

• Ability for domain experts to define problems and create decision trees to solve the problems

• Ontology based diseases and insects identification and variety selection

• Ability to add static web pages• Powerful administrative module • Full featured online help• Semantic Web compliant• Built on robust, platform independent Java

technology using n-tier web architecture

AgriDaksh Features

Page 106: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

AgriDaksh ModulesKeeping in mind the user friendliness, AgriDakshhas been designed in the following modules:• Knowledge Model Creation• Knowledge Acquisition• Problem Identification• Knowledge Retrieval• Ask Questions to Experts• Administration

Page 107: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Maize AgriDaksh

– Collaborated with Directorate of Maize Research

– DMR Scientists are domain experts

– AgriDaksh is a base technology

Page 108: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Home Page

Page 109: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Model Creation

• First step for building an expert system of a crop through AgriDaksh is to build its knowledge model.

• Knowledge model can be build by selecting the desired attributes from the Attributes List and moving them to Selected Attribute List.

• Once, the desired attributes are chosen, domain experts can enter the values of these attributes for each and every variety of the crop.

Page 110: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Model Creation

Selected AttributesAttributes

Page 111: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge AcquisitionKnowledge Acquisition module is used for entering knowledge about various entities such as

• Crop varieties, • Diseases, • Insect-pests, • Weeds, • Nematodes, • Physiological disorders • Post harvest technology.

Page 112: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Acquisition – Variety Management

Page 113: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Problem IdentificationThis module has two sub modules:

Rule based problem identificationFirst sub module allows the domain experts to define the problem and develop decision tree to solve the problem. Once the tree is developed, farmers can get the solution about the problem in their situation.

Ontology based problem identificationThe second sub module allows the farmers to identify the diseases and insects affecting their crops as well as select varieties according to their location and conditions.

Page 114: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 115: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 116: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 117: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 118: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 119: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 120: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human
Page 121: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontology based Problem Identification

Page 122: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ontology based Problem Identification

Page 123: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Retrieval

Knowledge Retrieval module is the most important module as far as farmers are concerned.

Through this module, a farmer can get information about each and every thing that domain experts have enterede.g., plant protection sub module allows farmers to

retrieve knowledge about diseases, insects, weeds, nematodes and physiological disorders.

Page 124: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Knowledge Retrieval

Page 125: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Ask Questions to Experts

• Using this module a farmer can ask question directly to domain experts.

• The system transfers the question to relevant domain experts and sends answer to the farmer thorough email.

• The same is displayed in the system for the benefit of other farmers.

Page 126: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Administration

• This module is for the administrator for controlling the overall functionality of the system.

• Using this module administrator can create different type of users such as end users, domain experts, domain expert validators, and crop administrator.

• One can add a new crop and assign a crop administrator for that crop.

Page 127: Knowledge Management through Ontologies. Web Today: Rich Information Source for Human Manipulation /Interpretation Human

Thank you!