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

fix(interactive): fix the docs of interactive engine #3131

Merged
merged 10 commits into from
Aug 22, 2023
9 changes: 5 additions & 4 deletions docs/interactive_engine/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ This guide gives you a quick start to use GraphScope for graph interactive tasks

GIE works as the core component of GraphScope. Therefore, you should install GraphScope at first to use GIE.

GraphScope provides python interface which requires:
GraphScope requires the following software versions:

- Python3.7 ~ 3.11
- Python 3.9 ~ 3.11
- Java 11 (both Java 8 and 20 have compatibility issues)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to list the environment requirement for all engines in the same place? it would be easier to keep them consistent.

e.g., you'll find that the following page is saying we only require Java 8 for GIE.

https://graphscope.io/docs/deployment/install_on_local#prerequisites

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. But shall we include an extra page for prerequisites. It 's actually required everywhere, and there are much more requirements than we've listed in https://graphscope.io/docs/deployment/install_on_local#prerequisites.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sighingnow I have already tried, java 8 would not work for gie any more. LoL

- gcc 7.1+ or Apple Clang


And it is tested on the following 64-bit operating systems:

- Ubuntu 18.04 or later
Expand Down Expand Up @@ -59,7 +61,6 @@ the modern graph, which has been widely used in [Tinkerpop](https://tinkerpop.ap
```python
import graphscope as gs
from graphscope.dataset.modern_graph import load_modern_graph
from neo4j import GraphDatabase, RoutingControl

gs.set_option(show_log=True)

Expand All @@ -76,7 +77,7 @@ q2 = g.execute('g.V().hasLabel(\'person\')')
print(q2.all().result()) # should print [[v[2], v[3], v[0], v[1]]]

# or `execute` any supported Cypher query, by passing `lang="cypher"`
q3 = g.execute("MATCH (n) RETURN count(n)", lang="cypher", routing_=RoutingControl.READ)
q3 = g.execute("MATCH (n) RETURN count(n)", lang="cypher")
print(q3.records[0][0]) # should print 6
```

Expand Down
2 changes: 1 addition & 1 deletion docs/overview/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ papers = interactive.execute( \
"MATCH (n1:author)-[:writes]->(p:paper)<-[:writes]-(n2:author) \
WHERE n1.id = 2 AND n2.id = 4307 \
RETURN count(DISTINCT p)", \
lang="cypher", routing_=RoutingControl.READ)
lang="cypher")
```
````

Expand Down
4 changes: 3 additions & 1 deletion python/graphscope/interactive/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def execute(self, query, lang="gremlin", request_options=None, **kwargs):
return self.submit(query, lang, request_options=request_options, **kwargs)

def submit(self, query, lang="gremlin", request_options=None, **kwargs):
from neo4j import RoutingControl

"""Execute gremlin or cypher querying scripts.

<Gremlin>
Expand All @@ -130,7 +132,7 @@ def submit(self, query, lang="gremlin", request_options=None, **kwargs):
if lang == "gremlin":
return self.gremlin_client.submit(query, request_options=request_options)
elif lang == "cypher":
return self.cypher_driver.execute_query(query, **kwargs)
return self.cypher_driver.execute_query(query, routing_=RoutingControl.READ)
else:
raise ValueError(
f"Unsupported query language: {lang} other than gremlin and cypher"
Expand Down
6 changes: 1 addition & 5 deletions python/graphscope/tests/unittest/test_lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,6 @@ def test_gremlin_timeout(sess):


def test_cypher_endpoint(sess):
from neo4j import RoutingControl

g_node = load_p2p_network(sess)
interactive = sess.interactive(g_node)
_ = interactive.execute(
"MATCH (n) RETURN n LIMIT 1", lang="cypher", routing_=RoutingControl.READ
)
_ = interactive.execute("MATCH (n) RETURN n LIMIT 1", lang="cypher")