-
Notifications
You must be signed in to change notification settings - Fork 8
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 and inter-collection relationship graphs in schema documentation #2198
Changes from all commits
3d4820b
9852362
5ecdcd5
ea3794b
27754b1
9c22098
aa4843c
80d509d
d8ed9b3
4e753b9
9b750e1
8915b2b
53a7875
168a3cc
4da13d4
472270e
8acd4c3
904ff38
9911c4c
e5943a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,18 @@ jobs: | |
- name: Install dependencies | ||
run: poetry install -E docs | ||
|
||
- name: Build documentation | ||
- name: Derive files from sources | ||
# Note: First, we replace the "0.0.0" placeholder version number in `pyproject.toml`. | ||
# Reference: https://github.com/mtkennerly/poetry-dynamic-versioning/blob/master/README.md#command-line-mode | ||
run: | | ||
mkdir -p site | ||
touch site/.nojekyll | ||
poetry self add "poetry-dynamic-versioning[plugin]" | ||
poetry dynamic-versioning | ||
make squeaky-clean all | ||
|
||
- name: Generate web-based documentation | ||
run: | | ||
mkdir -p docs | ||
touch docs/.nojekyll | ||
make gendoc | ||
poetry run mkdocs build -d site | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that this command is present in this |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,13 +155,23 @@ $(PYMODEL): | |
$(DOCDIR): | ||
mkdir -p $@ | ||
|
||
# Compile static Markdown files, images, and JavaScript scripts, into a documentation website. | ||
# | ||
# Then, use `refgraph` (part of `refscan`) to generate a pair of graphs (i.e. network diagrams), | ||
# one that depicts inter-collection relationships and one that depicts inter-class relationships. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My two cents here is it will be confusing and not very useful to distribute the inter-class relationship diagram until we make the ranges as strict as the structured syntax patterns. |
||
# | ||
gendoc: $(DOCDIR) | ||
# added copying of images and renaming of TEMP.md | ||
cp $(SRC)/docs/*md $(DOCDIR) ; \ | ||
cp -r $(SRC)/docs/images $(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` (part of `refscan`) to generate interactive diagrams within the compiled documentation file tree. | ||
# One diagram depicts the relationships between collections and the other depicts the relationships between classes. | ||
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 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Visualizations | ||
|
||
## Inter-collection relationship diagram | ||
|
||
<!-- Note: `visualizations/collection-graph.html` does not exist in the source code repository. | ||
It gets generated as part of the documentation build process. --> | ||
This [**inter-collection relationship diagram**](visualizations/collection-graph.html) | ||
shows the database **collections** described by the schema, and the **relationships** between those collections. | ||
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: These 3 lines were moved to an earlier step (i.e. to lines 36-38) so that a documentation website file tree exists by the time we try to inject the graphs into it (i.e. on lines 50-51).