Iterative Schema Development Possible?

Hello everyone,

I think my question is rather naive, but since I’m very new to the overall model of TerminusDB, I’d really like to sharpen my understanding.

I’d like to understand the relationship between the schema and the data. The tutorial[1] describes an approach, where you first define the schema and then load the data into it. However, I think that it might take some time to learn, for example, about your business domain before you are able to define better constraints.

Therefore I wonder, whether it is possible to change the schema stepwise, even after data has been loaded into TerminusDB.

Sorry again for the naive question, but I’d really like to know whether iterative schema development on already existing data is possible/encouraged/discouraged.

Regards,

Thomas

[1] https://terminusdb.com/docs/getting-started/start-tutorials/console_js/

2 Likes

Hi Thomas,

Thats a very good question, yes it is possible to change the schema after data has been loaded into TerminusDB. We have certain Violation Errors names as VIOs which takes care of this… so even if you have loaded data in to the database and wish to change schema there are inbuilt VIOs which would check if change in schema is in line with the loaded data … Hope this answers your question :slight_smile:

1 Like

It is possible to start loading data with no schema at all, and then structure the schema subsequently. In practice this can be a bit tricky since you have to make sure that the data as already loaded can accommodate the schema. This may involve doing things like tagging objects as being of the appropriate type.

It is also possible to alter schemas in a step-wise fashion. You can add complexity as you go, and restructure the data. As long as you update both the schema and the instance data in a single transaction and the final state is acceptable according to the schema conditions this is possible.

This is not possible from the OWL editor for the schema if you have to also update the data in order to massage it into a format that is accepted by the schema checker. You’ll have to do it in WOQL for the time-being.

1 Like

Hello everyone,

thanks for the quick replies (and sorry for my late answer). I think, I got the overall idea and will start with some experiments to get a feel for the possibilities…

Kind regards,

Thomas

1 Like

Thanks, Thomas. Fill us in on the outcome of the experiments - would be interesting to hear how you get on. We think the ability to revise schemas as you go - without breaking the database - and the ability to roll back and branch if you do break it (!) is a really powerful feature.

1 Like