loadMRDI sThis method parses an MRDI-formatted JSON string (or hash table) and reconstructs the corresponding Macaulay2 object. The namespace field (_ns) in the JSON determines which set of load methods is used for deserialization.
This function handles the _refs section of the JSON to reconstruct shared references via UUIDs. For example, when an ideal and a ring element both refer to the same polynomial ring, the ring is constructed once and shared.
A polynomial ring element can be round-tripped through the format.
|
|
|
|
|
The same works for ideals.
|
|
|
|
Objects can be loaded from a file as well using get.
|
|
|
|
|
A parsed hash table can also be passed directly, for instance when using ToString => false with saveMRDI.
|
|
The MRDI format supports cross-system interoperability. Objects serialized by the OSCAR computer algebra system can also be loaded.
|
To see which types have built-in load methods for a given namespace, call methods as follows.
|
|
Additional types can be supported by calling addLoadMethod.
If the JSON string references a namespace or type for which no load method has been registered, an error is produced. Use addLoadMethod to register handlers for custom types and addNamespace to register new namespaces.
The object loadMRDI is a method function.
The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/MRDI.m2:657:0.