Skip to main content
Version: V2-Next

Code Map

One entry per class, grouped by module and package — what each piece does and why it exists. (Records used purely as method parameters/results are grouped with their owning concept.)

model-forge-contract​

The public API: everything a host application touches. No Spring, web or persistence dependencies.

de.civitascore.modelforge.facade​

ClassCapability
ModelForgeThe 18-method embedded facade — the single integration boundary for hosts. See the API reference.

de.civitascore.modelforge.contract​

ClassCapability
ArtifactIdIdentity handle carrying a CORE URN (logical or versioned).
ArtifactKindThe seven artifact kinds (ELEMENT, MAPPING, PIPELINE, DATA_SOURCE, DATA_SINK, DATA_SET, DATA_STRUCTURE). XSD-backed Elements are ELEMENTs with an XSD representation format, not a separate kind.
ImportSchemaCommand / ImportResultElement import: JSON Schema in, root pin + imported ids + dependency lists out.
CreateArtifactCommand / SaveArtifactCommand / ArtifactWriteResultFirst store (mints the URN) and follow-up versions (with VersionBump); the result carries the assigned pin plus dependency lists.
VersionBumpPATCH / MINOR / MAJOR — the caller's change classification; Model Forge assigns the concrete SemVer.
ArtifactViewRaw stored document of an artifact plus its metadata.
SchemaViewQueryRead query for the bundled / inlined schema views.
ValidateInstanceCommand / ValidationResult / Diagnostic / DiagnosticSeverityValidation inputs and outputs; a Diagnostic is one finding (severity, message, code, path).
DependencyQuery / DependencyGraphViewGraph queries (dependencies, dependents, mapsTo, mappedFrom) and their node/edge result shape.
ArtifactSearchQuery / ArtifactSummaryCross-artifact metadata search and its result row.
ImportSmartDataModelCommand / ImportXRepositoryCommand / XRepositorySearchQuery / XRepositoryHitStandards import: FIWARE Smart Data Models by URL, xRepository search + XSD import.
ModelForgeExceptionBase of all semantic Model Forge failures.
ArtifactInUseExceptionDelete protection: thrown when other artifacts still reference the one being deleted; lists the blockers.
RegistryUnavailableExceptionThe registry (PostgreSQL) is unreachable — infrastructure, not caller error.
ValidationFailedExceptionA write was rejected because validation produced errors.

| BumpVersionCommand | Carries an artifact's current version forward as a new version at a requested change level. | | ValidateSchemaCommand | Validates one JSON Schema document — the schema-only counterpart to ValidateInstanceCommand. | | DependencyClosureView | The transitive dependency closure of an artifact, including the members the registry does not hold. | | NonConformingArtifact | One stored Element whose schema does not conform to JSON Schema 2020-12, with its diagnostics. |

de.civitascore.modelforge.domain​

ClassCapability
FormatsRepresentation format tokens (jsonschema, xsd, …) shared between content and registry.

de.civitascore.modelforge.urn​

ClassCapability
UrnParserStatic string-level URN toolbox: parse/validate (8/9 segments), logicalUrn, versionFromUrn, nameFromUrn, disambiguatorFromUrn, sanitize, and deriveDisambiguator (deterministic token). ArtifactId.logicalUrn()/version()/name() delegate here.

model-forge-runtime​

The embedded implementation behind the facade. Package slices are enforced by ArchUnit; nothing here is host-facing.

de.civitascore.modelforge.application​

