How to Migrate UML Models to INTERLIS with UML/INTERLIS-editorMigrating UML models to INTERLIS can streamline data exchange for geographic information systems (GIS), especially in contexts where Swiss geodata standards are used. INTERLIS (often written INTERLIS 2) is a modeling language and transfer format designed for coherent, validated exchange of spatial data. The UML/INTERLIS-editor bridges UML’s visual modeling strengths and INTERLIS’s domain-specific semantics, enabling modelers to produce INTERLIS-compliant schemas from UML diagrams. This guide walks through the migration process step-by-step, highlights common pitfalls, and offers practical tips for producing robust INTERLIS schemas.
Overview: UML, INTERLIS, and the UML/INTERLIS-editor
UML (Unified Modeling Language) is a general-purpose modeling language widely used for software and system design. INTERLIS focuses specifically on geospatial data modeling, definitions of data structures, and rules for transfer files. The UML/INTERLIS-editor is a modeling tool that:
- Accepts UML-based models (class diagrams and related constructs),
- Adds INTERLIS-specific stereotypes and properties,
- Exports INTERLIS 2 schemas (.ili files) and supports validation needs.
Key advantages of migrating UML to INTERLIS include standardized data exchange, consistent validation rules, and compatibility with Swiss geodata infrastructure.
Preparation: What you need before starting
- The UML model(s) you want to migrate (preferably exported as XMI or available within a supported UML tool).
- UML/INTERLIS-editor installed (check compatibility with your OS and Java version).
- Basic knowledge of INTERLIS concepts: domains, classes, attributes, associations, constraints, baskets, and transfer structures.
- Example source data and a target INTERLIS schema plan (to validate against real-world expectations).
Step 1 — Review and simplify the UML model
- Inspect class diagrams for domain-relevant classes only. Remove software-specific constructs (e.g., controllers, service classes) that don’t map to data entities.
- Flatten deep inheritance trees where appropriate. INTERLIS supports inheritance but overly complex hierarchies can complicate export and downstream usage.
- Identify attributes that represent geometry, coordinates, enumerations, or constrained values — these will need explicit INTERLIS domain mappings.
Tip: Create a small mapping spreadsheet listing UML elements and their intended INTERLIS counterparts (class → class/type, attribute → attribute/domain, association → reference/association).
Step 2 — Import UML into UML/INTERLIS-editor
- Export your UML model from your UML tool to XMI (preferably a version supported by the UML/INTERLIS-editor).
- Open the UML/INTERLIS-editor and import the XMI file. Address any import warnings — missing types or unsupported constructs should be resolved within the UML tool before re-exporting.
- Verify that classes, attributes, associations, and enumerations appear correctly.
Common import issues:
- XMI dialect differences (try exporting with different XMI versions).
- Custom UML profiles or stereotypes not recognized; map or remove them pre-export.
Step 3 — Apply INTERLIS-specific stereotypes and domains
- For each class, decide whether it maps to an INTERLIS class or a basic type. In geodata models, most UML classes with attributes and associations become INTERLIS classes.
- Mark geometry attributes (points, lines, surfaces) with INTERLIS geometry domains. INTERLIS has predefined geometry types — set the correct dimensionality and coordinate reference system (CRS) information where supported.
- Convert UML enumerations to INTERLIS enumerations (ENUMERATION). Ensure labels and code values follow any national or project conventions.
- Create INTERLIS domains for constrained attributes (e.g., string length, numeric ranges). Define units where relevant.
Example mapping (conceptual):
- UML attribute “status: String {values = [‘active’, ‘inactive’]}” → INTERLIS ENUMERATION Status = (active, inactive);
Step 4 — Map associations and cardinalities
- Translate UML associations to INTERLIS associations or references. INTERLIS supports association classes and various multiplicities; ensure cardinalities in UML map correctly (0..1, 1..*, etc.).
- For many-to-many relationships, consider whether INTERLIS association classes or intermediate classes are more appropriate for the data exchange semantics.
- If roles or navigability are important in the UML model, set equivalent reference roles in INTERLIS.
Pitfall: Implicit associations represented only by foreign key attributes in UML may need explicit INTERLIS associations for validation and clarity.
Step 5 — Implement constraints and business rules
- Translate UML OCL expressions (if present) into INTERLIS constraints. INTERLIS supports logical rules for validation; implement constraints as CHECK or CONSTRAINT constructs in the resulting .ili.
- Where OCL is complex, simplify rules into equivalent INTERLIS expressions or split them into multiple constraints for performance and maintainability.
- Validate domain constraints (e.g., ranges, mandatory fields) directly on attributes.
Example:
- UML OCL: context Building inv: self.height > 0
- INTERLIS: CONSTRAINT Building_height_positive: height > 0;
Step 6 — Configure transfer structures and baskets
INTERLIS distinguishes data models (schemas) from transfer structures (how data is packaged). The UML/INTERLIS-editor allows defining:
- Baskets (DATASET equivalents) to group objects for transfer.
- Transfer structure definitions: decide which classes are exportable, their sequence, and how multiple datasets are handled.
Best practice: Define baskets per logical dataset or administrative boundary (e.g., cadastral parcel basket, utility network basket).
Step 7 — Export and test INTERLIS (.ili) schema
- Use the UML/INTERLIS-editor export function to generate the .ili file.
- Run INTERLIS validators (e.g., ili2c or other INTERLIS tools) to check syntax and semantic compliance.
- Create sample transfer files (e.g., XTF or ITF) and run a full round-trip validation: generate data, export, import, validate.
Troubleshooting:
- Syntax errors often point to missing domain definitions or incorrect multiplicity translations.
- Validation errors commonly stem from unhandled nullability or geometry CRS mismatches.
Step 8 — Iterate with stakeholders and integrate feedback
- Share the generated INTERLIS schema and sample transfer files with domain experts (GIS analysts, cadastral authorities).
- Collect and implement feedback regarding vocabulary, units, and required attributes.
- Repeat export/validation cycles until the schema aligns with operational needs and national standards.
Common pitfalls and how to avoid them
- Overfitting UML: Resist modeling application behavior as data structures. Keep the UML focused on the data domain.
- Ignoring CRS: Geometry attributes must carry correct CRS or be annotated to avoid mismatches.
- Overly complex constraints: Break down complex validations into simpler, testable rules.
- Incomplete enumeration mapping: Ensure every enumeration value and its code/label are explicitly defined.
Example mini-workflow (concise)
- Export UML to XMI.
- Import XMI into UML/INTERLIS-editor.
- Apply INTERLIS stereotypes, define domains and geometry types.
- Map associations and cardinalities.
- Add constraints and define baskets/transfer structures.
- Export .ili, validate with ili2c, test with sample data.
- Iterate with stakeholders.
Tools and resources
- UML/INTERLIS-editor (installation and documentation).
- INTERLIS validators such as ili2c.
- GIS platforms that support INTERLIS (for testing and integration).
- Reference INTERLIS schema examples from national geodata portals.
Final notes
Migrating UML models to INTERLIS is both a technical and domain-driven process: the UML/INTERLIS-editor simplifies mechanistic conversions, but successful migration depends on clear domain definitions, correct handling of geometries and CRSs, and close collaboration with GIS stakeholders. With careful mapping, validation, and iteration, you can produce INTERLIS schemas that enable robust, interoperable geodata exchange.