From 906ca10d4707a04989c9ea3d58e1a2924a145e5f Mon Sep 17 00:00:00 2001 From: eecavanna Date: Fri, 1 Nov 2024 13:16:46 -0700 Subject: [PATCH] Generate inter-class relationship diagram and add it to docs site --- Makefile | 8 +++++--- src/docs/visualizations.md | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2ec5793c35..7085775fb8 100644 --- a/Makefile +++ b/Makefile @@ -157,8 +157,9 @@ $(DOCDIR): # Compile static Markdown files, images, and JavaScript scripts, into a documentation website. # -# Then, use `refgraph` (part of `refscan`) to generate a diagram (i.e. a graph that depicts -# inter-collection relationships) in the documentation website's file tree. +# Then, use `refgraph` (part of `refscan`) to generate a pair of diagrams within the website's file tree. +# One of the diagrams is a graph showing all the _inter-collection_ relationships the schema says can exist, +# and the other diagram is a graph showing all the _inter-class_ relationships the schema says can exist. gendoc: $(DOCDIR) # added copying of images and renaming of TEMP.md cp $(SRC)/docs/*md $(DOCDIR) ; \ @@ -166,9 +167,10 @@ gendoc: $(DOCDIR) $(RUN) gen-doc -d $(DOCDIR) --template-directory $(SRC)/$(TEMPLATEDIR) --include src/schema/deprecated.yaml $(SOURCE_SCHEMA_PATH) mkdir -p $(DOCDIR)/javascripts $(RUN) cp $(SRC)/scripts/*.js $(DOCDIR)/javascripts/ - # Use `refgraph` to generate an interactive diagram within the compiled documentation website file tree. + # Use `refgraph` (part of `refscan`) to generate diagrams within the website's file tree. mkdir -p $(DOCDIR)/visualizations $(RUN) refgraph --schema nmdc_schema/nmdc_materialized_patterns.yaml --subject collection --graph $(DOCDIR)/visualizations/collection-graph.html + $(RUN) refgraph --schema nmdc_schema/nmdc_materialized_patterns.yaml --subject class --graph $(DOCDIR)/visualizations/class-graph.html testdoc: gendoc serve diff --git a/src/docs/visualizations.md b/src/docs/visualizations.md index a20286a5a7..9f92928337 100644 --- a/src/docs/visualizations.md +++ b/src/docs/visualizations.md @@ -11,3 +11,15 @@ Each circle represents a collection. Each arrow represents all of the fields that documents in one collection—the one at that arrow's tail—can use to refer to documents in another collection—the one at that arrow's head. If you click on a circle, the names of the fields will appear on the arrows connected to that circle. + +## Inter-class relationship diagram + + +This [**inter-class relationship diagram**](visualizations/class-graph.html) +shows the **classes** defined within the schema, and the **relationships** between those classes. + +Each circle represents a class. +Each arrow represents all of the slots that instances of that class—the one at that arrow's tail—can +use to refer to instances of another class—the one at that arrow's head. +If you click on a circle, the names of the slots will appear on the arrows connected to that circle.