language (formalisms) for ontology building

44
Language (Formalisms) For Ontology Building Neda Alipanah 22 October 2012

Upload: miranda-roach

Post on 02-Jan-2016

28 views

Category:

Documents


1 download

DESCRIPTION

Language (Formalisms) For Ontology Building. Neda Alipanah 22 October 2012. Content. Why Ontologies ? Machine Process able Knowledge Knowledge Exchange Big Data Relevant Technologies Layered Architecture Building Tools and Visualization Ontology Application Information Integration - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Language (Formalisms) For Ontology Building

Language (Formalisms) For Ontology Building

Neda Alipanah22 October 2012

Page 2: Language (Formalisms) For Ontology Building

ContentWhy Ontologies?

Machine Process able Knowledge Knowledge Exchange Big Data

Relevant Technologies Layered Architecture Building Tools and Visualization

Ontology Application Information Integration Web Database Management Web Services

Page 3: Language (Formalisms) For Ontology Building

Why Ontologies? 1. Machine readable and understandable

process of data

2. Consistent Knowledge Presentation for Enterprise application integration (Knowledge Exchange)

3. Nodes and links that essentially form a very large database with specific rules

Page 4: Language (Formalisms) For Ontology Building

Why Ontologies? 1. Machine readable and understandable process of

data

John Smith is Assistant

Professor of Computer Science in University of X.

He is teaching several courses including Course

A, B, C.

Assistant

Professor

John Smith

University X

Page 5: Language (Formalisms) For Ontology Building

Why Ontologies? 2. Consistent Knowledge Presentation for

Enterprise application integration (Knowledge Exchange)

Disease

PatientSymptom

s

Address

Page 6: Language (Formalisms) For Ontology Building

Why Ontologies? 3. Nodes and links that essentially form a very

large database with specific rules. Database capture the data and relations (Entity Relations) but not the semantic and rules

Concept 1 is reverse of Concept 2. Concept 2 is subclass of Concept 3. Concept 100 has isA relation with Concept 2000 and is reverse of Concept 500.

Disease

PatientSymptom

s

Address

Page 7: Language (Formalisms) For Ontology Building

ContentWhy Ontologies?

Machine Process able Knowledge Knowledge Exchange Big Data

Relevant Technologies Layered Architecture Building Tools and Visualization

Ontology Application Information Integration Web Database Management Web Services

Page 8: Language (Formalisms) For Ontology Building

Technologies- Layered Architecture

Tim Berners Lee Architecture

XML/XML Schemas

RDF/Ontologies

Rules/Query

Logic, Proof and TrustTRUST

OtherServices

URI/UNICODE

PRIVACY

Page 9: Language (Formalisms) For Ontology Building

Technologies- Layered Architecture

URI (Uniform Resource Identifiers): ◦ Simple and Extensible means for Identifying a Resource◦ Universal Resource Identifiers in WWW◦ Example http://www.nih.gov/

http://www.ncbi.nlm.nih.gov/gap

http://www.ucsd.edu

http://www.semanticwe

b/JohnSmith

Page 10: Language (Formalisms) For Ontology Building

What is XML about?XML= eXtensible Markup Language by

the W3C (World Wide Web Consortium)Transport and Store Data (Structured

Knowledge)Key to XML is Document Type

Definitions (DTDs)◦Defines the role of each element of text in a

formal modelCompound Documents(Multiple files)

Page 11: Language (Formalisms) For Ontology Building

XML Example

Patents

Funds

Year: 2002

Name: U. Of X

ExpensesName:BioInformatics titleAuthorID

Asset report

Assets

Dept

Equipment

news

Patent

Other assets

Grants

Contracts

Page 12: Language (Formalisms) For Ontology Building

XML File Example<Professor credID=“9” subID = “16: CIssuer = “2”>

<name> Alice Brown </name><university> University of X <university/><department> CS </department><research-group> BioInformatics</research-

group></Professor>

<Secretary credID=“12” subID = “4: CIssuer = “2”><name> John James </name><university> University of X <university/><department> BioInformatics </department><level> Senior </level>

</Secretary>

