Explorar o código

WIP: Drawio vocabulary

Joeri Exelmans %!s(int64=2) %!d(string=hai) anos
pai
achega
6c483f3fb5

+ 46 - 10
examples/oml/CDF/src/oml/flandersmake.be/cdf/vocabulary/drawio.oml

@@ -2,21 +2,62 @@
 vocabulary <http://flandersmake.be/cdf/vocabulary/drawio#> as drawio {
 vocabulary <http://flandersmake.be/cdf/vocabulary/drawio#> as drawio {
 
 
 	extends <http://flandersmake.be/cdf/vocabulary/object_diagram#> as object_diagram
 	extends <http://flandersmake.be/cdf/vocabulary/object_diagram#> as object_diagram
+	extends <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic
 	extends <http://flandersmake.be/cdf/vocabulary/dict#> as dict
 	extends <http://flandersmake.be/cdf/vocabulary/dict#> as dict
 	extends <http://www.w3.org/2001/XMLSchema#> as xsd
 	extends <http://www.w3.org/2001/XMLSchema#> as xsd
 
 
-	aspect element :> object_diagram:Object
+	aspect element :> object_diagram:Object []
 	
 	
-	concept Page :> element [
+	// Cells and Pages have a GUID generated by drawio.
+	aspect elementWithDrawioId [
+		restricts scalar property hasDrawioId to exactly 1
+	]
+	scalar property hasDrawioId [
+		domain elementWithDrawioId
+		range xsd:string
+		functional
+	]
+
+	concept Cell :> elementWithDrawioId [
+		
+	]
+	relation entity HasParentCell :> acyclic:Acyclic, object_diagram:Link [
+		from Cell
+		to Cell
+		forward hasParent
+		reverse hasChild
+		asymmetric
+		irreflexive
+		functional // all cells have one parent, except for the root cell
+	]
+	
+	concept Vertex :> Cell []
+	concept Edge :> Cell []
+	
+	concept Page :> elementWithDrawioId [
 		restricts relation ofModel to exactly 1
 		restricts relation ofModel to exactly 1
 		restricts scalar property hasName to exactly 1
 		restricts scalar property hasName to exactly 1
-		restricts scalar property hasDrawioId to exactly 1
+
 	]
 	]
 	
 	
-	relation entity HasPageAttribute [
+	relation entity HasPageAttribute :> object_diagram:Link [
 		from Page
 		from Page
 		to PageAttribute
 		to PageAttribute
-		
+		forward hasAttribute
+		reverse ofPage
+		asymmetric
+		irreflexive
+		inverse functional
+	]
+	relation entity HasRootCell :> object_diagram:Link [
+		from Page
+		to Cell
+		forward hasRootCell
+		reverse isRootOf
+		asymmetric
+		irreflexive
+		functional
+		inverse functional
 	]
 	]
 	
 	
 	concept PageAttribute :> dict:DictEntry []
 	concept PageAttribute :> dict:DictEntry []
@@ -27,11 +68,6 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/drawio#> as drawio {
 		functional
 		functional
 	]
 	]
 	
 	
-	scalar property hasDrawioId [
-		domain Page
-		range xsd:string
-		functional
-	]
 	
 	
 	// A Drawio file:
 	// A Drawio file:
 	concept Model :> object_diagram:Model [
 	concept Model :> object_diagram:Model [