Advertisement
Guest User

some

a guest
Aug 9th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. //---------------------------------------------------
  2. // vertex -- [id, datetime, params, values] - variable/property
  3. //
  4. //state -- (ontology class) - [p,datetime,s, params,values, o[vertices+messages]] function (returns data) = class
  5. //stream -- (ontology class) - [p,datetime,s, params,values, o[vertexes, active edges]] function (returns action) = edges (subscriptions)
  6. //
  7. //session -- (function) --- context (edge) | definition(subject), body(constants + flow), arguments(inputs = messages), params(params), result => messages/actions
  8. //
  9. //message=state -- realine (ontology property) -- [p,datetime,s,[vertex || edges], params,values] (event)
  10. //
  11. //state machine: event -- action (transition) -- event -- listening to new event
  12. //---------------------------------------------------
  13. // edge -- [p,datetime,s,o, params,values]
  14. //vertex -- [id, datetime, params, values]
  15. //-------------------------------
  16. //
  17. // Intersection(old data)
  18. //- state 1 and state 2
  19. //- state1(vertex --> edges) --> state2(vertexes) ===> events[]
  20. //
  21. //Event filtration:
  22. // - stream1(vertex, edge) ---> message(edge)
  23. //
  24. //Assertion:
  25. // - filtration chain ---> object prop -- add new edges, vertex --> data prop....
  26. //
  27. //cardinality --> how many subscriptions to set up
  28. //restrictions --> rules, criteria
  29. //
  30. //-------------------
  31.  
  32. const coordinate = 1;
  33. const vertex = [coordinate, Date.now(), [], []];
  34.  
  35. const edge = [
  36. vertex, // sasha
  37. vertex, // hasDistanceTo
  38. vertex, // vasia
  39. Date.now(),
  40. [], // distance = 70
  41. []
  42. ];
  43.  
  44. const state = [vertex, vertex, [vertex, edge], Date.now(), [], []];
  45. const context = [vertex, vertex, [state, state], Date.now(), [], []];
  46.  
  47. const vasia = 1;
  48. const lives = 2;
  49. const apartment = 16;
  50. const vasiaInitialState = [vasia, lives, apartment];
  51. const hasDistanceTo = function(myApartment, vasiaApartment) {
  52. // return myApartment - vasiaApartment = distance
  53. }
  54.  
  55. const assertionParameters = [
  56. vertex/*definition (has Neighbour)*/,
  57. vertex/*result {expected Neighbour}*/,
  58. [vertex/*listen (Person)*/, edge/*listen (Person)*/],
  59. Date.now(),
  60. []/*preconditions, postconditions - cardinality,restrictions (DistanceFromFlat < 50)*/,
  61. []/*some function (get Neighbour)*/
  62. ];
  63.  
  64. // action params
  65. const moved = 10;
  66. const change = -6; // from apartment 16 to 10;
  67. const action = [vasia, moved, change];
  68. const afterAction = [vasia, lives, apartment + change];
  69.  
  70. const session = function(msg, args, context, definition) {
  71. // msg = button clicked
  72. // args = {username: 'sasha', password: 123}
  73. // context = login to company, some login form
  74. // definition = array of actions
  75. // to do something, need to do assertion
  76. // to do assertion need additional data or run function which gets data
  77. // validate criteria with restrictions
  78. // select action
  79. // commit to execute action
  80. // execute action
  81. // result is event or call next action
  82. };
  83.  
  84. /*<EquivalentClasses>
  85. <Class IRI="#Neighbour"/>
  86. <ObjectIntersectionOf>
  87. <Class IRI="#Person"/>
  88. <DataSomeValuesFrom>
  89. <DataProperty IRI="#DistanceFromFlat"/>
  90. <DatatypeRestriction>
  91. <Datatype abbreviatedIRI="xsd:int"/>
  92. <FacetRestriction facet="http://www.w3.org/2001/XMLSchema#maxExclusive">
  93. <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#int">50</Literal>
  94. </FacetRestriction>
  95. </DatatypeRestriction>
  96. </DataSomeValuesFrom>
  97. </ObjectIntersectionOf>
  98. </EquivalentClasses>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement