• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ontology Aware Applications @ YAPC::EU 2012
 

Ontology Aware Applications @ YAPC::EU 2012

on

  • 2,456 views

 

Statistics

Views

Total Views
2,456
Views on SlideShare
2,456
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ontology Aware Applications @ YAPC::EU 2012 Ontology Aware Applications @ YAPC::EU 2012 Presentation Transcript

    • Ontology Aware Applications Nuno Carvalho Alberto Sim˜es o Jos´ Jo˜o Almeida e a<smash@cpan.org> <ambs@cpan.org> <jjoao@cpan.org> 20th August YAPC::EU 2012 20th August, 2012 YAPC::EU Ontology Aware Applications 1
    • Introduction ontologies can he used to store data create, query, manipulate, maintain, reason, ... build applications using ontologies to store information approaches for representing ontologies mechanisms to implement common operations keep programs efficient language-wise want to use all this with our favourite programming language to develop applicationsPerl × ontology −→ modern rich ontology aware applications 20th August, 2012 YAPC::EU Ontology Aware Applications 2
    • IntroductionMotivations ontology use is growing solutions based in this technology are growing Semantic Web, etc. ontologies are a good approach to store knowledge ontologies are easy to store, share, maintain, ... clear border between data and applications 20th August, 2012 YAPC::EU Ontology Aware Applications 3
    • Introduction: Ontology DefinitionOntology - Definition 1A sphere of thought or action; field, province, scope of adepartment of knowledge, etc. in Oxford English Dictionary, Second Edition 20th August, 2012 YAPC::EU Ontology Aware Applications 4
    • Introduction: Ontology DefinitionOntology - Definition 2A domain ontology is an engineered artifact that informally definesconcepts from a specific domain, representing and organizing themas conceptualizations which a set of systems working cooperativelywith each other agree to share. in Ontological Adaptive Integration Of Reverse Engineering Tools 20th August, 2012 YAPC::EU Ontology Aware Applications 5
    • Introduction: Ontology DefinitionOntology - Definition 3 O = (C , H, I , R, P, A)where: C: set of concepts (classes and instances) H: set of taxonomic relationships between concepts I: set of relationships between classes and its instances R: set of other relationships P: set of properties of ontology classes A: set of axioms in A Process for Extracting Non-Taxonomic Relationships of Ontologies from Text 20th August, 2012 YAPC::EU Ontology Aware Applications 6
    • Introduction: Ontology DefinitionOntologyA domain ontology is an engineered artifact that informally definesconcepts from a specific domain, representing and organizing themas conceptualizations which a set of systems working cooperativelywith each other agree to share. city -7.84 .. Vila Real DST LAT ISA LNG ISA 39.63 .. IN Chaves LAT Lisbon Portugal -7.47 .. LNG IN ISA 41.74 .. country terms relations 20th August, 2012 YAPC::EU Ontology Aware Applications 7
    • Ontology RepresentationSKOS Simple Knowledge Organization SystemsTopic Maps specification for representing the structure of information resourcesOWL Web Ontology Language family of languages for publishing and sharing ontologies on the World Wide Web 20th August, 2012 YAPC::EU Ontology Aware Applications 8
    • Ontology RepresentationISO 2778 simple representation formalization to represent thesaurus (and more) plain text, clean Biblio::ThesaurusFrankfurtCITY-OF GermanyISA cityLisbonCITY-OF PortugalISA city 20th August, 2012 YAPC::EU Ontology Aware Applications 9
    • Ontology ManipulationDomain Specific Language describe operations on ontologies expressive, powerful, yet simple rule based produce arbitrary side effects OML – Ontology Manipulation LanguageRules pattern => actions. 20th August, 2012 YAPC::EU Ontology Aware Applications 10
    • OML Syntax OverviewOML Program program → rule + rule → Pattern => Action .Pattern a pattern of information, terms and relations, that can be found once or more than once in the ontologyAction manipulate information in the ontology add, remove, terms or relations, ... produce any arbitrary user defined side effects produce graphs, images, HTML pages, update databases, ... 20th August, 2012 YAPC::EU Ontology Aware Applications 11
    • OML Patterns Examples # Pattern 1 term(Frankfurt) term Frankfurt exists 2 rel(ISA) relation ISA exists 3 term($t) for all terms 4 rel($r) for all relations 5 Frankfurt ISA city 6 $name ISA city 7 $name ISA $place 8 Frankfurt $rel $term for all related to Frankfurt 9 Frankfurt ISA city ∧ Germany ISA country 10 Frankfurt ISA city ∨ Germany ISA country 11 Chaves LAT $lat ∧ Chaves LNG $lng 20th August, 2012 YAPC::EU Ontology Aware Applications 12
    • OML Actions ExamplesManipulate Information add(Germany ISA country) del($place ISA city)Arbitrary Effectsub { $db->execute( ’INSERT INTO cities (name) VALUES ($city)’ );} 20th August, 2012 YAPC::EU Ontology Aware Applications 13
    • OML Rules Examples$city IN Germany ⇒ add($city IN Europe).$c ISA city ∧ $c IN Germany ⇒ add($c LANG German).$city ISA city ∧ $city ISA country ⇒ sub { print ”Warning: review $city ISA relation!” }. ;$name ISA city ∧ $name IN $country ⇒ sub {$db->execute( ’INSERT INTO cities (name,country) VALUES ($name,$country)’)}.$a $r $b ∧ $b $r $c ⇒ add($a $r $c).$a $r $b ∧ $b $r $c ∧ $a $r $c ⇒ rem($a $r $c). 20th August, 2012 YAPC::EU Ontology Aware Applications 14
    • OML Compiler20th August, 2012 YAPC::EU Ontology Aware Applications 15
    • Architecture Overview ontology program compiler result 20th August, 2012 YAPC::EU Ontology Aware Applications 16
    • Compiler Architecture Overview program parser ontology pTree expander diTree reactor result 20th August, 2012 YAPC::EU Ontology Aware Applications 17
    • Embedded OML20th August, 2012 YAPC::EU Ontology Aware Applications 18
    • Embedded OMLChallenge can applications and tools be written only in OML? actually yes, but do we want to? NO!Why? efficient for ontology processing real world applications require more HTML operations, databases, ... we want the best of both worlds OML for ontology aware tasks general purpose programming language for everything else 20th August, 2012 YAPC::EU Ontology Aware Applications 19
    • Embed OML in Perl Example#!/usr/bin/perluse Biblio::Thesaurus::ModRewrite::Embed;my $term = $ARGV[0];my $ontology = thesaurusLoad($ARGV[1]);OML printTerms(ontology,term) term $r $t => sub { print "term $r $t"; }. $t $r term => sub { print "$t $r term"; }.ENDOMLprintTerms($ontology, $term); 20th August, 2012 YAPC::EU Ontology Aware Applications 20
    • Embed OML InitialProgram ne e ut bi ec m lit ex id co sp Perl Perl Perl Perl Perl Perl Perl + Perl Result OML Perl Perl Perl Perl OML Perl compile Final Result 20th August, 2012 YAPC::EU Ontology Aware Applications 21
    • Embedded OML AlgorithmAlgorithm 1: Weaver(program,split,compile,combine) : programInput: program – original program to processInput: split – function that separates the code parts by languageInput: compile – tranforms OML into PerlInput: combine – joins parts of code togetherparts ← split(program)forall the (lang , code) ∈ parts do if lang is DSL then code ← compile(code) push(parts2, code)returncombine(parts2) 20th August, 2012 YAPC::EU Ontology Aware Applications 22
    • Example: OntoMap20th August, 2012 YAPC::EU Ontology Aware Applications 23
    • Example Screenshot 20th August, 2012 YAPC::EU Ontology Aware Applications 24
    • Information in JSONGET /locations.cgi HTTP/1.1(...)Content-Type: application/json; charset=UTF-8{"markers":[{"name":"Braga","desc":"Braga<hr><b>CITY-OF</b>Portugal<br><b>IS-A</b> city<br><b>LAT</b> 41.5517605<br><b>LNG</b> -8.4229034<br>","lat":"41.5517605","lng":"-8.4229034","is":"city"},{"name":"Castelo de Alva","desc":"Castelode Alva<hr><b>IS-A</b> castle<br><b>LAT</b> 41.0913745<br><b>LNG</b> -6.8078773<br>","lat":"41.0913745","lng":"-6.8078773","is":"castle"},{"name":"Castelo de Tavira","desc":"Castelo de Tavira<hr><b>IS-A</b> castle<br><b>LAT</b> 37.1213122<br><b>LNG</b> -7.6533538<br>","lat":"37.1213122","lng":"-7.6533538","is":"castle"},{"name":"Guimaraes","desc":"Guimaraes<hr><b>CITY-OF</b> Portugal<br><b>IS-A</b> city<br><b>LAT</b> 41.4419546<br><b>LNG</b> -8.2956069<br>","lat":"41.4419546","lng":"-8.2956069","is":"city"},{"name":"Lagos","d 20th August, 2012 YAPC::EU Ontology Aware Applications 25
    • OML Program: locations.cgi1 use CGI ;2 use JSON ;3 use Biblio : : Thesaurus : : ModRewrite : : Embed ;45 my $onto = thesaurusLoad ( ’ geo . iso ’ ) ;6 my $filter = param ( ’ FILTER ’ ) or ’ ANY ’ ;7 print header ,8 ”{ m a r k e r s : ” ,9 get points ( $onto , $filter ) ,10 ”} ” ;1112 OML get points ( ontology , filter )13 $point LAT $x AND $point LNG $y14 AND $point ISA filter15 = sub { >16 print to json ( {name= >$point , lat=>$x , lng=>$y} ) ;17 }.18 ENDOML 20th August, 2012 YAPC::EU Ontology Aware Applications 26
    • OML Program: addlocation.cgi1 use CGI ;2 use Biblio : : Thesaurus : : ModRewrite : : Embed ;34 my $name = param ( ’ NAME ’ ) ;5 my $isa = param ( ’ ISA ’ ) ;6 my $lat = param ( ’ LAT ’ ) ;7 my $lng = param ( ’ LNG ’ ) ;89 my $onto = thesaurusLoad ( ’ geo . iso ’ ) ;10 add location ( $onto , $name , $isa , $lat , $lng ) ;11 $onto−>save ( ’ geo . iso ’ ) ;1213 OML add location ( ontology , name , isa , lat , lng )14 do =>15 add ( name ISA isa )16 add ( name LAT lat )17 add ( name LNG lng ) .18 ENDOML 20th August, 2012 YAPC::EU Ontology Aware Applications 27
    • Related WorkCPAN RDF::* OWL::* .. and much moreZhi# integrates the Web Ontology Language (OWL) and XML Schema Definition (XSD) data types with C# 20th August, 2012 YAPC::EU Ontology Aware Applications 28
    • Conclusionincrease language efficiency throughout the codeelegant and simple approach to build ontology-awareapplicationsmodular, build complex applications using small blocksembedded mechanism is a clear advantageunder research work, not finished! – many things will change 20th August, 2012 YAPC::EU Ontology Aware Applications 29
    • Conclusion weaving mechanism can be language-agnostic split many languages having compilers for each language ne e ut bi ec m lit ex id co sp Perl Perl Perl Perl Perl PerlPerl + Perl ResultDSL* Perl Perl Perl Perl DSL Perl compile* 20th August, 2012 YAPC::EU Ontology Aware Applications 30
    • Thank You! smash@cpan.org20th August, 2012 YAPC::EU Ontology Aware Applications 31