#937 Sub-proposal: Refs and Input/Output

Brian Frank Mon 19 Jul

This is a sub-proposal of the broader 940 Haystack 4 proposal.

The current path we are using requires coining three defs every time you want to create a flow relationships. For example:

  • hotWaterRef
  • hot-water-output
  • hot-water-input

This pattern leads to lots of boiler plate definitions. And furthermore it doesn't actually work today unless we also coin a first class hot-water-tank, hot-water-valve, hot-water-pump, etc.

Instead, I propose that inputs and outputs just become associations as part of the ontology. But with that change, we no longer have a single symbol that identifies the referent type of a ref tag. So I propose to replace the of tag (which is a symbol value) with the refTo tag with a filter string value.

// old design
def: ^hotWaterRef
is: ^ref
of: ^hot-water-output

// new design
def: ^hotWaterRef
is: ^ref
refTo: "outputs? ^hot-water"

We will discuss the actual syntax above in a separate sub-proposal 938. Putting it all together:

// current design
def: ^hotWaterRef
is: ^ref
of: ^hot-water-output
tagOn: ^hot-water-input
inputs: ^hot-water
----
def: ^hot-water-input
is: ^input
----
def: ^hot-water-output
is: ^output
----
def: ^hotWaterHeating
is: [^heatingProcessType, ^hot-water-input]

Proposed new design:

// proposed design
def: ^hotWaterRef
is: ^ref
refTo: "outputs? ^hot-water"
tagOn: ^hotWaterHeating
inputsFrom: ^hot-water
----
def: ^hotWaterHeating
is: ^heatingProcess 

Couple aspects to note:

  1. We are using inputs/outputs on the entity level to replace the foo-input and foo-output pattern
  2. So we use inputsFrom and outputsTo now as our relationship terms

Login or Signup to reply.