You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by dkuppitz <gi...@git.apache.org> on 2017/02/24 10:24:38 UTC

[GitHub] tinkerpop pull request #564: TINKERPOP-1639 Support simple String operations

GitHub user dkuppitz opened a pull request:

    https://github.com/apache/tinkerpop/pull/564

    TINKERPOP-1639 Support simple String operations

    https://issues.apache.org/jira/browse/TINKERPOP-1639
    
    Added support for simple String operations. `CountLocalStep`, `RangeLocalStep` and `TailLocalStep` can now imitate `String::length()` and `String::substring()`.
    
    A few examples:
    
    ```
    gremlin> g.V().values("name").count(local)
    ==>5
    ==>5
    ==>3
    ==>4
    ==>6
    ==>5
    gremlin> g.V().values("name").limit(local, 3)
    ==>mar
    ==>vad
    ==>lop
    ==>jos
    ==>rip
    ==>pet
    gremlin> g.V().values("name").tail(local, 4)
    ==>arko
    ==>adas
    ==>lop
    ==>josh
    ==>pple
    ==>eter
    gremlin> g.V().values("name").group().by(range(local, 1, 2)).next()
    ==>a=[marko, vadas]
    ==>e=[peter]
    ==>i=[ripple]
    ==>o=[lop, josh]
    ```
    
    VOTE: +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1639

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/564.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #564
    
----
commit c6f92c9ef65fd711028b37745eed6e94e9163f0b
Author: Daniel Kuppitz <da...@hotmail.com>
Date:   2017-02-24T10:13:53Z

    Added support for simple String operations. `CountLocalStep`, `RangeLocalStep` and `TailLocalStep` can now imitate `String::length()` and `String::substring()`.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop pull request #564: TINKERPOP-1639 Support simple String operations

Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz closed the pull request at:

    https://github.com/apache/tinkerpop/pull/564


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #564: TINKERPOP-1639 Support simple String operations

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/564
  
    I do not think we should support this feature. This is starting to mix semantics between what is a "data structure" and what is a "primitive."
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #564: TINKERPOP-1639 Support simple String operations

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/564
  
    @dkuppitz asked me to say more of my thoughts on the matter.
    
    I think we need a general theory for how we are going to handle primitive manipulations. That is, math operators, string operations, character operations, type casting operations, etc.
    
    If we just append this feature for `Strings` then we might end up backtracking come a more general theory. It just seems that this PR is a "this would be cool" and implemented. Not: "So, primitives all fit this style of manipulation in a flow-based system..."
    
    Questions that arise:
    
    * What about `unfold()`? Now we are in character manipulation or just single character strings?
    * What about `fold()`? Does character folding become strings?
    * What about `range()` on doubles/floats? Is that a way to clip precision?
    
    I don't think we should just add this PR without a fully thought through model for all primitives and how they will be effected by the current or "need to be built" steps.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #564: TINKERPOP-1639 Support simple String operations

Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the issue:

    https://github.com/apache/tinkerpop/pull/564
  
    It's true that this was just "would be cool" PR, that would have helped me in the short term. The general solution to this problem is proposed in https://issues.apache.org/jira/browse/TINKERPOP-1632.
    
    Closing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #564: TINKERPOP-1639 Support simple String operations

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/564
  
    Also, what other string operations do we need? I'm thinking reg-ex.
    
    So now we have a `filter()` steps for regex, but then what about pattern matching selection. Well, thats not range, but something new. Now you have all your string manipulation features spread out across numerous steps. Is this good? I don't know. Seems that all primitive operations should be grouped via predicate and operators else we will just be building a new data flow language (steps steps steps steps) for primitives and all the operations you want to do on them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---