b4lls4ck
b4lls4ck
Explore posts from servers
JJanusGraph
Created by b4lls4ck on 11/27/2024 in #questions
Index Creation Help
Hi, I fixed the issue by changing my first third command listed above to
:remote connect tinkerpop.server conf/remote.yaml session
:remote connect tinkerpop.server conf/remote.yaml session
. However I do have some persisting issues and confusions which I will send soon.
4 replies
JJanusGraph
Created by b4lls4ck on 11/27/2024 in #questions
Index Creation Help
Hi, I have tried to create indexes but I am running into issues. I am using the Docker image to jave a JanusGraph instance on my machine and I am using the gremlin console within the Docker container to create a composite index as follows: 1. I go into the Docker container via the
docker exec -it janausgraph-container bash
docker exec -it janausgraph-container bash
command 2. Once in the Docker container I run
./bin/gremlin.sh
./bin/gremlin.sh
to start up the gremlin console 3. I run
:remote connect tinkerpop.server conf/remote.yaml
:remote connect tinkerpop.server conf/remote.yaml
and then
:remote console
:remote console
which then outputs
==>All scripts will now be sent to Gremlin Server = [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
==>All scripts will now be sent to Gremlin Server = [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
4. I then run
mgmt = graph.openManagement()
mgmt = graph.openManagement()
which outputs
==>org.janusgraph.graphdb.database.management.ManagementSystem@16015e12
==>org.janusgraph.graphdb.database.management.ManagementSystem@16015e12
5. I then run
nameProperty = mgmt.makePropertyKey("name").dataType(String.class).make()
nameProperty = mgmt.makePropertyKey("name").dataType(String.class).make()
Which unfortunately appears to give me an error saying in the stack trace:
groovy.lang.MissingPropertyException: No such property: mgmt for class: Script5
groovy.lang.MissingPropertyException: No such property: mgmt for class: Script5
I am very confused as to why this is happening and would appreciate any assistance/troubleshooting
4 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
Hi @cdegroc Thank you so much for your response, may you please explain how someone can go about creating a Composite index? What is the difference between Graph Index, Vertex Centric Index, and Composite Index? I took a look at the link you sent, should the commands be run in a groovy console?
31 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
Hi everyone , thank you for responding, may someone please explain how to create an index in Python? This is assuming that creating an index will speed up performance of queries
31 replies
ATApache TinkerPop
Created by b4lls4ck on 8/1/2024 in #questions
How to find the edges of a node that have a weight of x or greater?
Thank you, this helped me fix my problem 🙂
8 replies
ATApache TinkerPop
Created by b4lls4ck on 8/1/2024 in #questions
How to find the edges of a node that have a weight of x or greater?
Also btw, I am assuming the way I am setting weights for the edges is correct:
person_A_node = g.V().has("person", "name", "A").to_list()[0] # this node represents person A

person_B_node = g.V().has("person", "name", "B").to_list()[0] # this node represents person B

person_C_node = g.V().has("person", "name", "C").to_list()[0] # this node represents person C

g.V(person_A_node).add_e("is friends with").to(person_B_node).property("weight", 0.9).iterate()
g.V(person_A_node).add_e("is friends with").to(person_C_node).property("weight", 0.7).iterate()
person_A_node = g.V().has("person", "name", "A").to_list()[0] # this node represents person A

person_B_node = g.V().has("person", "name", "B").to_list()[0] # this node represents person B

person_C_node = g.V().has("person", "name", "C").to_list()[0] # this node represents person C

g.V(person_A_node).add_e("is friends with").to(person_B_node).property("weight", 0.9).iterate()
g.V(person_A_node).add_e("is friends with").to(person_C_node).property("weight", 0.7).iterate()
8 replies
ATApache TinkerPop
Created by b4lls4ck on 8/1/2024 in #questions
How to find the edges of a node that have a weight of x or greater?
Oh yeah, I also tried that, and for some reason, it didn't work. My query was as follows:
from gremlin_python.process.traversal import P
a_friends = g.V().has("person", "name", "A").out("is friends with").has("weight", P.gt(0.75)).inV().to_list()
from gremlin_python.process.traversal import P
a_friends = g.V().has("person", "name", "A").out("is friends with").has("weight", P.gt(0.75)).inV().to_list()
And it returned an empty list even though I have that person C has a weight of 0.9 with person A
8 replies
JJanusGraph
Created by b4lls4ck on 7/18/2024 in #questions
Is there a suitable JanusGraph visualizer where you can see your created graphs?
I am leaning more towards a free visualization software
8 replies
JJanusGraph
Created by b4lls4ck on 7/18/2024 in #questions
Is there a suitable JanusGraph visualizer where you can see your created graphs?
Okay thank you! I'll take a look at these and see what they got, will come back with any questions I may have about them
8 replies
JJanusGraph
Created by b4lls4ck on 7/18/2024 in #questions
Is there a suitable JanusGraph visualizer where you can see your created graphs?
Thank you for sharing this, I am assuming after looking at pricing that it will cost $50/month to have it set up with JanusGraph?
8 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Wow That fixed it! thank you so much! I really appreciate your help and your super detailed explanations, thank you!!!!! Will post any other questions I have on a new thread if I have
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
it's quite a lot to send here , but the output of my docker logs are equivalent to what gets printed when starting the Janus Graph container itself, My Python script has been modified to look like this:
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.anonymous_traversal import traversal
from janusgraph_python.driver.serializer import JanusGraphSONSerializersV3d0

g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g',message_serializer=JanusGraphSONSerializersV3d0()))

v1 = g.add_v("person").property("name", "John").next()
print(v1)
v2 = g.add_v("person").property("name", "Mary").next()
print(v2)
e = g.V(v1).add_e("knows").to(v2).iterate()
print(g.V().has("person", "name", "John").out("knows").values("name").to_list())
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.anonymous_traversal import traversal
from janusgraph_python.driver.serializer import JanusGraphSONSerializersV3d0

g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g',message_serializer=JanusGraphSONSerializersV3d0()))

v1 = g.add_v("person").property("name", "John").next()
print(v1)
v2 = g.add_v("person").property("name", "Mary").next()
print(v2)
e = g.V(v1).add_e("knows").to(v2).iterate()
print(g.V().has("person", "name", "John").out("knows").values("name").to_list())
What is outputted is the following, still getting similar error , but I am now able to successfully add vertices using the add_v method, create an edge between the two vertices using add_e method, and print out the name of the person that John knows (Mary):
v[4184]
v[8296]
['Mary']
Error on reading from the event loop self pipe
loop: <ProactorEventLoop running=True closed=False debug=False>
Traceback (most recent call last):
File "C:\Python312\Lib\asyncio\proactor_events.py", line802, in _loop_self_reading
.
.
.
OSError: [WinError 87] The parameter is incorrect
Error on reading from the event loop self pipe
loop: <ProactorEventLoop running=True closed=False debug=False>
v[4184]
v[8296]
['Mary']
Error on reading from the event loop self pipe
loop: <ProactorEventLoop running=True closed=False debug=False>
Traceback (most recent call last):
File "C:\Python312\Lib\asyncio\proactor_events.py", line802, in _loop_self_reading
.
.
.
OSError: [WinError 87] The parameter is incorrect
Error on reading from the event loop self pipe
loop: <ProactorEventLoop running=True closed=False debug=False>
It's just I still get the OSError WinError 87 ,
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Hi @Florian Hockmann Thank you for letting me know that Janus doesn't have official Windows support, I have used the Docker container, and in this message I am replying to, I go into detail about the error I would get when using the Docker container, are there any suggestions or ways I could address this issue?
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Now in JanusGraph 1.0.0. distribution, there is a gremlin-server.bat file which I can run as I am on Windows, upon running it, it says it has connected to port 8182. I run my Python script afterwards
g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
v1=g.add_v("person").property("name", "John").next()
g = traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
v1=g.add_v("person").property("name", "John").next()
and I get an error outputted by the Python script saying
gremlin_python.driver.protocol.GremlinServerError: 499: The traversal source [g] for alias [g] is not configured on the server. bin/gremlin-server.sh conf/gremlin-server/gremlin-server-configuration.yaml
.
.
.
OSError: [WinError 87] The parameter is incorrect
gremlin_python.driver.protocol.GremlinServerError: 499: The traversal source [g] for alias [g] is not configured on the server. bin/gremlin-server.sh conf/gremlin-server/gremlin-server-configuration.yaml
.
.
.
OSError: [WinError 87] The parameter is incorrect
Now I will try out the add on above involving serialization, but do you think this different error could be due to another reason?
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Yes exactly, I am running a Janus Server in that docker container
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Is there any way of starting a JanusGraph server in Windows? I cannot run the /bin/janusgraph-server.sh script as I am on Windows, and there is no /bin/janusgraph-server.bat file included in the JanusGraph distribution I downloaded (1.0.0). This is the very reason why I am using Docker instead
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Thanks for sharing the Python examples, they look very helpful
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
I am using docker to run JanusGraph and I ran a command that is similar to the first command listed on this page: https://docs.janusgraph.org/getting-started/installation/ The exact command I run is:
docker run -it -p 8182:8182 --name janusgraph-default janusgraph/jannusgraph:latest
docker run -it -p 8182:8182 --name janusgraph-default janusgraph/jannusgraph:latest
which is similar to that first command on that page. I needed to modify it because i need to map port 8182 of the JanusGraph container to port 8182 of my machine (the host machine). Without the "-it -p 8182:8182" part I would get the following error when running the python script:
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8182 ssl:default [The remote computer refused the network connection]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001FFAA7B2210>
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8182 ssl:default [The remote computer refused the network connection]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001FFAA7B2210>
But since I am mapping the port of the container to the port of my machine, I am no longer getting that error, and am now facing this new error mentioned earlier So I would say that my python script is connecting to JanusGraph as opposed to the Gremlin Server
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
I am not too sure on why this would be occurring , I have seen it a couple of times
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
Which is what I had in my code, and it would yield the following error:
KeyError: <DataType.custom: 0>
Error on reading from the event loop self pipe
loop: <ProactorEventLoop running=True closed=False debug=False>
....
OSError: [WinError 87] The parameter is incorrect
KeyError: <DataType.custom: 0>
Error on reading from the event loop self pipe
loop: <ProactorEventLoop running=True closed=False debug=False>
....
OSError: [WinError 87] The parameter is incorrect
56 replies