One is to many relation in RDF: "predicate of type uid is scalar" issue

In my schema, Characters can have one or more works. I represented this with an array works: [Work] field for the Character type.

type Character {
    charId: String! @id
    works: [Work]

type Work {
    workId: String! @id
    characters: [Character] @hasInverse(field: works)

When I try to feed data in RDF format, I get an error:

Input for predicate "" of type uid is scalar. Edge: entity:650005 attr:"" value:"muchado"

Here’s the sample RDF data:

_:Character.leonato <Character.abbrev> "LEONATO" .
_:Character.leonato <> "muchado" .

_:Work.muchado <Work.workId> "muchado" .

I need an array of works [Work] because some characters have multiple works:

_:Character.antony <> "juliuscaesar" .
_:Character.antony <> "antonycleo" .

What’s gone wrong here?

_:Character.leonato <Character.abbrev> "LEONATO" .
_:Character.leonato <> _:Work.muchado .

_:Work.muchado <Work.workId> "muchado" .

Should do the trick. Don’t forget to add the reverse edge. Inserting in RDF/DQL does not auto matically do anything with the hasInverse directive outside of the graphql endpoint


Thanks, that was a silly mistake