Downloading and Installing the Shapes Demo

Download ShapesDemo Project from the SourceForge CVS Repository

Note: you may need to have a SourceForge account to check these files out from the repository.

  1. From the Eclipse Window pulldown menu, select "Window -> Open Perspective -> CVS Repository Exploring"
  2. Right-click anywhere in the "CVS Repositories" pane and select "New -> Repository Location..."
  3. Fill in the required information
  4. Expand the resulting CVS Repository listing: ... -> HEAD -> SadlModels
  5. Right-click on ShapesDemo and select "Check Out"
  6. If the project does not build (convert sadl model files to owl model files) automatically, make sure that "Build Automatically" is checked on the Project dropdown menu from the menu bar. You may use the Project -> Clean to rebuild the project. Note that some errors are to be expected in the ManualTests folder as part of the test suite is to make sure errors are detected.
  7. To run tests in a particular model, click on the plus sign (+) in front of the project name in the Eclipse Navigator to expand the project, then on plus sign in front of the "Test" directory name.
  8. Double click on any .sadl file to open the file. The first time you open a .sadl file you will be prompted to add the Xtext nature to the project. Answer yes.
  9. Right-click on the file name in the Project Explorer pane, then select "SADL Actions -> Test Model" on the popup action menu. Alternatively, with the focus on the editor window, press <alt-shift-t> to run tests. (Use <alt-shift-r> to bring up a query window.)
  10. Test results should appear in the console window. For example, running shapes-test.sadl with derivations (Project->Preferences) turned on will provide output similar to the following:
Running tests: shapes-test.sadl(http://sadl.imp/shapes_test)
Validity check returned no errors or warnings.
Test passed: MyCircle, area, 38.48

Test passed: MyRect, rdf:type, Shape

Test passed: MyRect, width, 4.5

Test passed: MyRect, area, 15.75

Test passed: [v]:select v where MyCircle, area, v == 38.48

Explanation of 'x, area, y':

	Derivation of 
http://sadl.imp/shapes_test#MyRect, area, 15.75:

		was concluded by: Rule AreaOfRectangle
			based on matching conditions:
				MyRect type Rectangle
				MyRect height 3.5
				MyRect width 4.5

 
	Derivation of 
	  http://sadl.imp/shapes_test#MyCircle, area, 38.48447895050049:

		was concluded by: Rule AreaOfCircle
			based on matching conditions:
				MyCircle type Circle
				MyCircle radius 3.5

 
Timing information:
	0 (ms): load ontology model
	47 (ms): load model 2 rules
	32 (ms): bind schema to reasoner
	31 (ms): prepare inference model
	0 (ms): ask(http://sadl.imp/shapes_test#MyCircle,http://sadl.imp/shapes_top#area,null)
	0 (ms): ask(http://sadl.imp/shapes_test#MyRect,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://sadl.imp/shapes_top#Shape)
	0 (ms): ask(http://sadl.imp/shapes_test#MyRect,http://sadl.imp/shapes_specific#width,null)
	0 (ms): ask(http://sadl.imp/shapes_test#MyRect,http://sadl.imp/shapes_top#area,null)
469 (ms): execute query (select ?v where {<http://sadl.imp/shapes_test#MyCircle> <http://sadl.imp/shapes_top#area> ?v})
	Total time (ms):579
Passed 5 of 5 tests.

Derivations written to 'G:\sadl\eclipse\workspace\ShapesDemo\Temp\shapes-test.Derivations.log'