Frames (simple logical javascript programs which know how to render documents and talk to the API)

This topic is dedicated to discussion of frames.

TerminusDB can generate code for presenting, updating and validating all the complex data types that are defined in its schema.

In the new documentation that went online yesterday as part of 2.0 alpha release I found no mention of Frames.

I saw some screenshots of frames and they still looked very basic, and mostly intended as a means to do some editing in the Admin UI. I think there is a good use case and a need to have lightweight forms libraries that offer abstractions and API’s with which developers can quickly build modern user interfaces in their own stack when they use TerminusDB, your OWL-based schema’s and JSON-LD exchange format.

This could be a FOSS project in itself that provides an intuitive forms framework based on several libraries. It could have a ‘core’ and ‘react’, ‘vue’, etc. addons.

Wonder what your thoughts are about this idea…

1 Like

Definitely in line with what we’re thinking. The frames library works as follows - you ask the server for any class frame - it returns a json object which includes all the logic needed to render every possible variation on an object of that type. Mostly this is pretty simple - you get pre-built arrays of things like enumerated types, but when you have complex datastructures it really shines - there are logic frames (and, not , or , xor) and classChoice Frames - which say something like (best_friend -> either a person or a dog goes here)

Then the frame library also includes a simple-rule pattern library where you can say things like - every time you find a type of “xdd:coordinate”, pass it to this renderer.

We think the auto-generated admin dashboard is the big use case here - you can programmatically specify rendering patterns and pair them with queries - which is really nice - a sort of self-contained visualisation view on steroids.

Also, in terms of dev schedules and plans, we are currently working on a suite of react elements which use the view and frame libraries - (react graph, react chart, react table, react document) which all use the pattern matching capabilities and the frames library. The idea is to make it very very easy for devs to say, I want to use this specific rendering widget for these types of things. We expect to have the react libraries all ready for full release (currently work in progress!) in 2-3 months. We would also love to collaborate with others on extending to other libraries widgets and viewers.

Personally I think this stuff is pretty exciting - because we have so much type information about the data that comes out of the db - the full schema, class hierarchy, properties and type constraint information is always available - just a simple query away - this means you can do a lot of type-mapping automation just with simple rules. The core part of our work is not the visualisations, though, it’s the type pattern matching - from our point of view we want to support really easy ways of saying stuff like:

wherever you find a coordinate within this region, pass it to my custom visualisation widget with these settings. We want to make it so that “my custom visualisation widget” could be anything at all


Oww, this is certainly cool and exciting! Thanks for elaborating, @kevin!