Page 13: Language (Formalisms) For Ontology Building

Technologies- Layered Architecture

Tim Berners Lee Architecture

XML/XML Schemas

RDF/OWL Ontologies

Rules/Query

Logic, Proof and TrustTRUST

OtherServices

URI/UNICODE

PRIVACY

Page 14: Language (Formalisms) For Ontology Building

RDFRDF = Resource Description FrameworkAdds semantics with the use of ontologies,

XML syntax

RDF Concepts◦ Basic Model

Resources, Properties and Statements

◦ Container Model Bag, Sequence and Alternative

Page 15: Language (Formalisms) For Ontology Building

RDFRDF/RDFS Elements

◦ Class (School, Department, Person) Rdfs:SubClassOf

◦ Properties (Works) Rdfs:SubPropertiesOf

◦ Domain and Range of Property Rdfs: domain (School) Rdfs: range (Person)

School

Department

SubClass

Person

Works

Page 16: Language (Formalisms) For Ontology Building

RDF vs. XML Views

<product><title>iPhone</title><price>$200</price>

</product>

<product title=”iPhone”>

<price>$200</price></product>

An iPhone is a Product that has a price of $200″

XML Views<owl:Class rdf:about="&OntTeaching;Product"/><owl:NamedIndividual

rdf:about="&OntTeaching;Product1"> <rdf:type rdf:resource="&OntTeaching;Product"/>

<rdfs:label

rdf:datatype="&xsd;Name">iPhone</rdfs:label> <price rdf:datatype="&xsd;decimal">200</price>

</owl:NamedIndividual>

OntTeaching:product1 rdf:type OntTeaching:Product OntTeaching:product1 OntTeaching:title “iPhone”

OntTeaching:product1 price “200″RDF View

Page 17: Language (Formalisms) For Ontology Building

OWL Web Ontology LanguageOWL: Semantic Markup Language for

Publishing/Sharing Ontologies Enumeration on Classes<owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Europe"/> <owl:Thing rdf:about="#Africa"/> <owl:Thing rdf:about="#NorthAmerica"/> <owl:Thing rdf:about="#SouthAmerica"/> <owl:Thing rdf:about="#Australia"/> <owl:Thing rdf:about="#Antarctica"/> </owl:oneOf> </owl:Class>

Page 18: Language (Formalisms) For Ontology Building

OWL Web Ontology LanguageOWL

◦Value Constraints OWL:ALLVALUESFROM OWL:SOMEVALUESFROM OWL:HASVALUE

<owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:someValuesFrom rdf:resource="#Physician" /> </owl:Restriction>

<owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /><owl:hasValue rdf:resource="#Clinton" /></owl:Restriction>

Page 19: Language (Formalisms) For Ontology Building

OWL Web Ontology Language

OWL: Cardinality constraints OWL:MAXCARDINALITY OWL:MINCARDINALITY  OWL:CARDINALITY

<owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:cardinality> </owl:Restriction>

Page 20: Language (Formalisms) For Ontology Building

OWL Web Ontology Language

OWL: Intersection, union and complement  OWL:INTERSECTIONOF OWL:UNIONOF OWL:COMPLEMENTOF

Not Meat

<owl:Class> <owl:complementOf> <owl:Class rdf:about="#Meat"/> </owl:complementOf> </owl:Class>

<owl:Class><owl:unionOf rdf:parseType="Collection"> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Tosca" /> <owl:Thing rdf:about="#Salome" /> </owl:oneOf> </owl:Class> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Turandot" /> <owl:Thing rdf:about="#Tosca" /> </owl:oneOf> </owl:Class> </owl:unionOf> </owl:Class>

Page 21: Language (Formalisms) For Ontology Building

OWL Web Ontology Language

OWL: Equivalent Class, Disjoint Class

<owl:Class rdf:about="#Man"> <owl:disjointWith rdf:resource="#Woman"/> </owl:Class>

