First let’s clarify if you are trying to use the DQL syntax or the GraphQL syntax. This was posted in the GraphQL category, but all examples above (schema and RDFs) is DQL syntax.
If you are new and don’t understand the differences between DQL and GraphQL you should start here:
After you hash that out, take a look at:
https://dgraph.io/docs/query-language/schema/#rdf-types
And here is some more context from the docs:
If a schema type isn’t specified before a mutation adds triples for a predicate, then the type is inferred from the first mutation. This type is either:
- type
uid
, if the first mutation for the predicate has nodes for the subject and object, or- derived from the RDF type, if the object is a literal and an RDF type is present in the first mutation, or
default
type, otherwise.
default
string