[
https://issues.apache.org/jira/browse/TINKERPOP-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18030709#comment-18030709
]
ASF GitHub Bot commented on TINKERPOP-2234:
-------------------------------------------
spmallette commented on code in PR #3211:
URL: https://github.com/apache/tinkerpop/pull/3211#discussion_r2440657470
##########
docs/src/reference/the-traversal.asciidoc:
##########
@@ -5553,6 +5551,36 @@ g.V().as('a').both().both().as('b').count()
g.V().as('a').both().both().as('b').where('a',neq('b')).count()
----
+[[a-note-on-types]]
+== A Note on Types
+
+Gremlin provides type-based filtering capabilities through the `GType`
enumeration, which represents the various data
+types that can be encountered during graph traversals. Each `GType` constant
corresponds to a specific Gremlin type and
+is primarily used with the `typeOf()` predicate to filter values based on
their runtime type.
+
+The `GType` enumeration includes common data types such as:
+
+* **Numeric types**: `INT`, `LONG`, `DOUBLE`, `FLOAT`, `BYTE`, `SHORT`,
`BIGDECIMAL`, `BIGINT`
+* **General types**: `STRING`, `BOOLEAN`, `CHAR`, `UUID`, `BINARY`
+* **Collection types**: `LIST`, `SET`, `MAP`
+* **Graph types**: `VERTEX`, `EDGE`, `PROPERTY`, `VPROPERTY`, `PATH`, `TREE`,
`GRAPH`
+* **Temporal types**: `DATETIME`, `DURATION`
+* **Special types**: `NULL`, `NUMBER` (supertype for all numeric types)
+
+[gremlin-groovy,modern]
Review Comment:
These examples aren't very good. Consider some better, more realistic use
cases. Isn't this about union'd data we want to pick part in some way?
`values('age','name')` for example? or what about cases where edges and
vertices are mixed? maybe you should describe a case where data is mixed within
a property (either purposely or accidentally) and `typeOf` can help? i'm not
sure if all this goes here or not. maybe it's part of `has()` or a new Gremlin
Recipe.
> Introduce Type Predicate
> ------------------------
>
> Key: TINKERPOP-2234
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2234
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.4.2
> Reporter: Stephen Mallette
> Priority: Major
>
> Provide for a {{typeOf()}} predicate that allows for testing the type of an
> object which would enable neat things like:
> {code}
> g.V().outE().has('weight',gt(0.1)).inV().path().unfold().is(typeOf(VERTEX))
> {code}
> See the linked DISCUSS thread for more information.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)