[
https://issues.apache.org/jira/browse/TINKERPOP-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16450253#comment-16450253
]
stephen mallette commented on TINKERPOP-1804:
---------------------------------------------
I wonder if there's a reasonably way to reliably detect and re-write
{{has('location', 'seattle')}} as
{{hasLabel('location').hasValue('seattle'))}}... seems like that's a really
narrow case where this would solve this particular problem, but i wonder if
other traversals that had more complex {{has()}}/filter would not work so
easily or would need some special additional handling. I might be overlooking
something simple to this, but if not, i wonder if the added code complexity is
worth the expansion of the feature.
> Has step doesn't consider strategy vertexProperty filters
> ---------------------------------------------------------
>
> Key: TINKERPOP-1804
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1804
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.3
> Reporter: Simone Cattani
> Assignee: stephen mallette
> Priority: Major
>
> Has step, when used in a traversal defined with strategies, doesn't consider
> filters applied on properties by the strategies
> Let's consider the crew example adding an old location for Marko, in Seattle,
> the current Matthias' location.
> {code}
> graph = TinkerFactory.createTheCrew()
> g = graph.traversal()
> g.V().has('name', 'marko').property('location', 'seattle', 'startTime', 1994,
> 'endTime', 1997)
> {code}
> Defining a strategy that considers just current location I can correctly
> obtain the list of current locations
> {code}
> g.withStrategies(SubgraphStrategy.build().vertexProperties(or(hasLabel(neq('location')),hasNot('endTime'))).create()).V().hasLabel("person").valueMap()
> ==>[name:[marko],location:[santa fe]]
> ==>[name:[stephen],location:[purcellville]]
> ==>[name:[matthias],location:[seattle]]
> ==>[name:[daniel],location:[aachen]]
> {code}
> But requiring people (currently) living in Seattle, I obtain Marko, too
> {code}
> g.withStrategies(SubgraphStrategy.build().vertexProperties(or(hasLabel(neq('location')),hasNot('endTime'))).create()).V().hasLabel("person").has('location',
> 'seattle').valueMap()
> ==>[name:[marko],location:[santa fe]]
> ==>[name:[matthias],location:[seattle]]
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)