-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: GraphQL API #6
Comments
Nice this looks great! Only 3 points:
Otherwise looks great! |
Will change!
This is a bit tricky since we "rolled up" relations as edges in Neo4j. This would mean going back to representing a relation as a node in Neo4j with edges
Since those properties are not enforced by the indexer, users can define entities without setting those properties. If we make them explicit in the schema, the question arises as to how we'd handle cases when they are missing? |
It's okay if they're nullable. This is how our current reference data service handles it. What are Currently we store Value types are super important for generic applications since we need to know the value type of the triple in order to know how to render it appropriately.
|
For the initial implementation we'll also need schemas exposed for governance-related things like members/editors, proposals, versions. Not sure if this proposal is meant to cover those. |
Yes! With the exception that there are no nested JSON objects. It's basically just the contents of the Neo4j node.
We can easily add filters to the
The query {
# query an entity of type "LgKenoh2EfWrvqJqN6A7Ci" (attribute type) with id "gEfvT3cW16tyPmFEGA9bp"
_LgKenoh2EfWrvqJqN6A7Ci(id: "gEfvT3cW16tyPmFEGA9bp") {
name
valueType
}
} or alternatively query {
# query an entity with id "gEfvT3cW16tyPmFEGA9bp" and match on type "LgKenoh2EfWrvqJqN6A7Ci" (attribute type)
entity(id: "gEfvT3cW16tyPmFEGA9bp") {
...on _LgKenoh2EfWrvqJqN6A7Ci {
name
valueType
}
}
}
Yep already working on that! |
Correct me if I'm wrong, but in your examples it looks like you query the value type defined on the Attribute right? Not the value type for the op that creates the triple? Not all attributes have value types set and not all triples conform to an attribute's value type. For a generalized knowledge graph browser like Geo, we need to be able to granularly render each triple independently from if the Attribute has a defined value type or not. With your examples my understanding is that I couldn't write this query from the reference data service with the query {
entity(id: "gEfvT3cW16tyPmFEGA9bp") {
triples(filter: { valueType: { equalTo: 'TEXT' } }) {
value
valueType
attribute {
name
}
}
}
} |
Add a GraphQL API on top of Neo4j
Motivation
Cypher queries will get more complicated as new features (e.g.: versioning, etc.) are added. Adding a query layer on top of the database will make this more manageable.
Proposal
Create a new GraphQL API service as part of the indexer stack that will serve as the main interface to query data from the KG.
Below the proposed simple generic schema for the GraphQL API
Example Query
Note: This is roughly equivalent to the following cypher query
Here is the response:
The text was updated successfully, but these errors were encountered: