Semantic Application Design Language (SADL)

Last revised 04/18/2008 by A. W. Crapo

Introduction

The Semantic Application Design Language (SADL) is a language for building semantic models and expressing rules that capture additional domain knowledge. The SADL-IDE (integrated development environment) is a set of Eclipse plug-ins that support the editing and testing of semantic models using the SADL language. This document provides a brief description of SADL and the SADL-IDE to facilitate approval of their release to Open Source. A simple semantic model of geometric shapes is used through out the main body of this document in an attempt to make the concepts embodied in SADL and the SADL-IDE more understandable.

Semantic Models

A semantic model is a formal declaration of what can (or does) exist in a domain of interest. As a language, SADL captures a subset of the expressive capability of the Web Ontology Language (OWL). Appendix A provides a complete mapping of current SADL constructs to their OWL equivalents, although additional future mappings are expected both to more completely support construction of OWL models and because OWL is itself evolving as a W3C recommendation.

Semantic models expressed in SADL (and OWL) are modular in nature. This allows large, complex models to be broken down into more maintainable pieces. It also allows portions of models to be shared between different applications. Each piece of a model is given a unique name in the form of a URI. The connection between pieces of a model is established by the "import" statement. One model, usually a more specific or detailed model, can import another, usually a more general, model.

Below are two very simple SADL models; the second imports (extends) the first.

shapes-top.sadl

uri "http://ctp.geae.ge.com/iws/shapes_top".

Shape is a top-level class.
area
describes Shape has values of type float.

shapes-specific.sadl

uri "http://ctp.geae.ge.com/iws/shapes_specific".

import "file://shapes-top.sadl" as shapes-top.

Circle is a type of Shape.
radius
describes Circle has values of type float.
Rectangle
is a type of Shape.
height
describes Rectangle has values of type float.
width
describes Rectangle has values of type float.

Note that the alias given to the imported model specifies a prefix. The name given to a SADL file in the "uri ..." statement defines an XML namespace. It is possible that a term such as "Circle" might be defined in two are more namespaces, possibly with different definitions. (This is sometimes unavoidable if one is importing models from different sources.) The prefix can be used to disambiguate the concept being used. For example, the third line in the second file above might be rewritten as:

Circle is a type of shapes-top:Shape.

Of course this is not necessary here, since we are not importing multiple models with different definitions of "Shape".

Rules

Support for rules in SADL is informed by the Semantic Web Rule Language (SWRL). Hence SADL rules are written in terms of the concepts defined in the semantic model. The SADL-IDE currently supports conversion of the rules either to SWRL or to the Jena Rule Language.

Below is a model containing two rules. Note that by importing "shapes-specific.sadl", "shapes-top.sadl" is also included since the former imports the latter.

shape-rules.sadl

uri "http://ctp.geae.ge.com/iws/shape_rules".

import "file://shapes-specific.sadl" as shapes-specific.

Rule AreaOfCircle
   
given
       
x is any Circle
   
if

    then
       
area of x = (radius of x * radius of x) * 3.14159 .

Rule AreaOfRectangle
   
given
       
x is any Rectangle
   
if

    then
       
area of x = height of x * width of x .

Note that the "if" or the "given" sections may be empty. When converted to SWRL or Jena Rules, both "if" and "given" statements become part of the rule body while the "then" statements become the rule head.

Instance Data

Semantic models can include instance data--information about specific instances of the concepts defined for the domain. For example, the file below defines two specific instances of subclasses of the Shape concept:

shapes-test.sadl

uri "http://ctp.geae.ge.com/iws/shapes_test".

import "file://shape-rules.sadl" as shape-rules.

MyCircle is a Circle, has radius 3.5.
MyRect
is a Rectangle, has height 3.5, has width 4.5.

The SADL-IDE

