Creating Predicates: Part 1
Now, we have four collections in our ledger:
artist, and we need to create predicates for those collections.
Collections and predicates are stored in the ledger the same way that any other type of information is stored.
When you are creating a new predicate, you are creating a new subject of type
_predicate, and that subject contains certain predicates. These are that particular predicate's predicates.
There are many predicates that you can specify for each predicate. The full list of built-in predicates can be found in the docs.
We will using the following predicate predicates:
_predicate/name must be namespaced with the collection you intend it to be used within. For example, if you want to make a predicate for a person's name, it can't just be
name - it must be
_predicate/type is data type for this predicate. The full list of valid types can be found in the docs, but for this lesson we'll be only using:
ref (reference), and
instant (time represented by number of seconds).
If we want to create a predicate -
person/fullName that should be of type
string, meaning it is text. The transaction would look like this:
This predicate will contain the text of a chat message. Make sure to specify both the predicate name and type.