You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Package docs are important to have as overviews,
and we were previously missing any.
Added a few notes to any future hackers, as well.
Removed the "export" file that was only used by the
generator gadget. I don't believe it worked anyway.
It wasn't exercised in CI because of the build tags.
And since it was first written, we've relaxed on
what we allow to be exported anyway, and the field
that file contained a build-tag-fenced accessor for is
simply available anyway. So, I updated the codegen
gadget to just use that directly. No sweat.
Package schema/dmt contains types and functions for dealing with the data model form of IPLD Schemas.
3
+
4
+
(DMT is short for "data model tree" -- see https://ipld.io/glossary/#dmt .)
5
+
6
+
As with anything that's IPLD data model, this data can be serialized or deserialized into a wide variety of codecs.
7
+
8
+
To contrast this package with some of its neighbors and with some various formats for the data this package describes:
9
+
Schemas also have a DSL (a domain-specific language -- something that's meant to look nice, and be easy for humans to read and write),
10
+
which are parsed by the `schema/dsl` package, and produce a DMT form (defined by and handled by this package).
11
+
Schemas also have a compiled form, which is the in-memory structure that this library uses when working with them;
12
+
this compiled form differs from the DMT because it can use pointers (and that includes cyclic pointers, which is something the DMT form cannot contain).
13
+
We use the DMT form (this package) to produce the compiled form (which is the `schema` package).
14
+
15
+
Creating a Compiled schema either flows from DSL(text)->`schema/dsl`->`schema/dmt`->`schema`,
16
+
or just (some codec, e.g. JSON or CBOR or etc)->`schema/dmt`->`schema`.
17
+
18
+
The `dmt.Schema` type describes the data found at the root of an IPLD Schema document.
19
+
The `Compile` function turns such data into a `schema.TypeSystem` that is ready to be used.
20
+
The `dmt.Prototype.Schema` value is a NodePrototype that can be used to handle IPLD Schemas in DMT form as regular IPLD Nodes.
21
+
22
+
Typically this package is imported aliased as "schemadmt",
23
+
since "dmt" is a fairly generic term in the IPLD ecosystem
0 commit comments