Skip to main content

History Queries, Based on Flake Format

Data in Fluree is stored in the form of flakes. The flake format is an array where the first three elements specify an subject, predicate, and object in that order.

You can see the history of any flakes that match a certain pattern. Specifiying either a predicate or a subject is required.

For example, to query the history of updates to the person/follows predicate on the ["person/handle", "zsmith"] subject, you could issue the following query:

"history": [["person/handle", "zsmith"], "person/follows"]

If, however, we were interested in looking at flakes that matched any subject with the predicate, person/handle, and the object, jdoe, we would issue:

"history": [null, "person/handle", "jdoe"]

If we skip the subject, we need to put null, whereas we can just omit a flake-pattern without an object (because it is at the end of our array).

History Query

Write a history query looking at the history of subject 1234 and predicate person/handle.