Zippyrate edited this page Apr 3, 2015 · 2 revisions

Table of Contents

What is the SWRL Editor?

The SWRL Editor is an extension to the graphical component provided by the SWRLAPI that supports the editing of SWRL rules. It can be used to create SWRL rules, edit existing SWRL rules, and read and write SWRL rules.

The SWRL Submission does not specify a presentation syntax for the language so implementors must define a suitable syntax. The presentation syntax supported by the SWRL Editor is described here. The SWRL language itself is described here.

How do I edit SWRL rules?

To edit a rule, either double-click on the rule or select the rule and click on the "Edit" button. A modal popup dialog box will appear. It will contain a text area to edit a rule and the same icon panel that was displayed for in place editing. To save the edited rule press the "Ok" button. To abandon editing, press the "Cancel" button. This dialog also can be used to edit the name and comment annotations of the rule.

The editor will not allow an erroneous or incomplete SWRL rule to be saved.

Does the SWRL Editor have auto-complete?

Yes. Pressing the Tab key while editing an entity name will auto-complete that name if it has a unique expansion or will incrementally bring up a selection of completions via repeat pressing of the tab key. Pressing the escape key abandons any autocompletion presented.

For example, typing xsd: followed by the Tab key in the SWRL Editor text area will list all available datatypes.

Similarly, typing swrlb: followed by the Tab key in the SWRL editor text area will list all currently accessible built-ins in that namespace.

How do I create a new SWRL rule?

A SWRL rule can be created by clicking on the "Add" button on the bottom right of the SWRL editing panel. The multi-line editor pops up and a rule can then be created and saved.

How do I delete a SWRL rule?

A SWRL rule can be deleted by selecting the rule in the SWRL editor panel and clicking on the "Delete" button on the bottom right of the editor panel.

How do I save SWRL rules?

A rule can be saved by clicking "Ok" on the popup editor.

Does the SWRL Editor validate SWRL rules?

The SWRL Editor performs basic syntactic and semantic checking. It will ensure that a rule is syntactically correct before it is saved and will also ensure that any references to OWL entities are valid. However, the editor does not perform any integrity checking between rules in an ontology, does not attempt to ensure that rule do not conflict with OWL axioms, and does not prevent the user from writing well formed but meaningless rules.

Also, the SWRL specification does not specify that checking should be performed on the types of arguments to built-ins so the SWRL Editor does not perform this checking. In any case, the OWL definition of a SWRL built-in by default does not specify the types of arguments that the built-in is expecting so a general argument type checking mechanism is not possible. A built-in definition can (optionally) specify the number of arguments it is expecting but these are currently ignored.

Can I use third-party software to work with the rules generated by the SWRL Editor?

Yes. SWRL rules are represented in a standard form.