Understanding RDForms flexibility

RDForms is a UI-framework for working with RDF in a wide range of web environments. Lets briefly go through a few of the central concepts of how RDForms works to get an idea of it’s capabilities.

At the core of RDForms is the template mechanism that in declarative fashion describes which parts of a RDF graph to work with. The larger form-level templates are often assembled from smaller (reusable) field level templates that deals with how to work with individual triples. The templates provides labels, lists of acceptable values, cardinality constraints, help texts etc.

The template expressions have been designed to be used for multiple purposes. For instance, the same template can be used for editing, presenting, validating and even generating something like a specification. These different use-cases are realized by initializing different views on a binding structure generated by matching a template with a graph.

To allow RDForms to blend in better with different web applications it supports different UI-frameworks. Currently it supports Material UI (React), jQuery (presenter only), Bootstrap 4 and Bootstrap Material Design. Choosing a UI-framework involves registering enough renderers for the views you need. The renderer infrastructure also allows registering individual more specific renderers to provide better usability, e.g. a boundingbox selector over a map. It is also possible to implement support for an entire new UI-framework, although that is substantially more work.

In the edit view it is often the case that you need to search for new values, typically URIs. For instance, if you have a template for describing an organization you may want to connect the organization to people. Clearly, a list of all people cannot be listed statically in the template. Instead, you need to be able to search for people in a manner that is configurable by the surrounding webb application. The mechanism RDForms offers is registering choosers that provide both inline search as well as custom dialogs. The custom dialogs are implemented by the surrounding application and have the potential to provide more functionality than what is possible in the inline search of a field.

At a minimum, using RDForms in your webb application will require you to do the following:

  1. Provide a template.
  2. Provide an RDF graph.
  3. Register a set of renderers utilizing a UI-framework.
  4. Implement / register at least one chooser if you are using the edit view.
  5. Render a view by combining the graph, the template and specify which URI to match the template against.

Finally, it is worth noticing that it is the flexibility of RDForms that makes it a framework rather than a library. For instance one of the telltales of a framework is the use of the inversion of control pattern which is how both renderers and choosers work.