-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specialising vocabulary terms for properties #904
Comments
I see a small chance of collisions with other terms on the Concept, for example, if I have a property on the Concept called How about we reserve a special term for overridden terms, and push the property name into an argument? That would also help us to avoid messy escaping for fully-qualified names too.
|
If we put the overridden terms on the concept, then we don't have to worry about escaping for fully-qualified names. My hesitancy with this one is whether we need to support this at the API level, or whether users can deal with this as a custom term for the concept itself, using our existing YAML and APIs. If we push this into "user land" then users can invent their own prefix to prevent conflicts, if necessary. |
The snippet defines a schema for vehicles in YAML format. It includes a Vehicle entity with properties like vin and color, while Truck and Motorcycle inherit from it with their specific attributes, such as weight for trucks and distinct color_term for each type. The namespace defines the organizational scope and versioning.
|
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This might also be useful to support for any decorator rather than just terms. |
Feature Request 🛍️
It would be very useful to be able to specialise the vocabulary terms for concept properties, based on the concept inheritance tree.
Use Case
Take the model below, as an example.
The term for
Truck.color
in US English should beThe color of the truck
while in GB English it should beThe colour of the lorry
, and similarly forMotocycle.color
.Possible Solution
VocabularyManager can check for a term attached to the current declaration (e.g. Truck) before looking on class declaration that declares the property (Vehicle).
Context
Detailed Description
Updates to
VocabularyManager.getTerm(s) and resolveTerm(s)
to first check the class declaration specified in the arguments, before checking the class declaration that declares the property.Updates to
VocabularyManager.generateDecoratorCommands
are conceptually more complex, as the@Term
decorator must be attached to the declaration of the property.E.g. the model that has the vocabulary (en-GB) applied is currently:
Because there is no declared property
Truck.color
orMotocycle.color
there is nowhere in the model to put the specialised vocabulary terms.The proposal is therefore to create a Decorator Command Set that creates the model below. The specialised terms have been hoisted onto the class declaration that specialises the term.
An alternative would be to place all decorators on the property itself. E.g.
In most cases we could use short names (the derived type and the base type are in the same namespace) but if the derived type is in a separate namespace we would have to use mangled fully-qualified names.
The text was updated successfully, but these errors were encountered: