-
Notifications
You must be signed in to change notification settings - Fork 8
Home
- Todo: https://github.com/abstractfactory/openmetadata/wiki/Use-Case
- Todo: https://github.com/abstractfactory/openmetadata/wiki/We-need-help
Open Metadata is designed to store a multitude of data-formats, like integers, booleans, but also likes and links and vectors and matrices. To successfully serialise a type on disk it uses the suffix of a file-name.
$ /folderwithmetadata/.meta/thisIsAnInt.int
$ /folderwithmetadata/.meta/thisIsALike.like
$ /folderwithmetadata/.meta/thisIsAMatrix.matrix
The content of each file is always stored in a JSON-serialised format.
However, the suffix of a file is only that, a serialisation of type, and not something to be modified or ever interacted with.
# Not allowed
>>> an_int.path.suffix = "string"
And it will change depending on what data you assign to it:
>>> assert an_int.path.suffix == 'int'
>>> an_int.value = "a string"
>>> assert an_int.path.suffix == 'string'
That's because the logical equivalent of data-types in Open Metadata aligns with that of dynamic programming languages:
>>> an_int = 5
>>> assert isinstance(an_int, int)
>>> an_int = "string"
>>> assert isinstance(an_int, basestring)
Here, the variable an_int
is assigned a string value, even though it was already associated with an integer. No mention or complaint about its type changing is made and the language silently re-assigns the type of the variable. The same is true in Open Metadata.
# Dynamic programming languages
>>> my_dict = 1337
>>> my_dict = "Elite"
# Open Metadata
>>> my_dict.value = 1337
>>> assert my_dict.path.suffix == 'int'
>>> assert my_dict.type == 'int' # A shorthand-version of the suffix is also available
>>> my_dict.value = "Elite"
>>> assert my_dict.type == 'string'