1 / 24

Ontology-Driven Software Development with Prot é g é and OWL

Ontology-Driven Software Development with Prot é g é and OWL. Holger Knublauch Stanford Medical Informatics holger@smi.stanford.edu Model-Driven Semantic Web Workshop 21.09.2004. Prot é g é. Core System (since 1990s) Generic metamodel (OKBC) Configurable Open platform with “Plugins”.

calder
Download Presentation

Ontology-Driven Software Development with Prot é g é and OWL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ontology-Driven Software Development with Protégé and OWL Holger Knublauch Stanford Medical Informatics holger@smi.stanford.edu Model-Driven Semantic Web Workshop 21.09.2004

  2. Protégé • Core System (since 1990s) • Generic metamodel (OKBC) • Configurable • Open platform with “Plugins” • OWL Plugin (since 2003) • OWL Full metamodel • Optimized user interface • Built-in reasoning access • Several thousand users

  3. Protégé / OWL Plugin

  4. Protégé / OWL Plugin

  5. Overview • How to develop Semantic Web applications? • Example • Architecture and OWL-Java mapping • Tool support • Can we apply this to general purpose MDA? • OWL is often more suitable than UML • Major benefit: Semantics at edit-time & run-time

  6. Example Scenario

  7. Traditional Web Architecture

  8. Semantic Web Architecture

  9. Ontologies Travel Ontology ActivityProvider providesActivity hasContact Geography Ontology Activity ContactAddress GeographicArea hasLocation AdventureActivity City Country BungeeJumping Caving HeliBungeeJumping Travel Extension Ontologies

  10. Software Architecture (1) HeliBungee.owl ... ActivityX.owl Semantic Web Layer Travel.owl Customer.owl Web ServiceInterface (WSDL) End-UserInterface (JSP) Core Ontologies Ontology representation as Java objects Web Service, Control Logic (Java Code) Internal Layer Reasoners (OWL DL, SWRL, ...)

  11. Ontology Code in Java Typical approach with a generic API (Jena): OntModel model = ...; OntProperty nameProperty = model.getOntProperty(baseURI + “name”); Individual myActivity = model.getIndividual(baseURI + “test”); String name = myActivity.getPropertyValue(nameProperty); Bookings.book(myActivity); ... Nicer approach with a customized API: XYModel model = ...; Activity myActivity = model.getActivity(baseURI + “test”); String name = myActivity.getName(); myActivity.book(); ...

  12. UML to Java (conventional) public class Activity { private String name; private Collection providers; public String getName() public void setName(String name) public Iterator listProviders() public void addProvider(ActivityProvider p) public void removeProvider(ActivityProvider p) } Activity - name : String 0..* providedBy 0..* ActivityProvider

  13. OWL to Java (Jena) public class Activity extends OntClassImpl { public String getName() public void setName(String name) public Iterator listProviders() public void addProvider(ActivityProvider p) public void removeProvider(ActivityProvider p) } Activity - name : String 0..* providedBy 0..* ActivityProvider

  14. Working with Jena Classes Resource RDF Triple Store Generic Level OntProperty OntClass Customer Activity Application Level Bungee

  15. Software Architecture (2) HeliBungee.owl ... ActivityX.owl Semantic Web Layer Travel.owl Customer.owl Web ServiceInterface (WSDL) End-UserInterface (JSP) Core Ontologies Activity.java ... Customer.java ... Web Service, Control Logic (Java Code) Internal Layer Dynamic Object Model (Jena) Reasoners (OWL DL, SWRL, ...)

  16. Dynamic Object Model • Model is accessible at run-time: • Generic algorithms/reasoners can be executed • Generic test cases available at run-time • Generic serialization, database storage etc. • Generic user interfaces can be generated • Classes can be handled as individuals (Metaclasses are supported) • Instances can have multiple types(dynamic polymorphism using Jena API) • Instances can be classified & change types

  17. Other OWL to Java Benefits Traditional Code: Code based on generated Jena classes: Collection patients = model.getPatients(); for(Iterator it = patients.iterator(); it.hasNext(); ) { Patient patient = (Patient) it.next(); if(patient.isMale()) { patient.doSomething(); } } for(Iterator it = model.listIndividuals(MALE, true); it.hasNext(); ) { Patient patient = (Patient) it.next(); patient.doSomething(); }

  18. Generalizing This Approach • Every program has a “domain model” • Customers, Accounts, Products • Patients, Diseases, Treatments • Domain model is potentially most reusable • No real need for UML • Paradigm shift to anew dialect of OO Model View Control

  19. Dynamic Object Models and MDA • MDA taken to extremes • Design not only to generate code • Design is part of the deployed system • Open ontologies to share between applications • Machine-accessible semantics at run-time • Built-in reflection across metalevels • However: Limited expressivity of OWL; Coding needed (procedural attachment).

  20. Advantages of OWL over UML • Explicit, sharable modeling artifacts • Open architecture of Semantic Web • OWL has rich semantics • closer to domain than UML • built-in reasoning support (DL, SWRL) • A single language across metalevels

  21. Strengths of tools like Protégé • Can be used by domain experts • Better scalable than visual UML modeling • Reasoning support at edit-time • Rapid prototyping of models • Individuals can be acquired using forms • Open architecture / adaptability • Start your application as a plugin

  22. Ontology-Driven Development Agile Modeling Incremental Code Generation Model View Control Agile Programming

  23. Future Work with Protégé (1) • Embrace UML, encourage use of OWL • Incremental OWL-Java code generation • Determine optimal mapping OWL to Java,(using an example application) • Define rules for updating code in response to changes in the ontology (create, rename, etc). • Write Eclipse plugin to perform the updating (either directly or in batch mode)

  24. Future Work with Protégé (2) • Use Protégé as an ODM editor • Map core Protégé metamodel to RDF(S) Collaborations? ODM Bridge

More Related