SADL Tips
Last revised
11/30/2012
by A. W. Crapo
This document is a list of useful tips about how to do things in SADL.
- Content assistance can help you by providing a list of legal things to add
at the current cursor location. This list includes templates (identified with
a green dot before the menu item) that allow you to
create and customize entire phrases or statements by typing or
selecting from a menu and then tabbing to the next input in the template. When
using a template, first click on the template and then type in a template item
if there is no menu or pick an item from the menu if there is a menu.
- Escape a reserved word: to "escape" a reserved word
so that it can be used as the name of a user-defined concept, precede the word
with a "^". For example, "where" is a reserved word in SADL V2 (can be used in
queries). To define a property named "where", do the following:
TS_Event
is
a
top-level
class,
described
by
^where
with
values
of
type
Location.
There is a particular twist to this when the name needs to be prefixed.
For example, if "rdf:type" were to be passed as an argument to a built-in
function it would need to be written as follows.
rdf:^type
- When a SADL Version 1 project is first loaded into SADL Version 2, some
model file changes will be done automatically to make the file compatible with
Version 2. The first action after opening the project or checking it out of a
repository should be to clean and rebuild the project (from the menu bar
Project -> Clean...). This should be repeated two times.
- Project -> Build Automatically must be checked on the menu bar dropdown
menu for the save operation on a SADL file to also create the OWL and
associated translation files.
- There is a key binding for running the tests in a model. With the focus on
the opened model editor window, press Alt-Shift-T.
- There is a key binding for running ad hoc queries on a model. With the
focus on the opened model editor window, press Alt-Shift-R.
- A reasoner is selected and configured using the project preferences. With
the project open (and highlighted in the Project Explorer pane, select Project
-> Properties. In the resulting dialog, click on the "+" in front of "Sadl" in the left-hand pane and click on "Reasoner
Preferences". This allows selection and configuration of the reasoner.
Reasoner configuration is saved in the "configuration.rdf"
file in the OwlModels folder of the project. For more information about the
default reasoner, see Jena Reasoner
Configuration.
- You can define domain-specific templates for a project. For an example,
see Domain-Specific Templates.
- You can do "recursive" queries in SPARQL by using "+" after the property
to be recursed. See
http://answers.semanticweb.com/questions/9909/sparql-recursive-query.
There is an example named RecursiveQuery.sadl in the AutoTests folder of the
TestSadlIde project on SourceForge.
- You can use Lucene in conjunction with SPARQL to do a textual search of
annotations (rdfs:label, rdfs:comment) in a model. The predicate is "http://jena.hpl.hp.com/ARQ/property#textMatch"
and the object is of the form " '+<text>' where <text> is the replaced with
the text to be matched. "For more information on syntax and function, see
http://jena.apache.org/documentation/larq/index.html. For use of a custom
Lucene indexer to generate annotations from URI's, see
Jena Configuration.