How to handle namespaces in GraphQL

So I have loades starwas.ttl and sample graph queries from documentation work fine.

Now I would like to develop graphql queries for my own knowledge graph that has prefixes and namespaces - usual sparql RDF stuff...

  • How do I do that?

Example or tutorial should help.

Thank you,
Radu

See this section in the docs for namespaces Home | Stardog Documentation Latest

Stardog examples are usually at this repo, although I don't think there are any GraphQL examples yet. There might be some stuff in the stardog blog.

Thanks Zach! That worked.

Now one more question - can I separate the withPrefixes directive into some separate json file . Is that possible?

Thanks,
Radu

Raud,

If you store the namespaces in the database then you don't need the explicit directive and you can use prefixes like foaf_ directly in your queries. Otherwise there is no option to separate directives from queries.

The next release will also introduce a new schema directive that will let you define the namespaces at the GraphQL schema level so they don't have to be repeated in queries and you can use filed names without the namespace prefixes.

As a side note, there is a GraphQL example in the examples repo but the example only uses the default namespace so not relevant here,

Best,
Evren