samepage-network / roam-samepage

MIT License
4 stars 2 forks source link

Purpose of getRelationTypes() #19

Closed mdroidian closed 7 months ago

mdroidian commented 7 months ago

What is the intended Purpose/Goal of getRelationTypes()?

The query result returns:

[
  [
    {
      children: [
        {
          ":db/id": 27351,
        },
        {
          ":db/id": 27384,
        },
        {
          ":db/id": 27480,
        },
      ],
      id: "_lGr4e4Jc",
      text: "relations",
      order: 3,
    },
  ],
]

But it is them mapped over to look for specifications. And the return seems to imply a discourse node rather than a discourse relation

https://github.com/samepage-network/roam-samepage/blob/0cde6cced2caa2e42e7ab5d0fe86e521a806ae45/src/utils/getDatalogQuery.ts#L1187

I tried to see where it might be used to infer it's intent, but I don't believed it is used yet. It is then passed as context to the translator.

Should it be returning something similar to query builder's getDiscourseRelations()?

dvargas92495 commented 7 months ago

This is WIP that was never finished. The overall goal of these files was to support the query builder spec in samepage's backend, so we could start extending it for other applications.

But yes, the intent is for it to reproduce getDiscourseRelations()