Giter Club home page Giter Club logo

Comments (15)

davebshow avatar davebshow commented on September 26, 2024 2

The whole point of allowing users to pass a hasher as a kwarg is so that goblin is vendor agnostic. For example, DSE Graph requires a different hashing function. The default implementation of Goblin should run against the reference implementation TinkerGraph, which does not require a hasher.

from goblin.

davebshow avatar davebshow commented on September 26, 2024 1

If I'm not mistaken, 1.0.0b2 should work just fine with TP 3.2.3. You should be able to install with pip:

$ pip install goblin==1.0.0b2

As a side note, have you considered moving from Titan to JanusGraph? Titan is no longer active and won't see any new releases. I'm sure upcoming releases of JanusGraph will support TP 3.2.4+, which includes a lot of improvements. I believe the most recent release only tests against 3.2.3, but you may be able to build it with 3.2.4...

from goblin.

davebshow avatar davebshow commented on September 26, 2024 1

Well here I think this is because JanusGraph uses hashes for IDs...some other users have used this function to work with JanusGraph. You can then pass as the get_hashable_id kwarg to the Goblin.open method:

def get_hashable_id(val):
    #Use the value "as-is" by default.
    result = val
    if isinstance(val, dict) and "@type" in val and "@value" in val:
        if val["@type"] == "janusgraph:RelationIdentifier":
            result = val["@value"]["value"]
    return result

See example code here and see if that fixes your issue: #60

from goblin.

Will-Hardman avatar Will-Hardman commented on September 26, 2024

It's worth noting that the edge does get created. I can then traverse it without problems. But if I attempt to retrieve an edge I get the same error, this time thrown by another method.

from goblin.

davebshow avatar davebshow commented on September 26, 2024

I believe this is a (de)serialization error caused by the server version. Goblin now relies on the aiogremlin language variant version 3.2.4, which requires TinkerPop (Gremlin Server) 3.2.4. I would recommend bumping to the current Gremlin Server version for your app. The other option would be to use the previous version of Goblin. Let me know if this works for you.

from goblin.

Will-Hardman avatar Will-Hardman commented on September 26, 2024

Hi Dave,

Thanks for getting back to me so speedily!

I tried building Titan 1.1 with TinkerPop 3.2.4 but was getting an error like:

Can't construct a java object for tag:yaml.org,2002:org.apache.tinkerpop.gremlin.server.Settings; exception=Cannot create property=ssl for JavaBean=org.apache.tinkerpop.gremlin.server.Settings@33f88ab; java.lang.reflect.InvocationTargetException

So I guess I'll need to try an older version of Goblin. Which one would you recommend?

Will

from goblin.

Will-Hardman avatar Will-Hardman commented on September 26, 2024

Hi Dave,

Thanks for your thoughts above. I'm on vacation this week but will update you as soon as I'm back.

Regarding JanusGraph - I briefly considered it but then decided that it was too early in development to risk using. However, a closer inspection of the docs suggests that it might be a fork of the Titan codebase? In any case, it's a good shout and I'll probably migrate.

With regards,

Will

from goblin.

davebshow avatar davebshow commented on September 26, 2024

Yes JanusGraph is Titan under a new name. If you don't mind me asking, what are you using Goblin/TinkerPop for? If it's top secret no worries, if it is semi-secret feel free to email me at [email protected].

from goblin.

Will-Hardman avatar Will-Hardman commented on September 26, 2024

Hi Dave,

So I've had a chance to resolve the issues (switching to the JanusGraph 0.11 release in the process).

  • I pulled Goblin 1.0.0b2 from pip but it started throwing different errors: for example it seems that traversals like g().V().iterate() were not supported by the corresponding version of aiogremlin.

  • I tried building from the Master branch of JanusGraph - which does depend on TP 3.2.4 - but I get errors at runtime when forking Elasticsearch ("cannot run as root").

So I guess the best solution is to wait for JanusGraph 0.2, unless I've missed something else?

I'll email you separately about my use case :-)

With regards,

Will

from goblin.

davebshow avatar davebshow commented on September 26, 2024

Yes, the 1.0.0b2 version features a "special" version of the GLV. Since the 2.0.0 release (which uses aiogremlin), we support the official gremlin-python GLV API.

Regarding building the Master branch of JanusGraph, I'm not sure what is going on there. I know that they provide great support through their Google group.

from goblin.

davebshow avatar davebshow commented on September 26, 2024

Has this been resolved?

from goblin.

John-Boik avatar John-Boik commented on September 26, 2024

Hi Dave. I'm getting a similar error as Will did. So I built JanusGraph from scratch, using TP 3.2.5. Using Will's code (as well as the sample code in the Goblin docs), I get the same error that I received when I was using JanusGraph 0.1.1. It seems that a dict is trying to use a dict as a key. Any ideas on how I might fix this? Or, perhaps I am doing something wrong.

Traceback (most recent call last):
File "run_janus.py", line 37, in
loop.run_until_complete(create(app, e))
File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "run_janus.py", line 19, in create
await session.flush()
File "/home/john/.virtualenvs/ETR/lib/python3.5/site-packages/goblin/session.py", line 270, in flush
await self.save(elem)
File "/home/john/.virtualenvs/ETR/lib/python3.5/site-packages/goblin/session.py", line 312, in save
result = await self.save_edge(elem)
File "/home/john/.virtualenvs/ETR/lib/python3.5/site-packages/goblin/session.py", line 350, in save_edge
self.current[hashable_id] = result
File "/home/john/.virtualenvs/ETR/lib/python3.5/weakref.py", line 158, in setitem
self.data[key] = KeyedRef(value, self._remove, key)
TypeError: unhashable type: 'dict'
Task was destroyed but it is pending!

from goblin.

John-Boik avatar John-Boik commented on September 26, 2024

Good to go, Dave. Thanks for the quick response.

from goblin.

dyangelo-grullon avatar dyangelo-grullon commented on September 26, 2024

I received this error as well, and although the workaround provided is an adequate solution, I feel as if goblin should be vendor agnostic. Can't the 'get_hashable_id' callback that you've provided be the default callback?

from goblin.

dyangelo-grullon avatar dyangelo-grullon commented on September 26, 2024

Thank you for clarifying!

from goblin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.