<owl:Class rdf:about="#DaPonteOperaOfMozart"> <owl:equivalentClass> <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Restriction> <owl:onProperty rdf:resource="#hasComposer"/> <owl:hasValue rdf:resource="#Wolfgang_Amadeus_Mozart"/></owl:Restriction> <owl:Restriction> <owl:onProperty rdf:resource="#hasLibrettist"/> <owl:hasValue rdf:resource="#Lorenzo_Da_Ponte"/> </owl:Restriction> </owl:intersectionOf></owl:Class> </owl:equivalentClass> </owl:Class>

Page 22: Language (Formalisms) For Ontology Building

How to Build OWL/RDF files?Do we need to remember all the

OWL language syntax?How to do it easy to use and

remember?

Page 23: Language (Formalisms) For Ontology Building

ContentWhy Ontologies?

Machine Process able Knowledge Knowledge Exchange Big Data

Relevant Technologies Layered Architecture Building Tools and Visualization

Ontology Application Information Integration Web Database Management Web Services

Page 24: Language (Formalisms) For Ontology Building

How to Build RDF/OWL files?Different Building and

Visualization Tools◦Protégé, http://protege.stanford.edu/◦Gruff,

http://www.franz.com/agraph/gruff/(Download version 3.3)

Using Programming Languages◦Java and Jena API◦http://jena.apache.org/ ◦http://jena.sourceforge.net/tutorial/RD

F_API/

Page 25: Language (Formalisms) For Ontology Building

Protégé Tool- Open Source Ontology Editor Class Creation

Page 26: Language (Formalisms) For Ontology Building

Protégé Tool- Open Source Ontology Editor Property (Object/Data properties)

Page 27: Language (Formalisms) For Ontology Building

Protégé Tool- Open Source Ontology Editor Individual Creation

Page 28: Language (Formalisms) For Ontology Building

Gruff Tool- A Grapher-Based Triple-Store Browser for AllegroGraph1.What is triple Store?

<owl:Class rdf:about="&OntTeaching;Product"/><owl:NamedIndividual

rdf:about="&OntTeaching;Product1"> <rdf:type rdf:resource="&OntTeaching;Product"/>

<rdfs:label

rdf:datatype="&xsd;Name">iPhone</rdfs:label> <price rdf:datatype="&xsd;decimal">200</price>

</owl:NamedIndividual>

Subject Predicate ObjectOntTeaching:product1 rdf:type OntTeaching:Product

OntTeaching:product1 OntTeaching:title “iPhone” OntTeaching:product1 price “200″

Product

Product1

iPhone

200type

title price

Page 29: Language (Formalisms) For Ontology Building

Gruff Tool- A Grapher-Based Triple-Store Browser for AllegroGraph

1.Create a New Triple Store2.Choose a Path for the

Ontology3.Load Ontology4.Present the Ontology Triples5.Query the Triples

Page 30: Language (Formalisms) For Ontology Building

Gruff Tool- A Grapher-Based Triple-Store Browser for AllegroGraph

Page 31: Language (Formalisms) For Ontology Building

Gruff Tool- A Grapher-Based Triple-Store Browser for AllegroGraph

Page 32: Language (Formalisms) For Ontology Building

Gruff Tool- A Grapher-Based Triple-Store Browser for AllegroGraph

Page 33: Language (Formalisms) For Ontology Building

Programming with OntologiesJava + Jena APICollection of Tools and Java Libraries For Developing Linked-data Apps, Tools and

ServersStore Information in RDF Triples in Directed

GraphsAn Ontology API for Handling OWL and

RDFS OntologiesA Rule-based Inference Engine for

Reasoning with RDF and OWL data sourcesEfficient Storage of Triples on DiskA query engine compliant with the latest

SPARQL

Page 34: Language (Formalisms) For Ontology Building

Ontology Building using Jena

http://www.semanticweb.org/ontologies/2012/9/OntTeaching.owl#Product1 http://www.w3.org/1999/02/22-rdf-

syntax-ns#type http://www.semanticweb.org/ontologies/2012/9/OntTeaching.owl#

Product

Product1 http://www.semanticweb.org/ontologies/2012/9/OntTeaching.owl#title

“iPhone”Product1 http://www.semanticweb.org/ontologies/iPhone.Owl#

price “200”

Triples

