[ 
https://issues.apache.org/jira/browse/TINKERPOP-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18030707#comment-18030707
 ] 

ASF GitHub Bot commented on TINKERPOP-2234:
-------------------------------------------

spmallette commented on code in PR #3211:
URL: https://github.com/apache/tinkerpop/pull/3211#discussion_r2440645052


##########
docs/src/upgrade/release-3.8.x.asciidoc:
##########
@@ -50,11 +50,46 @@ gremlin> 
g.V().has('airport','code','IAD').valueMap('code','desc','lon','lat')
 ==>[code:[IAD],lon:[-77.45580292],lat:[38.94449997],desc:[Washington Dulles 
International Airport]]
 ----
 
+==== Type Predicate
+
+The new `P.typeOf()` predicate allows filtering traversers based on their 
runtime type. It accepts either a `GType`
+enum constant or a string representation of a simple class name. This 
predicate is particularly useful for type-safe
+filtering in heterogeneous data scenarios.
+
+[source,text]
+----
+// Filter vertices by property type
+gremlin> g.V().has("age", P.typeOf(GType.INT)).values("name")
+==>marko
+==>vadas
+==>josh
+==>peter
+
+// Filter by class name registered in the GlobalTypeCache

Review Comment:
   maybe the `Note on Types` section should have some user facing reference to 
`GlobalTypeCache`? what about the provider docs for those trying to extend this 
feature? 





> 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)

Reply via email to