-
-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
chris-day edited this page Nov 21, 2025
·
9 revisions
This page provides complete practical examples showing how TSV inputs are transformed into OWL 2 ontologies using uml2semantics.
Each example illustrates:
- the TSV inputs
- expected ontology output (Manchester + Turtle)
- modelling rationale
- SHACL considerations
- typical CLI invocation
These examples form the basis for the golden tests and are designed for reproducibility.
This example demonstrates the smallest possible ontology generated from TSV inputs.
Curie Name ParentNames Definition
ex:Account Account A financial account.
Class Name ClassEnumOrPrimitiveType MinMultiplicity MaxMultiplicity Definition
Account Id xsd:string 1 1 Account identifier.
Class: Account
Annotations: rdfs:label "Account"
DataProperty: Id
Domain: Account
Range: xsd:string
uml2semantics -c Classes.tsv -a Attributes.tsv -o out.ttl -i http://example.org/ns
Class Name ClassEnumOrPrimitiveType MinMultiplicity MaxMultiplicity MinLength MaxLength Pattern
Account OwnerId xsd:string 1 1 16 16 [A-Z0-9]+
DataProperty: OwnerId
Domain: Account
Range:
xsd:string
[ minLength 16,
maxLength 16,
pattern "[A-Z0-9]+" ]
Curie Name BaseDatatype Pattern MinLength MaxLength
iso:LEI20 LEI20 xsd:string [A-Z0-9]{20} 20 20
Class Name ClassEnumOrPrimitiveType MinMultiplicity MaxMultiplicity
Account LeiId LEI20 0 1
Datatype: LEI20
EquivalentTo:
xsd:string
[ pattern "[A-Z0-9]{20}",
minLength 20,
maxLength 20 ]
DataProperty: LeiId
Domain: Account
Range: LEI20
Curie Name
iso:CurrencyCode CurrencyCode
Enumeration Curie Name Definition
CurrencyCode iso:GBP GBP Pound Sterling
CurrencyCode iso:EUR EUR Euro
CurrencyCode iso:USD USD US Dollar
Class Name ClassEnumOrPrimitiveType MinMultiplicity MaxMultiplicity
Account Ccy CurrencyCode 1 1
Class: CurrencyCode
Individual: GBP
Types: CurrencyCode
Individual: EUR
Types: CurrencyCode
Individual: USD
Types: CurrencyCode
DataProperty: Ccy
Range: CurrencyCode
Curie Name ChoiceOf ChoiceSemantics
ex:PtyIdChoice PartyIdentifierChoice LEIId|BICId exclusive
ex:LEIId LEIId
ex:BICId BICId
Class: PartyIdentifierChoice
SubClassOf: LEIId or BICId
DisjointClasses:
PartyIdentifierChoice, LEIId
DisjointClasses:
PartyIdentifierChoice, BICId
This example shows all TSV types working together.
Curie Name ParentNames
ex:Account Account
ex:Holder Holder
ex:PtyChoice PartyChoice LEIId|BICId exclusive
Class Name ClassEnumOrPrimitiveType MinMultiplicity MaxMultiplicity
Account Id xsd:string 1 1
Account Ccy CurrencyCode 1 1
Account Party PartyChoice 0 1
Holder Name xsd:string 1 1
Curie Name BaseDatatype Pattern MinLength MaxLength
iso:LEI20 LEI20 xsd:string [A-Z0-9]{20} 20 20
Curie Name
iso:CurrencyCode CurrencyCode
Enumeration Curie Name
CurrencyCode iso:GBP GBP
CurrencyCode iso:EUR EUR
Curie Name Definition
dct:source Source Origin of the element
TargetCurie AnnotationProperty Value
ex:Account dct:source "Imported from ISO 20022"
Class: Account
SubClassOf:
Id exactly 1 xsd:string,
Ccy exactly 1 CurrencyCode,
Party max 1 PartyChoice
Class: PartyChoice
SubClassOf: LEIId or BICId
DisjointClasses: PartyChoice, LEIId
DisjointClasses: PartyChoice, BICId
Individual: GBP
Types: CurrencyCode
graph TD
C[Classes.tsv] --> P[Parser]
A[Attributes.tsv] --> P
D[Datatypes.tsv] --> P
E[Enumerations.tsv] --> P
V[EnumerationNamedValues.tsv] --> P
AP[AnnotationProperties.tsv] --> P
AN[Annotations.tsv] --> P
P --> O[Ontology Output]
Use:
uml2semantics -c Classes.tsv -a Attributes.tsv --datatypes Datatypes.tsv --enumerations Enumerations.tsv --enum-values EnumerationNamedValues.tsv --annotation-properties AnnotationProperties.tsv --annotations Annotations.tsv -o out.ttl -i http://example.org/ns -p "ex:http://example.org/ns#,dct:http://purl.org/dc/terms#"
- Back to TSV-Specification
- Continue to Golden-Tests
- Return to Home