Predicate naming for humans

Consider these two node type definitions. Notice the Files predicate in the first and the HasFiles predicate in the second. Technically these two definitions are identical. The name of the predicate is the only difference. Aside from human readability, are there any benefits to one style over the other?

Files: [uid] .
type Post {
    title
    body
    Files
    created
    updated
}

---

HasFiles: [uid] .
type Post {
    title
    body
    HasFiles
    created
    updated
}

I think you answered your own question. If you’re asking if internally Dgraph treats predicates that have a verb prefix differently, the answer is: no.

Yes, I am mostly wondering if one is more of a best practice, semantically speaking.

There’s really no style-guide for this. Some people like the verbs, some do not. As for me, the only time I cringe is when a schema lacks consistency.

1 Like