Ontology: iPhone.owl

Subject Predicate Object

Product

Product1

iPhone

200

typetitle

price

Page 35: Language (Formalisms) For Ontology Building

Ontology Building using JenaThe code to create this graph, or model, is simple:// some definitions static String productURI =

"http://www.semanticweb.org/ontologies/Product";

// create an empty Model Model model = ModelFactory.createDefaultModel();

// create the resource Resource product = model.createResource(productURI);

// add the property product.addProperty(title, ”iPhone”); product.addProperty(price, ”200”);

Page 36: Language (Formalisms) For Ontology Building

Jena How to read Ontology?

// list the statements in the ModelStmtIterator iter = model.listStatements();

// print out the predicate, subject and object of each statementwhile (iter.hasNext()) { Statement stmt = iter.nextStatement(); // get next statement Resource subject = stmt.getSubject(); // get the subject Property predicate = stmt.getPredicate(); // get the predicate RDFNode object = stmt.getObject(); // get the object

System.out.print(subject.toString()); System.out.print(" " + predicate.toString() + " "); if (object instanceof Resource) { System.out.print(object.toString()); } else { // object is a literal System.out.print(" \"" + object.toString() + "\""); }System.out.println(" .");}

Page 37: Language (Formalisms) For Ontology Building

SPARQL QueryQuery on Triples with Exact

Pattern Matching (Subject of query is Product1)

SELECT ?b ?c Where {

<http://www.semanticweb.org/ontologies/2012/9/OntTeaching.owl#Product1> ?b ?c

} Result

Page 38: Language (Formalisms) For Ontology Building

ContentWhy Ontologies?

Machine Process able Knowledge Knowledge Exchange Big Data

Relevant Technologies Layered Architecture Building Tools and Visualization

Ontology Application Information Integration Web Database Management Web Services

Page 39: Language (Formalisms) For Ontology Building

Ontology ApplicationsThe database of Genotypes and Phenotypes (dbGaP) is

archiving

the results of different Genome Wide Association Studies (GWAS).

• Phenotype variables are not harmonized across studies.

• Redundent phenotype identifiers for the same phenotype.

• dbGaP lacks semantic relations among its variables.• Search on phenotypes is inefficient and inaccurate .• Goal is to standardize dbGaP information to allow

accurate, reusable and quick retrieval of information

Page 40: Language (Formalisms) For Ontology Building

Ontology ApplicationsSeveral Available dbGAP Studies

id=”phv00122015”,

Description=”Age at time of Study”,

name=”age”,version=“1”,

Logical Max=”65”,

Logical Minimum=”18”,

unit=”Years”, type=”decimal”

id=”phv00122058”,

Description=”Age of patient at the time of Study”, name=”age”,version=“1”,

Logical Max=”90”,

Logical Minimum=”20”,

unit=”Years”, type=”decimal”

phs000284.v1.pht001901.v1.CFS_CARe_Sample.data_dict_2011_02_07

phs000284.v1.pht001903.v1.CFS_CARe_ECG.data_dict_2011_02_07

Page 41: Language (Formalisms) For Ontology Building

Ontology ApplicationsBuilding Information Model

(Ontology)

Individual

Age

id=”phv00122058”

id=”phv00122015”

Page 42: Language (Formalisms) For Ontology Building

Ontology ApplicationsInformation Retrieval and

Ranking PhenotypesQuery={Age of Subject}

Study Phenotype Variable

phs000284.v1.pht001901.v1.CFS_CARe_Sample.data_dict_2011_02_07

id=”phv00122058

phs000284.v1.pht001903.v1.CFS_CARe_ECG.data_dict_2011_02_07

id=”phv00122015”

Page 43: Language (Formalisms) For Ontology Building

ConclusionBenefits of Structured Data (XML,

OWL)Tools to Create and Visualize

OntologiesJena API for Building Ontologies Sparql Queries on OntologiesApplications uses Ontologies

Page 44: Language (Formalisms) For Ontology Building

ContactsNeda AlipanahDivision of Biomedical

Informatics9500 Gilman Dr., Bldg 2 #0203E

Email: [email protected]