ontology engineering and plugin development with the neon toolkit plug-in development for the neon...

22
Ontology Engineering and Plugin Ontology Engineering and Plugin Development with the NeOn Toolkit Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase, Holger Lewen, Rudi Studer

Upload: dortha-mathews

Post on 31-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Ontology Engineering and Plugin Ontology Engineering and Plugin Development with the NeOn ToolkitDevelopment with the NeOn Toolkit

Plug-in Development for the NeOn ToolkitPlug-in Development for the NeOn Toolkit

June 1st, 2008

Michael Erdmann, Peter Haase,Holger Lewen, Rudi Studer

Page 2: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 2

AgendaAgenda

General Eclipse Overview

Plug-in Example: – Import wizard for ontologies

NeOn Toolkit:– Extension Points– Datamodel API

Hands-on plug-ins:– Write your own plugin for the NeOn Toolkit

Page 3: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 3

Eclipse Plug-in ArchitectureEclipse Plug-in Architecture

Plug-in = smallest unit of Eclipse functionality– Big example: HTML editor– Small example: Action to create zip files

Extension point = named entity for collecting “contributions”– Example: extension point for workbench preferences UI– Comparable to Java interface

Extension = a contribution– Example: specific HTML editor preferences– Comparable to Java class implementing an interface

Page 4: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 4

Eclipse Platform - SummaryEclipse Platform - Summary

Plug-ins, extension points, extensions– Modular, open, extensible architecture– “Everything is a plug-in”

Workspace, projects, files, folders– Common place to store and organize development artifacts

Workbench, editors, views, perspectives– Common UI paradigm

Not only for Java Development…– IDEs for other languages (C++, Python, PHP…)– UML, Reports, Data base schema, …– NeOn Toolkit, OntoStudio

Page 5: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 5

Why we Love Eclipse ;-)Why we Love Eclipse ;-)

What Eclipse provides for you:– A lot of preexisting components, “workflows” (wizards…), services– Frameworks for editors (text & graphical), property dialogs,

preferences, concurrent tasks, debugging, …– Support for typical IDE and Workspace tasks– Extensible online-help– […]

What some prominent plug-ins provide for you (NeOn):– Metamodel support– Graphical tool generation support– Collaboration support– Web service support– […]

Page 6: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 6

AgendaAgenda

General Eclipse Overview

Plug-in Example: – Import wizard for ontologies

NeOn Toolkit:– Extension Points– Datamodel API

Hands-on plug-ins:– Write your own plugin for the NeOn Toolkit

Page 7: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 7

Create a New Plug-in ProjectCreate a New Plug-in Project

Page 8: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 8

Specify Project PropertiesSpecify Project Properties

Page 9: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 9

Specify Plug-in PropertiesSpecify Plug-in Properties

Page 10: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 10

Plug-in WizardPlug-in Wizard

Page 11: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 11

Choose TemplateChoose Template

Page 12: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 12

Customize TemplateCustomize Template

Page 13: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 13

ImportWizard TemplateImportWizard Template

Find more information about Wizards at – http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc

.isv/guide/dialogs_wizards.htm– http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc

.isv/guide/dialogs_wizards_extensions.htm

Find more information about ImportWizards at – http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc

.user/reference/ref-70.htm– http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc

.isv/guide/dialogs_wizards_importWizards.htm

Page 14: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 14

The Plug-in is CreatedThe Plug-in is Created

The Plug-in is now ready!

But without any customized code, i.e. it is hardly doing anything.

You can try it out, by starting the NeOn Toolkit.

Afterwards, you can browse the plug-ins properties…

Page 15: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 15

Plug-in PropertiesPlug-in Properties

Page 16: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 16

Plug-in DependenciesPlug-in Dependencies

Add here:- com.ontoprise.ontostudio.datamodel- datamodel- datamodelbase- util

Page 17: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 17

Runtime SpecsRuntime Specs

Specify here: packages that should be visible externally, i.e. can be used by other plug-ins

Specify here:libraries that are needed by this plug-in at runtime

Page 18: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 18

Extending Extension PointsExtending Extension Points

Adapt the properties here, e.g.

- better labels

- other icons

Page 19: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 19

ImportWizard.javaImportWizard.java

Find your ImportWizard.java class

Go to the default implementation of performFinish()– This method will be called when the ImportWizard’s <Finish> button

will be pressed.

We will refine this method to actually load an ontology.

Add this line to performFinish()return openOntology(file);

Implement the method as shown on next page:private boolean openOntology(IFile file)

Page 20: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 20

ImportWizard.openOntology(IFile)ImportWizard.openOntology(IFile)

Page 21: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 21

ImportWizardPage.javaImportWizardPage.java

Find your ImportWizardPage.java class

Go to the default impl. of createAdvancedControls ()– This method will be called when the different pages of the wizard are

initialized.

We will refine this method to restrict the file filter to ontology extensions understood by NeOn Toolkit.

Replace the lineString[] extensions = new String[] { "*.*" };

With this one:String[] extensions = new String[] {"*.oxml", "*.flo", "*.rdf", "*.owl"};

Page 22: Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,

Slide 22

Sample ImplementationSample Implementation

Solutions are provided on the CDorg.neontoolkit.sample.ontologyimport