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
10 changes: 5 additions & 5 deletions docs/deployment/install_on_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide will walk you through the process of installing GraphScope on your lo

- Ubuntu 20.04 or later, CentOS 7 or later, or macOS 11 (Intel) / macOS 12 (Apple silicon) or later
- Python 3.7 ~ 3.11, and pip >= 19.3
- OpenJDK 8 or later (If you want to use GIE)
- JDK 11 (If you want to use GIE, both JDK 8 and 20 have known compatibility issues)

## Install from packages
GraphScope is distributed via [Python wheels](https://pypi.org/project/graphscope), and could be installed by [pip](https://pip.pypa.io/en/stable/) directly.
Expand Down Expand Up @@ -74,7 +74,7 @@ cd graphscope

### Use dev image with all dependencies installed

To make our life easier, we provide a pre-built docker image with all the dependencies installed.
To make our life easier, we provide a pre-built docker image with all the dependencies installed.
You can use pull it and work in a container with this image to build GraphScope.

```bash
Expand All @@ -87,7 +87,7 @@ git clone https://github.com/alibaba/graphscope

### Build and install

After the dependencies are installed on your local or in the container,
After the dependencies are installed on your local or in the container,
you can build and install GraphScope in root directory of the source code.

```bash
Expand All @@ -96,7 +96,7 @@ make install
```

````{note}
Analytical engine(GAE) may require on-the-fly compilation, which needs clang or g++. Hence additional setup steps may in need to install build-essentials. e.g., on ubuntu:
Analytical engine(GAE) may require on-the-fly compilation, which needs clang or g++. Hence additional setup steps may in need to install build-essentials. e.g., on ubuntu:

```bash
apt update -y &&
Expand All @@ -110,4 +110,4 @@ Learning engine (GLE) doesn't support running on Python 3.11 currently, cause Te

````{note}
Currently, the support for arm-based platforms is very preliminary, and not ready for production yet.
````
````
1 change: 1 addition & 0 deletions docs/interactive_engine/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ For your reference, we've tested the tutorial on Ubuntu 20.04.

- Kubernetes Cluster
- Python >= 3.9
- JDK 11 (Both JDK 8 and 20 have known compatibility issues)

To get started, you need to prepare a Kubernetes Cluster to continue.

Expand Down
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
- JDK 11 (Both JDK 8 and 20 have known compatibility issues)
- 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")