Skip to content

Commit

Permalink
update gremlin docs with current features
Browse files Browse the repository at this point in the history
  • Loading branch information
tb06904 committed May 2, 2024
1 parent 1b8d1c0 commit 3568489
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docs/user-guide/query/gremlin/gremlin-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@ but some features may also be yet to be implemented.

Current TinkerPop features not present in the GafferPop implementation:

- Property index for allowing unseeded queries.
- Using a Gaffer user for authentication. Access control and authorisations are not supported
as these are based on users.
- Removal of entities/edges or properties - base Gaffer currently does not
- Property index for allowing unseeded queries (unseeded queries run a `GetAllElements`).
- Gaffer graphs are readonly to Gremlin queries.
support this.
- TinkerPop Graph Computer is not supported.
- Graph Variables can't be updated - there is limited support for this in base
Gaffer as usually requires shutting down and restarting the Graph.
- TinkerPop Transactions are not supported.
- TinkerPop Lambdas are not supported.

Current known limitations or bugs:

- Proper user authentication is only available if using a Gremlin server to
connect to the graph.
- Performance compared to standard Gaffer `OperationChain`s will likely be
slower as multiple Gaffer `Operations` may utilised to perform one Gremlin
step.
- The entity group `id` is reserved for an empty group containing only the
vertex ID, this is currently used as a workaround for other limitations.
- When you get the in or out Vertex directly off an Edge it will not contain any
actual properties or be in correct group/label - it just returns a vertex in
the `id` group. This is due to Gaffer allowing multiple entities to be
associated with the source and destination vertices of an Edge.
- Limited support for updating properties, this has partial support via Gaffer's
ingest aggregation mechanism.
- Performance compared to standard Gaffer OperationChains is hampered due to
a custom `TraversalStratergy` not being implemented.
- The ID of an Edge follows a specific format that is made up of its source and
destination IDs like `[source, dest]`. To use this in a seeded query you must
format it like `g.E("[source, dest]")` or a list like
Expand Down
19 changes: 19 additions & 0 deletions docs/user-guide/query/gremlin/gremlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,22 @@ a table of how different parts are mapped is as follows:
| Entity | Vertex |
| Edge | Edge |
| Edge ID | A list with the source and destination of the Edge e.g. `[dest, source]` |

## Custom Features

The GafferPop implementation provides some extra features on top of the
standard Tinkerpop framework that you can utilise in your queries. These
are likely specific to how a Gaffer graph operates and may not be available
in other graph technologies that support Gremlin queries.

### Adding Options to Queries

In standard Gremlin syntax it is possible to add additional key value variables
into a query via a [`with()` step](https://tinkerpop.apache.org/docs/current/reference/#with-step).
This feature is utilised to allow some custom properties to be passed in
for Gaffer specific options:

| Key | Example | Description |
| --- | --- | --- |
| `operationOptions` | `g.with("operationOptions", "gaffer.federatedstore.operation.graphIds:graphA").V()` | Allows passing options to the underlying Gaffer Operations, this is the same as the `options` field on a standard JSON query. |
| `getAllElementsLimit` | `g.with("getAllElementsLimit", 100).V()` | Limits the amount of elements returned if performing an unseeded query e.g. a `GetAllElements` operation. |

0 comments on commit 3568489

Please sign in to comment.