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

stephen mallette commented on TINKERPOP-1804:
---------------------------------------------

I've looked at this one from time to time since it was created. I still can't 
figure out what can be done here. Ultimately, the only way I can think of to 
get the result you want is for the strategy to produce this traversal:

{code}
gremlin> 
sg.V().hasLabel("person").has('location','seattle').filter(properties('location').hasValue('seattle').hasNot('endTime')).valueMap()
==>[name:[matthias],location:[seattle]]
{code}

Basically that 
{{filter(properties('location').hasValue('seattle').hasNot('endTime'))}} ends 
up being responsible for filtering out the "marko" vertex that we don't want. 
Not sure how to make {{SubgraphStrategy}} do that....

I'd say that right now, the {{vertexProperties()}} configuration on the 
{{SubgraphStrategy.Builder}} really is only responsible for filtering out what 
shows up in calls to things like {{valueMap()}}. It can't do anything to build 
up more complex filters for vertices. The two configurations operate 
independently from one another.


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

Reply via email to