Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL: Add support for rdfList #24

Open
Aklakan opened this issue Sep 24, 2024 · 0 comments
Open

GraphQL: Add support for rdfList #24

Aklakan opened this issue Sep 24, 2024 · 0 comments

Comments

@Aklakan
Copy link
Member

Aklakan commented Sep 24, 2024

The @rdfList annotation should produce JSON arrays in JSON mode but nested objects (with the usual first/rest properties) in RON (RDF Object Notation) mode.

A goal is to make it possible to expose the intermediate list nodes. This means that at least internally the pattern ?rdf:rest* ?inter . ?iter rdf:first ?item needs to be constructed. Ideally, it would also be possible to provide a pattern and designate one variable as the intermediate one.

So what needs to be clarified is the interaction between @pattern and @rdfList.

Rough ideas:

  • Have pattern point to the variable which carries the list, then use @rdfList on that variable.
{
   myList @pattern(of: "?s eg:authors ?l") @rdfList(from: "l", to: "item", via: "intermediate")
}

Generated pattern would be:

SELECT * {
  ?s eg:authors ?l .
  ?l rdf:rest* ?intermediate . ?intermediate rdf:first ?item .
}
  • Point the pattern's target to the list items, and use @rdfList to declare the intermediate variable.
{
   myList @pattern(of: "?s eg:authors/rdf:rest* ?i . ?i rdf:first ?o", from: "s", to: "o")
          @rdfList(of: "?i")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant