neosemantics
neosemantics copied to clipboard
Attempting to generate GraphQL schema from an ontology + instanced data
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!