|
|
@@ -2,8 +2,12 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
|
|
|
|
|
|
extends <http://flandersmake.be/cdf/vocabulary/object_diagram#> as object_diagram
|
|
|
extends <http://www.w3.org/2001/XMLSchema#> as xsd
|
|
|
+
|
|
|
+ extends <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic
|
|
|
|
|
|
- aspect State :> object_diagram:Object [
|
|
|
+ aspect element :> object_diagram:Object []
|
|
|
+
|
|
|
+ aspect State :> element [
|
|
|
restricts scalar property hasName to exactly 1
|
|
|
]
|
|
|
|
|
|
@@ -15,6 +19,7 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
|
|
|
|
|
|
concept OrState :> State [
|
|
|
restricts relation hasDefaultState to exactly 1
|
|
|
+ restricts relation hasChild to min 1
|
|
|
]
|
|
|
|
|
|
relation entity DefaultState :> object_diagram:Link [
|
|
|
@@ -26,10 +31,15 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
|
|
|
asymmetric
|
|
|
irreflexive
|
|
|
]
|
|
|
+
|
|
|
+ rule DefaultStateIsChild [
|
|
|
+ OrState(P) ^ hasDefaultState(P,C) -> hasChild(P,C)
|
|
|
+ ]
|
|
|
+
|
|
|
|
|
|
concept AndState :> State []
|
|
|
|
|
|
- relation entity Parent :> object_diagram:Link [
|
|
|
+ relation entity Parent :> object_diagram:Link, acyclic:Acyclic [
|
|
|
from State
|
|
|
to State
|
|
|
forward hasParent
|
|
|
@@ -39,13 +49,36 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
|
|
|
irreflexive
|
|
|
]
|
|
|
|
|
|
- relation entity Transition :> object_diagram:Link [
|
|
|
+ // Uncomment to add transitive 'hasAncestor' relation and forbid parent cycles:
|
|
|
+
|
|
|
+ // relation entity HasAncestor [
|
|
|
+ // from State
|
|
|
+ // to State
|
|
|
+ // forward hasAncestor
|
|
|
+ // reverse hasDescendant
|
|
|
+ // asymmetric
|
|
|
+ // irreflexive
|
|
|
+ // transitive // seems to have no effect in current version of OWL reasoner, see workaround below
|
|
|
+ // ]
|
|
|
+ //
|
|
|
+ // rule ParentIsAncestor [
|
|
|
+ // hasParent(C,P) -> hasAncestor(C,P)
|
|
|
+ // ]
|
|
|
+ //
|
|
|
+ // // Workaround:
|
|
|
+ // rule MakeTransitive [
|
|
|
+ // hasAncestor(C,P) ^ hasAncestor(P,P2) -> hasAncestor(C,P2)
|
|
|
+ // ]
|
|
|
+
|
|
|
+ relation entity Transition :> object_diagram:Link, element [
|
|
|
from State
|
|
|
to State
|
|
|
- // uncomment to make label mandatory:
|
|
|
+
|
|
|
restricts scalar property hasLabel to exactly 1
|
|
|
]
|
|
|
|
|
|
+ // Currently, OML thinks the relation 'hasLabel' is a subtype of 'hasName'.
|
|
|
+ // Not sure why. This is not intended.
|
|
|
scalar property hasLabel :> object_diagram:hasField [
|
|
|
domain Transition
|
|
|
range xsd:string
|
|
|
@@ -54,7 +87,7 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
|
|
|
|
|
|
concept Model :> object_diagram:Model, object_diagram:Object [
|
|
|
restricts relation hasRoot to exactly 1
|
|
|
- restricts all relation object_diagram:hasObject to State
|
|
|
+ restricts all relation object_diagram:hasObject to element
|
|
|
]
|
|
|
|
|
|
relation entity Root :> object_diagram:Link [
|