tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marko A. Rodriguez (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP3-761) Some basic mathematical functions / steps
Date Mon, 03 Aug 2015 15:32:04 GMT

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

Marko A. Rodriguez commented on TINKERPOP3-761:
-----------------------------------------------

Note that we already have {{fold(seed,binary operator)}}. However, we we provide {{mean()}}?
Why? We should be wary of too much fold(), unfold(), reduce(), etc. While we can work at this
level, it makes the query crazy looking. {{mean()}}, {{max()}}, etc. are much more user friendly.
For those reduction operators that people want to add that are beyond the typical operators,
{{fold(seed,operator)}} is there.

I think the same hold for math operators. {{sum()}}, {{div()}}, etc. can be provided, but
then, these simply extend a {{BinaryOperatorStep}} (like {{ReducingBarrierStep}} and {{fold()}}).
For operators people want to add beyond the typical operators, they can do {{op(R.conjugate)}}.

I like your concept of {{bind()}}. .... how can we generalize this to support the mutation
steps better? {{addV()}}. Perhaps:

{code}
g.V().as('a').out('knows').value('age').min(bind(as('a').value('age')))
g.V().as('a').out('knows').value('age').min(bind('a').by('age'))
g.V().as('a').out('knows').as('b').min(bind('a').by('age'), bind('b').by('age'))
{code}

How would this play with {{addOutE}} ?

{code}
g.V().as('a').outE().as('b').inV().addOutE('knows',bind('a'),'weight',bind('b').by('weight'))
{code}

In essence, {{bind(string)}} or {{bind(as().traversal)}} pulls from the {{Scope}}. This then
solves the problem of "if this 'a' a property value or a variable in Scope?" 

> Some basic mathematical functions / steps
> -----------------------------------------
>
>                 Key: TINKERPOP3-761
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-761
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Daniel Kuppitz
>            Assignee: Marko A. Rodriguez
>
> Every once in a while I wish to have steps for some basic mathematical operations ({{add()}},
{{sub()}}, {{mul()}}, {{div()}}). Since {{sub(num)}} is the same as {{add(-num)}} and {{div(num)}}
is the same as {{mul(1/num)}}, we would only need two new step implementations.
> Oh, and then there's also {{mod()}}, thus 3 new step implementations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message