Project Michael Dings Impressum Login

Dings-Feature-Browse-Graph

I am a Feature.

Also

- I am a Todo.

- I am a Work-Item.

About

Goal

Definiere und implementiere eine erste saubere Richtung für das neue graph Sub-Command von dings-gpt.

Das graph Sub-Command zeigt Graph-Projektionen aus bestehenden Dings-Channels.

Erster CLI-Schnitt:

dings-gpt graph classes [SELECTION]

Current Status

Der erste Schnitt ist implementiert.

Aktuelle Richtung:

dings-gpt graph classes [SELECTION]

zeigt die Class-Hierarchy eines oder mehrerer Dings.

Beispiel:

dings-gpt graph classes 70000225,200040057,0

Die Ausgabe besteht aus Result-Blocks. Bei mehreren Result-Blocks wird jeder Block durch eine Separator-Zeile abgeschlossen:

---

Channel Model

Der Graph-Channel heißt:

gr

Grundsatz:

gr is not sm3.
gr is a Graph-Projection Channel from an explicit Source_Channel.

Mögliche Graph-Projektionen:

md  -> gr
si  -> gr
sm1 -> gr
sm2 -> gr

oder expliziter:

gr(md)
gr(si)
gr(sm1)
gr(sm2)

Ein gr Result muss seine Herkunft kennen:

Channel
Source_Channel
Source_Field or Source_View
Graph_View
Edge_Type

V1 Meaning

Für graph classes gilt aktuell:

Channel        = gr
Source_Channel = sm1
Graph_View     = Class_Hierarchy
Edge_Type      = Base_Class

Die V1-Sicht wird aus sm1 gebaut.

graph erzeugt keine neue semantische Wahrheit.

Class Types

Die Base-Class-Sicht unterscheidet:

main
also

Bedeutung:

main = main explicit Base-Class
also = additional explicit Base-Classes

Aktuelle Option:

-type VALUE

-type ist eine Listen-Option.

Unterstützte Werte:

main
also
main,also
all
all,!main
all,!also

Default:

-type all

Das bedeutet:

graph classes

zeigt standardmäßig alle expliziten Base-Classes aus sm1:

main
also

Naming

Die frühere Bezeichnung:

Dings_SM_Base_Class_Definition

wurde umbenannt zu:

Dings_SM_Base_Class_Main

Damit steht Main sauber neben Also.

Important Distinction

graph classes ist nicht dasselbe wie graph parents.

classes = Base-Class / Class-Hierarchy
parents = Relation-Parents / Statement-Parents

Beispiel für Class-Hierarchy:

I am a [Human](40000001.md).

Beispiel für Relation-Parents:

- My [Creator](60106.md) is [Ridley_Scott](70000225.md).

Deshalb bleibt graph parents für spätere Relation-Parent-Views reserviert.

Möglicher späterer Schnitt:

dings-gpt graph parents Blade_Runner --predicate Creator

Graph-Ontology

Das Sub-Command soll sich an der bestehenden Graph-Ontology orientieren:

600087.md   Graph
9015001.md  Graph_Node
9015002.md  Graph_Edge
9015003.md  Graph_Path
9015004.md  Graph_Fn_Get_Shortest_Path
9015005.md  Graph_Fn_Get_Shortest_Path_Length

Für den aktuellen Stand sind vor allem relevant:

Graph
Graph_Node
Graph_Edge

Spätere Commands können verwenden:

Graph_Path
Graph_Fn_Get_Shortest_Path
Graph_Fn_Get_Shortest_Path_Length

Possible gr JSON File Naming

Falls gr Ergebnisse persistiert werden, soll das Dateinamen-Schema sein:

<DINGS>.gr.<source-channel>.json

Beispiele:

640062.gr.md.json
640062.gr.si.json
640062.gr.sm1.json
640062.gr.sm2.json

Lesart:

640062.gr.sm1.json

bedeutet:

Dings:          640062
Channel:        gr
Source_Channel: sm1
Format:         json

Die Information muss zusätzlich im JSON selbst stehen.

Invariante:

The Channel and Source_Channel encoded in the File Name must match the JSON Content.

JSON Type Rule

Alle Dings-Referenzen im gr Channel sollen als Strings serialisiert werden.

Grund:

Dings Numbers are Identifiers, not Calculation Values.

Also:

"Root_Dings_Number": "640062"

nicht:

"Root_Dings_Number": 640062

Das gilt entsprechend für Nodes und Edges:

{
  "Dings_Number": "640062",
  "Source_Dings_Number": "640062",
  "Target_Dings_Number": "600041"
}

Minimal gr JSON Shape

Ein mögliches minimales gr Result:

{
  "Channel": "gr",
  "Source_Channel": "sm1",
  "Graph_View": "Class_Hierarchy",
  "Edge_Type": "Base_Class",
  "Root_Dings_Number": "640062",
  "Class_Type": "main,also",
  "Class_Type_List": [
    "main",
    "also"
  ],
  "Graph_Node_List": [
    {
      "Dings_Number": "640062",
      "Dings_Name": "Domain-specific-Language"
    },
    {
      "Dings_Number": "600041",
      "Dings_Name": "Language"
    }
  ],
  "Graph_Edge_List": [
    {
      "Source_Dings_Number": "640062",
      "Target_Dings_Number": "600041",
      "Edge_Type": "Base_Class",
      "Class_Type": "main"
    }
  ]
}

Default CLI Output

Die Default-Ausgabe ist menschenlesbar.

Beispiel-Form:

# Ridley_Scott (70000225)

Classes:

Main:

└── Human (40000001)
    └── Biologic-Species (40000022)

Also:

├── Knight-Grand-Cross (180020004)
│   └── Human (40000001)
└── Movie-Director (200300002)
    └── Profession (202000000)

Implementation Rules

graph classes soll nicht direkt Markdown parsen.

Es soll über die bestehenden Pipeline-Strukturen gehen:

md -> si -> sm1 -> sm2

Für den aktuellen Schnitt:

Source_Channel = sm1
Graph_View     = Class_Hierarchy
Edge_Type      = Base_Class

Regeln:

gr must not create new Semantic Truth.
gr must not correct sm1 or sm2.
gr must not infer new Class Memberships.
Every Graph Edge must be traceable to its Source_Channel and Source_Field or Source_View.

Non-Goals

Aktuell nicht:

Follow-Up

Nach diesem Zwischenstand soll zunächst das Todo-Feature umgesetzt werden:

dings-gpt show sm todo

Danach kann das Graph-Subcommand abgeschlossen werden.

Möglicher späterer Branch:

Browse-Graph-Finish

Mögliche spätere Erweiterungen:

dings-gpt graph classes <DINGS> -format tree
dings-gpt graph classes <DINGS> -format edges
dings-gpt graph classes <DINGS> -format gr
dings-gpt graph classes <DINGS> -format json
dings-gpt graph classes <DINGS> -depth N

dings-gpt graph parents <DINGS> -predicate Creator
dings-gpt graph children <DINGS>
dings-gpt graph path <FROM> <TO>
dings-gpt graph distance <FROM> <TO>

Core Principle

gr is not sm3.
gr is a Graph-Projection Channel from an explicit Source_Channel.