Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

janusgraph-python geoWithin #11

Open
John-Boik opened this issue Sep 9, 2018 · 1 comment
Open

janusgraph-python geoWithin #11

John-Boik opened this issue Sep 9, 2018 · 1 comment

Comments

@John-Boik
Copy link

Looks like the file core/attribute/GeoPredicate/geoWithin.py should be renamed GeoWithin. Doing so allows me to use: from janusgraph_python.structure.io.GraphsonReader import JanusGraphSONReader. Otherwise, I get the error: ModuleNotFoundError: No module named 'janusgraph_python.core.attribute.GeoPredicate.GeoWithin'

@debasishdebs
Copy link

debasishdebs commented Sep 10, 2018

@John-Boik : Can you share the snippet of code you are working with because the following import works on my system.

from janusgraph_python.structure.io.GraphsonWriter import JanusGraphSONWriter
from janusgraph_python.structure.io.GraphsonReader import JanusGraphSONReader

reader = JanusGraphSONReader().register_deserializer(geoshape_identifier, geoshape_deserializer)
writer = JanusGraphSONWriter().register_serializer(obj_to_register, circle_serializer)

If you take a look at unreleased library docs, you will see the exact classes which needs to be imported.

As for import error regarding GeoWithin and GeoContains, you are importing in wrong way. The following unreleased library docs guides through how to invoke all Geo predicates.
You ideally don't import the module directly. Rather, you import GeoPredicate.Geo module, inside which you call either geoContains or geoWithin predicates.

So, something like this should work:

from janusgraph_python.core.attribute import Geo
g.V().has("name", "hercules").outE().has("place", Geo.geoWithin(shape)).next()

Hope that helps :-)

debasishdebs added a commit to debasishdebs/janusgraph-python that referenced this issue Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants