2nd proj. update: integrating swi-prolog for semantic reasoning in bioclipse

29
2 nd Status report of degree project Integrating Blipkit/BioProlog for semantic reasoning in Bioclipse Samuel Lampa, 2010-01-25 Project blog: http://saml.rilspace.com 2 nd Status report of degree project Integrating Blipkit/BioProlog for semantic reasoning in Bioclipse Samuel Lampa, 2010-01-25 Project blog: http://saml.rilspace.com

Upload: samuel-lampa

Post on 16-May-2015

1.019 views

Category:

Documents


1 download

DESCRIPTION

Contains a small background on the semantic web, and shows how Prolog is thought to be used from inside Bioclipse research software for RDF data handling.

TRANSCRIPT

Page 1: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

2nd Status report of degree project

Integrating Blipkit/BioProlog for semantic reasoning in Bioclipse

Samuel Lampa, 2010-01-25Project blog: http://saml.rilspace.com

2nd Status report of degree project

Integrating Blipkit/BioProlog for semantic reasoning in Bioclipse

Samuel Lampa, 2010-01-25Project blog: http://saml.rilspace.com

Page 2: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Some background...Some background...

Page 3: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

What is “Semantic Web”?What is “Semantic Web”?

Page 4: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

“Enabling more powerful use of information”

Main goals:● Data availability (on the web)● Machine-readability of data● Knowledge integration● Automatic “conclusion drawing”

● “Reasoning”, using Reasoners →

What is Semantic Web?What is Semantic Web?

Page 5: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

This project compares two reasoners: Pellet and Blipkit

This project compares two reasoners: Pellet and Blipkit

Page 6: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Research questionResearch question

Page 7: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

How do biochemical questions

formulated as Prolog queries

compare to other solutions

available in Bioclipse in terms of

speed and expressiveness?

Research questionResearch question

Page 8: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

● Pellet/Jena● Uses W3C languages

– OWL (Class definitions)– RDF (Facts)– SPARQL (Querying)

● Blipkit/BioProlog● Uses Prolog, with W3C languages “on top”

– Class definitions, Facts and Queries either in W3C languages (“on top” of prolog) or in pure Prolog!

Semantic ReasonersSemantic Reasoners

Page 9: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

What is Prolog?What is Prolog?

Page 10: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

● State facts and rules● Execute by running queries over these

facts and rules

● Unique features:● Backtracking● “Closed-world assumption”

What is Prolog?What is Prolog?

Page 11: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Prolog code exampleProlog code example

Page 12: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

% === SOME FACTS ===

hasHBondDonors( substanceX, 3 ). % “substance X has 3 H-bond donors”% etc …

% === A RULE ("RULE OF FIVE" ÀLA PROLOG) ===

isDrugLike( Substance ) :- hasHBondDonorsCount( Substance, HBDonors ), HBDonors <= 5, hasHBondAcceptorsCount( Substance, HBAcceptors ), HBAcceptors <= 10, hasMolecularWeight( Substance, MW ), MW < 500.

% === QUERYING THE RULE ===

?- isDrugLike(substanceX)true.?- isDrugLike(X)X = substanceX ;X = substanceY.

Prolog code exampleProlog code example

Page 13: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

% === SOME FACTS ===

hasHBondDonors( substanceX, 3 ). % “substance X has 3 H-bond donors”% etc …

% === A RULE ("RULE OF FIVE" ÀLA PROLOG) ===

isDrugLike( Substance ) :- hasHBondDonorsCount( Substance, HBDonors ), HBDonors <= 5, hasHBondAcceptorsCount( Substance, HBAcceptors ), HBAcceptors <= 10, hasMolecularWeight( Substance, MW ), MW < 500.

% === QUERYING THE RULE ===

?- isDrugLike(substanceX)true.?- isDrugLike(X)X = substanceX ;X = substanceY.

Prolog code exampleProlog code example

Body

