Просмотр исходного кода

Merge remote-tracking branch 'msdl/main'

Joeri Exelmans 3 лет назад
Родитель
Сommit
1085ca0ec5

+ 12 - 0
README.md

@@ -133,6 +133,18 @@ SPARQL queries such as this one which selects all the available classes can be u
     }
     LIMIT 25
 
+## Setting up the project
+
+You need a few things to get the project working.
+I am lazy so this is what I did:
+
+    curl -s "https://get.sdkman.io" | bash 
+    sdk install gradle 8.0.1
+    cd "examples/omlSystemDesignOntology2Layers" && gradle clean && gradle build && gradle publishToMavenLocal
+    cd "examples/Drivetrain" && gradle clean && gradle build && gradle publishToMavenLocal
+
+Your mileage may vary.
+
 [oml]: http://www.opencaesar.io/oml/
 [drawio]: https://app.diagrams.net/
 [sprotty]: https://projects.eclipse.org/projects/ecd.sprotty

+ 1 - 0
examples/oml/Drivetrain/build.gradle

@@ -113,6 +113,7 @@ task owlReason(type:io.opencaesar.owl.reason.OwlReasonTask, group:"oml", depends
 task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
     configurationPath = file('.fuseki.ttl')
     outputFolderPath = file('.fuseki')
+    webUI = true
 }
 
 /*

+ 1 - 0
examples/oml/SystemDesignOntology2Layers/build.gradle

@@ -114,6 +114,7 @@ task owlReason(type:io.opencaesar.owl.reason.OwlReasonTask, group:"oml", depends
 task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
     configurationPath = file('.fuseki.ttl')
     outputFolderPath = file('.fuseki')
+    webUI = true
 }
 
 /*

+ 3 - 5
examples/oml/SystemDesignOntology2Layers/src/oml/ua.be/sdo2l/vocabulary/base.oml

@@ -87,11 +87,11 @@ vocabulary <http://ua.be/sdo2l/vocabulary/base#> as base {
 		asymmetric
 		irreflexive
 	]
-	
+
 	// Version
-	
+
 	aspect Versionable
-	
+
 	@rdfs:comment "The has canonical name property"
 	scalar property hasVersion [
 		domain Versionable
@@ -106,6 +106,4 @@ vocabulary <http://ua.be/sdo2l/vocabulary/base#> as base {
 		asymmetric
 		irreflexive
 	]
-
-
 }

+ 5 - 3
examples/oml/SystemDesignOntology2Layers/src/oml/ua.be/sdo2l/vocabulary/bundle.oml

@@ -1,11 +1,13 @@
 vocabulary bundle <http://ua.be/sdo2l/vocabulary/bundle#> as ^bundle {
 	includes <http://ua.be/sdo2l/vocabulary/base#>
 	includes <http://ua.be/sdo2l/vocabulary/ftg#>
-	includes <http://ua.be/sdo2l/vocabulary/base/component#>
+    includes <http://ua.be/sdo2l/vocabulary/workflow#>
 	includes <http://ua.be/sdo2l/vocabulary/processtraces#>
+	includes <http://ua.be/sdo2l/vocabulary/federation#>
+
+	includes <http://ua.be/sdo2l/vocabulary/base/component#>
 	includes <http://ua.be/sdo2l/vocabulary/base/requirement#>
 	includes <http://ua.be/sdo2l/vocabulary/base/system#>
-	includes <http://ua.be/sdo2l/vocabulary/workflow#>
 	includes <http://ua.be/sdo2l/vocabulary/base/shaclproperty#>
 	includes <http://ua.be/sdo2l/vocabulary/base/violation#>
 	includes <http://ua.be/sdo2l/vocabulary/base/code#>
@@ -15,4 +17,4 @@ vocabulary bundle <http://ua.be/sdo2l/vocabulary/bundle#> as ^bundle {
 	includes <http://ua.be/sdo2l/vocabulary/base/script#>
 	includes <http://ua.be/sdo2l/vocabulary/base/tabular#>
 	includes <http://ua.be/sdo2l/vocabulary/base/text#>
-}
+}

+ 25 - 0
examples/oml/SystemDesignOntology2Layers/src/oml/ua.be/sdo2l/vocabulary/federation.oml

@@ -0,0 +1,25 @@
+vocabulary <http://ua.be/sdo2l/vocabulary/federation#> as federation {
+	extends <http://www.w3.org/2000/01/rdf-schema#> as rdfs
+	extends <http://www.w3.org/2001/XMLSchema#> as xsd
+
+    // Virtual data access (service and storage)
+    @rdfs:comment "A Callable specifies one possible call (or operation) that can be made. For example 'translate' for a Point class."
+    aspect Callable [key hasEndPoint]
+	scalar property hasEndPoint [
+		domain Callable
+		range xsd:string
+	]
+    scalar property hasSideEffect [
+		domain Callable
+		range xsd:boolean
+	]
+
+    @rdfs:comment "An Actionable specifies an element which has one or more Callables (aka a service)."
+    aspect Actionable
+    relation entity Callables [
+		from Actionable
+		to Callable
+		forward hasCallable
+		reverse isCallableFrom
+	]
+}

+ 2 - 0
examples/oml/SystemDesignOntology2Layers/src/oml/ua.be/sdo2l/vocabulary/processtraces.oml

@@ -5,6 +5,8 @@ vocabulary <http://ua.be/sdo2l/vocabulary/processtraces#> as traces {
 	extends <http://www.w3.org/2001/XMLSchema#> as xsd
 	extends <http://www.w3.org/2002/07/owl#> as owl
 
+	# TODO Add time to Event (starting time and ending time of PT events)
+
 	@rdfs:comment "The class to represent traces of execution of a given workflow."
 	concept Trace :> base:IdentifiedThing
 

+ 44 - 0
examples/oml/SystemDesignOntology2Layers/src/shacl/pt_time_consistency.ttl

@@ -0,0 +1,44 @@
+@prefix sh:   <http://www.w3.org/ns/shacl#> .
+@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
+@prefix owl:  <http://www.w3.org/2002/07/owl#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix time: <http://www.w3.org/2006/time#> .
+
+@prefix base:          <http://ua.be/sdo2l/vocabulary/base#> .
+@prefix tabular:       <http://ua.be/sdo2l/vocabulary/base/tabular#> .
+@prefix process-trace: <http://ua.be/sdo2l/vocabulary/processtraces#> .
+@prefix ftgpm-shapes:  <http://ua.be/sdo2l/vocabulary/tabular-shapes#> .
+
+ftgpm-shapes:
+  a owl:Ontology ;
+  owl:imports sh: ;
+  sh:declare [ sh:prefix "time" ;    sh:namespace "http://www.w3.org/2006/time#"^^xsd:anyURI ; ] ;
+  sh:declare [ sh:prefix "owl" ;     sh:namespace "http://www.w3.org/2002/07/owl#"^^xsd:anyURI ; ] ;
+  sh:declare [ sh:prefix "rdf" ;     sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI ; ] ;
+  sh:declare [ sh:prefix "xsd" ;     sh:namespace "http://www.w3.org/2001/XMLSchema#"^^xsd:anyURI ; ] ;
+  sh:declare [ sh:prefix "afn" ;     sh:namespace "http://jena.apache.org/ARQ/function#"^^xsd:anyURI ; ] ;
+  sh:declare [ sh:prefix "tabular" ; sh:namespace "http://ua.be/sdo2l/vocabulary/base/tabular#"^^xsd:anyURI ; ] .
+
+# TODO Fix this to get the actual times
+# 1. Need to get the 2 corresponding events (now we assume we have both start and end in the same individual)
+ftgpm-shapes:ot_time_consistency
+  a sh:NodeShape ;
+  sh:targetClass process-trace:Event ;
+  sh:sparql [
+    a sh:SPARQLConstraint ;
+    sh:message "Proces trace Event end date must be greater than or equal to the begin Date.";
+    sh:select
+      """
+	  SELECT $this (?beginTime AS ?intervalStart) (?endTime AS ?intervalEnd)
+      WHERE {
+        $this     process-trace:hasTime        ?time .
+        ?time     process-trace:ReferenceBegin ?beginIRI ;
+                  process-trace:ReferenceEnd   ?endIRI .
+        ?beginIRI time:inXSDDate               ?beginDate .
+        ?endIRI   time:inXSDDate               ?endDate .
+        FILTER  (!(?endDate >= ?beginDate))
+      }
+	  """ ;
+  ] ;
+  sh:closed false .

+ 1 - 0
examples/oml/car_example/build.gradle

@@ -161,6 +161,7 @@ task owlReason(type:io.opencaesar.owl.reason.OwlReasonTask, group:"oml", depends
 task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
     configurationPath = file('.fuseki.ttl')
     outputFolderPath = file('.fuseki')
+    webUI = true
 }
 
 /*

+ 1 - 0
examples/oml/simple_car/build.gradle

@@ -111,6 +111,7 @@ task owlReason(type:io.opencaesar.owl.reason.OwlReasonTask, group:"oml", depends
 task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
     configurationPath = file('.fuseki.ttl')
     outputFolderPath = file('.fuseki')
+    webUI = true
 }
 
 /*