Skip to content
Stache edited this page May 23, 2022 · 4 revisions

Nodes are the building block of the whole pipeline to augment data with semantics. With Nodes, data can be passed in JSON, which can be explored, described, and tagged, and the nodes can then be used to build data models.

What is a Node

A Node corresponds roughly to one of the accessors of the JSON data passed in parameter, namely, a path/data pair. In addition, Nodes can contain sub-nodes, called children, to form a tree structure.

Note: Tree is a special node with the automatic name "$" and the automatic type "Root". Useful for quickly creating trees!

Nodes contain default attributes, generated at initialization, and immutable:

  • fieldName: What is the name of the accessor, i.e., the endpoint of the accessor.
  • data: The data of the Node; empty if it is another Node (e.g., dict or list).
  • foundType: The type corresponding to data.
  • parent: If applicable, the parent Node to this Node.
  • children: If applicable, the children of this Node.
  • path: The full path of this Node's accessor.

Note: Nodes can be of type NodeList or NodeDict, to differentiate them even more explicitly from root (Tree) or leaf Nodes!

In addition to the immutable attributes described above, Nodes can contain other arbitrary attributes.

Note: More on the attributes workflow.

In particular, at initialization, Nodes get the following attributes free of charge:

  • descriptiveType: A URI to describe (in a semantic sense) the type of data.
  • unique: Whether the Node is unique (a single path in the whole Tree) or not.
  • default: If applicable, the default value of data.
  • description: A human-readable description of data, whatever its usefulness, content, or other element useful to the reader.
  • choices: If applicable, a list containing possible choices for data.
  • regex: If applicable, a regex for formatting data.

By default, these values are set to None, but can be changed by a browser to add information to the nodes.

Finally, a special attribute that can be used in many ways: traversal, which is basically a dictionnary of the whole Node and its children.

Purpose of Nodes

The idea of the Nodes is to be the main entry point for data exploration, and to allow you to prepare the ground for the generation of Models. It is with them that you start your journey towards the golden fleece, concretely. (:.

Usage example

from argonodes.nodes import Tree

json_data = ...
tree = Tree(json_data)

Argonodes Wiki

Tutorials

  • SOON

Usage and pipeline

  1. General usage examples
  2. Parsers: Preparation and conversion
  3. Nodes: Explore the data
  4. Appliers: Enhance the data
  5. Models: Abstract the data
  6. Filters: Filter and refine
  7. Exporters: Save your hard work!

Schemas

Argonodes

Known sources

Ressources

Clone this wiki locally