Head Implication (“If [body] then [head]”)

Comma means conjunction (“and”)

Capitalized terms are always variables

Page 14: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

% === SOME FACTS ===

hasHBondDonors( substanceX, 3 ). % “substance X has 3 H-bond donors”% etc …

% === A RULE ("RULE OF FIVE" ÀLA PROLOG) ===

isDrugLike( Substance ) :- hasHBondDonorsCount( Substance, HBDonors ), HBDonors <= 5, hasHBondAcceptorsCount( Substance, HBAcceptors ), HBAcceptors <= 10, hasMolecularWeight( Substance, MW ), MW < 500.

% === QUERYING THE RULE ===

?- isDrugLike(substanceX)true.?- isDrugLike(X)X = substanceX ;X = substanceY.

Prolog code exampleProlog code example

By submitting a variable (“X”), it will be populated with all instances which satisfies the “isDrugLike” rule

Testing a specific atom (“sutstanceX”)

Page 15: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Where are we now?Where are we now?

Page 16: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Project planProject plan

Page 17: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

What is done so far?What is done so far?

Page 18: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

● Integration of Blipkit in Bioclipse● Done: General purpose methods● Done: Found usage strategy for combined use of

Bioclipse JS scripting and Prolog

● Comparing Prolog and Pellet● Done: Simple performance testing● Now: Stuck on NMR spectrum similarity search

– (No backtracking on arithmetic operators in SPARQL)

What is What is donedone so far? so far?

Page 19: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

What is left?What is left?

Page 20: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

● Integration of Prolog / Blipkit● Refinements?

● Comparing Prolog and Pellet● NMR spectrum similarity search

– Investigate use of OWL in querying– Other options? SWRL?

● ChEMBL data● Toxicity data (opentox.org)

What remains to be done?What remains to be done?

Page 21: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Example Bioclipse / Prolog script

Example Bioclipse / Prolog script

Page 22: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

blipkit.init();blipkit.loadRDFToProlog("nmrshiftdata.100.rdf.xml");

// Define a “convenience prolog method”

blipkit.loadPrologCode(" \ hasPeak( Subject, Predicate ) :- \ rdf_db:rdf( Subject, \ 'http://www.nmrshiftdb.org/onto#hasPeak', \ Predicate ). \");

// Call the convenience method (which in turn executes it's // “body”), and returns all mathing results as an arrayvar resultList =blipkit.queryProlog(["hasPeak","10","Subject","Predicate"]);

Example Bioclipse/Prolog scriptExample Bioclipse/Prolog script

Page 23: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

blipkit.init();blipkit.loadRDFToProlog("nmrshiftdata.100.rdf.xml");

// Define a “convenience prolog method”

blipkit.loadPrologCode(" \ hasPeak( Subject, Predicate ) :- \ rdf_db:rdf( Subject, \ 'http://www.nmrshiftdb.org/onto#hasPeak', \ Predicate ). \");

// Call the convenience method (which in turn executes it's // “body”), and returns all mathing results as an arrayvar resultList =blipkit.queryProlog(["hasPeak","10","Subject","Predicate"]);

Example Bioclipse/Prolog scriptExample Bioclipse/Prolog script

Prolog rule to load into prolog engine

Prolog method to callLimit the number of results Prolog variables

Page 24: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Current status of research questionCurrent status of research question

Page 25: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

● Performance ● Prolog won so far. Exceptions?

● Usability ● Prolog very convenient for iterative

wrapping of complex logic. Can RDF/OWL/SPARQL replicate this?

● Where do RDF/OWL/SPARQL excel?

Current status of research questionCurrent status of research question

Page 26: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Project planProject plan

Page 27: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Thank you!Project blog: http://saml.rilspace.com

Thank you!Project blog: http://saml.rilspace.com

Page 28: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Project plan – Current versionProject plan – Current version

Page 29: 2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse

Project plan – Proposed versionProject plan – Proposed version