-
Notifications
You must be signed in to change notification settings - Fork 219
Legend FAQs
Complex Data Types: Does Legend support common complex data types that can be utilized by many models?
Yes, Legend supports common complex data types. For example, you can define a Money class that can be re-used by many models. How? Users can create a common project and depend on it (note: project dependencies are not yet fully open sourced).
Yes, Legend supports common classes. See also question 1.a. Users can group common classes into a single project and depend on it (note: project dependencies are not yet fully open sourced).
Regular Expression matches: How do we add a regular expression check for a constraint? Example I want the property to be nonemptystring allowing only alpha & numeric.
This would be handled via the matches function in Legend PURE. It is not yet open sourced.
Uniqueness constraint: Is there any existing function that can be used to implement the uniqueness constraint on a model parameter? Can you share an example of how it could be used?
[Pending]
Re-usable constraints: How and where should I build reusable constraints to optimize the Modeling experience? For example, if all of my string properties are to be validated a certain way, how do I create reusable functions & reuse them?
Legend allows you to write constraints on classes that can be re-used. For example, if you define the constraint on "Money" class that the quantity must be greater than zero, then that constraint is checked when you perform queries on top of the "Money" class. Is is not possible to apply constraints on the primitive data types (e.g. string, number). The Legend team is looking into adding this feature. As a workaround, users can create a non-primitive class that resembles the primitive class.
Yes, via Profiles which can be used to create and add stereotypes (=labels) and tagged values (=free-text additions) to build metadata extensions to your data models.
Does Legend allow you to express mutually exclusive classes/sub types? For example class1 "Married Person" and class2 "Unmarried Person".
This is not supported. However, Legend does allow you to express this exclusivity via constraints.
What are some general best practices for setting up the project structure in Legend for larger organizations?
This very much depends on how the organization wants to manage their data models. It may be recommended setting up projects along data domains with versioned dependencies between them. This facilitates change management. Legend supports workspaces for developers to implement features, but all changes are merged back to the master branch and releases are driven by the master.
- For Legend Users
- For Legend Maintainers