Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions behaviour/fsm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"@context": {
"fsm": "https://secorolab.github.io/metamodels/behaviour/fsm#",
"xsd": "http://www.w3.org/2001/XMLSchema#",

"FSM": "fsm:FSM",

"name": { "@id": "fsm:name", "@type": "xsd:string" },
"description": { "@id": "fsm:description", "@type": "xsd:string" },

"State": "fsm:State",
"Transition": {
"@id": "fsm:Transition",
"@context": {
"transition-from": {
"@id": "fsm:transition-from",
"@type": "@id"
},
"transition-to": {
"@id": "fsm:transition-to",
"@type": "@id"
}
}
},
"Reaction": {
"@id": "fsm:Reaction",
"@context": {
"when-event": {
"@id": "fsm:when-event",
"@type": "@id"
},
"do-transition": {
"@id": "fsm:do-transition",
"@type": "@id"
},
"fires-events": {
"@id": "fsm:fires-events",
"@container": "@set",
"@type": "@id"
}
}
},

"states": {
"@id": "fsm:states",
"@container": "@set"
},

"start-state": { "@id": "fsm:start-state", "@type": "@id" },
"current-state": { "@id": "fsm:current-state", "@type": "@id" },
"end-state": { "@id": "fsm:end-state", "@type": "@id" },

"events": {
"@id": "fsm:events",
"@container": "@set"
},

"transitions": {
"@id": "fsm:transitions",
"@container": "@set"
},

"reactions": {
"@id": "fsm:reactions",
"@container": "@set"
}
}
}
111 changes: 111 additions & 0 deletions behaviour/fsm.shacl.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix fsm: <https://secorolab.github.io/metamodels/behaviour/fsm#> .
@prefix el: <https://secorolab.github.io/metamodels/behaviour/event_loop#> .

fsm:FSMShape
a sh:NodeShape ;
sh:targetClass fsm:FSM ;

sh:property [
sh:path fsm:name ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:description ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:states ;
sh:node fsm:StateShape ;
sh:minCount 1 ;
] ;

sh:property [
sh:path fsm:start-state ;
sh:class fsm:State ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:end-state ;
sh:class fsm:State ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:current-state ;
sh:class fsm:State ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:events ;
sh:class el:Event ;
sh:minCount 1 ;
] ;

sh:property [
sh:path fsm:transitions ;
sh:node fsm:TransitionShape ;
sh:minCount 1 ;
] ;

sh:property [
sh:path fsm:reactions ;
sh:node fsm:ReactionShape ;
sh:minCount 1 ;
] .

fsm:StateShape
a sh:NodeShape ;
sh:targetClass fsm:State .

fsm:TransitionShape
a sh:NodeShape ;
sh:targetClass fsm:Transition ;

sh:property [
sh:path fsm:transition-from ;
sh:class fsm:State ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:transition-to ;
sh:class fsm:State ;
sh:minCount 1 ;
sh:maxCount 1 ;
] .

fsm:ReactionShape
a sh:NodeShape ;
sh:targetClass fsm:Reaction ;

sh:property [
sh:path fsm:when-event ;
sh:class el:Event ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:do-transition ;
sh:class fsm:Transition ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

sh:property [
sh:path fsm:fires-events ;
sh:class el:Event ;
] .