ClassCapability
EmbeddedModelForgeOperationsImplements the ModelForge facade — translates contract commands into service calls and results back into contract records.
SchemaImportServiceElement import pipeline: validate → normalise $id → split $defs into separate Elements → store with reference edges → create the DataStructure grouping. Also XSD import and SSRF-guarded import-by-URL.
ElementCommandServiceElement write side: store JSON Schema / raw XSD versions, and delete with the dependents check (delete protection).
ElementQueryServiceElement read side: the raw stored JSON Schema for a URN.
ViewServiceGenerates the two read projections: inlined view (every $ref inlined) and bundled view (dependency closure under $defs), both cycle-safe.
ReferenceExistenceValidatorRegistry-aware check that every concrete x-core-ref foreign-key target exists.
SmartDataModelsServiceImports a FIWARE Smart Data Model schema by URL through the guarded fetcher.
XRepositoryServicexRepository orchestration: search the catalog, download an XSD, convert to JSON Schema Elements or store as raw XSD.
SchemaImportRequest / SchemaImportResultInternal input/result pair of the JSON Schema import.
XsdImportRequestInternal input of a raw XSD import, without JSON Schema conversion.
XRepositoryImportCommand / XRepositorySearchPageInternal xRepository import parameters and search page shape.
UpstreamExceptionAn external system (xRepository, remote schema host) failed or is unreachable.

de.civitascore.modelforge.core.port​

ClassCapability
ArtifactRegistryThe storage boundary: store/fetch/list/delete artifacts, reference edges, XSD namespace index, search, delete-blocking dependents. Every write returns the assigned versioned pin.
ArtifactSearchCriteria / ArtifactSearchResultSearch input/output at the port level.
RemoteSchemaRepositoryFetches external JSON Schemas by URL without exposing HTTP details.
XRepositoryCatalog / XRepositoryArtifact / XRepositorySearchResultxRepository catalog access (search, XSD download) and its result shapes.
XsdSchemaConverter / XsdSchemaConversionExceptionXSD → JSON Schema conversion boundary.

| ArtifactVersionIdentity | One stored version reduced to what deciding a reference's resolvability needs. |

de.civitascore.modelforge.graph​

ClassCapability
DependencyGraphServiceVersion-precise in-memory dependency graph: forward/reverse edges, rebuilt from the registry at startup, updated on every write; answers dependencies/dependents and the traversals behind the views.
SchemaRefExtractorExtracts all outgoing CORE-URN $ref values from a JSON Schema document.

de.civitascore.modelforge.urn​

ClassCapability
UrnServiceMints new URNs from the configured scope/owner/domain plus a name and a fresh random disambiguator — the only place URNs are minted.

de.civitascore.modelforge.persistence.postgres​

ClassCapability
PostgresArtifactRegistryClientThe ArtifactRegistry implementation: transactional JdbcClient writes, SemVer assignment, content-hash idempotency, outage translation to RegistryUnavailableException.
ArtifactRepository / ArtifactRowartifact table access — one row per logical identity.
ArtifactVersionRepository / ArtifactVersionRowartifact_version table access — immutable SemVer versions.
ArtifactRepresentationRepository / ArtifactRepresentationRowartifact_representation table access — the stored content (JSONB or XSD text) per version and format.
ArtifactReferenceRepository / ReferenceRowartifact_reference table access — the complete typed edge graph (including cycles), late-binding target resolution, the blocking-dependents query.
XsdNamespaceRepositoryxsd_namespace index — targetNamespace → URN for xs:import resolution.
ReferenceExtractionDerives the typed reference rows from an artifact document (schema $refs, mapping source/target, pipeline nodes, manifest ref arrays).
SemVerParses/compares SemVer strings and computes the next version for a VersionBump.
RegistryMappingRegistry token constants (artifact types, content types) and group ↔ type mapping.
RegistryTimeNull-safe Instant ↔ OffsetDateTime (UTC) conversions for timestamptz columns.
XsdSchemaSupportTransparent XSD → JSON Schema conversion on read (cached), namespace extraction, xs:import resolution.

de.civitascore.modelforge.validation​

