Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include inter-class relationship graph in schema documentation #2243

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,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) prefixmaps
# Copy all documentation files to the documentation directory
cp -rf $(SRC)/docs/* $(DOCDIR)
Expand All @@ -181,9 +182,11 @@ gendoc: $(DOCDIR) prefixmaps
# Create directory for JavaScript files and copy them
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

MKDOCS = $(RUN) mkdocs
Expand Down
12 changes: 12 additions & 0 deletions src/docs/visualizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<!-- Note: `visualizations/class-graph.html` does not exist in the source code repository.
It gets generated as part of the documentation build process. -->
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.
Loading