Trying out PlantUML with a package diagram for Schematron

Posted on March 8, 2017 by Rick Jelliffe

PlantUML is a neat tool, quite mature, for generating UML diagrams from text, using a little domain-specific language. It reminds me of UNIX pic, which allowed really fast and easy generation of diagram, up to a point. WYSIWYG really sucks for many technical diagrams: I actively dislike Visio for UML, but I have had good experiences with Enterprise Architect except it is so damn big now. I can imagine it could be used to render Schematron converted to UML (whatever that would look like).

Anyway, I thought I would give PlantUML a try with a package diagram for Schematron: perhaps more a mind map than a package diagram, to help surface how I think Schematron is organized.

The code for this is here:

@startuml
package "Schematron" {

[Schematron Core] <.. [Properties]
[Schematron Core] <.. [Diagnostics]
[Modeling] ..> [Schematron Core]
[SenseMaking] ..> [Schematron Core]
[Schematron Core] ..> [Web]

note top of [Schematron Core]
Find the presence or absence of patterns in XML documents
<assert>, <report>, <rule>, <pattern>, <let>, <schema>, <ns>
Describe the patterns in a rich way
<name>, <value-of>, <title>, <p>, <span>, <emph>, @id
end note

note bottom of SenseMaking
How does this assertion fit?
@see, @role, @subject
end note

note bottom of Modeling
Does the rule, pattern or schema fit
into some bigger picture?
<phase>, <active>, <include>,
<extends>, @abstract, @is-a
end note

note bottom of Web
Does the document fit into
some bigger picture?
document(), property/@document,
<param>,
end note

note bottom of Diagnostics
What does the human need to know?
<diagnostics>, <diagnostic>
end note

note bottom of Properties
What information do we need to send
to downstream processors?
<properties>, <property>
end note

}

[Schematron Core] <.. [QuickFix]

note bottom of QuickFix
What can we do to simply
adjust the document?
end note

Schematron –> () Skeleton

note top of Skeleton
Plug in API for different reports
end note

() Skeleton –> [Schematron SVRL]
() Skeleton –> [Schematron Message]
() Skeleton –> [Schematron Terminate]
@enduml

(Hat-tip to ThoughtWorks’ Technology Radar.)