{"id":13726851,"url":"https://github.com/apache/incubator-s2graph","last_synced_at":"2025-10-08T01:30:25.658Z","repository":{"id":65979446,"uuid":"49258459","full_name":"apache/incubator-s2graph","owner":"apache","description":"Mirror of Apache S2Graph (Incubating)","archived":true,"fork":false,"pushed_at":"2020-05-28T14:18:00.000Z","size":14439,"stargazers_count":269,"open_issues_count":17,"forks_count":71,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-10-02T05:23:36.014Z","etag":null,"topics":["s2graph"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-08T08:00:06.000Z","updated_at":"2024-09-06T09:22:00.000Z","dependencies_parsed_at":"2023-02-19T19:01:24.274Z","dependency_job_id":null,"html_url":"https://github.com/apache/incubator-s2graph","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-s2graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-s2graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-s2graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-s2graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/incubator-s2graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235669382,"owners_count":19026815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["s2graph"],"created_at":"2024-08-03T01:03:27.343Z","updated_at":"2025-10-08T01:30:20.200Z","avatar_url":"https://github.com/apache.png","language":"Scala","funding_links":[],"categories":["其他_生物医药","Scala","数据库"],"sub_categories":["网络服务_其他"],"readme":"\u003c!---\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n---\u003e\n\nS2Graph [![Build Status](https://travis-ci.org/apache/incubator-s2graph.svg?branch=master)](https://travis-ci.org/apache/incubator-s2graph)\n=======\n\n[**S2Graph**](http://s2graph.apache.org/) is a **graph database** designed to handle transactional graph processing at scale. Its REST API allows you to store, manage and query relational information using **edge** and **vertex** representations in a **fully asynchronous** and **non-blocking** manner.\n\nS2Graph is a implementation of [**Apache TinkerPop**](https://tinkerpop.apache.org/) on [**Apache HBASE**](https://hbase.apache.org/).\n\nThis document covers some basic concepts and terms of S2Graph as well as help you get a feel for the S2Graph API.\n\nBuilding from the source\n========================\n\nTo build S2Graph from the source, install the JDK 8 and [SBT](http://www.scala-sbt.org/), and run the following command in the project root:\n\n sbt package\nThis will create a distribution of S2Graph that is ready to be deployed.\n\nOne can find distribution on `target/apache-s2graph-$version-incubating-bin`.\n\nQuick Start\n===========\n\nOnce extracted the downloaded binary release of S2Graph or built from the source as described above, the following files and directories should be found in the directory.\n\n```\nDISCLAIMER\nLICENCE               # the Apache License 2.0\nNOTICE\nbin                   # scripts to manage the lifecycle of S2Graph\nconf                  # configuration files\nlib                   # contains the binary\nlogs                  # application logs\nvar                   # application data\n```\n\nThis directory layout contains all binary and scripts required to launch S2Graph. The directories `logs` and `var` may not be present initially, and are created once S2Graph is launched.\n\nThe following will launch S2Graph, using [HBase](https://hbase.apache.org/) in the standalone mode for data storage and [H2](http://www.h2database.com/html/main.html) as the metadata storage.\n\n sh bin/start-s2graph.sh\nTo connect to a remote HBase cluster or use MySQL as the metastore, refer to the instructions in [`conf/application.conf`](conf/application.conf).\nS2Graph is tested on HBase versions 0.98, 1.0, 1.1, and 1.2 (https://hub.docker.com/r/harisekhon/hbase/tags/).\n\nProject Layout\n==============\n\nHere is what you can find in each subproject.\n\n1. `s2core`: The core library, containing the data abstractions for graph entities, storage adapters and utilities.\n2. `s2http`: The REST server built with [akka-http] the write and query API.\n~~4. `loader`: A collection of Spark jobs for bulk loading streaming data into S2Graph.~~\n~~5. `spark`: Spark utilities for `loader` and `s2counter_loader`.~~\n5. [`s2jobs`](s2jobs/README.md): A collection of Spark jobs to support OLAP on S2Graph.\n6. `s2counter_core`: The core library providing data structures and logics for `s2counter_loader`.\n7. `s2counter_loader`: Spark streaming jobs that consume Kafka WAL logs and calculate various top-*K* results on-the-fly.\n8. `s2graph_gremlin`: Gremlin plugin for tinkerpop users.\n\nThe first four projects are for OLTP-style workloads, currently the main target of S2Graph.\nThe remaining projects are for OLAP-style workloads, especially for integrating S2Graph with other projects, such as [Apache Spark](https://spark.apache.org/) and [Kafka](https://kafka.apache.org/).\nThe ~~`loader` and `spark`~~ projects are deprecated by [`s2jobs`](s2jobs/README.md) since version 0.2.0.\n\nNote that, the OLAP-style workloads are under development and we are planning to provide documentations in the upcoming releases.\n\nYour First Graph\n================\n\nOnce the S2Graph server has been set up, you can now start to send HTTP queries to the server to create a graph and pour some data in it. This tutorial goes over a simple toy problem to get a sense of how S2Graph's API looks like. [`bin/example.sh`](bin/example.sh) contains the example code below.\n\nThe toy problem is to create a timeline feature for a simple social media, like a simplified version of Facebook's timeline:stuck_out_tongue_winking_eye:. Using simple S2Graph queries it is possible to keep track of each user's friends and their posts.\n\n1. First, we need a name for the new service.\n\n  The following POST query will create a service named \"KakaoFavorites\".\n\n  ```\n  curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: Application/json' -d '\n  {\"serviceName\": \"KakaoFavorites\", \"compressionAlgorithm\" : \"gz\"}\n  '\n  ```\n\n  To make sure the service is created correctly, check out the following.\n\n  ```\n  curl -XGET localhost:9000/graphs/getService/KakaoFavorites\n  ```\n\n2. Next, we will need some friends.\n\n  In S2Graph, relationships are organized as labels. Create a label called `friends` using the following `createLabel` API call:\n\n  ```\n  curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d '\n  {\n    \"label\": \"friends\",\n    \"srcServiceName\": \"KakaoFavorites\",\n    \"srcColumnName\": \"userName\",\n    \"srcColumnType\": \"string\",\n    \"tgtServiceName\": \"KakaoFavorites\",\n    \"tgtColumnName\": \"userName\",\n    \"tgtColumnType\": \"string\",\n    \"isDirected\": \"false\",\n    \"indices\": [],\n    \"props\": [],\n    \"consistencyLevel\": \"strong\"\n  }\n  '\n  ```\n\n  Check if the label has been created correctly:+\n\n  ```\n  curl -XGET localhost:9000/graphs/getLabel/friends\n  ```\n\n  Now that the label `friends` is ready, we can store the friendship data. Entries of a label are called edges, and you can add edges with `edges/insert` API:\n\n  ```\n  curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d '\n  [\n    {\"from\":\"Elmo\",\"to\":\"Big Bird\",\"label\":\"friends\",\"props\":{},\"timestamp\":1444360152477},\n    {\"from\":\"Elmo\",\"to\":\"Ernie\",\"label\":\"friends\",\"props\":{},\"timestamp\":1444360152478},\n    {\"from\":\"Elmo\",\"to\":\"Bert\",\"label\":\"friends\",\"props\":{},\"timestamp\":1444360152479},\n    {\"from\":\"Cookie Monster\",\"to\":\"Grover\",\"label\":\"friends\",\"props\":{},\"timestamp\":1444360152480},\n    {\"from\":\"Cookie Monster\",\"to\":\"Kermit\",\"label\":\"friends\",\"props\":{},\"timestamp\":1444360152481},\n    {\"from\":\"Cookie Monster\",\"to\":\"Oscar\",\"label\":\"friends\",\"props\":{},\"timestamp\":1444360152482}\n  ]\n  '\n  ```\n\n  Query friends of Elmo with `getEdges` API:\n\n  ```\n  curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '\n  {\n    \"srcVertices\": [{\"serviceName\": \"KakaoFavorites\", \"columnName\": \"userName\", \"id\":\"Elmo\"}],\n    \"steps\": [\n      {\"step\": [{\"label\": \"friends\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]}\n    ]\n  }\n  '\n  ```\n\n  Now query friends of Cookie Monster:\n\n  ```\n  curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '\n  {\n    \"srcVertices\": [{\"serviceName\": \"KakaoFavorites\", \"columnName\": \"userName\", \"id\":\"Cookie Monster\"}],\n    \"steps\": [\n      {\"step\": [{\"label\": \"friends\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]}\n    ]\n  }\n  '\n  ```\n\n3. Users of Kakao Favorites will be able to post URLs of their favorite websites.\n\n  We will need a new label ```post``` for this data:\n  ```\n  curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d '\n  {\n    \"label\": \"post\",\n    \"srcServiceName\": \"KakaoFavorites\",\n    \"srcColumnName\": \"userName\",\n    \"srcColumnType\": \"string\",\n    \"tgtServiceName\": \"KakaoFavorites\",\n    \"tgtColumnName\": \"url\",\n    \"tgtColumnType\": \"string\",\n    \"isDirected\": \"true\",\n    \"indices\": [],\n    \"props\": [],\n    \"consistencyLevel\": \"strong\"\n  }\n  '\n  ```\n\n  Now, insert some posts of the users:\n\n\n  ```\n  curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d '\n  [\n    {\"from\":\"Big Bird\",\"to\":\"www.kakaocorp.com/en/main\",\"label\":\"post\",\"props\":{},\"timestamp\":1444360152477},\n    {\"from\":\"Big Bird\",\"to\":\"github.com/kakao/s2graph\",\"label\":\"post\",\"props\":{},\"timestamp\":1444360152478},\n    {\"from\":\"Ernie\",\"to\":\"groups.google.com/forum/#!forum/s2graph\",\"label\":\"post\",\"props\":{},\"timestamp\":1444360152479},\n    {\"from\":\"Grover\",\"to\":\"hbase.apache.org/forum/#!forum/s2graph\",\"label\":\"post\",\"props\":{},\"timestamp\":1444360152480},\n    {\"from\":\"Kermit\",\"to\":\"www.playframework.com\",\"label\":\"post\",\"props\":{},\"timestamp\":1444360152481},\n    {\"from\":\"Oscar\",\"to\":\"www.scala-lang.org\",\"label\":\"post\",\"props\":{},\"timestamp\":1444360152482}\n  ]\n  '\n  ```\n\n  Query posts of Big Bird:\n\n  ```\n  curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '\n  {\n    \"srcVertices\": [{\"serviceName\": \"KakaoFavorites\", \"columnName\": \"userName\", \"id\":\"Big Bird\"}],\n    \"steps\": [\n      {\"step\": [{\"label\": \"post\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]}\n    ]\n  }\n  '\n  ```\n\n4. So far, we have designed a label schema for the labels `friends` and `post`, and stored some edges to them.+\n\n  This should be enough for creating the timeline feature! The following two-step query will return the URLs for Elmo's timeline, which are the posts of Elmo's friends:\n\n  ```\n  curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '\n  {\n    \"srcVertices\": [{\"serviceName\": \"KakaoFavorites\", \"columnName\": \"userName\", \"id\":\"Elmo\"}],\n    \"steps\": [\n      {\"step\": [{\"label\": \"friends\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]},\n      {\"step\": [{\"label\": \"post\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]}\n    ]\n  }\n  '\n  ```\n\n  Also try Cookie Monster's timeline:\n  ```\n  curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '\n  {\n    \"srcVertices\": [{\"serviceName\": \"KakaoFavorites\", \"columnName\": \"userName\", \"id\":\"Cookie Monster\"}],\n    \"steps\": [\n      {\"step\": [{\"label\": \"friends\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]},\n      {\"step\": [{\"label\": \"post\", \"direction\": \"out\", \"offset\": 0, \"limit\": 10}]}\n    ]\n  }\n  '\n  ```\n\nThe example above is by no means a full blown social network timeline, but it gives you an idea of how to represent, store and query graph data with S2Graph.+\n\nTinkerPop Support\n================\n\nSince version 0.2.0-incubating, S2Graph integrate natively with `Apache TinkerPop 3.2.5`.\nS2Graph passes `Apache TinkerPop`'s `StructureStandardSuite` and `ProcessStandardSuite` test suites.\n\n### Graph Features **not** implemented.\n- Computer\n- Transactions\n- ThreadedTransactions\n\n### Vertex Features **not** implemented.\n- MultiProperties\n- MetaProperties\n- UuidIds\n- AnyIds\n- NumericIds\n- StringIds\n\n### Edge Features **not** implemented.\n- UuidIds\n- AnyIds\n- NumericIds\n- StringIds\n\n### Vertex property features **not** implemented.\n- UuidIds\n- AnyIds\n- NumericIds\n- StringIds\n- MapValues\n- MixedListValues\n- BooleanArrayValues\n- ByteArrayValues\n- DoubleArrayValues\n- FloatArrayValues\n- IntegerArrayValues\n- StringArrayValues\n- LongArrayValues\n- SerializableValues\n- UniformListValues\n\n### Edge property feature **not** implemented.\n- MapValues\n- MixedListValues\n- BooleanArrayValues\n- ByteArrayValues\n- DoubleArrayValues\n- FloatArrayValues\n- IntegerArrayValues\n- StringArrayValues\n- LongArrayValues\n- SerializableValues\n- UniformListValues\n\n\u003eNOTE: This is an ongoing task.\n\n## Getting Started\n\n### Maven coordinates\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.s2graph\u003c/groupId\u003e\n    \u003cartifactId\u003es2core_2.11\u003c/artifactId\u003e\n    \u003cversion\u003e0.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Start\n\nS2Graph is a singleton that can be shared among multiple threads. You instantiate S2Graph using the standard TinkerPop static constructors.\n\n- Graph g = S2Graph.open(final Configuration configuration)\n\nSome important properties for configuration.\n\n#### HBase for data storage.\n```\nhbase.zookeeper.quorum=localhost:2181\n```\n\n#### RDBMS for meta storage.\n```\ndb.default.driver=org.h2.Driver\ndb.default.url=jdbc:h2:file:./var/metastore;MODE=MYSQL\"\ndb.default.password=graph\ndb.default.user=graph\n```\n\n### Gremlin Console\n\n#### 1. install plugin\nOn gremlin console, it is possible to install s2graph as follow.\n\n```\n:install org.apache.s2graph s2graph-gremlin 0.2.0\n:plugin use tinkerpop.s2graph\n```\n\nExample run.\n\n```\nshonui-MacBook-Pro:apache-tinkerpop-gremlin-console-3.2.5 shon$ bin/gremlin.sh\n\n         \\,,,/\n         (o o)\n-----oOOo-(3)-oOOo-----\nplugin activated: tinkerpop.server\nplugin activated: tinkerpop.utilities\nplugin activated: tinkerpop.tinkergraph\ngremlin\u003e :install org.apache.s2graph s2graph-gremlin 0.2.0\n==\u003eLoaded: [org.apache.s2graph, s2graph-gremlin, 0.2.0] - restart the console to use [tinkerpop.s2graph]\ngremlin\u003e :plugin use tinkerpop.s2graph\n==\u003etinkerpop.s2graph activated\ngremlin\u003e :plugin list\n==\u003etinkerpop.server[active]\n==\u003etinkerpop.gephi\n==\u003etinkerpop.utilities[active]\n==\u003etinkerpop.sugar\n==\u003etinkerpop.credentials\n==\u003etinkerpop.tinkergraph[active]\n==\u003etinkerpop.s2graph[active]\ngremlin\u003e\n```\n\nOnce `s2graph-gremlin` plugin is acvive, then following example will generate tinkerpop's modern graph in s2graph.\n\nTaken from [TinkerPop](http://tinkerpop.apache.org/docs/current/reference/#intro)\n\n![Modern Graph from Tinkerpop](http://tinkerpop.apache.org/docs/current/images/tinkerpop-modern.png)\n\n\n### tp3 modern graph(simple).\n\n```\nconf = new BaseConfiguration()\ngraph = S2Graph.open(conf)\n\n// init system default schema\nS2GraphFactory.initDefaultSchema(graph)\n\n// init extra schema for tp3 modern graph.\nS2GraphFactory.initModernSchema(graph)\n\n// load modern graph into current graph instance.\nS2GraphFactory.generateModern(graph)\n\n// traversal\nt = graph.traversal()\n\n// show all vertices in this graph.\nt.V()\n\n// show all edges in this graph.\nt.E()\n\n// add two vertices.\nshon = graph.addVertex(T.id, 10, T.label, \"person\", \"name\", \"shon\", \"age\", 35)\ns2graph = graph.addVertex(T.id, 11, T.label, \"software\", \"name\", \"s2graph\", \"lang\", \"scala\")\n\n// add one edge between two vertices.\ncreated = shon.addEdge(\"created\", s2graph, \"_timestamp\", 10, \"weight\", 0.1)\n\n// check if new edge is available through traversal\nt.V().has(\"name\", \"shon\").out()\n\n// shutdown\ngraph.close()\n```\n\nNote that simple version used default schema for `Service`, `Column`, `Label` for compatibility.\nPlease checkout advanced example below to understand what data model is available on S2Graph.\n\n### tp3 modern graph(advanced).\n\nIt is possible to separate multiple namespaces into logical spaces.\nS2Graph achieve this by following data model. details can be found on https://steamshon.gitbooks.io/s2graph-book/content/the_data_model.html.\n\n1. Service: the top level abstraction\n\nA convenient logical grouping of related entities\nSimilar to the database abstraction that most relational databases support.\n\n2. Column: belongs to a service.\n\nA set of homogeneous vertices such as users, news articles or tags.\nEvery vertex has a user-provided unique ID that allows the efficient lookup.\nA service typically contains multiple columns.\n\n3. Label: schema for edge\n\nA set of homogeneous edges such as friendships, views, or clicks.\nRelation between two columns as well as a recursive association within one column.\nThe two columns connected with a label may not necessarily be in the same service, allowing us to store and query data that spans over multiple services.\n\nInstead of convert user provided Id into internal unique numeric Id, S2Graph simply composite service and column metadata with user provided Id to guarantee global unique Id.\n\nFollowing is simple example to exploit these data model in s2graph.\n```\n// init graph\ngraph = S2Graph.open(new BaseConfiguration())\n\n// 0. import necessary methods for schema management.\nimport static org.apache.s2graph.core.Management.*\n\n// 1. initialize dbsession for management which store schema into RDBMS.\nsession = graph.dbSession()\n\n// 2. properties for new service \"s2graph\".\n\nserviceName = \"s2graph\"\ncluster = \"localhost\"\nhTableName = \"s2graph\"\npreSplitSize = 0\nhTableTTL = -1\ncompressionAlgorithm = \"gz\"\n\n// 3. actual creation of s2graph service.\n// details can be found on https://steamshon.gitbooks.io/s2graph-book/content/create_a_service.html\n\nservice = graph.management.createService(serviceName, cluster, hTableName, preSplitSize, hTableTTL, compressionAlgorithm)\n\n// 4. properties for user vertex schema belongs to s2graph service.\n\ncolumnName = \"user\"\ncolumnType = \"integer\"\n\n// each property consist of (name: String, defaultValue: String, dataType: String)\n// defailts can be found on https://steamshon.gitbooks.io/s2graph-book/content/create_a_servicecolumn.html\nprops = [newProp(\"name\", \"-\", \"string\"), newProp(\"age\", \"-1\", \"integer\")]\n\n\nschemaVersion = \"v3\"\nuser = graph.management.createServiceColumn(serviceName, columnName, columnType, props, schemaVersion)\n\n// 2.1 (optional) global vertex index.\ngraph.management.buildGlobalVertexIndex(\"global_vertex_index\", [\"name\", \"age\"])\n\n// 3. create VertexId\n// create S2Graph's VertexId class.\nv1Id = graph.newVertexId(serviceName, columnName, 20)\nv2Id = graph.newVertexId(serviceName, columnName, 30)\n\nshon = graph.addVertex(T.id, v1Id, \"name\", \"shon\", \"age\", 35)\ndun = graph.addVertex(T.id, v2Id, \"name\", \"dun\", \"age\", 36)\n\n// 4. friends label\nlabelName = \"friend_\"\nsrcColumn = user\ntgtColumn = user\nisDirected = true\nindices = []\nprops = [newProp(\"since\", \"-\", \"string\")]\nconsistencyLevel = \"strong\"\nhTableName = \"s2graph\"\nhTableTTL = -1\noptions = null\n\nfriend = graph.management.createLabel(labelName, srcColumn, tgtColumn,\n        isDirected, serviceName, indices, props, consistencyLevel,\n        hTableName, hTableTTL, schemaVersion, compressionAlgorithm, options)\n\nshon.addEdge(labelName, dun, \"since\", \"2017-01-01\")\n\nt = graph.traversal()\n\n\nprintln \"All Edges\"\nprintln t.E().toList()\n\nprintln \"All Vertices\"\nprintln t.V().toList()\n\nprintln \"Specific Edge\"\nprintln t.V().has(\"name\", \"shon\").out().toList()\n```\n\n## Architecture\n\nphysical data storage is closed related to data model(https://steamshon.gitbooks.io/s2graph-book/content/the_data_model.html).\n\nin HBase storage, Vertex is stored in `v` column family, and Edge is stored in `e` column family.\n\neach `Service`/`Label` can have it's own dedicated HBase Table.\n\nHow Edge/Vertex is actually stored in `KeyValue` in HBase is described in [details](https://steamshon.gitbooks.io/s2graph-book/content/the_low-level_data_formats.html).\n\n## Indexes\nwill be updated.\n\n## Cache\nwill be updated.\n\n## Gremlin\nS2Graph has full support for gremlin. However gremlin’s fine grained graphy nature results in very high latency\n\nProvider suppose to provide `ProviderOptimization` to improve latency of traversal, and followings are currently available optimizations.\n\n\u003eNOTE: This is an ongoing task\n\n#### 1. `S2GraphStep`\n\n1. translate multiple `has` step into lucene query and find out vertexId/edgeId can be found from index provider, lucene.\n2. if vertexId/edgeId can be found, then change full scan into point lookup using list of vertexId/edgeId.\n\nfor examples, following traversal need full scan on storage if there is no index provider.\n\n```\ng.V().has(\"name\", \"steamshon\").out()\ng.V().has(\"name\", \"steamshon\").has(\"age\", P.eq(30).or(P.between(20, 30)))\n```\n\nonce following global vertex index is created, then `S2GraphStep` translate above traversal into lucene query, then get list of vertexId/edgeId which switch full scan to points lookup.\n```\ngraph.management.buildGlobalVertexIndex(\"global_vertex_index\", [\"name\", \"age\"])\n```\n\n\n#### [The Official Website](https://s2graph.apache.org/)\n\n#### [S2Graph API document](https://steamshon.gitbooks.io/s2graph-book/content/)\n\n#### Mailing Lists\n\n* [users@s2graph.incubator.apache.org](mailto:users@s2graph.incubator.apache.org) is for usage questions and announcements.\n[(subscribe)](mailto:users-subscribe@s2graph.incubator.apache.org?subject=send this email to subscribe)\n[(unsubscribe)](mailto:users-unsubscribe@s2graph.incubator.apache.org?subject=send this email to unsubscribe)\n[(archives)](http://markmail.org/search/?q=list%3Aorg.apache.s2graph.users)\n* [dev@s2graph.incubator.apache.org](mailto:dev@s2graph.incubator.apache.org) is for people who want to contribute to S2Graph.\n[(subscribe)](mailto:dev-subscribe@s2graph.incubator.apache.org?subject=send this email to subscribe)\n[(unsubscribe)](mailto:dev-unsubscribe@s2graph.incubator.apache.org?subject=send this email to unsubscribe)\n[(archives)](http://markmail.org/search/?q=list%3Aorg.apache.s2graph.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fincubator-s2graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fincubator-s2graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fincubator-s2graph/lists"}