Creating Predicates: Part 2
Our full application schema will contain 12 predicates.
We've already shown you how to create
chat/messsage. In order to create the other 10 predicates, we'll need to use additional predicate predicates:
_predicate/unique- Is a predicate unique?
_predicate/multi- Can a predicate include multiple objects (values)?
_predicate/restrictCollection- If a predicate is of type
ref, we can restrict it so that the references only refer to one type of subject. The value for this should be the name of the collection, i.e.
Application Schema Predicates
The following is the full list of predicates we still need to create.
Predicates that should be unique are marked with a '*'.
Predicates that are of type
refare marked with a '~'. See if you can figure out what collections those predicates should be referencing.
Predicates that are
"multi": trueare marked with a '+'.
person/follows~ , +
person/favArtists~ , +
chat/comments~ , +
Your job is to create the remaining 10 predicates. A few points:
- If a predicate is not unique, you don't have to list
"unique": false. Predicates are not unique by default.
- If a predicate is not 'multi', you don't have to list
"multi": false. Predicates are not multi by default.
falsedo not need to be surrounded by quotation marks. In most programming languages, and in FlureeQL,
falseare special keywords.
- Remember, the types we are using are:
Create All 10 Predicates Above
Write a transaction to create the 10 predicates we need for our chat application schema.