build: make the Enterprise Architect module optional via the 'ea' profile - #1
Open
jdsika wants to merge 5 commits into
Open
build: make the Enterprise Architect module optional via the 'ea' profile#1jdsika wants to merge 5 commits into
jdsika wants to merge 5 commits into
Conversation
…rictions The OWLISO19150 ontology target emitted owl:onClass for every qualified cardinality restriction, including restrictions on datatype properties. Per the W3C OWL 2 specification, a qualified cardinality restriction on a data property MUST use owl:onDataRange pointing at a data range (Structural Specification and Functional-Style Syntax, Sec. 8.5 "Data Property Cardinality Restrictions"; Mapping to RDF Graphs, Sec. 3.2). owl:onClass is reserved for object property cardinality restrictions (Sec. 8.3). Emitting owl:onClass with an XSD datatype (e.g. `owl:onClass xsd:double`) is invalid OWL 2 DL and breaks OWL reasoners and downstream OWL-to-SHACL tooling. createQCardinalityRestriction, createQMinCardinalityRestriction and createQMaxCardinalityRestriction now select the linking predicate via a new helper, qualifiedRestrictionOnPredicate(p), which returns owl:onDataRange for datatype properties and owl:onClass for object properties. Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
Adds a pure SCXML integration test (no Enterprise Architect model required) covering rule-owl-prop-multiplicityAsQualifiedCardinalityRestriction: - datatype properties with exact/min/max qualified cardinality use owl:onDataRange (xsd:double, xsd:integer) - object properties use owl:onClass The reference model is verified against the fixed OntologyModel. Without the fix the test fails, because owl:onClass is emitted for XSD datatypes (invalid OWL 2 DL). Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
…CXML Replace the hand-written SCXML model of the qualifiedCardinalityRestrictions integration test with an Enterprise Architect repository as the original model, plus the SCXML resources derived from it via the standard mechanism (updateOrCreateScxmlResources=true), as requested in the review of PR ShapeChange#756. - Add test_qualifiedCardinalityRestrictions.qea: minimal EA model (Test Schema with Road/Lane feature types) exercising both branches of rule-owl-prop-multiplicityAsQualifiedCardinalityRestriction: datatype properties (length Real[1], width Real[1..*], speedLimit Integer[0..1]) -> owl:onDataRange, and the object property (lane Lane[1]) -> owl:onClass. - Add the EA-derived SCXML resources (test_qualifiedCardinalityRestrictions.zip) and the derived testEA_..._runWithSCXML.xml configuration. - Add the original EA configuration testEA_owl_qualifiedCardinalityRestrictions.xml (inputModelType=EA7) and point OntologyTest at it. - Remove the previous hand-written scxml.xml and testSCXML_... configuration. The reference OWL output is unchanged, so the EA-derived model reproduces the exact expected result; the test still runs on 64bit Java without EA using the committed SCXML resources. Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
…dinality-ondatarange fix(owl): use owl:onDataRange for datatype qualified cardinality restrictions
jdsika
force-pushed
the
build/optional-ea-module
branch
from
July 30, 2026 09:06
f5ccfb7 to
8030540
Compare
…file
shapechange-app declares a compile-scope dependency on shapechange-ea, which
compiles against org.sparx:eaapi. That artifact ships inside an Enterprise
Architect installation and is on no public repository, so a machine or CI runner
without EA cannot build the app module at all:
Could not resolve dependencies for project net.shapechange:shapechange-ea
dependency: org.sparx:eaapi:jar:17.0.1704 (compile)
Could not find artifact org.sparx:eaapi:jar:17.0.1704 in central
The code does not need it. DefaultModelProvider resolves the EA model reader by
class name (Class.forName("...shapechange.ea.model.EADocument")) and SqlDdl does
the same for DatabaseModelWriterEA, so shapechange-core and shapechange-app hold
no compile-time reference to any EA type - only the Maven wiring forces it.
- Root POM: shapechange-ea moves into an 'ea' profile, activated by the absence
of the skipEa property, so the default reactor is exactly as before.
- shapechange-app: the shapechange-ea dependency and the EA-only resource copy
move into the same profile.
- BasicTest: the one EA type in the test sources, EAModelDiff, is resolved by
class name in the private similarEaRepo helper, mirroring how the main code
loads EA classes. Only .qea comparisons touch it, and without the module they
now fail with a message naming the cause instead of failing to compile.
Building with -DskipEa yields a distribution supporting every non-EA input type
(SCXML, XMI, GCSR). Selecting inputModelType=EA7 in such a build fails at model
load, where the class is looked up.
Verified on Ubuntu 24.04 (WSL2), OpenJDK 21.0.11, Maven 3.9.16, against both
paths - with Enterprise Architect 17 installed and its eaapi.jar registered in
the local repository, and without it:
- default: reactor unchanged, four modules; mvn install builds shapechange-core,
shapechange-ea and shapechange-app successfully
- -DskipEa: reactor is ShapeChange, shapechange-core, shapechange-app; builds
- the OWL regression test passes on both paths:
mvn [-DskipEa] -pl shapechange-app -am \
-Dtest=OntologyTest#testQualifiedCardinalityRestrictions test
Tests run: 1, Failures: 0, Errors: 0. Without this change that command cannot
run at all on a machine without EA.
- full suite, both paths: Tests run: 255, Failures: 14, Errors: 78, Skipped: 34.
Identical numbers with and without EA, so this change alters no test outcome.
None of those 92 failures relates to this change, and all are EA-independent:
- 78 errors and 12 failures come from the unconditional Saxon exclusion in this
module's surefire configuration (classpathDependencyExcludes,
net.sf.saxon:Saxon-HE). Lifting it makes CodelistsTest 3/3,
FeatureCatalogueTest 16/16 and OutputProcessingTest 2/2 pass.
- 2 failures are GeoPackage tests needing the external sqldiff binary, absent
here.
The 34 skipped tests are the same classes on both paths, the EA-backed ones
among them (TaggedValueEaInputTransformerTest, SQLDatabaseModelTest,
UmlModelTest, ArcGISWorkspaceTest): EA's native COM layer is not reachable from
a Linux JVM, so they skip whether or not the module is built. No EA test starts
failing silently under -DskipEa.
Out of scope, but noted while testing: the Saxon exclusion makes any
XSLT-producing target fail under mvn test, with or without EA. Worth a separate
look; deliberately not touched here.
Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
jdsika
force-pushed
the
build/optional-ea-module
branch
from
July 30, 2026 11:07
8030540 to
093d03e
Compare
Author
|
Filed upstream as ShapeChange#757, rebased onto current Keeping this fork PR open as the internal record until ShapeChange#757 is resolved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
shapechange-appdeclares a compile-scope dependency onshapechange-ea, which compilesagainst
org.sparx:eaapi. That artifact ships inside an Enterprise Architect installationand is on no public repository, so a machine or CI runner without EA cannot build the app
module at all:
This blocks contributors and any CI for input types that have nothing to do with EA — SCXML
in particular, which is the path this project's own
updateOrCreateScxmlResourcesmechanismexists to enable.
Why the code doesn't need it
The architecture already treats EA as pluggable.
DefaultModelProviderresolves the modelreader by class name:
SqlDdldoes the same forDatabaseModelWriterEA. Neithershapechange-corenorshapechange-appholds a compile-time reference to any EA type —shapechange-appis asingle source file (
Main.java) with noorg.sparximport anywhere. Only the Mavenwiring forces EA on everyone.
Change
shapechange-eamoves into aneaprofile, activated by the absence ofthe
skipEaproperty, so the default reactor is byte-for-byte the same as before.shapechange-app/pom.xml— theshapechange-eadependency and the EA-only resourcecopy move into the same profile.
BasicTest— the single EA type in the test sources (EAModelDiff, used by theprivate
similarEaRepohelper for.qeacomparisons) is resolved by class name, mirroringhow the main code loads EA classes. Without the module those comparisons now fail with a
message naming the cause, instead of the whole test tree failing to compile.
mvn -DskipEa …produces a distribution supporting every non-EA input type (SCXML, XMI,GCSR). Selecting
inputModelType=EA7in such a build fails at model load, where the lookuphappens.
Verification
Ubuntu 24.04 (WSL2), OpenJDK 21.0.11, Maven 3.9.16 — run both with Enterprise Architect
17 installed (its
eaapi.jarregistered locally viainstall:install-file) and without it:-DskipEashapechange-ea— unchangedShapeChange,shapechange-core,shapechange-appmvn installOntologyTest#testQualifiedCardinalityRestrictionsThe full-suite numbers are the same on both paths, so this change alters no test outcome.
The regression-test row matters beyond this PR: it backs ShapeChange#756, and without this
change that command cannot be executed at all on a machine without EA.
Accounting for every failure, on both paths
classpathDependencyExcludes→net.sf.saxon:Saxon-HE)CodelistsTest3/3,FeatureCatalogueTest16/16,OutputProcessingTest2/2 passsqldiffbinary absentCannot run program "sqldiff"in the GeoPackage testsThe skipped tests
34 tests skip, the same classes on both paths, including the EA-backed ones
(
TaggedValueEaInputTransformerTest,SQLDatabaseModelTest,UmlModelTest,ArcGISWorkspaceTest). EA's native COM layer is not reachable from a Linux JVM, so theyskip whether or not the module is built — no EA test starts failing silently under
-DskipEa. A reviewer on Windows with EA should confirm those still run there.Noted, deliberately not fixed here
The Saxon exclusion makes every XSLT-producing target fail under
mvn test, with or withoutEA. That looks worth a separate look; it is out of scope for this change and untouched.