Introduce data field as the main property on which to get/set other properties #4

Merged
jsheunis merged 2 commits from events into main 2026-02-04 08:50:05 +00:00

2 commits

Author SHA1 Message Date
257d996b0d Update readme usage example to reflect change in API 2025-03-16 12:23:25 +01:00
c68e56506d introduce 'data' field as the main property on which to get/set other properties
This is in response to the process of trying to turn class instances into reactive objects.
Since this library is a core dependency of 'shacl-vue' which uses Vuejs, and since this
library is independent of Vuejs, an external package should be able to take shacl-tulip's
exports and make them reactive. It has been a challenging process to figure out how to do
this generally. Refer to https://github.com/psychoinformatics-de/shacl-vue/issues/84. So
th current best solution that I could find is to introduce a 'data' argument, which defaults
to an empty object, to the RdfDataset class and to set this as the value of this.data in
the class constructor. This allows external libraries to pass a reactive object to the

constructor, and afterward the reactive object will be accessible on the data property of
the class instance. All data properties get moved to be properties of the data property
and methods remain where they are. Additionally, tests were updated to reflect this change.
2025-03-16 12:19:59 +01:00