An integrated development environment (IDE) provides comprehensive facilities for helping someone to say useful things in a particular language, in this case SADL. The SADL-IDE is built using the IDE Meta-Tooling Platform (IMP) from IBM Watson Research. IMP is an Open Source project available from SourceForge under the Eclipse Public License. (It is being moved to an Eclipse incubator project at http://www.eclipse.org/imp/.) Much of the functionality of the SADL-IDE, implemented or pending implementation, uses IMP. This functionality includes:

  1. Coloring words in the language in different colors depending upon their semantic type, e.g., class, property, instance. The screenshot below shows all of the concepts illustrated above in a single model file:

    Classes (sets of things) such as Shape are dark blue bold, properties (attributes, relationships) are green, instances are light blue, keywords in the language (e.g., describes) are magenta, literals (e.g., 3.14159) have a blue background, variables in rules are pink, and other identifiers such as the names of rules and mathematical operators are black.
  2. Marking errors in a text and providing information about the nature of the error. In the example below the name of the super class of Rectangle is mistyped. When the cursor is placed over the red X marker in the margin or over the red underline of the word "Shapes", a message pops up describing the error.

     
  3. Completion proposals for the expression or for the text as a whole. In the example below, content suggestions have been requested with the cursor on an empty line.

     
  4. Hyper linking the use of terms to their definitions. (not currently implemented)
  5. Reformatting of a SADL file to adjust indentation, spacing, etc., to a particular style. (not currently implemented)
  6. Taking action on a document (file) such as converting to OWL/SWRL or validating the model using a reasoner. In the screenshot below, the user has right-clicked on the "shapes-test.sadl" filename in the Navigator pane and selected "Validate and Test with Jena" on the action menu.

     
  7. Providing an expandable/collapsible outline of a document (see screenshot in #1 above).
  8. "Folding" portions of a document so that it occupies a single line to hide detail. In the screenshot below the two rules are folded to a single line each and the cursor is placed over the "+" in front of one of the rules to expose the folded content in a popup window.

IMP supports additional IDE functionality that may be useful and could be relatively easily added to the SADL-IDE, and future functionality of IMP will likely be useful as well.

Reasoning

Reasoning over a set of SADL documents takes two basic forms. Validation of a model involves checking the model for contradictions or inconsistencies. Rule processing involves examining the rules in the model inlight of the current instance data to see if any of the rules can "fire" to infer additional information. Two reasoners are integrated with the SADL-IDE. If the rules are converted to SWRL, then Pellet may be used to perform both kinds of reasoning. If the rules are converted to Jena Rules, then the Jena Rules Engine can be used for both kinds of reasoning.

Testing

SADL supports one construct which goes beyond the expressivity of OWL--the concept of a test. A test in SADL consists of the keyword "Test:" followed by a statement about a named instance (see Instance Data above). If the reasoner can verify that the statement is true the test passes, otherwise it fails. The screenshot below illustrates a set of tests to validate the calculation of the areas of the two Shape instances, along with inherited type (Shape) and the specified width of MyRect. The Console window shows the results of running these tests along with abbreviated derivation information for those items that are set by rules. The level of derivation information displayed may be set in the SADL preferences dialog.

Rule Filtering

Rule management may be difficult in projects with many rules and multiple rule files. The SADL-IDE offers a dynamic "slice and dice" rules view through the use of rule filters. In the top pane of the screenshot below, we have constructed a filter to select all rules that have a pre-condition that something is a Circle. The results are shown in the bottom pane. Filters can contain multiple expressions in any part of the rule.

Appendix A: SADL to OWL Mappings

The following table defines the current syntax and semantics of SADL with respect to standard OWL constructs. Note that snippets of models other than the shapes example used above are introduced because the shapes example is not sufficiently complex to exemplify all of the constructs. These additional examples are drawn from familiar domains to the end that they might be more easily understood.

Example SADL Statement OWL Equivalent (in RDF/XML-ABBREV) Meaning/Comments
uri "http://resaerch.ge.com.shapes". xmlns="http://research.ge.com.shapes#"
xml:base
="
http://research.ge.com.shapes">
The namespace of this ontology.
import "file://shapes-top.sadl" as shapes-top. xmlns:shapes-top="http://research.ge.com.hapes_top#"
<owl:Ontology rdf:about="http://research.ge.com.shapes_specific">
    <
owl:imports>
        <
owl:Ontology rdf:about="http://research.ge.com.shapes_top"/>
    </
owl:imports>
</
owl:Ontology>
This ontology imports the ontology in the file "shapes-top.sadl", which is, as identified by it's "uri" statement, "http://research.ge.com.shapes_top".
Shape is a top-level class. <owl:Class rdf:ID=”Shape”> Shape is a subclass of owl:Thing; the model defines no other superclass of Shape.
Gender is a top-level class must be one of {Male, Female}.

       or

Gender is a top-level class, must be one of {Male, Female}.

<owl:Class rdf:ID="Gender">
      
<owl:equivalentClass>
             
<owl:Class>
                   
<owl:oneOf rdf:parseType="Collection">
                          
<Gender rdf:ID="Male"/>
                          
< Gender rdf:ID="Female"/>
                   
</owl:oneOf>
             
</owl:Class>
      
</owl:equivalentClass>
</
owl:Class>

Gender is a class that is defined by explicit enumeration of its members, i.e., Male and Female.
Circle is a type of Shape. <owl:Class rdf:ID="Circle">
    <
rdfs:subClassOf rdf:resource="http://research.ge.com.shapes#Shape"/>
</
owl:Class>
Every instance of Circle is also an instance of Shape.
Woman is a type of {Person, Female}. <owl:Class rdf:ID="Woman">
    <
rdfs:subClassOf rdf:resource="#Female"/>
    <
rdfs:subClassOf rdf:resource="#Person"/>
</
owl:Class>
Every instance of Woman is an instance of Person and is also an instance of Female. (Note: translation of this construct not yet implemented.)
area describes Shape has values of type float. <owl:DatatypeProperty rdf:ID="area">
    <
rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/>
    <
rdfs:domain rdf:resource="http://ctp.geae.ge.com/iws/shapes#Shape"/>
</
owl:DatatypeProperty>
"area" is a property with domain Shape and range xsd:float.
teaches describes Professor has values of type Student.

    or

relationship of Professor to Student is teaches.

<owl:ObjectProperty rdf:ID="teaches">
    <
rdfs:range rdf:resource="http://ctp.geae.ge.com/iws/this_model_name#Student"/>
    <
rdfs:domain rdf:resource="http://ctp.geae.ge.com/iws/this_model_name#Professor"/>
</
owl:ObjectProperty>
"teaches" is a property with domain Professor and range Student.
surfaceArea describes Shape-3D is a type of area. <owl:DatatypeProperty rdf:ID="surfaceArea">
    <
rdfs:domain rdf:resource="#Shape-3D"/>
    <
rdfs:subPropertyOf>
        <
owl:DatatypeProperty rdf:ID="area"/>
    </
rdfs:subPropertyOf>
</
owl:DatatypeProperty>
"surfaceArea" is a sub-property of "area" with domain Shape-3D.
teaches of Professor has at least one value of type College_Student. <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:someValuesFrom>
                <
owl:Class rdf:about="#College_Student"/>
            </
owl:someValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor must have at least one value for the property "teaches" from the class College_Student.
teaches of Professor has at least one value of type {Fulltime_Student, Parttime_Student} <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:someValuesFrom>
                <
owl:Class>
                    <
owl:oneOf rdf:parseType="Collection">
                        <
owl:Class rdf:ID="Fulltime_Student"/>
                        <
owl:Class rdf:ID="Partime_Student"/>
                    </
owl:oneOf>
                </
owl:Class>
            </
owl:someValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor must have at least one value for the property "teaches" that is either a Fulltime_Student or a Parttime_Student. (Note: translation of this construct not yet implemented.)
teaches of Professor has at least one value each of types {Fulltime_Student, Parttime_Student} <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:someValuesFrom>
                <
owl:Class rdf:about="#Fulltime_Student"/>
            </
owl:someValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:someValuesFrom>
                <
owl:Class rdf:about="#Parttime_Student"/>
            </
owl:someValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor must have at least one value for the property "teaches" that is an instance of Fulltime_Student and another value that is an instance of Parttime_Student. (Note: translation of this construct not yet implemented.)
teaches of Professor only has values of type College_Student. <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:allValuesFrom>
                <
owl:Class rdf:about="#College_Student"/>
            </
owl:allValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor can only have values for the property "teaches" that are instances of College_Student, although it can have no values.

teaches of Professor has at least one value of type College_Student,
              only has values of type College_Student.

<owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:someValuesFrom>
                <
owl:Class rdf:about="#College_Student"/>
            </
owl:someValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:allValuesFrom>
                <
owl:Class rdf:about="#College_Student"/>
            </
owl:allValuesFrom>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
SADL allows restrictions to be combined into a list. This means that an instance of Professor must have one or more values for the property "teaches" that are instances of College_Student.
teaches of Professor has at least 1 values. <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">1
            </
owl:minCardinality>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor must have at least one value for the property "teaches".
teaches of Professor has at most 500 values. <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">500
            </
owl:maxCardinality>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor may have at most 500 values for the property "teaches".
teaches of Professor has exactly 30 values. <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#teaches"/>
            </
owl:onProperty>
            <
owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">30
            </
owl:cardinality>
        </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
An instance of Professor must have exactly 30 values for the property "teaches".
rating of Professor must be one of {Excellent, Good, Average, Poor}. <owl:Class rdf:about="#Professor">
    <
rdfs:subClassOf>
        <
owl:Restriction>
            <
owl:onProperty>
                <
owl:ObjectProperty rdf:about="#rating"/>
            </
owl:onProperty>
            <
owl:allValuesFrom>
                <
owl:Class>
                    <
owl:oneOf rdf:parseType="Collection">
                        <
Rating rdf:about="#Excellent"/>
                        <
Rating rdf:about="#Good"/>
                        <
Rating rdf:about="#Average"/>
                        <
Rating rdf:about="#Poor"/>
                    </
owl:oneOf>
                </
owl:Class>
            </
owl:allValuesFrom>
       </
owl:Restriction>
    </
rdfs:subClassOf>
</
owl:Class>
Values of the property "rating" for an instance of Professor must come from the set of instances (of Rating) {Excellent, Good, Average, Poor}. (Note: translation of this construct not yet implemented.)
if teaches has value College_Student then type is College_Professor. <owl:Class rdf:about="#College_Professor">
    <
rdfs:subClassOf>
        <
owl:Class rdf:about="#Professor"/>
            </
rdfs:subClassOf>
                <
owl:equivalentClass>
                    <
owl:Restriction>
                        <
owl:onProperty>
                            <
owl:ObjectProperty rdf:about="#teaches"/>
                        </
owl:onProperty>
                        <
owl:allValuesFrom>
                            <
owl:Class rdf:about="#College_Student"/>
                        </
owl:allValuesFrom>
                    </
owl:Restriction>
                </
owl:equivalentClass>
            </
rdfs:subClassOf>
        </
owl:Class>
    </
rdfs:subClassOf>
</
owl:Class>
If an instance of something has a value for the "teaches" property which is an instance of College_Student then the instance belongs to the class College_Professor. (Note: translation of this construct not yet implemented.)
Jane is a Student. <Student rdf:ID="Jane"/> Jane is an instance of Student.
Jane is a Student, has age 19 . <Student rdf:ID="Jane">
    <
age rdf:datatype="http://www.w3.org/2001/XMLSchema#int">19</age>
</
Student>
Jane is an instance of Student, has value of the "age" property of 19.
Jane is a Student, has age 19, has gender Female. <Student rdf:ID="Jane">
    <
age rdf:datatype="http://www.w3.org/2001/XMLSchema#int">19</age>
    <
gender rdf:resource="http://ctp.geae.ge.com/iws/this_model_name#Female"/>
</
Student>
Jane is an instance of Student, has value of the "age" property of 19, has Female as the value of the "gender" property.

 

Appendix B: Open Source Dependencies of SADL-IDE

The SADL-IDE uses a number of Open Source projects. These projects are:

  1. The Eclipse environment, more particularly Eclipse 3.2.2, see http://eclipse.org, may be downloaded from http://archive.eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/index.php.
  2. The Eclipse IDE Meta-tooling Platform (IMP, from IBM's Watson Research Center, see http://eclipse-imp.sourceforge.net/imp.html)

  3. The Jena Semantic Web Framework (HP Labs, see http://jena.sourceforge.net/)

  4. The OWL API, which is similar to Jena but supports SWRL (University of Manchester, see http://owlapi.sourceforge.net/)

  5. The Pellet OWL DL reasoner (Clark & Parsia, see http://pellet.owldl.com/).