ACE View — a natural language interface to knowledge engineering




Introduction

Watch the screencast (12'34, 43MB, QuickTime)!
Note: shows an old version of ACE View (v1.2.1)

ACE View is an ontology and rule editor that uses Attempto Controlled English (ACE) in order to create, view and edit OWL 2 ontologies and SWRL rulesets.

In many cases you don't have to know the details of OWL and SWRL — the ACE view hides them from you. But you do have to know ACE. In order to get started read: Writing OWL ontologies in ACE. Later visit the Attempto project website to learn more.

ACE View is implemented as an extension to the popular ontology editor Protégé 4 (please take time to register as a Protégé user). Note that ACE View does not work with Protégé 3.

If you have questions, then post them to the Attempto Mailing List.

In order submit bugs and feature requests use the ACE View Issues List.

How to install ACE View?

Installing ACE View is a simple process thanks to the Protégé plug-in auto update feature which provides an overview of the Protégé plug-in repository, allows new plugins to be installed, and existing ones to be updated in case they have newer versions.

Proceed as follows.

  1. Download and install Protégé 4.0 by following the installation instructions at http://protege.stanford.edu/download/registered.html#p4.
  2. Start Protégé.
  3. Press File → Check for plugins....
  4. Select "ACE View" and press "Install".
  5. Restart Protégé.

That's it!

If this didn't work for some reason, then just manually copy the ACE View jar-file ch.uzh.ifi.attempto.aceview.jar (3 MB) into the Protégé plugins-directory.

How to configure ACE View?

The quickest way to reach ACE View after Protégé has been launched, is to select "Create new OWL ontology", press "Continue" twice, and press "Finish". The Protégé interface opens up with all its tabs, including the "ACE View" tab. In case the "ACE View" tab is not visible, then load it by clicking on the "ACE View" menu item in the Tabs-menu. All ACE views are available under View → ACE views but note that most of them are displayed automatically by the "ACE View" tab.

Note: if some ACE View views did not load (and there was an error message) then execute: Tabs → Reset selected tab to default state.

In order to be able to use ACE View you must be connected to the internet because the OWL→ACE translator is currently only available as a webservice. (By default, the ACE→OWL/SWRL translator is also used via a webservice, but it is also possible to install it locally, see below for the instructions.) The Protégé preferences panel contains a tab with the ACE View preferences where you can configure the webservice addresses. For example, set them as shown in the following screenshot of the preferences-panel.

ACE View preferences

Normally, one is expected to first define the content words before they are going to be used in ACE sentences. For example, in order to enter the sentence Every dog hates a cat. one must first define the words `dog', `hate', `cat' as OWL entities (class and property names). (Note that the morphological surface forms like `hates' are generated automatically and stored as entity annotations while the entity is being declared.) If you want to enter a sentence without defining the words first, then you can enable "Parse sentences that contain undefined wordforms" and rely on the built-in lexicon ("Use Clex") and guessing ("Guess unknown words") that the ACE→OWL/SWRL service provides. In case you switch on "Generate paraphrase" then all the sentences entered in the ACE View are additionally paraphrased. The paraphrases belong to a fragment of ACE called Core ACE. This fragment reformulates every-sentences as if-then-sentences and replaces relative clauses with full sentences.

Views

Introduction

ACE View provides many different views to the ACE text. Some of these views are editable, i.e. the word(form)s and sentences shown in the view can be changed or removed.

View name Function Editable? Default?
ACE Snippet Editor Allows a single snippet to be added to or deleted from the active ACE text. A snippet is a short sequence of one or more ACE sentences. Usually just one sentence. YES YES
ACE Feedback Shows some information about the selected snippet: error messages, paraphrase, annotations, corresponding logical axioms, similar snippets. no YES
ACE Text Shows the active ACE text as plain text YES YES
ACE Snippets Shows the active ACE text as a list of snippets. YES YES
ACE Q&A Shows all the questions (and their answers) in the active ACE text YES YES
ACE Entailments Shows the entailments derived from the active ACE text no no
ACE Explanation Shows the explanation for the snippet that was active when the Why?-button was pressed no YES
ACE Lexicon Shows the active lexicon as a table YES YES
ACE Lexicon format Shows the active lexicon as plain text ACE Lexicon format no no
ACE Words Shows an alphabetically sorted list of content words of the active ACE text no YES
ACE Word Usage Shows the usage of the selected content word no YES
ACE Index Lists all the content words together with their usage in the active ACE text no no
ACE Metrics Shows some statistics about the active ACE text and its lexicon no YES

All views are available from the View → ACE views menu. Unless the view is more technical, it is also included in the default configuration of the ACE View tab.

Snippet editor

The Snippet Editor is for working with very short texts (one or two sentences), where the sentences are syntactically or logically very connected, e.g.

The Snippet Editor shows the currently selected snippet (either asserted or entailed) and allows you to change or delete it, or add a new snippet to the active ACE text. The editor supports auto-completion of content word forms. The Annotate-button lets you annotate the snippet (e.g. add tags or comments), and the Why?-button lets you ask for an explanation of why the snippet holds.

The Snippet Editor is best used together with the "ACE Feedback" view which shows the

ACE Snippet Editor and Feedback views.

If a sentence could not be translated into OWL/SWRL then an error message is shown explaining the nature of the error. For example, the sentence Every baltic-state is EU-country ... is not a correct ACE sentence because it lacks a determiner in front of a noun.

ACE Snippet Editor and Feedback views: Error messages.

Text view

Text view is a simple view that shows the complete knowledge base. You can enter sentences and integrate them into the knowledge base by pressing "Update". You can store the complete knowledge base (in ACE) by select, copy, and paste.

For example, create a new ontology and enter the following ACE text in the "ACE Text" view. (Note that you have to use "Clex" and "guessing" to successfully parse this text, unless you enter all the words as OWL entities first.)

Every country is a territory.

Every city is a territory.

No body-of-water is a territory.

Every city-state is a city.

Every city-state is a country.

Every territory that is not bordered by a body-of-water is a landlocked-territory.
Every landlocked-territory is a territory that is not bordered by a body-of-water.

Every territory that is surrounded by a country is an enclave.
Every enclave is a territory that is surrounded by a country.

Every territory that is surrounded by something that is not a body-of-water
	is not bordered by a body-of-water.

Every non-landlocked-enclave is an enclave that is not a landlocked-territory.

Italy is a country.

Vatican_City is a city-state.
Vatican_City is surrounded by Italy.

What is a territory?

Which enclave is not a landlocked-territory?

Now press "Update" to integrate this text into the ontology.

Words views

"ACE Words" provides a view to all the content words (nouns, verbs, proper names) of the ACE text. For each word its frequency is show in parentheses. The frequency denotes the number of sentences that contain this word in the text. Clicking on the word selects the word so that other views will start displaying information about the word, e.g. its usage will be displayed in the "ACE Word Usage" view.

ACE View Words and Word Usage: vegetarian

Words that do not have linguistic annotations (singular, plural, and past participle forms) yet are displayed in grey color.

Snippet views

Clicking on "ACE Snippets" opens a view that lists all the snippets in the ACE text together with some of their properties (content word count, parser error/warning message count, corresponding OWL/SWRL axiom count, timestamp, ...). You can sort the list alphabetically or by the properties, you can highlight or show only snippets which contain the currently selected word, you can search the table by a keyword (press Ctrl-F), and you can also edit each snippet by double-clicking on the corresponding table row.

ACE Snippet view.

Clicking on the table row selects the corresponding snippet, so that e.g. the Snippet Editor will display the snippet, and the Snippet Feedback will show the properties of the snippet.

Q&A view

The Q&A view lists all the questions (i.e. asserted interrogative snippets) which will be answered on the basis of the existing text (including also the implicit knowledge in the text) whenever you run the reasoner. First you need to switch on the reasoner (e.g. select: Reasoner → Pellet). Every time you run the reasoner (by: Reasoner → Classify) followed by the "Update answers" action the answers to the questions are updated.

The questions must contain exactly one query word (either `who', `what', `which', or `whose'), e.g.

The answers are given as three lists of words.

  1. Named individuals i.e. proper names that satisfy the question, e.g. France is a EU-country and is a NATO-country.
  2. Named classes (sub classes) i.e. groups that satisfy the question, e.g. Every baltic-state is EU-country and is a NATO-country.
  3. Named classes (super classes), i.e. groups that every answer belongs to, e.g. France is a country., Every baltic-state is a territory.

For example the following picture shows a list of questions about a text about European countries, and shows the answers to the question Which EU-country is a NATO-country?.

ACE Q&A view

The answer counts are presented in a tabular and sortable form, so that you can easily get answers to questions that involve counting and comparison of counts. Such questions cannot be expressed in the underlying DL-Query language nor in ACE (at least currently). Such questions are for example:

Note that the counts represent known answers, i.e. answers which the reasoner was able to derive on the basis of the knowledge base. If the reasoner has not yet been applied to the question then a question mark (?) is shown in the count cells. In case the question corresponds to an unsatisfiable expression (e.g. Which EU-country is not an EU-country?) then nothing is displayed in the cell.

Every answer can be expressed as an ACE sentence (i.e. as full answer) but for a better overview just lists of words are presented. However, when you click on a word then the full answer appears in the Snippet Editor. You can add this snippet to the text (if it's not already there), or remove it from the text (if it is there), or ask for the explanations using the Why?-button.

Entailments view

The Entailments view lists sentences that follow from but that were not explicitly stated in the text. The list is updated whenever you run the reasoner (similarly to the Q&A view). As any non-trivial text entails infinitely many sentences, only the sentences with certain simple structure are reported in this view, e.g.

ACE Entailments view: Ireland is an island-country.

Such entailments can also be explained by listing a minimal set of snippets that cause the entailment. In order to see the explanations, double-click on the entailed snippet, the explanation appears in the Explanation view.

Entailments which might point to certain modeling errors are written in red (e.g. Nothing is a non-landlocked-enclave.). Each entailment is tagged with a timestamp. Tag 0 means current entailment. Negative tags (-1, -2, etc.) point to entailments which do not hold currently, but which were obtained in previous executions of the reasoner. Such tagging provides a simple method for detecting lost entailments.

Lexicon view

The lexicon view lists all the content words (nouns, transitive verbs, proper names) in the ACE text. The surface forms (singular, plural, past participle) of each word can be edited.

ACE Lexicon view

Actions

The actions initiated via the standard Protégé menus (e.g. Back/forward arrows, search box, Edit → Undo) trigger a corresponding change in the ACE View views. In addition, there are ACE View specific actions listed in the Tools-menu. The actions apply to the active ACE text.

Action name Function
Create AceWiki Pops up a file chooser to ask for a zip file name. Writes the ACE text as a set of AceWiki articles into the specified zip file. Each article corresponds to a content word and contains all the snippets that contain this word. Only if the lexicon contains all the required forms for a word is its corresponding article created. (You can run the "Fill lexicon" action to automatically generate missing forms.)
Reparse failed snippets Reparses every snippet that has no corresponding OWL/SWRL axioms. Useful if there are many snippets which have failed because of missing lexical entries, and meanwhile the required entries have been added.
Fill lexicon Fills every empty slot in the lexicon by generating lexical annotations (singular, plural, past participle) for each OWL entity.
Update answers Updates the answers to every question in the ACE text. This can take a long time, depending on the complexity and the amount of questions.

Examples

Here are some example ACE texts and OWL/SWRL ontologies for you to play with. The ACE texts should be copied into the "Text view", after which "Update" should be pressed. The OWL ontologies can be opened in the usual way, via File→Open....

Reasoning with the examples was tested with Pellet 2.

People and Pets

people_pets_nice.ace.txt (122 snippets) is the famous "People and pets" ontology automatically verbalized in ACE and later manually modified a bit to make it more readable. Note that it uses the word `pet' as both a regular noun and a relational noun (of-construct). As a result you get an entity `pet' which is used via punning both as a class name and object property name.

Countries

countries.ace.txt (~250 snippets) contains some membership and bordering information about (mostly European) countries. This text also contains many questions (the answers to which will be filled in if the reasoner is executed). Note that one should first load the vocabulary countries_base.owl before the ACE text can be parsed.

Iokaste

The "Iokaste" example (on pages 73, 74) demonstrates a complex (open-world) reasoning problem. The question is who of the Greek characters mentioned in the text could be classified as "answer".

Iokaste's child is Oedipus.

Iokaste's child is Polyneikes.

Oedipus's child is Polyneikes.

Polyneikes' child is Thersandros.

Oedipus is a patricide.

Thersandros is not a patricide.

Everybody whose child is a patricide whose child is
	somebody who is not a patricide is an answer.

Note that we could get the answer also by asking the question:

Whose child is a patricide whose child is somebody who is not a patricide?

Five houses

five_houses.ace.txt (~20 snippets) describes a sequence of five houses (House1, ..., House5). The properties of the sequence are described (e.g. there is only a single "first house"), but where the houses are exactly located is left open.

House_1 (first) → House_? → House_3 (middle) → House_? → House_? (last)

Answers to the questions give us feedback if our modeling is correct (and complete enough).

Demo: Five houses

Note that although this text is tiny, it can take a reasoner a long time to answer these questions.

Known issues

Which APE interface to use?

APE — the Attempto Parsing Engine — offers conversion of ACE sentences into various logical forms, including OWL/SWRL axioms and DL-Queries. From ACE View, APE can be accessed via three different interfaces.

All three provide the exact same functionality.

By default, the APE webservice interface is used, accessing APE that runs on the Attempto server. This requires no installation and configuration, but one needs an internet access and has to live with a slower processing speed.

Alternatively, you can install APE on your computer and access it locally. Follow the instructions at the Attempto Downloads page. If you have a local APE installation (i.e. the file ape.exe), then you can use all the three types of interfaces. See the README.txt that comes with the APE distribution to learn how to run APE in the various modes.

The fastest ACE processing is provided by APE Local. (APE Local is about 1.5 times faster than an HTTP or socket interface that is set up locally).

To set up APE Local, do the following steps.

  1. Install the latest version of SWI-Prolog (we have tested with v5.6.61, but more recent versions should work as well), with packages: clib, sgml, http, and jpl. On Windows and Mac OS X, you get all the required packages with the default installation. On Linux you might need to install the packages separately, e.g. on Ubuntu, install the Ubuntu packages: swi-prolog, swi-prolog-clib, swi-prolog-http, swi-prolog-sgml.
  2. Create ape.exe as explained on the Attempto Downloads page.
  3. Make sure that SWI-Prolog's libjpl is referenced by the Java library path.
  4. (This step you probably do not need to do.) In the lib-directory of the ACE View jar-file, replace jpl.jar with the version that comes with your SWI Prolog installation.
  5. Start Protégé and modify the ACE View preferences:

Installing the OWL verbalizer locally

It is also possible to install the OWL→ACE webservice locally. Download it from here. It depends on SWI-Prolog with packages clib, sgml, http. Installation instructions are in the README.txt file.

Dependencies on external libraries

Apart from the libraries that come with Protégé 4, ACE View depends of the following libraries. These are all included in the ACE View distribution and also in the jar-file, so that you do not need to download them separately.

Developers corner

The ACE View source code is hosted by Google Code Project Hosting at http://code.google.com/p/aceview/. If you are interested in contributing code to the ACE View project, send an email to kaljurand@gmail.com. Note that you need to have a Google Account to become a project member.

Similar projects

Kaarel Kaljurand 2009-06-21