Semantically-annotated Automata

From Educational Exercises and Activities Community Group
<automaton id="automaton1" start="#node1">
  <head>
    <script type="text/javascript" src="..." />
    <script type="text/javascript">...</script>
    <data type="application/rdf+xml" src="..." />
    <data type="application/rdf+xml">
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
        <rdf:Description rdf:about="#automaton1"><!-- ... --></rdf:Description>
        <rdf:Description rdf:about="#region1"><!-- ... --></rdf:Description>
        <rdf:Description rdf:about="#region2"><!-- ... --></rdf:Description>
      </rdf:RDF>
    </data>
  </head>
  <body>
    <region id="region1" onenter="function1(event);" onexit="function2(event);" />
    <region id="region2" onenter="function3(event);" onexit="function4(event);" />
    <node id="node1" onenter="function5(event);" onexit="function6(event);" of="#region1">
      <edge id="edge1" to="#node2" input="..." output="..." ontransition="function7(event);" of="#region1" />
    </node>
    <node id="node2" onenter="function8(event);" onexit="function9(event);" of="#region1 #region2">
      <edge id="edge2" to="#node3" input="..." output="..." ontransition="function10(event);" of="#region2" />
    </node>
    <node id="node3" onenter="function11(event);" onexit="function12(event);" of="#region2" />
  <body>
</automaton>
<automaton id="automaton1" start="#node1">
  <head>
    <script type="text/javascript" src="..." />
    <script type="text/javascript">...</script>
    <data type="application/ld+json" src="..." />
    <data type="application/ld+json">
    [{
      "@id": "#automaton1",
      ...
    },
    {
      "@id": "#region1",
      ...
    },
    {
      "@id": "#region2",
      ...
    }]
    </data>
  </head>
  <body>
    <region id="region1" onenter="function1(event);" onexit="function2(event);" />
    <region id="region2" onenter="function3(event);" onexit="function4(event);" />
    <node id="node1" onenter="function5(event);" onexit="function6(event);" of="#region1">
      <edge id="edge1" to="#node2" input="..." output="..." ontransition="function7(event);" of="#region1" />
    </node>
    <node id="node2" onenter="function8(event);" onexit="function9(event);" of="#region1 #region2">
      <edge id="edge2" to="#node3" input="..." output="..." ontransition="function10(event);" of="#region2" />
    </node>
    <node id="node3" onenter="function11(event);" onexit="function12(event);" of="#region2" />
  <body>
</automaton>