Description (8DO)
The Protege Script Console is a tab plug-in for Protege that provides a scripting environment for manipulating an ontology. It is compatible with Protege-Frames and Protege-OWL. The Script Console can be used to: (8DP)
- Reuse existing functions from other scripts or Java classes. (8DQ)
- Write your own scripts for designing an intermediate representation of an ontology. (8DR)
- Define your own functions for performing tasks such as reasoning or consistency checking. (8DS)
Download (8DT)
The Protege Script Console is bundled with the "full" installation of Protege. (83W)
The source code for the Script Console is available from the Protege Subversion repository: (8DU)
http://smi-protege.stanford.edu/repos/protege/protege-script-console/trunk/ (8DV)
There is an Ant build file in the trunk directory and all third-party libraries required to compile the source code are located in trunk/lib. The Javadoc for the latest version is available from this Wiki site: (8DY)
http://protege.cim3.net/file/work/files/ProtegeScriptConsole/javadoc-0.26/ (8DZ)
Installation (8DW)
To enable the Script Console from within Protege, open a project (or create a new one) and click on Project -> Configure... to bring up the Configure dialog. On the Tab Widgets panel, check the box next to ProtegeScriptTab: (8DX)
Screenshot (83X)
To follow is a screenshot of the Protege Script Console from within Protege: (8FJ)
Documentation (8FK)
The basic principle behind the Protege Script Console is that your scripting language gives you access to the Java objects of your ontology from within Protege. Therefore, you only need a basic level of expertise with your scripting language (but probably a higher level of expertise in Java). For interacting with the various objects in your ontology, a useful resource will be the Javadoc for the Protege API. If you are interacting with an OWL ontology, you will also want to reference the Javadoc for the Protege-OWL API and the Protege-OWL API Programmer's Guide. (8FL)
Supported Languages (8FM)
The Script Console relies on Apache's Bean Scripting Framework (BSF) and as such, any BSF-compliant scripting language can easily be integrated. So far, the supported languages are Jython (a Java implementation of Python), Perl, Beanshell, Groovy (partially), and JRuby (an experimental Java implementation of Ruby). (8FN)
Frequently Asked Questions (3V9)
The following separate FAQ pages for the Protege Script Console are available from this Wiki site: (8FO)
- Protege Script Console - Main FAQ page (3VA)
- Protege Script Console - OWL FAQ page (8FP)
- Protege Script Console - Python FAQ page (8FQ)
- Protege Script Console - Ruby FAQ page (8FR)
Tutorials (3VB)
A tutorial will soon be made available. Until then, please look at the JOT Tutorial, as the content will be fairly similar. (8FS)
Script Repository (3VD)
A script repository is available for providing examples and sharing useful information. Submission of example scripts are most welcome! (3VE)
Author (8FH)
Olivier's "to do" and "wish list" page. (8FT)
License (8E2)
The Protege Script Console is available under the Mozilla Public License and is provided "as is". Your are free to use it, distribute it, and modify it. (8E3)
Credits (8E4)
The Protege Script Console relies on third-party software components: (8E5)
- Bean Scripting Framework (BSF) - provides scripting language support within Java applications, and access to Java objects and methods (8E6)
- Jython - a Java implementation of Python (8E7)
- BSFPerl - a BSF-compliant Java implementation of Perl (8E8)
- Beanshell - a BSF-compliant Java implementation of a Java-like scripting language (8E9)
- Groovy (8EA)
- JRuby - a BSF-compliant Java implementation of Ruby (8EB)
Release Notes (8EC)
Version 0.26 (8ED)
- Modified ant build file so that nothing is done if the JVM is not 1.4 (8EE)
Version 0.25 (8F7)
- Recompiled with Java 1.4 :-) (8EG)
Version 0.24 (8F8)
- Fixed the ant build file so that icons are included in the jar file. (8EI)
Version 0.19 (8F9)
Version 0.18 (8FA)
- Fixed the groovy-dependent jar files for groovy-1.0beta10. (8EN)
Version 0.16 (8FB)
Version 0.15 (8FC)
- Fixed missing icon. (8ES)
Version 0.14 (8FD)
- Fixed the backspace that was always erasing the last character in the command, not the character before the caret. (8EU)
Version 0.13 (8FE)
- Fixed a minor bug that made the left arrow to behave as backspace. (8EW)
Version 0.12 (8FF)
- If the system property edu.stanford.smi.protege.script.defaultScriptLanguage is set, then it is used to determine the default scripting language. Possible values are: "jython", "perl", "beanshell", "groovy", "jruby". The default value is "jython" (8EY)
- If the system property edu.stanford.smi.protege.script.defaultScriptPath is set to a value that actually points to a file, then this file is executed on startup (8EZ)
- Hitting backspace key deletes one character or one indentation level (8F0)
- Hitting enter on a line only composed of spaces brings the cursor at the beginning of the new line (no more indentation) (8F1)