Closed securedimensions closed 1 year ago
Thank you @securedimensions for the report.
This is interesting because Metanorma does not do anything special with PlantUML diagrams. We will investigate.
The command line plantuml (plantuml a.txt
) does the following with the supplied PlantUML:
That is identical to what you are getting when Metanorma parses the document.
So clearly the Visual Studio Code implementation of PlantUML is cleverer than the command line implementation: the former is conflating package and class diagram definitions, and fleshing out classes found in the former with class definitions found in the latter. The command line tool doesn't.
Looking more closely at PlantUML, I refer you first to the halfway solution of embedding class definitions within packages
https://forum.plantuml.net/8975/dependency-between-packages-containing-classes?show=9003#c9003
which however does not work:
@startuml
package OGC [
{{
class GeoXACML_Spatial_Analysis {
# Boolean allowTransformation=false
Spatial Analysis Functions ()
}
interface GeoXACML_API {
OGC OpenAPI
OGC Landing Page
OGC Conformance Class Page
}
interface GeoXACML_CRS_Transformation {
# XACML AttributeValue attribute 'allowTransformation'
# Boolean allowTransformation={false, true}
}
class GeoXACML_Core {
# XACML DataType Geometry
# XACML AttributeValue attribute 'srid'
# XACML AttributeValue attribute 'precision'
# Boolean allowTransformation=false
Geometry encoding based on WKT and WKB
Processing may result in 'geometry-error'
CRS default 'urn:ogc:def:crs:OGC::CRS84'
Processing different CRS result in 'crs-error'
Processing may result in 'precision-error'
Geometry Functions ()
Spatial Relations Functions ()
XACML Bag / Set Functions ()
}
GeoXACML_Core ..d.|> GeoXACML_API: <<optional>>
GeoXACML_Core ..d.|> GeoXACML_CRS_Transformation: <<optional>>
GeoXACML_Spatial_Analysis -r-|> GeoXACML_Core: <<optional>>
}}
]
package ISO [
{{
abstract class SimpleFeatures {
ISO 19125:2004
# Geometry
# WKT
# WKB
Functions ()
}
}}
]
package OASIS [
{{
abstract class XACML3 {
OASIS XACML 3.0
Policy schema
AD and ADR schema
Functions ()
}
XACML3 <|-d- OGC.GeoXACML_Core: <<extends>>
}}
]
ISO.SimpleFeatures -o OGC.GeoXACML_Core : use
@enduml
--- the classes and packages are drawn, but the diagram cannot comprehend arrows drawn from one package to another at all: you can see that both the namespaced ISO.SimpleFeatures -o OGC.GeoXACML_Core : use
outside the ISO package, and the un-namespaced XACML3 <|-d- OGC.GeoXACML_Core: <<extends>>
within the OASIS package, are ignored.
I then refer you to the current PlantUML solution, implemented as of February 2023, which is to conflate namespaces and packages completely. PlantUML command-line will simply not deal with all three of packages, class definitions, and class relations, as far as I can tell; and by getting rid of packages completely and replacing them with namespaces, you are no longer forcing it to.
So the following does work:
@startuml
OGC.GeoXACML_Core ..d.|> OGC.GeoXACML_API: <<optional>>
OGC.GeoXACML_Core ..d.|> OGC.GeoXACML_CRS_Transformation: <<optional>>
OGC.GeoXACML_Spatial_Analysis -r-|> OGC.GeoXACML_Core: <<optional>>
ISO.SimpleFeatures -o OGC.GeoXACML_Core : use
OASIS.XACML3 <|-d- OGC.GeoXACML_Core: <<extends>>
abstract class ISO.SimpleFeatures {
ISO 19125:2004
# Geometry
# WKT
# WKB
Functions ()
}
abstract class OASIS.XACML3 {
OASIS XACML 3.0
Policy schema
AD and ADR schema
Functions ()
}
class OGC.GeoXACML_Core {
# XACML DataType Geometry
# XACML AttributeValue attribute 'srid'
# XACML AttributeValue attribute 'precision'
# Boolean allowTransformation=false
Geometry encoding based on WKT and WKB
Processing may result in 'geometry-error'
CRS default 'urn:ogc:def:crs:OGC::CRS84'
Processing different CRS result in 'crs-error'
Processing may result in 'precision-error'
Geometry Functions ()
Spatial Relations Functions ()
XACML Bag / Set Functions ()
}
class OGC.GeoXACML_Spatial_Analysis {
# Boolean allowTransformation=false
Spatial Analysis Functions ()
}
interface OGC.GeoXACML_CRS_Transformation {
# XACML AttributeValue attribute 'allowTransformation'
# Boolean allowTransformation={false, true}
}
interface OGC.GeoXACML_API {
OGC OpenAPI
OGC Landing Page
OGC Conformance Class Page
}
@enduml
I am reasonably confident that the Visual Studio rendering of PlantUML that you are appealing to has never worked with command-line PlantUML, and therefore with Metanorma. Metanorma uses the command-line implementation alone; please refer to that in future.
Thanks a lot!
The rendering for plantuml diagrams is broken.
The rendering of plantuml diagrams was working fine I think, but now it's broken.
Example
Visual Studio Code rendering
Rendering the code above produces the following image:
Metanorma rendering
Rendering the code above with metanorma (
docker run -v "$(pwd)":/metanorma metanorma/metanorma metanorma compile -t ogc -x html,pdf --agree-to-terms 22-050.adoc
) produces the following image: