atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seetharam Venkatesh <venkat...@innerzeal.com>
Subject Re: Does Atlas really support Gremlin queries?
Date Tue, 19 Jan 2016 20:47:29 GMT
Gremlin is quite notorious and does not work always. But clearly, using
Gremlin is quite leaky as you can see and hence my preference over the DSL.

Wrt to your code, we have had issues with OR operator. Can you test this on
a sample GSON and load it into gremlin and test this script. Thats how we
verified every query in the DSL to gremlin translation layer.

Once it works in gremlin, you can then send it across to Atlas and it
should work.

Makes sense?

On Tue, Jan 19, 2016 at 12:36 PM Dmitry Vasilenko <dvasilen@gmail.com>
wrote:

> Thanks a lot, looking forward to the Atlas DSL API that has support for
> ORDER BY and LIMIT.
>
> In the mean time here is the sample of the Gremlin query we have to use:
>
>  g.V().and(
>   _().has('__typeName', T.eq, 'XXXXX'),
>   _().or(
>      _().has('__traitNames',
> com.thinkaurelius.titan.core.attribute.Text.CONTAINS, 'YYYY') ,
>      _().has('__traitNames',
> com.thinkaurelius.titan.core.attribute.Text.CONTAINS, 'KKKKK') )  ,
>    _().has('GGGGGGG', T.eq, "ppppppp") ,
>    _().has('KKKKKKK', T.gte, 1452702737671),
>    _().has('DDDDDDDDD', T.eq, 'mmmmm')).
>    sort{'__timestamp'}_()[0].toList()
>
> for the task at hand. Took some time to figure out the exact syntax but it
> works now.
>
> Regards
> Dmitry
>
>
>
>
> On Tue, Jan 19, 2016 at 2:27 PM, Seetharam Venkatesh <
> venkatesh@innerzeal.com> wrote:
>
> > I added Gremlin and Rexster APIs as an experiment and mostly for testing
> > instead of pointing Titan to the DB instance outside. I should have
> > annotated them as LimitedPrivate to avoid confusion.
> >
> > If you notice, Gremlin is a pass-through today and we did not intend to
> > support it in the long run. Atlas DSL is rich and type-aware. We should
> > enhance the DSL and provide the features that you are asking for.
> >
> > Rexster is also a read-only API that I thought was removed.
> >
> > Thanks!
> >
> > Venkatesh
> >
> > On Mon, Jan 18, 2016 at 6:00 AM Dmitry Vasilenko <dvasilen@gmail.com>
> > wrote:
> >
> > > Hi Hemanth,
> > >
> > > The Atlas DSL API does not support ORDER BY and LIMIT as of yet. It
> > returns
> > > the complete result set and does not scale well if you have a lot of
> > data.
> > >
> > > See also
> > > https://issues.apache.org/jira/browse/ATLAS-435
> > > https://issues.apache.org/jira/browse/ATLAS-436
> > >
> > > Pagination
> > > https://issues.apache.org/jira/browse/ATLAS-347
> > > is definitely nice to have but it forces the client to filter out the
> > > results instead of pushing the processing to the server.
> > >
> > > If the DSL is extended to support ORDER BY and LIMIT it will be the
> > > preferable way to search the repository but until that functionality is
> > > implemented using Gremlin queries seems to be the only option.
> > >
> > > Regards
> > > Dmitry
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Sun, Jan 17, 2016 at 10:38 PM, Hemanth Yamijala <
> > > hyamijala@hortonworks.com> wrote:
> > >
> > > > Dmitry,
> > > >
> > > > Apologies upfront for a possibly not very helpful response. This is
> > more
> > > > to understand from a product perspective.
> > > >
> > > > Could you tell us what your motivation is to go directly with Gremlin
> > as
> > > > opposed to either going through the UI or the DSL API? Are there
> things
> > > > that you would like to see in either that are not currently
> supported?
> > > For
> > > > example, I know that the current REST APIs do not restrict number of
> > > > results and had opened
> https://issues.apache.org/jira/browse/ATLAS-347
> > > > for this. Are there enhancements like this that would help using
> Atlas
> > > > easier?
> > > >
> > > > Or do you prefer the Gremlin queries for some other reason?
> > > >
> > > > Thanks
> > > > hemanth
> > > >
> > > >
> > > >
> > > >
> > > > On 1/13/16, 10:40 PM, "Dmitry Vasilenko" <dvasilen@gmail.com> wrote:
> > > >
> > > > >Dear developers:
> > > > >
> > > > >I am trying to create a query that includes order by and limit the
> > > result
> > > > >to a single instance and as Atlas DSL
> > > > >does not  support ORDER BY and LIMIT I am trying to use Gremlin.
> > > > >
> > > > >The simple Gremlin query like
> > > > >
> > > > >g.V().has("__guid", "9b1329e0-12ff-4d45-ad51-9455e18736b9"
> ).toList()
> > > > >
> > > > >works just fine but anything a bit more complex that includes
> > > > >order().by(...).limit(1) fails miserably with QueryParsingException.
> > > > >
> > > > >I would naively think that the Gremlin syntax like this should be
> > > > >well-formed and perfectly valid:
> > > > >
> > > > >g.V().has("__guid", "9b1329e0-12ff-4d45-ad51-9455e18736b9"
> > > > >).order().by("name").limit(1).toList()
> > > > >
> > > > >but unfortunately it does not work (QueryParsingException)
> > > > >
> > > > >Does any one know how the Gremlin query with order().by() ....
> > limit(1)
> > > > >should look like to be palatable by Atlas?
> > > > >
> > > > >
> > > > >Regards
> > > > >Dmitry Vasilenko
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message