Comments (15)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Has this been resolved?
from goblin.
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.
Good to go, Dave. Thanks for the quick response.
from goblin.
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.
Thank you for clarifying!
from goblin.
Related Issues (20)
- Reference instance to test goblin against HOT 3
- How to change version of Goblin OGM Serializer for Janusgraph (TinkerPop 3.2.6) HOT 3
- TypeError: unhashable type: 'dict' when creating an Edge HOT 10
- goblin does not work with aiohttp>=3.0.0 HOT 5
- Question about using a multi-value/set VertexProperty HOT 6
- Vertex property gets changed from Gremlin Console but not from Python/Goblin script HOT 2
- goblin not working with aiohttp (server) HOT 2
- Mocking JanusGraph Connection for unit tests
- Add method to easily remove Vertex HOT 1
- The project appears idle, can I take over? HOT 10
- Problem with Edge data type HOT 5
- App/Cluster configuration using URL HOT 3
- Schema generator HOT 3
- Belated License change HOT 5
- Question: Extent to which OO modeling is supported in Goblin HOT 7
- How to use mixed index in goblin? HOT 4
- AttributeError: AsyncGraphTraversal.last_traverser HOT 1
- [Proposal] - OGM distinct from driver HOT 7
- Ability to set vertex or edge ID HOT 5
- Unexpected results when updating property HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goblin.