Extract the vocabularies and document shapes into linkeddatahub-rdf - #398
Merged
Merged
Conversation
The RDF a client has to send to create a container, add a chart or grant an authorization was described in static buildModel methods hanging off picocli @command classes, reachable only by depending on the CLI - so Web-Algebra's ldh-* operations, which build the same documents through REST-VKG's execution context rather than through Jersey, had no way to share them and would have had to restate every shape. A shape restated is a shape that drifts. rdf/ now builds com.atomgraph:linkeddatahub-rdf with Jena as its only dependency: what is shared is the shape of the request body, not how it is sent, so neither consumer inherits the other's transport. The eighteen builders move off the command classes into classes named for what they build - Documents (container, item), Blocks, Views, Queries, Services, Imports, Acl and Ontologies - with BaseCommand.createSubject becoming Subjects.of, since fifteen of them needed it. The nine vocabulary classes and Slugs, SequenceNumbers, Digests and Updates move across unchanged. Commands are now argument parsing and a call. URIRewriter splits rather than moving whole: childURI, encodeSlug and adminBase are conventions the platform itself applies and belong in the library as URIs, while rewrite is the --proxy option sending a request somewhere other than where its URI says, which stays a CLI concern with origin now private. The platform keeps its own com.atomgraph.linkeddatahub.vocabulary, still duplicated with the library's. Collapsing them would make the platform depend on rdf/, and the Dockerfile builds the webapp from COPY src and COPY pom.xml alone, so the dependency has to point away from the platform rather than at it. cli/pom.xml resolves the library by ${project.version}; make cli installs it first, and make cli-version and release.sh's sync_cli_version now version both poms together, since the two must move as one or the CLI stops resolving. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The library had no distributionManagement and no publishing plugin, so a client outside this machine could not resolve it at all - REST-VKG's ldh-* operations would have had only a local install to depend on. rdf/pom.xml now declares the central-portal-snapshots repository and the central-publishing plugin, the licenses, developers and scm blocks Central rejects a release without, and a release profile attaching sources, javadoc and GPG signatures, mirroring what <releaseProfiles>release</releaseProfiles> activates for the platform. release.sh deploys it immediately after release:perform, which carries reactor modules only. It builds from the release tag via git archive rather than from the working tree, because sync_cli_version has moved rdf/pom.xml on to the next development version by that point. Inside the irreversible zone on purpose: a platform release whose pinned library is absent is a release whose clients cannot build. Building the release profile also caught a javadoc reference to SP#Describe, which the trimmed vocabulary does not carry - it holds Construct and Select. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cli/ is its own build, so the platform pom's <repositories> do not reach it, and it had never needed any of its own: everything it depended on is released to Maven Central. linkeddatahub-rdf between releases is not - Central serves no snapshots - so resolution succeeded only where the library happened to be in the local repository, which is to say on the machine that had just installed it. CI resolved nothing and failed on the dependency. Verified against a local repository that never had the install, which is the state CI starts from: the CLI builds and its 86 tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
The RDF a client sends to create a container, add a chart or grant an authorization was described in static
buildModelmethods hanging off picocli@Commandclasses, reachable only by depending on the CLI. Web-Algebra'sldh-*operations build the same documents through REST-VKG's execution context rather than through Jersey, so they had no way to share those shapes and would have had to restate every one. A shape restated is a shape that drifts.rdf/now buildscom.atomgraph:linkeddatahub-rdfwith Jena as its only dependency. What is shared is the shape of the request body, not how it is sent, so neither consumer inherits the other's transport.What moved
rdf/rdf.vocabulary.{A,AC,ACL,DH,LDH,NFO,SD,SP,SPIN}cli.vocab.*Slugs,SequenceNumbers,Digests,Updatescli.util.*,cli.sparql.*Subjects.of(...)BaseCommand.createSubjectThe eighteen builders come off the command classes into classes named for what they build —
Documents(container, item),Blocks,Views,Queries,Services,Imports,Acl,Ontologies. Commands become argument parsing plus a call:URIRewritersplits rather than moving whole.childURI,encodeSlugandadminBaseare conventions the platform itself applies and becomerdf.URIs;rewriteis the--proxyoption sending a request somewhere other than where its URI says, which stays a CLI concern withoriginnow private.What did not move
The platform keeps its own
com.atomgraph.linkeddatahub.vocabulary, still duplicated with the library's. Collapsing them would make the platform depend onrdf/, and the Dockerfile builds the webapp fromCOPY src+COPY pom.xmlalone — so the dependency has to point away from the platform rather than at it. Independently fixable later, once the artifact is published.Build and release
cli/pom.xmlresolves the library by${project.version}, so the two move together or the CLI stops resolving.make cliinstallsrdf/first;make cli-versionandrelease.sh'ssync_cli_versionversion both poms.release.shalso deploys the library right afterrelease:perform, which carries reactor modules only — building from the release tag viagit archive, sincesync_cli_versionhas moved the working tree on to the next SNAPSHOT by then. Inside the irreversible block on purpose: a platform release whose pinned library is absent is a release whose clients cannot build.Verification
rdf/, including the 25ModelBuildersTestcases, which assert the exact models and passed unchanged after the movecli/make cliend to end, the shaded jar carryingcom/atomgraph/linkeddatahub/rdf/*.class, andldh --version/ldh create container --helpoff the launchermvn -Prelease clean verifybuilds the main, sources and javadoc jarsNot run: the
tests/httpsuite. Every one of these builders is exercised by it, so that is the real check and it wants a dev stack on 4443. Worth running before this merges.🤖 Generated with Claude Code