GraphViz, PlantUML, and IdStrings
David Kemp
We discussed GraphViz and PlantUML today; here is the GraphViz version of the SPDX 2.2 information model (level of detail: conceptual). You can paste it into any number of tools, I like https://sketchviz.com/ (not because it has a sketchy mode, but because the UI feels friendliest to me.) As you can see, it does it's own layout. This is convenient and often provides valuable insight, but isn't what a true artist like William would put into a model diagram 😁. Artists need layout control, so a format like diagrams.net (the new name for draw.io) that gives that control is required. ----------------------- Also look at the content of the GraphViz file. The IdStrings are simple numbers n0-n37, each node ID is accompanied by hints ([label="xyz"]), and the hints can be deleted without destroying the graph. The graph will be laid out the same with or without the labels/hints, and most importantly, n3 without a hint is the same node as n3 with a hint. IdStrings should have this same property - hints do not affect equality. Dave # title: SPDX v2.2 Information Model # package: http://spdx.org/spdx-v2.2 # license: CC0-1.0 # namespaces: {'ll': 'http://spdx.org/license-list'} # exports: ['Document'] digraph G { graph [fontname=Times, fontsize=12]; node [fontname=Arial, fontsize=8, shape=box, style=filled, fillcolor=lightskyblue1]; edge [fontname=Arial, fontsize=7, arrowsize=0.5, labelangle=45.0, labeldistance=0.9]; bgcolor="transparent"; n0 [label="Document"] n0 -> n1 [label="externalDocumentRefs", headlabel="0..*", taillabel="1"] n0 -> n2 [label="creationInfo", headlabel="1", taillabel="1"] n0 -> n3 [label="packages", headlabel="0..*", taillabel="1"] n0 -> n4 [label="files", headlabel="1..*", taillabel="1"] n0 -> n5 [label="snippets", headlabel="0..*", taillabel="1"] n0 -> n36 [label="hasExtractedLicensingInfos", headlabel="0..*", taillabel="1"] n0 -> n6 [label="relationships", headlabel="0..*", taillabel="1"] n0 -> n7 [label="annotations", headlabel="0..*", taillabel="1"] n1 [label="External\nDocument\nRef"] n1 -> n26 [label="checksum", headlabel="1", taillabel="1"] n2 [label="Creation\nInfo"] n3 [label="Package\nInfo"] n3 -> n25 [label="packageVerificationCode", headlabel="0..1", taillabel="1"] n3 -> n26 [label="checksums", headlabel="0..*", taillabel="1"] n3 -> n28 [label="externalRefs", headlabel="0..*", taillabel="1"] n3 -> n7 [label="annotations", headlabel="0..*", taillabel="1"] n4 [label="File\nInfo"] n4 -> n26 [label="checksums", headlabel="0..*", taillabel="1"] n4 -> n28 [label="externalRefs", headlabel="0..*", taillabel="1"] n4 -> n7 [label="annotations", headlabel="0..*", taillabel="1"] n4 -> n35 [label="artifactOf", headlabel="0..*", taillabel="1"] n5 [label="Snippet\nInfo"] n5 -> n33 [label="ranges", headlabel="1..*", taillabel="1"] n5 -> n7 [label="annotations", headlabel="0..*", taillabel="1"] n6 [label="Relationship"] n7 [label="Annotation"] n23 [label="Entity\nAlternate"] n25 [label="Package\nVerification\nCode"] n26 [label="Checksum"] n27 [label="Checksum\nAlternate"] n28 [label="External\nRef"] n33 [label="Range"] n33 -> n34 [label="startPointer", headlabel="1", taillabel="1"] n33 -> n34 [label="endPointer", headlabel="1", taillabel="1"] n34 [label="Range\nPointer"] n35 [label="Artifact"] n36 [label="Extra\nLicensing\nInfo"] n37 [label="Cross\nRef"] } |
|