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

Attempting to generate GraphQL schema from an ontology + instanced data #277

Open
raRaRa opened this issue Sep 20, 2022 · 0 comments
Open

Comments

@raRaRa
Copy link

raRaRa commented Sep 20, 2022

Hey everyone.

I've successfully imported an ontology and instanced data that is linked to the ontology, which is really cool. However, I'm now facing an issue when generating GraphQL schema from the graph data within Neo4j. The problem is that every instance has the label Resource on it, which makes the GraphQL types look like this:

  type Resource3
    @node(
      label: "Resource"
      additionalLabels: ["ns0__Team", "owl__NamedIndividual"]
    ) {
    ns0__teamName: String!
    ns0__teamPurpose: String!
    rdfTypeResource4S: [Resource4!]!
      @relationship(type: "rdf__type", direction: OUT)
    resource2Sns0Member: [Resource2!]!
      @relationship(type: "ns0__member", direction: IN)
    uri: String!
  }

I really want to use ns0__Team as the type so that I can make a GraphQL query such as:

{
ns0__Team {
  ns0__teamName
}
}

Currently I need to do:

{
resource3s {
  ns0__teamName
}
}

which is... not ideal!

I'm now wondering what would be the best way to solve this. If I remove the Resource label from instanced data, wouldn't I then run into issues when I want to export the data from Neo4j as RDF? Additionally I was thinking about how cool it would be if I could simply generate GraphQL schema from the ontology without instanced data, has that been solved?

Thanks!

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