Skip to content

Commit

Permalink
add info on TSTV
Browse files Browse the repository at this point in the history
  • Loading branch information
cn337131 committed Jun 12, 2024
1 parent 38e4774 commit 591be1a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
11 changes: 4 additions & 7 deletions docs/user-guide/query/gremlin/gremlin-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ Current TinkerPop features not present in the GafferPop implementation:

Current known limitations or bugs:

- Proper user authentication is only available if using a Gremlin server and
the `GafferPopAuthoriser` class.
- Proper [user authentication]((../../../administration-guide/gaffer-deployment/gremlin.md#user-authentication))
is only available if using a Gremlin server and the `GafferPopAuthoriser` class.
- Performance compared to standard Gaffer `OperationChain`s will likely be
slower as multiple Gaffer `Operations` may utilised to perform one Gremlin
step.
- The ID of an Edge must either be made up of its source and
destination IDs, e.g. `[source, dest]`, or its source, label and destination,
e.g. `[source, label, dest]`. To use this in a seeded query you must
format it like `g.E("[source, dest]")` or a list like
`g.E(["[source1, dest1]","[source2, label, dest2]"])`
- Edge IDs in GafferPop are not the same as in standard Gremlin. Instead of `g.E(11)`
edge IDs take the format `g.E([source, dest])` or `g.E([source, label, dest])`.
- 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.
- Chaining `hasLabel()` calls together like `hasLabel("label1").hasLabel("label2")`
Expand Down
48 changes: 27 additions & 21 deletions docs/user-guide/query/gremlin/gremlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,33 @@ of how Gremlin handles this:

There are more example queries to be found in the [Gremlin Getting Started](https://tinkerpop.apache.org/docs/current/tutorials/getting-started/) docs.

## Mapping Gaffer to TinkerPop

Some of the terminology is slightly different between TinkerPop and Gaffer,
a table of how different parts are mapped is as follows:

| Gaffer | TinkerPop |
| --- | --- |
| Group | Label |
| Vertex | Vertex with default label of `id` |
| Entity | Vertex |
| Edge | Edge |

In Gafferpop Edge ID's must be made up of a list containing either source and destination
IDs, e.g. `[source, dest]`, or source, label and destination, e.g. `[source, label, dest]`.
In a seeded query these should be formatted like so `g.E("[source, dest]")` or
`g.E(["[source1, dest1]","[source2, label, dest2]"])`.

Note that if using TSTV values for seeds or property values these must be in the
format `t:type|st:subtype|v:value`.

## 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.

### NamedOperations in Gremlin

The [GafferPopNamedOperationService](https://gchq.github.io/Gaffer/uk/gov/gchq/gaffer/tinkerpop/service/GafferPopNamedOperationService.html)
Expand All @@ -251,7 +278,6 @@ Currently, users can add and run Named Operations.
=== "Gremlin"

```python
# Create the operation chain
operation = gc.OperationChain(
operations=[
gc.GetAllElements(),
Expand Down Expand Up @@ -301,26 +327,6 @@ Users can also run any existing or added Named Operations that are stored in the
g.call("namedoperation", params).toList();
```

## Mapping Gaffer to TinkerPop

Some of the terminology is slightly different between TinkerPop and Gaffer,
a table of how different parts are mapped is as follows:

| Gaffer | TinkerPop |
| --- | --- |
| Group | Label |
| Vertex | Vertex with default label of `id` |
| 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
Expand Down

0 comments on commit 591be1a

Please sign in to comment.