POSH : The Prolog OWL Shell          Chris Mungall   Lawrence Berkeley Laboratory                                  1
Ontology Hacking•  I’m in a hurry and I want to:  – translate all “R some Y” to “(R some Y) or Y”  – add an equivalence ax...
Ontology Environments•  GUI  – Protégé 4  – OBO-Edit•  API  – Java     •  OWL API     •  Jena     •  Ortiz                ...
Ontology Environments•  GUI  – Protégé 4  – OBO-Edit      }   Not powerful enough!                      need programmatic ...
Where is the Perl of OWL?   •  Perl is remarkably good for slicing, dicing, twisting,      wringing, smoothing, summarizin...
Pathologically Obfuscated         Semantic Hacking (POSH)•  What is it?    –  Command line interface to Thea       (Vassil...
Posh Lightning summary•  Infix predicates                •  Prolog syntax   –  Axiom predicate shortcuts:       •  < (SubC...
Initiation $ thea-poshj --format rdf_direct http://purl.obolibrary.org/obo/uberon.owl% ::: Welcome to Posh, the Prolog OWL...
Querying asserted axioms  ?- q X where X < part_of some brain.     prolog syntaxforebrain.                                ...
Querying inferences                                              axioms in {}s?- init hermit.                             ...
Mixed prolog / reasoner queries?- q X where  {X < neuron and X < not(part_of some brain)}.                   open-world?- ...
POPL: Prolog Ontology Processing           Language-- rewrites expressions as if R were reflexive:?- R some Y ===> Y or R ...
Similar tools•  Declarative JVM language with REPL +   OWL API  – Groovy    •  El-Vira (Hoehndorf)  – Armed Bear Common Li...
Availability•  http://blipkit.wordpress.com/posh/•  also distributed as part of Thea:  – http://www.semanticweb.gr/thea/  ...
Upcoming SlideShare
Loading in …5
×

POSH: The Prolog OWL Shell

1,982 views

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,982
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
30
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

POSH: The Prolog OWL Shell

  1. 1. POSH : The Prolog OWL Shell Chris Mungall Lawrence Berkeley Laboratory 1
  2. 2. Ontology Hacking•  I’m in a hurry and I want to: – translate all “R some Y” to “(R some Y) or Y” – add an equivalence axiom for every class pair with closely matching labels – automatically extend an ontology using some tabular data files and/or relational db – iteratively refactor my ontology based on complex structural pattern matching•  What are my options? 2
  3. 3. Ontology Environments•  GUI – Protégé 4 – OBO-Edit•  API – Java •  OWL API •  Jena •  Ortiz 3
  4. 4. Ontology Environments•  GUI – Protégé 4 – OBO-Edit } Not powerful enough! need programmatic capabilities•  API – Java •  OWL API •  Jena } I’m in a hurry! too verbose; hard to read and write; •  Ortiz 4
  5. 5. Where is the Perl of OWL? •  Perl is remarkably good for slicing, dicing, twisting, wringing, smoothing, summarizing, and otherwise mangling text… •  Perl programs are easy to write and fast to develop… •  Perl is a good prototyping language…– Lincoln Stein, How Perl Saved the Human genome Project, Dr Dobbs Journal, 1996, http:// drdobbs.com/184410424 •  What’s a good way for slicing, dicing, mangling and hacking axioms and expressions? 5
  6. 6. Pathologically Obfuscated Semantic Hacking (POSH)•  What is it? –  Command line interface to Thea (Vassilidas, OWLED2009)•  Features –  OWL2 Manchester-like syntax –  Command Line (REPL) –  Declarative •  but with full ‘impure’ programmatic capabilities •  Turing complete –  Succinct –  Configurable and extendable –  Behind the scenes label<->IRI translation 6
  7. 7. Posh Lightning summary•  Infix predicates •  Prolog syntax –  Axiom predicate shortcuts: •  < (SubClassOf) –  variable leading upper case •  == (EquivalentClasses) •  (or use OWL2 syntax) –  Expression operators •  Prolog queries •  and –  Predicates dynamically •  or mapped to queries on in- •  not memory RDF db •  some •  all –  E.g. •  min(N) •  forebrain < part_of some •  max(N) brain. •  … 7
  8. 8. Initiation $ thea-poshj --format rdf_direct http://purl.obolibrary.org/obo/uberon.owl% ::: Welcome to Posh, the Prolog OWL Shell :::% Parsed uberon.owl? - writeln(hello world).hello worldtrue. standard Thea query?- subClassOf(X,Y).X = http://purl.obolibrary.org/obo/UBERON_0000002,Y = http://purl.obolibrary.org/obo/UBERON_0001560 ;X = http://purl.obolibrary.org/obo/UBERON_0000002,Y = http://purl.obolibrary.org/obo/UBERON_0005156 ;X = http://purl.obolibrary.org/obo/UBERON_0000002, underlying ontology uses numeric IRIs 8
  9. 9. Querying asserted axioms ?- q X where X < part_of some brain. prolog syntaxforebrain. is highly configurable!medial forebrain bundle.hindbrain.cranial dura mater. Posh provides configurablebrainstem. IRI <-> label translationnucleus of brain.regional part of brain.midbrain-hindbrain boundary.brain blood vessel.brain grey matter.brain white matter.brain meninx.brain pia mater.subventricular zone.ventricular system of brain.brain vasculature.… 9
  10. 10. Querying inferences axioms in {}s?- init hermit. sent to reasoner?- q X where {X < part_of some brain}.cortical layer VI<part_of some brain.commissure of inferior colliculus<part_of some brain.cortical layer V<part_of some brain.cingulate cortex<part_of some brain.brain arachnoid mater<part_of some brain.limitans nucleus<part_of some brain.cortical layer II<part_of some brain.brachium of inferior colliculus<part_of some brain.cortical layer I<part_of some brain.pontine tegmentum<part_of some brain.cortical layer IV<part_of some brain.cortical layer III<part_of some brain.brain arachnoid mater<part_of some brain.--[SNIP]-- 10
  11. 11. Mixed prolog / reasoner queries?- q X where {X < neuron and X < not(part_of some brain)}. open-world?- q X where {X < neuron}, +{X < not(part_of some brain)}. mixed open/closed world (cf SPARQL FILTER) 11
  12. 12. POPL: Prolog Ontology Processing Language-- rewrites expressions as if R were reflexive:?- R some Y ===> Y or R some Y.-- add equivalence axioms where labels closely match?- assert( sameLabel(X,Y) :- label(X,XN), label(Y,YN), X=Y,porter_stem(XN,N),porter_stem(YN,N) ).?- add X==Y where sameLabel(X,Y). 12
  13. 13. Similar tools•  Declarative JVM language with REPL + OWL API – Groovy •  El-Vira (Hoehndorf) – Armed Bear Common Lisp •  LSW (Ruttenberg)•  OPPL•  owl.rb (Balhoff)•  SPARQL + various environments 13
  14. 14. Availability•  http://blipkit.wordpress.com/posh/•  also distributed as part of Thea: – http://www.semanticweb.gr/thea/ – (check out “posh” branch) 14

×