ClassCapability
ModelValidatorJSON Schema 2020-12 meta-schema validation (validateSchema) and instance-against-schema validation (validateData).
CoreSchemaValidatorOpt-in validation of an artifact document against the CORE schema its $schema declares (mapping/pipeline/…); documents without a known $schema pass through unvalidated.
CoreJsonSchemaFactorynetworknt factory pre-configured with the CORE x-* extension keywords as non-validating annotations.
SchemaErrorsMaps a networknt validation message to a Diagnostic.
JacksonBridgeSerialise/parse bridge between Jackson 3 (tools.jackson) and the Jackson 2 trees networknt requires.

de.civitascore.modelforge.xsd​

ClassCapability
XsdToJsonSchemaConverterConverts an XSD (Apache XmlSchema) into one JSON Schema per named type, with CORE URN $ids and x-xsd-source back-references.

de.civitascore.modelforge.util​

ClassCapability
JsonSchemaShared JSON Schema constants ($schema dialect URI, …).
NameMatchRelevance scoring for name/title search.
SecureXsdParserXSD parsing with layered XXE/SSRF protection.
XmlInputGuardRejects DOCTYPE/ENTITY declarations before any XML parsing (the XXE entry points).
XsdDocumentationExtracts xs:annotation/xs:documentation text.
XsdTypeMappingClassifies XSD built-in types into the JSON type vocabulary.

de.civitascore.modelforge.integrations​

ClassCapability
RemoteSchemaFetcherRemoteSchemaRepository implementation: HTTPS fetch with UrlGuard validation.
util.UrlGuardSSRF guard: allow-listed schemes/hosts, blocks private address ranges.
RemoteRefResolverReplaces the http(s) $refs of a fetched document with the schemas they point at.
VendoredSchemaLoaderResolves the third-party schema documents that ship on the classpath, so a reference to one needs no network call.
xrepository.XRepositoryClientXRepositoryCatalog implementation against the public xRepository REST API.

model-forge-spring-boot-starter​

ClassCapability
ModelForgeAutoConfigurationWires the whole runtime into a host context: all beans explicitly created and modelForge*-prefixed, ordered after Flyway/JdbcClient/Jackson; runs Model Forge's own Flyway migration in the model_forge schema.
ModelForgePropertiesTyped model-forge.* configuration (URN scope/owner/domain, registry schema and migration table).

model-forge-admin-ui​

Internal developer tool (own Spring Boot + Wicket app); consumes the library through the facade like any host. Always runs against a real Postgres registry (docker compose up -d in the module starts one).

ClassCapability
AdminUiApplicationSpring Boot entry point.
wicket.AdminWicketApplication / wicket.WicketConfigWicket setup and page mounting.
wicket.BasePageShared layout/navigation.
wicket.components.CodeEditorPanelCodeMirror-based JSON editor component.
pages.ArtifactListPageSearch/browse all artifacts.
pages.ArtifactViewPage / pages.ArtifactEditPageInspect a stored artifact; edit and save a new version.
pages.SchemaViewComparisonPageRaw vs. bundled vs. inlined view side by side.
pages.GraphPagevis-network rendering of the dependency graph.
pages.ImportPage / pages.ValidatePageImport a JSON Schema; dry-run validation.
pages.SmartDataModelImportPage / pages.XRepositoryImportPageStandards import front-ends.
wicket.tree.ArtifactTree / wicket.tree.ArtifactTreeProvider / wicket.tree.ArtifactTreeNode / wicket.tree.ArtifactTreeNodePanelWicket tree view of artifacts and their dependency structure.
ArtifactTypeCatalogThe canonical artifact-type tokens as ModelForge.search stores and returns them.
SchemaCatalogPicks the JSON Schema that drives editor autocomplete and validation for an artifact.
pages.SeedPageImports whole bundled example model sets, discovered on the classpath.
seed.StaSeedConfiguration / seed.SeedImporter / seed.SeedBundleOptional startup seeding of example STA Elements through the facade, gated by model-forge.admin-ui.seed.enabled (default on) and idempotent — an Element whose logical URN already resolves is skipped.