You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-28Lines changed: 41 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,40 @@
1
1
# python-hydra-agent
2
2
3
-
The python-hydra-agent is a smart python hydra client which is working with [hydrus](https://github.com/HTTP-APIs/hydrus).
3
+
For a general introduction to Hydra Ecosystem, see [hydraecosystem.org](http://hydraecosystem.org).
4
4
5
-
It caches the server data from hydra server for fast data querying.
5
+
`python-hydra-agent` is a smart Hydra client implemented in Python which works with [hydrus](https://github.com/HTTP-APIs/hydrus). Reference implementation is [Heracles.ts](https://github.com/HydraCG/Heracles.ts). Smart clients are generic automated clients that establish resilient connected data networks leveraging knowledge graphs.
6
6
7
-
It uses Redis to cache the data at the end of the client.
7
+
## General characteristics
8
8
9
-
So, Data is loaded from the server and store in Redis memory as a graph using redisgraph.
9
+
The client is designed to:
10
+
* Cache metadata from the Hydra server it connects to, to allow querying on the client-side;
11
+
* Use Redis as a graph-store leveraging `redisgraph` (see [here](https://oss.redislabs.com/redisgraph/));
12
+
* simply, metadata and data are loaded from the server and stored in Redis;
13
+
* The graph can be queried using OpenCypher.
10
14
11
-
With the help of Redis, clients become faster and easier to query the data.
15
+
The starting objective is to create a querying layer that is able to reach data in one or more Hydra srever/s. Leveraging Redis, clients can construct their own representation of the data stored in one or more Hydra servers; querying the data as they need it, and respond complex semantic queries. This will allow any client connected to any server to have access to an "aggregated view" of the connected network (the network of all the servers it connects to).
16
+
17
+
## Missing bits at the moment
18
+
* For now it is a proof-of-concept, only `GET` functionality
19
+
* Soon to develop, a reliable synchronization mechanism to allow strong consistency between server-side data and client-side representation.
12
20
13
21
## Installation
14
22
15
23
**NOTE:** You'll need to use python3.
16
24
25
+
To install only requirements:
26
+
27
+
pip3 install -r requirements.txt
28
+
29
+
or,
30
+
17
31
To install or setup the client environment, you have to run:
18
32
19
33
python3 setup.py install
20
34
21
-
or,
22
35
23
-
To install only requirements:
24
-
25
-
pip3 install -r requirements.txt
26
-
27
-
To install Redis and start Redis server:
36
+
To install Redis and other Redis modules:
28
37
29
-
cd hydra_redis
30
38
./redis_setup.sh
31
39
32
40
## Quickstart
@@ -48,17 +56,16 @@ To run the demo for python-hydra-agent, you have to follow the instructions:
48
56
49
57
you should follow the instructions of [installation](#installation).
50
58
51
-
After setup the environment and run the Redis server. You can query or run the client.
59
+
After setup the environment. You can query or run the client.
52
60
53
-
* To run the client you should run querying_mechanism.py like:
54
-
55
-
cd hydra_redis
56
-
python3 querying_mechanism.py
61
+
* To run both the things Redis server and the client. You can run the command:
62
+
63
+
docker-compose run client
57
64
58
65
59
66
and provide a valid URL and then you can query in querying format.
60
67
61
-
`>>>url` #here url should be a valid link, for testing you can use https://storage.googleapis.com/api3/api
68
+
`>>>url` #here url should be a valid link, for testing you can use http://35.224.198.158:8080/api
62
69
`>>>help` # it will provide the querying format
63
70
64
71
#### Code simplification
@@ -96,18 +103,24 @@ The client takes the query as input, like:
96
103
you can query as following querying formats:
97
104
98
105
```
99
-
print("for endpoint:- show endpoint")
100
-
print("for class_endpoint:- show classEndpoint")
101
-
print("for collection_endpoint:- show collectionEndpoint")
102
-
print("for members of collection_endpoint:-",
106
+
print("querying format")
107
+
print("Get all endpoints:- show endpoints")
108
+
print("Get all class_endpoints:- show classEndpoints")
109
+
print("Get all collection_endpoints:- show collectionEndpoints")
110
+
print("Get all members of collection_endpoint:-",
103
111
"show <collection_endpoint> members")
104
-
print("for properties of any member:-",
112
+
print("Get all properties of objects:-",
113
+
"show objects<endpoint_type> properties")
114
+
print("Get all properties of any member:-",
105
115
"show object<id_of_member> properties ")
106
-
print("for properties of objects:-show objects<endpoint_type> properties")
107
-
print("for collection properties:-",
108
-
"show <collection_endpoint> properties")
109
-
print("for classes properties:- show class<class_endpoint> properties")
0 commit comments