Creating ontology Hands on! universAAL Training Day Barcelona, Spain 16 January 2014
Agenda universAAL Training – Creating ontology hands on!
Agenda This is going to be a practical session… …you will create a simple ontology that different applications can use for exchanging their data universAAL Training – Creating ontology hands on!
Agenda Getting Ready universAAL Training – Creating ontology hands on!
Getting Ready Assumption: all of you have successfully installed… Eclipse Modeling Tools Indigo 3.7 Java 6 JDK (the JRE is not sufficient) The universAAL tools (“AAL Studio”) …or have you? universAAL Training – Creating ontology hands on!
Getting Ready We have provided you with a ZIP-file named Training_Context Unzip the file to somewhere and then copy the folder Training_Context into your universAAL folder (which should result in the folder c:\universAAL\Training_Context) Start Eclipse and select this folder as your new workspace folder Note: this is so later we have everything in same workspace universAAL Training – Creating ontology hands on!
Workspace inspection! Select: File->Switch Workspace->Other.. universAAL Training – Creating ontology hands on! Source:
Troubleshooting... o Error: "No AALSpace default configuration found on the path: configurations/etc/„ Solution Go to: Training_Context\rundir\configurations\services Open „mw.managers.aalspace.core.properties” Set absolute path for – aalSpaceConfigurationPath=configurations/etc – aalSpaceSchemaURL=configurations/etc E.g.: – aalSpaceConfigurationPath=C:/universAAL/Training_Context/rundir/configurations/etc – aalSpaceSchemaURL=C:/universAAL/Training_Context/rundir/configurations/etc universAAL Training – Hands on!
Agenda Hands on! Creating Lighting ontology universAAL Training – Creating ontology hands on!
Hands on! AAL Studio -> Create a new Ontology Project universAAL Training – Creating ontology hands on!
Hands on! Ontology name: LightingTrainingOntology Maven version: universAAL Training – Creating ontology hands on!
Hands on! Uncheck: „Use derived values” Project name: ont.lighting.training Maven name (same): ont.lighting.training universAAL Training – Creating ontology hands on!
Hands on! Ontology name: LightingTrainingOntology Uncheck: „Use derived values” Project name: ont.lighting.training Maven name (same as): ont.lighting.training Maven version: universAAL Training – Creating ontology hands on!
Hands on! Import most common ontologies (as maven dependencies) Select „Finish” universAAL Training – Creating ontology hands on!
Hands on! ont.lighting.training project is created Open pom.xml.. universAAL Training – Creating ontology hands on!
Hands on! View pom.xml as xml universAAL Training – Creating ontology hands on!
Hands on! Maven artefact info: (unique description of our ontology artefact) group id artifact id version universAAL Training – Creating ontology hands on!
Hands on! Open LightingTrainingOntology.di universAAL Training – Creating ontology hands on!
Hands on! universAAL Training – Creating ontology hands on!
Hands on! Delete Device and MyDevice (will not neeed it in our ontology) Right click -> Delete Selected Element Note: pressing Delete only hides the object in this (Papyrus) view universAAL Training – Creating ontology hands on!
Hands on! Rename: MyConcept->LightSource MyService->Lighting Add datatypeProperty to LightSource universAAL Training – Creating ontology hands on!
Hands on! Right click datatypeProperty and Show Properties View universAAL Training – Creating ontology hands on!
Hands on! Right click datatypeProperty and Show Properties View Name: brightness Type: Integer universAAL Training – Creating ontology hands on!
Hands on! LightingTrainingOntology-> Package import org.universaal.ontology.phThing-> Package import org.universaal.ontology.datatypes-> Integer universAAL Training – Creating ontology hands on!
Hands on! Name: brightness Type: Integer universAAL Training – Creating ontology hands on!
Hands on! Association: From A) Lighting to B) LightSource Note: 1st click Association then Lighting then LightSource universAAL Training – Creating ontology hands on!
Hands on! universAAL Training – Creating ontology hands on! Result
Important: Save changes!! universAAL Training – Creating ontology hands on!
Hands on! Right click LightingTrainingOntology.uml AAL Studio-> Transform UML ontology to Java universAAL Training – Creating ontology hands on!
Hands on! Mw compliance universAAL Training – Creating ontology hands on!
Hands on! Java code now generated (no need for any modification) universAAL Training – Creating ontology hands on!
Hands on! universAAL Training – Creating ontology hands on! Build universAAL application (alternative: Run As -> Maven install)
Hands on! universAAL Training – Creating ontology hands on! Result
Hands on! universAAL Training – Creating ontology hands on! Our (ontology) artefact is now built and installed into our local maven repository
Thanks! universAAL Training – Creating ontology hands on!