diff --git a/.github/assets/hugegraph-standard-staging-reference.jpg b/.github/assets/hugegraph-standard-staging-reference.jpg new file mode 100644 index 000000000..5abcaf62a Binary files /dev/null and b/.github/assets/hugegraph-standard-staging-reference.jpg differ diff --git a/.github/assets/oink-1-upgrade-overview.png b/.github/assets/oink-1-upgrade-overview.png new file mode 100644 index 000000000..434a95336 Binary files /dev/null and b/.github/assets/oink-1-upgrade-overview.png differ diff --git a/.github/assets/oink-final-staging-community.jpg b/.github/assets/oink-final-staging-community.jpg new file mode 100644 index 000000000..8adc3e953 Binary files /dev/null and b/.github/assets/oink-final-staging-community.jpg differ diff --git a/.github/assets/oink-final-staging-home.jpg b/.github/assets/oink-final-staging-home.jpg new file mode 100644 index 000000000..963a1bd0e Binary files /dev/null and b/.github/assets/oink-final-staging-home.jpg differ diff --git a/.github/assets/oink-final-staging-mobile.jpg b/.github/assets/oink-final-staging-mobile.jpg new file mode 100644 index 000000000..a61916ce2 Binary files /dev/null and b/.github/assets/oink-final-staging-mobile.jpg differ diff --git a/.github/assets/oink-home-refined.jpg b/.github/assets/oink-home-refined.jpg new file mode 100644 index 000000000..05ac33a68 Binary files /dev/null and b/.github/assets/oink-home-refined.jpg differ diff --git a/.github/assets/oink-v6-docs-mobile.png b/.github/assets/oink-v6-docs-mobile.png new file mode 100644 index 000000000..c2f5fd947 Binary files /dev/null and b/.github/assets/oink-v6-docs-mobile.png differ diff --git a/.github/assets/oink-v6-footer-compact.png b/.github/assets/oink-v6-footer-compact.png new file mode 100644 index 000000000..8e6253943 Binary files /dev/null and b/.github/assets/oink-v6-footer-compact.png differ diff --git a/.github/assets/oink-v6-home-mobile.png b/.github/assets/oink-v6-home-mobile.png new file mode 100644 index 000000000..6267f256f Binary files /dev/null and b/.github/assets/oink-v6-home-mobile.png differ diff --git a/.github/assets/oink-v6-nav-desktop.png b/.github/assets/oink-v6-nav-desktop.png new file mode 100644 index 000000000..f54df3b3e Binary files /dev/null and b/.github/assets/oink-v6-nav-desktop.png differ diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 17a1e1858..ecc3c4664 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -1,58 +1,233 @@ -# Sample workflow for building and deploying a Hugo site to GitHub Pages -name: "Deploy site to pages (hugo)" +name: Build and deploy site on: pull_request: push: - branches: ["master"] # Set a branch name to trigger deployment + branches: [master] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + HUGO_VERSION: 0.165.0 + HUGO_ENVIRONMENT: production + HUGO_CACHEDIR: /tmp/hugo_cache jobs: - deploy: + prepare: runs-on: ubuntu-latest permissions: - contents: write - pages: write - id-token: write - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - # Hugo steps + contents: read + outputs: + versions: ${{ steps.matrix.outputs.versions }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + python-version: "3.13" - - name: Setup Node - uses: actions/setup-node@v3 + - name: Validate source and version tooling + run: | + bash dist/validate-links.sh + python3 -m unittest discover -s scripts -p 'test_*.py' -v + + - name: Resolve immutable version matrix + id: matrix + env: + LATEST_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: | + python3 scripts/versioning.py prepare \ + --latest-sha "$LATEST_SHA" \ + --output resolved-versions.json + echo "versions=$(jq -c '.include' resolved-versions.json)" >> "$GITHUB_OUTPUT" + + - name: Upload resolved version manifest + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - node-version: "16" + name: resolved-versions-${{ github.sha }} + path: resolved-versions.json + if-no-files-found: error - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + build: + needs: prepare + runs-on: ubuntu-latest + permissions: + contents: read + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.prepare.outputs.versions) }} + site: + - name: production + origin: https://hugegraph.apache.org/ + - name: staging + origin: https://hugegraph-oink.staged.apache.org/ + name: Build ${{ matrix.site.name }} / ${{ matrix.version.id }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: - hugo-version: '0.102.3' + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 + with: + python-version: "3.13" + + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 + with: + go-version-file: go.mod + cache: true + + - name: Setup Hugo Extended + uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1 + with: + hugo-version: ${{ env.HUGO_VERSION }} extended: true - - uses: actions/cache@v3 + - name: Cache Hugo resources + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 with: - path: /tmp/hugo_cache - key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} + path: ${{ env.HUGO_CACHEDIR }} + key: ${{ runner.os }}-hugo-${{ env.HUGO_VERSION }}-${{ matrix.version.id }}-${{ hashFiles('go.sum') }} restore-keys: | - ${{ runner.os }}-hugomod- + ${{ runner.os }}-hugo-${{ env.HUGO_VERSION }}-${{ matrix.version.id }}- + + - name: Verify pinned OINK module + run: | + go mod verify + go list -m all + test "$(go list -m -f '{{ .Path }}')" = "github.com/apache/hugegraph-doc" + test "$(go list -m all | wc -l)" -eq 2 + test "$(go list -m -f '{{ .Path }}@{{ .Version }}' github.com/pgsty/oink)" = "github.com/pgsty/oink@v1.0.0" + test -z "$(go list -m -f '{{ with .Replace }}{{ .Path }}@{{ .Version }}{{ end }}' github.com/pgsty/oink)" - - name: Check Links - run: bash dist/validate-links.sh + - name: Build isolated version artifact + env: + OINK_PYTHON: python3 + run: | + python3 scripts/versioning.py build \ + --version "${{ matrix.version.id }}" \ + --sha "${{ matrix.version.sha }}" \ + --site-origin "${{ matrix.site.origin }}" \ + --output "${RUNNER_TEMP}/version-public" + python3 scripts/versioning.py validate \ + --version "${{ matrix.version.id }}" \ + --sha "${{ matrix.version.sha }}" \ + --site-origin "${{ matrix.site.origin }}" \ + --artifact "${RUNNER_TEMP}/version-public" - - name: Build Site (minify) - run: npm i && hugo --minify + - name: Upload isolated version artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: ${{ matrix.site.name }}-${{ matrix.version.id }} + path: ${{ runner.temp }}/version-public + include-hidden-files: true + if-no-files-found: error + + # Keep this job id aligned with the required `deploy` status in .asf.yaml. + # It produces deployable artifacts but does not publish untrusted PR code. + deploy: + if: always() + needs: [prepare, build] + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Require every version build to succeed + env: + PREPARE_RESULT: ${{ needs.prepare.result }} + BUILD_RESULT: ${{ needs.build.result }} + run: | + test "$PREPARE_RESULT" = success + test "$BUILD_RESULT" = success + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 + with: + python-version: "3.13" + + - name: Download resolved version manifest + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: resolved-versions-${{ github.sha }} + path: resolved + + - name: Download production versions + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + pattern: production-* + path: version-artifacts + + - name: Download staging versions + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + pattern: staging-* + path: version-artifacts + + - name: Aggregate production and staging sites + run: | + python3 scripts/versioning.py aggregate \ + --artifacts version-artifacts \ + --artifact-prefix production- \ + --resolved-manifest resolved/resolved-versions.json \ + --site-origin https://hugegraph.apache.org/ \ + --output "${RUNNER_TEMP}/public-production" + python3 scripts/versioning.py aggregate \ + --artifacts version-artifacts \ + --artifact-prefix staging- \ + --resolved-manifest resolved/resolved-versions.json \ + --site-origin https://hugegraph-oink.staged.apache.org/ \ + --asf-profile oink \ + --asf-whoami asf-staging-oink \ + --output "${RUNNER_TEMP}/public-staging" + + - name: Upload production aggregate + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: hugegraph-site-production-${{ github.sha }} + path: ${{ runner.temp }}/public-production + include-hidden-files: true + if-no-files-found: error + + - name: Upload ASF staging aggregate + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: hugegraph-site-staging-${{ github.sha }} + path: ${{ runner.temp }}/public-staging + include-hidden-files: true + if-no-files-found: error + + publish: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: deploy + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download reviewed production aggregate + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: hugegraph-site-production-${{ github.sha }} + path: public-production - - name: Deploy Site - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/master' }} + - name: Publish clean aggregate to asf-site + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - # Refer: https://github.com/marketplace/actions/github-pages-action - publish_dir: ./public + publish_dir: ./public-production publish_branch: asf-site - keep_files: true # A simple way to keep ".asf.yaml" file + keep_files: false + force_orphan: false commit_message: ${{ github.event.head_commit.message }} diff --git a/.gitignore b/.gitignore index 86f2983b1..44576fb57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ public/ +public-staging/ resources/ node_modules/ package-lock.json diff --git a/.htaccess b/.htaccess new file mode 100644 index 000000000..295223cc2 --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +RedirectMatch 404 "(?i)(?:^|/)\.git(?:/|$)" +ErrorDocument 404 /404.html diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index b009dfb9d..000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -lts/* diff --git a/NOTICE b/NOTICE index 86e9aa7ca..91cb6e33a 100644 --- a/NOTICE +++ b/NOTICE @@ -5,3 +5,6 @@ This product includes software developed at The Apache Software Foundation (http://www.apache.org/). The initial codebase was donated to the ASF by HugeGraph Authors, copyright 2017-2021. + +This product includes OINK v1.0.0 (https://github.com/pgsty/oink), +Copyright 2026 PGSTY contributors, licensed under the Apache License 2.0. diff --git a/README.md b/README.md index 8f19005ba..0d2cda900 100644 --- a/README.md +++ b/README.md @@ -14,26 +14,25 @@ For the HugeGraph database project, visit [apache/hugegraph](https://github.com/ ## Quick Start -Only **3 steps** to run the documentation website locally: +Only **3 steps** are needed to run the documentation website locally. -**Prerequisites:** [Hugo Extended](https://github.com/gohugoio/hugo/releases) v0.95+ and Node.js v16+ +**Prerequisites:** Go 1.27+ and [Hugo Extended](https://github.com/gohugoio/hugo/releases) 0.165.0. OINK does not require Node.js, npm, PostCSS, or a vendored theme checkout. ```bash # 1. Clone repository git clone https://github.com/apache/hugegraph-doc.git cd hugegraph-doc -# 2. Install dependencies -npm install +# 2. Verify the pinned theme module +hugo mod graph -# 3. Start development server (auto-reload) +# 3. Start the development server (auto-reload) hugo server ``` Open http://localhost:1313 to preview. -> **Troubleshooting:** If you see `TOCSS: failed to transform "scss/main.scss"`, -> install Hugo **Extended** version, not the standard version. +The module graph must resolve `github.com/pgsty/oink@v1.0.0`. For a production-equivalent check, run the strict build command shown below. ## Repository Structure @@ -51,12 +50,13 @@ hugegraph-doc/ │ │ └── community/ # Community pages │ └── en/ # 🇺🇸 English documentation (mirrors cn/ structure) │ -├── themes/docsy/ # 🎨 Docsy theme (git submodule) -├── assets/ # 🖼️ Custom assets (fonts, images, scss) +├── data/ # 🧭 Landing-page and footer data +├── i18n/cn.yaml # 🌐 OINK interface strings for the /cn/ locale +├── assets/ # 🖼️ Project brand assets ├── layouts/ # 📐 Hugo template overrides ├── static/ # 📁 Static files -├── config.toml # ⚙️ Site configuration -└── package.json # 📦 Node.js dependencies +├── go.mod / go.sum # 📌 Pinned OINK module +└── hugo.yaml # ⚙️ Site configuration ``` ## Contributing @@ -78,17 +78,14 @@ hugegraph-doc/ ### Detailed Guide -See [contribution.md](./contribution.md) for: -- Platform-specific Hugo installation -- Docsy theme customization -- Translation tips +See [contribution.md](./contribution.md) for the pinned toolchain, strict build, OINK customization, and translation rules. ## Commands | Command | Description | |---------|-------------| | `hugo server` | Start dev server (hot reload) | -| `hugo --minify` | Build production to `./public/` | +| `hugo --cleanDestinationDir --gc --minify --environment production --printPathWarnings --printI18nWarnings --panicOnWarning` | Strict production build to `./public/` | | `hugo server -p 8080` | Custom port | --- @@ -101,17 +98,17 @@ See [contribution.md](./contribution.md) for: ### 快速开始 -只需 **3 步**即可在本地启动文档网站: +只需 **3 步**即可在本地启动文档网站。 -**前置条件:** [Hugo Extended](https://github.com/gohugoio/hugo/releases) v0.95+ 和 Node.js v16+ +**前置条件:** Go 1.27+ 和 [Hugo Extended](https://github.com/gohugoio/hugo/releases) 0.165.0。OINK 不需要 Node.js、npm、PostCSS 或检出到仓库内的主题副本。 ```bash # 1. 克隆仓库 git clone https://github.com/apache/hugegraph-doc.git cd hugegraph-doc -# 2. 安装依赖 -npm install +# 2. 检查固定的主题模块 +hugo mod graph # 3. 启动开发服务器(支持热重载) hugo server @@ -119,8 +116,7 @@ hugo server 打开 http://localhost:1313 预览网站。 -> **常见问题:** 如果遇到 `TOCSS: failed to transform "scss/main.scss"` 错误, -> 说明你需要安装 Hugo **Extended** 版本,而不是标准版本。 +模块图必须解析为 `github.com/pgsty/oink@v1.0.0`。需要执行与生产一致的检查时,请运行下方的严格构建命令。 ### 仓库结构 @@ -138,12 +134,13 @@ hugegraph-doc/ │ │ └── community/ # 社区页面 │ └── en/ # 🇺🇸 英文文档(与 cn/ 结构一致) │ -├── themes/docsy/ # 🎨 Docsy 主题 (git submodule) -├── assets/ # 🖼️ 自定义资源 (fonts, images, scss) +├── data/ # 🧭 首页与页尾数据 +├── i18n/cn.yaml # 🌐 /cn/ 语言的 OINK 界面文案 +├── assets/ # 🖼️ 项目品牌资源 ├── layouts/ # 📐 Hugo 模板覆盖 ├── static/ # 📁 静态文件 -├── config.toml # ⚙️ 站点配置 -└── package.json # 📦 Node.js 依赖 +├── go.mod / go.sum # 📌 固定的 OINK 模块 +└── hugo.yaml # ⚙️ 站点配置 ``` ### 如何贡献 @@ -165,17 +162,14 @@ hugegraph-doc/ #### 详细指南 -查看 [contribution.md](./contribution.md) 了解: -- 各平台 Hugo 安装方法 -- Docsy 主题定制 -- 翻译技巧 +查看 [contribution.md](./contribution.md) 了解固定工具链、严格构建、OINK 定制和翻译要求。 ### 常用命令 | 命令 | 说明 | |------|------| | `hugo server` | 启动开发服务器(热重载) | -| `hugo --minify` | 构建生产版本到 `./public/` | +| `hugo --cleanDestinationDir --gc --minify --environment production --printPathWarnings --printI18nWarnings --panicOnWarning` | 严格构建生产版本到 `./public/` | | `hugo server -p 8080` | 指定端口 | --- diff --git a/assets/fonts/OpenSans-Bold.woff b/assets/fonts/OpenSans-Bold.woff deleted file mode 100644 index c2bbcc47b..000000000 Binary files a/assets/fonts/OpenSans-Bold.woff and /dev/null differ diff --git a/assets/fonts/OpenSans-Bold.woff2 b/assets/fonts/OpenSans-Bold.woff2 deleted file mode 100644 index f5977a43a..000000000 Binary files a/assets/fonts/OpenSans-Bold.woff2 and /dev/null differ diff --git a/assets/fonts/OpenSans-BoldItalic.woff b/assets/fonts/OpenSans-BoldItalic.woff deleted file mode 100644 index aabfede83..000000000 Binary files a/assets/fonts/OpenSans-BoldItalic.woff and /dev/null differ diff --git a/assets/fonts/OpenSans-BoldItalic.woff2 b/assets/fonts/OpenSans-BoldItalic.woff2 deleted file mode 100644 index 6056a4ff1..000000000 Binary files a/assets/fonts/OpenSans-BoldItalic.woff2 and /dev/null differ diff --git a/assets/fonts/OpenSans-Italic.woff b/assets/fonts/OpenSans-Italic.woff deleted file mode 100644 index 3128dfa80..000000000 Binary files a/assets/fonts/OpenSans-Italic.woff and /dev/null differ diff --git a/assets/fonts/OpenSans-Italic.woff2 b/assets/fonts/OpenSans-Italic.woff2 deleted file mode 100644 index bb2166e55..000000000 Binary files a/assets/fonts/OpenSans-Italic.woff2 and /dev/null differ diff --git a/assets/fonts/OpenSans-Light.woff b/assets/fonts/OpenSans-Light.woff deleted file mode 100644 index 569e841ab..000000000 Binary files a/assets/fonts/OpenSans-Light.woff and /dev/null differ diff --git a/assets/fonts/OpenSans-Light.woff2 b/assets/fonts/OpenSans-Light.woff2 deleted file mode 100644 index d6c8549e8..000000000 Binary files a/assets/fonts/OpenSans-Light.woff2 and /dev/null differ diff --git a/assets/fonts/OpenSans-LightItalic.woff b/assets/fonts/OpenSans-LightItalic.woff deleted file mode 100644 index 3ddd5a657..000000000 Binary files a/assets/fonts/OpenSans-LightItalic.woff and /dev/null differ diff --git a/assets/fonts/OpenSans-LightItalic.woff2 b/assets/fonts/OpenSans-LightItalic.woff2 deleted file mode 100644 index 02dce9cd8..000000000 Binary files a/assets/fonts/OpenSans-LightItalic.woff2 and /dev/null differ diff --git a/assets/fonts/OpenSans-Regular.woff b/assets/fonts/OpenSans-Regular.woff deleted file mode 100644 index fccba0c72..000000000 Binary files a/assets/fonts/OpenSans-Regular.woff and /dev/null differ diff --git a/assets/fonts/OpenSans-Regular.woff2 b/assets/fonts/OpenSans-Regular.woff2 deleted file mode 100644 index e2d3fa4ea..000000000 Binary files a/assets/fonts/OpenSans-Regular.woff2 and /dev/null differ diff --git a/assets/fonts/Rubik-Bold.woff b/assets/fonts/Rubik-Bold.woff deleted file mode 100644 index 899f56f8f..000000000 Binary files a/assets/fonts/Rubik-Bold.woff and /dev/null differ diff --git a/assets/fonts/Rubik-Bold.woff2 b/assets/fonts/Rubik-Bold.woff2 deleted file mode 100644 index 5f295d9ee..000000000 Binary files a/assets/fonts/Rubik-Bold.woff2 and /dev/null differ diff --git a/assets/fonts/Rubik-Light.woff b/assets/fonts/Rubik-Light.woff deleted file mode 100644 index 685c98235..000000000 Binary files a/assets/fonts/Rubik-Light.woff and /dev/null differ diff --git a/assets/fonts/Rubik-Light.woff2 b/assets/fonts/Rubik-Light.woff2 deleted file mode 100644 index 085082290..000000000 Binary files a/assets/fonts/Rubik-Light.woff2 and /dev/null differ diff --git a/assets/fonts/Rubik-Medium.woff b/assets/fonts/Rubik-Medium.woff deleted file mode 100644 index e4d02283e..000000000 Binary files a/assets/fonts/Rubik-Medium.woff and /dev/null differ diff --git a/assets/fonts/Rubik-Medium.woff2 b/assets/fonts/Rubik-Medium.woff2 deleted file mode 100644 index 02be45c1a..000000000 Binary files a/assets/fonts/Rubik-Medium.woff2 and /dev/null differ diff --git a/assets/fonts/Rubik-Regular.woff b/assets/fonts/Rubik-Regular.woff deleted file mode 100644 index 08a8210c2..000000000 Binary files a/assets/fonts/Rubik-Regular.woff and /dev/null differ diff --git a/assets/fonts/Rubik-Regular.woff2 b/assets/fonts/Rubik-Regular.woff2 deleted file mode 100644 index 29ffcf2f2..000000000 Binary files a/assets/fonts/Rubik-Regular.woff2 and /dev/null differ diff --git a/assets/fonts/Rubik-SemiBold.woff b/assets/fonts/Rubik-SemiBold.woff deleted file mode 100644 index 0e8de2c53..000000000 Binary files a/assets/fonts/Rubik-SemiBold.woff and /dev/null differ diff --git a/assets/fonts/Rubik-SemiBold.woff2 b/assets/fonts/Rubik-SemiBold.woff2 deleted file mode 100644 index 5f6db1eb8..000000000 Binary files a/assets/fonts/Rubik-SemiBold.woff2 and /dev/null differ diff --git a/assets/fonts/Tajawal-Bold.woff b/assets/fonts/Tajawal-Bold.woff deleted file mode 100644 index 9aa652e21..000000000 Binary files a/assets/fonts/Tajawal-Bold.woff and /dev/null differ diff --git a/assets/fonts/Tajawal-Bold.woff2 b/assets/fonts/Tajawal-Bold.woff2 deleted file mode 100644 index 05d3a6e47..000000000 Binary files a/assets/fonts/Tajawal-Bold.woff2 and /dev/null differ diff --git a/assets/fonts/Tajawal-Light.woff b/assets/fonts/Tajawal-Light.woff deleted file mode 100644 index d35e90cfc..000000000 Binary files a/assets/fonts/Tajawal-Light.woff and /dev/null differ diff --git a/assets/fonts/Tajawal-Light.woff2 b/assets/fonts/Tajawal-Light.woff2 deleted file mode 100644 index ddd5d6b38..000000000 Binary files a/assets/fonts/Tajawal-Light.woff2 and /dev/null differ diff --git a/assets/fonts/Tajawal-Medium.woff b/assets/fonts/Tajawal-Medium.woff deleted file mode 100644 index 437ab129a..000000000 Binary files a/assets/fonts/Tajawal-Medium.woff and /dev/null differ diff --git a/assets/fonts/Tajawal-Medium.woff2 b/assets/fonts/Tajawal-Medium.woff2 deleted file mode 100644 index c7b63d30a..000000000 Binary files a/assets/fonts/Tajawal-Medium.woff2 and /dev/null differ diff --git a/assets/fonts/Tajawal-Regular.woff b/assets/fonts/Tajawal-Regular.woff deleted file mode 100644 index 3eb2876e4..000000000 Binary files a/assets/fonts/Tajawal-Regular.woff and /dev/null differ diff --git a/assets/fonts/Tajawal-Regular.woff2 b/assets/fonts/Tajawal-Regular.woff2 deleted file mode 100644 index d62192fef..000000000 Binary files a/assets/fonts/Tajawal-Regular.woff2 and /dev/null differ diff --git a/assets/fonts/Vazir-Bold.woff b/assets/fonts/Vazir-Bold.woff deleted file mode 100644 index a76f3f8f1..000000000 Binary files a/assets/fonts/Vazir-Bold.woff and /dev/null differ diff --git a/assets/fonts/Vazir-Bold.woff2 b/assets/fonts/Vazir-Bold.woff2 deleted file mode 100644 index f6789731d..000000000 Binary files a/assets/fonts/Vazir-Bold.woff2 and /dev/null differ diff --git a/assets/fonts/Vazir-Light.woff b/assets/fonts/Vazir-Light.woff deleted file mode 100644 index e41832558..000000000 Binary files a/assets/fonts/Vazir-Light.woff and /dev/null differ diff --git a/assets/fonts/Vazir-Light.woff2 b/assets/fonts/Vazir-Light.woff2 deleted file mode 100644 index 62ff68eb3..000000000 Binary files a/assets/fonts/Vazir-Light.woff2 and /dev/null differ diff --git a/assets/fonts/Vazir-Medium.woff b/assets/fonts/Vazir-Medium.woff deleted file mode 100644 index 3d73c01c1..000000000 Binary files a/assets/fonts/Vazir-Medium.woff and /dev/null differ diff --git a/assets/fonts/Vazir-Medium.woff2 b/assets/fonts/Vazir-Medium.woff2 deleted file mode 100644 index b6bdfa976..000000000 Binary files a/assets/fonts/Vazir-Medium.woff2 and /dev/null differ diff --git a/assets/fonts/Vazir-Regular.woff b/assets/fonts/Vazir-Regular.woff deleted file mode 100644 index c397650b0..000000000 Binary files a/assets/fonts/Vazir-Regular.woff and /dev/null differ diff --git a/assets/fonts/Vazir-Regular.woff2 b/assets/fonts/Vazir-Regular.woff2 deleted file mode 100644 index cb95c4f20..000000000 Binary files a/assets/fonts/Vazir-Regular.woff2 and /dev/null differ diff --git a/assets/images/docs/community/wechat.png b/assets/images/docs/community/wechat.png new file mode 100644 index 000000000..dff07dba6 Binary files /dev/null and b/assets/images/docs/community/wechat.png differ diff --git a/assets/images/docs/contribution/github-authentication.png b/assets/images/docs/contribution/github-authentication.png new file mode 100644 index 000000000..0e8a56527 Binary files /dev/null and b/assets/images/docs/contribution/github-authentication.png differ diff --git a/assets/images/docs/contribution/github-email.png b/assets/images/docs/contribution/github-email.png new file mode 100644 index 000000000..0af2793af Binary files /dev/null and b/assets/images/docs/contribution/github-email.png differ diff --git a/assets/images/docs/contribution/github-fork.png b/assets/images/docs/contribution/github-fork.png new file mode 100644 index 000000000..e2fb9ccde Binary files /dev/null and b/assets/images/docs/contribution/github-fork.png differ diff --git a/assets/images/docs/graphs/tinkerpop-modern.png b/assets/images/docs/graphs/tinkerpop-modern.png new file mode 100644 index 000000000..b101292a6 Binary files /dev/null and b/assets/images/docs/graphs/tinkerpop-modern.png differ diff --git a/assets/images/docs/hugegraph-ai/gradio-kg.jpg b/assets/images/docs/hugegraph-ai/gradio-kg.jpg new file mode 100644 index 000000000..71d0c3449 Binary files /dev/null and b/assets/images/docs/hugegraph-ai/gradio-kg.jpg differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-01.png b/assets/images/docs/hugegraph-ai/quick-start-01.png new file mode 100644 index 000000000..045d4887d Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-01.png differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-02.png b/assets/images/docs/hugegraph-ai/quick-start-02.png new file mode 100644 index 000000000..c39f780f3 Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-02.png differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-03.jpg b/assets/images/docs/hugegraph-ai/quick-start-03.jpg new file mode 100644 index 000000000..e1e93396d Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-03.jpg differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-04.png b/assets/images/docs/hugegraph-ai/quick-start-04.png new file mode 100644 index 000000000..c41e33dc3 Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-04.png differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-05.jpg b/assets/images/docs/hugegraph-ai/quick-start-05.jpg new file mode 100644 index 000000000..1e7eca192 Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-05.jpg differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-06.png b/assets/images/docs/hugegraph-ai/quick-start-06.png new file mode 100644 index 000000000..2418630fb Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-06.png differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-07.png b/assets/images/docs/hugegraph-ai/quick-start-07.png new file mode 100644 index 000000000..0af002749 Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-07.png differ diff --git a/assets/images/docs/hugegraph-ai/quick-start-08.png b/assets/images/docs/hugegraph-ai/quick-start-08.png new file mode 100644 index 000000000..600a23f91 Binary files /dev/null and b/assets/images/docs/hugegraph-ai/quick-start-08.png differ diff --git a/themes/docsy/assets/icons/apache_logo.svg b/assets/img/apache_logo.svg similarity index 100% rename from themes/docsy/assets/icons/apache_logo.svg rename to assets/img/apache_logo.svg diff --git a/themes/docsy/assets/icons/logo.svg b/assets/img/logo.svg similarity index 100% rename from themes/docsy/assets/icons/logo.svg rename to assets/img/logo.svg diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss new file mode 100644 index 000000000..e0941c5d5 --- /dev/null +++ b/assets/scss/_styles_project.scss @@ -0,0 +1,690 @@ +// HugeGraph homepage: preserve the original product copy and isometric brand +// artwork while using OINK's accessible navigation and landing primitives. +$hg-navbar-purple: #532fc9; + +.td-home { + // Keep OINK's display face for headings, but restore the original site's + // native system stack for body copy, links, buttons, and navigation. + --td-ui-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, + "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", sans-serif, + "Apple Color Emoji", "Segoe UI Emoji"; + --td-body-font-family: var(--td-ui-font-family); + --td-heading-font-family: "Inter", var(--td-ui-font-family); +} + +.td-site-header--wide > .td-site-container { + max-width: none; + padding-inline: clamp(16px, 1.5vw, 28px); +} + +.td-home > .td-site-header { + position: fixed; + inset-block-start: 0; + inset-inline: 0; + z-index: 100; + width: 100%; + border-block-end: 0; + background: transparent; + color: #fff; + -webkit-backdrop-filter: none; + backdrop-filter: none; + transition: + background-color 180ms ease, + box-shadow 180ms ease, + -webkit-backdrop-filter 180ms ease, + backdrop-filter 180ms ease; + + &::after { + display: none; + } + + &.td-scrolled { + background: rgba($hg-navbar-purple, 0.96); + box-shadow: 0 6px 22px rgba(20, 17, 73, 0.24); + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + } + + .td-nav-title { + background: none; + color: #fff; + font-family: var(--td-ui-font-family); + font-size: 1.08rem; + font-weight: 700; + letter-spacing: 0; + -webkit-text-fill-color: #fff; + } + + .td-nav-brand, + .td-nav-menu-zone > .nav-link, + .td-nav-menu-zone .td-nav-menu > .nav-link, + .td-nav-search-box, + .td-nav-version-menu > .td-nav-util, + .td-site-nav__language > .td-language-selector__trigger, + .td-nav-theme-menu > .td-nav-util, + .td-shell-keyboard__trigger, + .td-nav-github, + .td-site-drawer-toggle { + color: #fff; + } + + .td-nav-search-box { + border-color: rgba(255, 255, 255, 0.38); + background: rgba(15, 24, 92, 0.2); + + kbd { + border-color: rgba(255, 255, 255, 0.32); + background: rgba(255, 255, 255, 0.1); + color: #fff; + } + } + + .td-nav-brand:hover, + .td-nav-brand:focus-visible, + .td-nav-menu-zone > .nav-link:hover, + .td-nav-menu-zone > .nav-link:focus-visible, + .td-nav-menu-zone .td-nav-menu > .nav-link:hover, + .td-nav-menu-zone .td-nav-menu > .nav-link:focus-visible, + .td-nav-search-box:hover, + .td-nav-search-box:focus-visible, + .td-nav-util:hover, + .td-nav-util:focus-visible, + .td-nav-github:hover, + .td-nav-github:focus-visible, + .td-site-drawer-toggle:hover, + .td-site-drawer-toggle:focus-visible { + background: rgba(15, 24, 92, 0.28); + color: #fff; + } +} + +// Keep global help with the other persistent header utilities. The OINK +// shortcut panel is reused intact; only its trigger and viewport anchoring are +// adapted from the former footer placement. +.td-site-header { + .td-shell-keyboard__trigger { + width: 34px; + height: 34px; + padding: 0 8px; + color: var(--bs-tertiary-color); + } + + .td-shell-keyboard-help { + width: unquote('min(21rem, calc(100vw - 2rem))'); + max-height: calc(100dvh - 5rem); + gap: 0; + padding: 0; + overflow-y: auto; + inset-inline-start: auto; + inset-inline-end: 0; + } +} + +.td-default main .td-landing-hero.hg-home-hero { + min-height: clamp(650px, 100svh, 780px); + padding: clamp(108px, calc(7vh + 50px), 132px) 0 24px; + align-items: flex-start; + background-color: #356fe8; + background-image: url('/img/home/hugegraph-hero-1920.jpg'); + background-position: center bottom; + background-repeat: no-repeat; + background-size: cover; + + .td-landing-hero__glow { + display: none; + } + + .td-landing-hero__copy { + max-width: 1040px; + text-shadow: 0 1px 3px rgba(11, 25, 67, 0.48); + + > .td-landing-hero__title { + order: 0; + } + + > .td-landing-hero__actions { + order: 1; + margin: 18px 0 28px; + } + + > .td-landing-hero__lead { + order: 2; + } + + > .td-landing-hero__note { + order: 3; + } + } + + .td-landing-hero__title { + margin-bottom: 0; + color: #fff; + font-size: clamp(2.8rem, 4.6vw, 4.35rem); + line-height: 1.04; + } + + .td-landing-hero__lead, + .td-landing-hero__note { + display: block; + max-width: 1040px; + margin: 0 auto 10px; + color: #fff; + font-family: var(--bs-body-font-family); + font-size: clamp(1rem, 1.35vw, 1.16rem); + font-weight: 500; + letter-spacing: 0; + line-height: 1.55; + text-wrap: balance; + + a { + color: inherit; + text-decoration-color: rgba(255, 255, 255, 0.72); + text-decoration-line: underline; + text-decoration-thickness: 1px; + text-underline-offset: 0.16em; + + &:hover { + text-decoration-thickness: 2px; + } + } + } + + .td-landing-hero__note i { + display: none; + } + + .td-landing-button { + min-height: 48px; + padding: 13px 25px; + border-radius: 999px; + box-shadow: 0 8px 24px rgba(20, 17, 73, 0.28); + text-shadow: none; + } + + .td-landing-button--primary { + background: #5930b8; + + &:hover { + background: #48239e; + } + } + + .td-landing-button--ghost { + border-color: transparent; + background: #ffa630; + color: #fff; + + &:hover { + border-color: transparent; + background: #e38100; + color: #fff; + } + } +} + +.td-home .td-landing-landing :where(p, li) a:not(.td-landing-button) { + color: #3176d9; + + &:hover, + &:focus-visible { + color: #1e53a0; + } +} + +[data-bs-theme="dark"] + .td-home + .td-landing-landing + :where(p, li) + a:not(.td-landing-button) { + color: #78b7ff; + + &:hover, + &:focus-visible { + color: #a8d0ff; + } +} + +// Restore the solid purple Docs banner from the previous site while keeping +// OINK's sticky header, search, version, language, theme, and help controls. +.td-shell-chrome .td-site-header { + border-block-end-color: rgba(255, 255, 255, 0.22); + background: $hg-navbar-purple; + color: #fff; + -webkit-backdrop-filter: none; + backdrop-filter: none; + + .td-nav-title { + color: #fff; + -webkit-text-fill-color: #fff; + } + + .td-nav-brand, + .td-nav-menu-zone > .nav-link, + .td-nav-menu-zone .td-nav-menu > .nav-link, + .td-nav-version-menu > .td-nav-util, + .td-site-nav__language > .td-language-selector__trigger, + .td-nav-theme-menu > .td-nav-util, + .td-shell-keyboard__trigger, + .td-nav-github, + .td-site-drawer-toggle { + color: #fff; + } + + .td-nav-search-box { + border-color: rgba(255, 255, 255, 0.4); + background: rgba(20, 17, 73, 0.18); + color: #fff; + + kbd { + border-color: rgba(255, 255, 255, 0.32); + background: rgba(255, 255, 255, 0.1); + color: #fff; + } + } + + .td-nav-brand:hover, + .td-nav-brand:focus-visible, + .td-nav-menu-zone > .nav-link:hover, + .td-nav-menu-zone > .nav-link:focus-visible, + .td-nav-menu-zone .td-nav-menu > .nav-link:hover, + .td-nav-menu-zone .td-nav-menu > .nav-link:focus-visible, + .td-nav-search-box:hover, + .td-nav-search-box:focus-visible, + .td-nav-util:hover, + .td-nav-util:focus-visible, + .td-nav-github:hover, + .td-nav-github:focus-visible, + .td-site-drawer-toggle:hover, + .td-site-drawer-toggle:focus-visible { + background: rgba(20, 17, 73, 0.24); + color: #fff; + } +} + +// The desktop Docs sidebar deliberately overlays the navbar's left edge. Give +// its identity row the same band treatment so the two structural regions read +// as one header, while the drawer keeps its light mobile surface. +@media (min-width: 768px) { + .td-shell-chrome--navbar .td-shell-sidebar__brand-row { + min-height: var(--td-shell-nav-h); + margin: calc(-1 * #{$spacer}) calc(-1 * #{$spacer}) 0; + padding-inline: $spacer; + border-block-end: 1px solid rgba(255, 255, 255, 0.22); + background: $hg-navbar-purple; + color: #fff; + box-shadow: 1px 0 $hg-navbar-purple; + + .td-shell-wordmark { + background: none; + color: #fff; + -webkit-text-fill-color: #fff; + } + + .td-shell-iconbtn { + color: #fff; + + &:hover, + &:focus-visible { + background: rgba(20, 17, 73, 0.24); + color: #fff; + } + } + } +} + +@media (forced-colors: active) and (min-width: 768px) { + .td-shell-chrome--navbar .td-shell-sidebar__brand-row { + border-color: CanvasText; + background: Canvas; + color: CanvasText; + + .td-shell-wordmark, + .td-shell-iconbtn { + color: CanvasText; + -webkit-text-fill-color: CanvasText; + } + } +} + +.td-home .hg-home-introduction { + padding-block: clamp(46px, 6vw, 76px); + background: color-mix(in srgb, var(--td-blue) 8%, var(--bs-body-bg)); + + .td-landing-markdown { + max-width: 1040px; + margin: 0 auto; + color: var(--td-ink); + font-size: clamp(1.02rem, 1.4vw, 1.16rem); + line-height: 1.75; + text-align: center; + + p:last-child { + margin-bottom: 0; + } + } +} + +.td-home .hg-home-capabilities, +.td-home .hg-home-community { + padding-block: clamp(54px, 6vw, 82px); +} + +.td-home .hg-home-capabilities .td-landing-card, +.td-home .hg-home-community .td-landing-card { + height: 100%; +} + +.td-home .hg-home-band { + padding-block: clamp(42px, 5vw, 66px); + background: color-mix(in srgb, var(--td-blue) 10%, var(--bs-body-bg)); + text-align: center; + + .td-landing-section__head { + margin: 0; + } + + .td-landing-section__head h2 { + font-size: clamp(1.75rem, 3.4vw, 2.6rem); + } +} + +.td-home .hg-home-welcome { + background: color-mix(in srgb, var(--td-copper) 9%, var(--bs-body-bg)); +} + +.hg-asf-footer { + border-block-start: 2px solid #21b6d7; + background: #41414d; + color: #f5f5f8; + + &__container { + display: grid; + grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.7fr); + align-items: center; + gap: clamp(1.5rem, 4vw, 4rem); + max-width: 1440px; + margin: 0 auto; + padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1.25rem, 5vw, 4.5rem); + } + + &__brand { + text-align: center; + + > a { + display: inline-block; + } + + img { + display: block; + width: 100%; + max-width: 260px; + height: auto; + margin: 0 auto 0.7rem; + } + + ul { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 0.25rem 1rem; + margin: 0; + padding: 0; + list-style: none; + } + } + + a { + color: #f5f5f8; + text-decoration-color: rgba(255, 255, 255, 0.5); + text-underline-offset: 0.16em; + + &:hover, + &:focus-visible { + color: #fff; + text-decoration-thickness: 2px; + } + } + + &__legal { + font-size: clamp(0.9rem, 1.25vw, 1.02rem); + line-height: 1.5; + text-align: center; + + p { + margin: 0; + } + + p + p { + margin-top: 0.6rem; + } + } +} + +.hg-shell-mobile-utils, +.hg-landing-mobile-utils { + display: none; +} + +@media (max-width: 767.98px) { + .hg-shell-mobile-utils, + .hg-landing-mobile-utils { + display: grid; + gap: 0.75rem; + padding: 0.9rem; + border-block-start: 1px solid var(--bs-border-color); + background: var(--bs-body-bg); + } + + .hg-landing-mobile-utils { + margin-block-start: 0.25rem; + border-block-end: 1px solid var(--bs-border-color); + } + + .hg-shell-mobile-utils__group { + display: grid; + gap: 0.35rem; + + > strong { + color: var(--bs-tertiary-color); + font-family: var(--td-meta-font-family); + font-size: 0.68rem; + letter-spacing: 0.08em; + text-transform: uppercase; + } + } + + .hg-shell-mobile-utils__links { + display: flex; + flex-wrap: wrap; + gap: 0.35rem; + + > a, + > button { + display: inline-flex; + align-items: center; + gap: 0.4rem; + min-height: 36px; + padding: 0.4rem 0.6rem; + border: 0; + border-radius: 0.5rem; + background: var(--bs-tertiary-bg); + color: var(--bs-body-color); + font-size: 0.8rem; + text-decoration: none; + } + + > a[aria-current='page'], + > button[aria-pressed='true'] { + background: var(--bs-primary-bg-subtle); + color: var(--bs-primary-text-emphasis); + } + } + + .hg-shell-mobile-utils__github { + display: inline-flex; + align-items: center; + gap: 0.45rem; + min-height: 36px; + color: var(--bs-body-color); + font-size: 0.82rem; + text-decoration: none; + } +} + +@media (max-width: 768px) { + .hg-asf-footer__container { + grid-template-columns: minmax(0, 1fr); + gap: 2rem; + } + + .hg-asf-footer__brand img { + width: 76vw; + max-width: 220px; + } +} + +@media (max-width: 900px) { + .td-default main .td-landing-hero.hg-home-hero { + min-height: 720px; + padding-top: 102px; + background-position: center bottom; + background-image: url('/img/home/hugegraph-hero-960.jpg'); + background-size: auto 100%; + + .td-landing-hero__copy { + max-width: 680px; + } + + .td-landing-hero__lead, + .td-landing-hero__note { + max-width: 680px; + } + } +} + +@media screen and (max-width: 575.98px) { + // Keep technical tokens readable and let OINK's labelled, focusable wrapper + // own mobile overflow instead of collapsing identifiers one letter per line. + .td-content .td-table-scroll > table :is(th, td), + .td-content .td-table-scroll > table :is(th, td) :is(a, code) { + overflow-wrap: normal; + word-break: normal; + } +} + +@media (max-width: 575.98px) { + .td-default main .td-landing-hero.hg-home-hero { + min-height: 760px; + padding: 88px 0 20px; + background-position: 50% bottom; + background-size: auto 74%; + + .td-landing-hero__copy { + align-items: stretch; + } + + .td-landing-hero__title { + font-size: clamp(2.25rem, 11vw, 3rem); + text-align: center; + } + + .td-landing-hero__actions { + justify-content: center; + margin-bottom: 24px; + } + + .td-landing-hero__lead, + .td-landing-hero__note { + font-size: 0.98rem; + line-height: 1.48; + text-align: start; + text-wrap: pretty; + } + } +} + +@media (forced-colors: active) { + .td-home > .td-site-header { + background: Canvas; + + .td-nav-title, + .td-nav-brand, + .td-nav-menu-zone > .nav-link, + .td-nav-search-box, + .td-nav-util, + .td-nav-github, + .td-site-drawer-toggle { + color: CanvasText; + -webkit-text-fill-color: CanvasText; + } + } + + .td-default main .td-landing-hero.hg-home-hero { + min-height: auto; + background-image: none; + + .td-landing-hero__copy { + text-shadow: none; + } + + .td-landing-hero__title, + .td-landing-hero__lead, + .td-landing-hero__note { + color: CanvasText; + } + + .td-landing-button { + border: 2px solid ButtonText; + box-shadow: none; + } + } +} + +@media print { + .td-home .td-landing-landing { + --td-ink: #000; + --td-soft: #222; + --td-muted: #333; + --td-paper: #fff; + background: #fff; + color: #000; + + &::before { + display: none; + } + } + + .td-home .td-landing-section, + .td-home .td-landing-card, + .td-home .td-landing-final-cta { + background: #fff; + color: #000; + box-shadow: none; + } + + .td-default main .td-landing-hero.hg-home-hero { + min-height: auto; + padding: 1rem 0; + background-color: #fff; + background-image: none; + + .td-landing-hero__copy { + text-shadow: none; + } + + .td-landing-hero__title, + .td-landing-hero__lead, + .td-landing-hero__note { + color: #000; + } + + .td-landing-button, + .td-landing-button--primary, + .td-landing-button--ghost { + border: 1px solid #000; + background: #fff; + box-shadow: none; + color: #000; + } + } +} diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss deleted file mode 100644 index 0575a5ef0..000000000 --- a/assets/scss/_variables_project.scss +++ /dev/null @@ -1,182 +0,0 @@ -/* - -Add styles or override variables from the theme here. - -*/ - -// Self-hosted font declarations -// Open Sans font family -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url('/assets/fonts/OpenSans-Light.woff2') format('woff2'), - url('/assets/fonts/OpenSans-Light.woff') format('woff'); -} - -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 300; - font-display: swap; - src: url('/assets/fonts/OpenSans-LightItalic.woff2') format('woff2'), - url('/assets/fonts/OpenSans-LightItalic.woff') format('woff'); -} - -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url('/assets/fonts/OpenSans-Regular.woff2') format('woff2'), - url('/assets/fonts/OpenSans-Regular.woff') format('woff'); -} - -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 400; - font-display: swap; - src: url('/assets/fonts/OpenSans-Italic.woff2') format('woff2'), - url('/assets/fonts/OpenSans-Italic.woff') format('woff'); -} - -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url('/assets/fonts/OpenSans-Bold.woff2') format('woff2'), - url('/assets/fonts/OpenSans-Bold.woff') format('woff'); -} - -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 700; - font-display: swap; - src: url('/assets/fonts/OpenSans-BoldItalic.woff2') format('woff2'), - url('/assets/fonts/OpenSans-BoldItalic.woff') format('woff'); -} - -// Rubik font family (Hebrew) -@font-face { - font-family: 'Rubik'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url('/assets/fonts/Rubik-Light.woff2') format('woff2'), - url('/assets/fonts/Rubik-Light.woff') format('woff'); -} - -@font-face { - font-family: 'Rubik'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url('/assets/fonts/Rubik-Regular.woff2') format('woff2'), - url('/assets/fonts/Rubik-Regular.woff') format('woff'); -} - -@font-face { - font-family: 'Rubik'; - font-style: normal; - font-weight: 500; - font-display: swap; - src: url('/assets/fonts/Rubik-Medium.woff2') format('woff2'), - url('/assets/fonts/Rubik-Medium.woff') format('woff'); -} - -@font-face { - font-family: 'Rubik'; - font-style: normal; - font-weight: 600; - font-display: swap; - src: url('/assets/fonts/Rubik-SemiBold.woff2') format('woff2'), - url('/assets/fonts/Rubik-SemiBold.woff') format('woff'); -} - -@font-face { - font-family: 'Rubik'; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url('/assets/fonts/Rubik-Bold.woff2') format('woff2'), - url('/assets/fonts/Rubik-Bold.woff') format('woff'); -} - -// Tajawal font family (Arabic) -@font-face { - font-family: 'Tajawal'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url('/assets/fonts/Tajawal-Light.woff2') format('woff2'), - url('/assets/fonts/Tajawal-Light.woff') format('woff'); -} - -@font-face { - font-family: 'Tajawal'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url('/assets/fonts/Tajawal-Regular.woff2') format('woff2'), - url('/assets/fonts/Tajawal-Regular.woff') format('woff'); -} - -@font-face { - font-family: 'Tajawal'; - font-style: normal; - font-weight: 500; - font-display: swap; - src: url('/assets/fonts/Tajawal-Medium.woff2') format('woff2'), - url('/assets/fonts/Tajawal-Medium.woff') format('woff'); -} - -@font-face { - font-family: 'Tajawal'; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url('/assets/fonts/Tajawal-Bold.woff2') format('woff2'), - url('/assets/fonts/Tajawal-Bold.woff') format('woff'); -} - -// Vazir font family (Persian/Farsi) -@font-face { - font-family: 'Vazir'; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url('/assets/fonts/Vazir-Light.woff2') format('woff2'), - url('/assets/fonts/Vazir-Light.woff') format('woff'); -} - -@font-face { - font-family: 'Vazir'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url('/assets/fonts/Vazir-Regular.woff2') format('woff2'), - url('/assets/fonts/Vazir-Regular.woff') format('woff'); -} - -@font-face { - font-family: 'Vazir'; - font-style: normal; - font-weight: 500; - font-display: swap; - src: url('/assets/fonts/Vazir-Medium.woff2') format('woff2'), - url('/assets/fonts/Vazir-Medium.woff') format('woff'); -} - -@font-face { - font-family: 'Vazir'; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url('/assets/fonts/Vazir-Bold.woff2') format('woff2'), - url('/assets/fonts/Vazir-Bold.woff') format('woff'); -} - diff --git a/config.toml b/config.toml deleted file mode 100644 index fdb79307f..000000000 --- a/config.toml +++ /dev/null @@ -1,275 +0,0 @@ -baseURL = "/" -title = "Apache HugeGraph" - -# Language settings -contentDir = "content/cn" -defaultContentLanguage = "en" -defaultContentLanguageInSubdir = false -#publishdir = "docs" - -# Useful when translating. -enableMissingTranslationPlaceholders = true - -enableRobotsTXT = true - -# Hugo allows theme composition (and inheritance). The precedence is from left to right. -theme = ["docsy"] - -# Will give values to .Lastmod etc. -enableGitInfo = true - -# Comment out to enable taxonomies in Docsy -# disableKinds = ["taxonomy", "taxonomyTerm"] - -# TODO: upgrade docsy version to latest one (curretly mermaid.js is not working) -[params.mermaid] -enable = true -theme = "default" - -############################################################################### -# Hugo - Top-level navigation (horizontal) -############################################################################### -[menu] - [[menu.main]] - name = "Documentation" - weight = -101 - pre = "" - url = "/docs/" - [[menu.main]] - name = "Blog Posts" - weight = -100 - hidden = false - pre = "" - url = "/blog/" - [[menu.main]] - name = "GitHub" - weight = -99 - pre = "" - url = "https://github.com/apache/hugegraph" - [[menu.main]] - name ="Download" - weight = -98 - pre = "" - url = "/docs/download/download/" - - -# You can add your own taxonomies -[taxonomies] -tag = "tags" -category = "categories" - -[params.taxonomy] -# set taxonomyCloud = [] to hide taxonomy clouds -taxonomyCloud = ["tags", "categories"] - -# If used, must have same lang as taxonomyCloud -taxonomyCloudTitle = ["Tag Cloud", "Categories"] - -# set taxonomyPageHeader = [] to hide taxonomies on the page headers -taxonomyPageHeader = ["tags", "categories"] - - -# Highlighting config -pygmentsCodeFences = true -pygmentsUseClasses = false -# Use the new Chroma Go highlighter in Hugo. -pygmentsUseClassic = false -#pygmentsOptions = "linenos=table" -# See https://help.farbox.com/pygments.html -pygmentsStyle = "tango" - -# Configure how URLs look like per section. -[permalinks] -blog = "/:section/:year/:month/:day/:slug/" - -## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday -[blackfriday] -plainIDAnchors = true -hrefTargetBlank = true -angledQuotes = false -latexDashes = true - -# Image processing configuration. -[imaging] -resampleFilter = "CatmullRom" -quality = 75 -anchor = "smart" - -[services] -[services.googleAnalytics] -# Comment out the next line to disable GA tracking. Also disables the feature described in [params.ui.feedback]. -##id = "UA-00000000-0" - -# Language configuration - -[languages] -[languages.cn] -title = "HugeGraph" -description = "Apache HugeGraph 官网" -languageName ="中文" -contentDir = "content/cn" -# Weight used for sorting. -weight = 1 - -[languages.en] -title = "HugeGraph" -description = "Apache HugeGraph site" -languageName ="English" -contentDir = "content/en" - -[markup] - [markup.goldmark] - [markup.goldmark.renderer] - unsafe = true - [markup.highlight] - # See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html - style = "tango" - # Uncomment if you want your chosen highlight style used for code blocks without a specified language - guessSyntax = "true" - -# Everything below this are Site Params - -# Comment out if you don't want the "print entire section" link enabled. -[outputs] -section = ["HTML", "print", "RSS"] - -[params] -copyright = "Apache Hugegraph Authors" -privacy_policy = "https://policies.google.com/privacy" - -# First one is picked as the Twitter card image if not set on page. -# images = ["images/project-illustration.png"] - -# Menu title if your navbar has a versions selector to access old versions of your site. -# This menu appears only if you have at least one [params.versions] set. -version_menu = "Releases" - -# Flag used in the "version-banner" partial to decide whether to display a -# banner on every page indicating that this is an archived version of the docs. -# Set this flag to "true" if you want to display the banner. -archived_version = false - -# The version number for the version of the docs represented in this doc set. -# Used in the "version-banner" partial to display a version number for the -# current doc set. -version = "1.7" - -# A link to latest version of the docs. Used in the "version-banner" partial to -# point people to the main doc site. -url_latest_version = "https://example.com" - -# Repository configuration (URLs for in-page links to opening issues and suggesting changes) -github_repo = "https://github.com/apache/hugegraph-doc" -# An optional link to a related project repo. For example, the sibling repository where your product code lives. -github_project_repo = "https://github.com/apache/hugegraph" - -# Specify a value here if your content directory is not in your repo's root directory -# github_subdir = "" - -# Uncomment this if you have a newer GitHub repo with "main" as the default branch, -# or specify a new value if you want to reference another branch in your GitHub links -# github_branch= "master" - -# Google Custom Search Engine ID. Remove or comment out to disable search. -#gcs_engine_id = "d72aa9b2712488cc3" - -# Enable Algolia DocSearch -algolia_docsearch = false - -# Enable Lunr.js offline search -offlineSearch = false - -# Enable syntax highlighting and copy buttons on code blocks with Prism -prism_syntax_highlighting = true - -# User interface configuration -[params.ui] -# Set to true to disable breadcrumb navigation. -breadcrumb_disable = false -# Set to true to disable the About link in the site footer -footer_about_disable = false -# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top navbar -navbar_logo = true -# Set to false if you don't want to display a logo (/assets/icons/apache_logo.svg) in the footer -footer_logo = true -# Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage. -navbar_translucent_over_cover_disable = false -# Enable to show the side bar menu in its compact state. -sidebar_menu_compact = false -# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) -sidebar_search_disable = true - -# Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events. -# This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set. -# If you want this feature, but occasionally need to remove the "Feedback" section from a single page, -# add "hide_feedback: true" to the page's front matter. -[params.ui.feedback] -enable = true -# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful). -yes = 'Glad to hear it! Please tell us how we can improve.' -no = 'Sorry to hear that. Please tell us how we can improve.' - -# Adds a reading time to the top of each doc. -# If you want this feature, but occasionally need to remove the Reading time from a single page, -# add "hide_readingtime: true" to the page's front matter -[params.ui.readingtime] -enable = false - -[params.links] -# End user relevant links. These will show up on left side of footer and in the community page if you have one. -#[[params.links.user]] -# name = "User mailing list" -# url = "users@hugegraph.apache.org" -# icon = "fa fa-envelope" -# desc = "Discussion and help from your fellow users" -#[[params.links.user]] -# name ="Twitter" -# url = "https://example.org/twitter" -# icon = "fab fa-twitter" -# desc = "Follow us on Twitter to get the latest news!" -#[[params.links.user]] -# name = "Stack Overflow" -# url = "https://example.org/stack" -# icon = "fab fa-stack-overflow" -# desc = "Practical questions and curated answers" -# Developer relevant links. These will show up on right side of footer and in the community page if you have one. -[[params.links.user]] - name ="Introduction" - url = "../docs/introduction/" - icon = "fa fa-book" - desc = "Increase your understanding about the project" -[[params.links.user]] - name ="Quick start" - url = "../docs/quickstart/hugegraph-server/" - icon = "fa fa-rocket" - desc = "Embark on your HugeGraph journey with a simple configuration" -[[params.links.user]] - name ="Download" - url = "../docs/download/download/" - icon = "fa fa-download" - desc = "Explore the comprehensive details of the project" -[[params.links.user]] - name ="Config" - url = "../docs/config/" - icon = "fa fa-cog" - desc = "Unleash your ideas through file configuration" -[[params.links.user]] - name ="WeChat" - url = "https://github.com/apache/hugegraph#contact-us" - icon = "fa fa-comments" - desc = "Follow us on WeChat to get the latest news" -[[params.links.developer]] - name = "GitHub" - url = "https://github.com/apache/hugegraph" - icon = "fab fa-github" - desc = "Development takes place here~" -[[params.links.developer]] - name = "Security mailing list" - url = "mailto:security@hugegraph.apache.org" - icon = "fab fa-slack" - desc = "Report SEC problems" -[[params.links.developer]] - name = "Developer mailing list" - url = "../docs/contribution-guidelines/subscribe/" - icon = "fa fa-envelope" - desc = "Discuss community issues around the project" diff --git a/content/cn/_index.html b/content/cn/_index.html deleted file mode 100644 index fb07c957f..000000000 --- a/content/cn/_index.html +++ /dev/null @@ -1,103 +0,0 @@ -+++ -title = "HugeGraph Website" -linkTitle = "Huge Docs" - -+++ - -{{< blocks/cover image_anchor="top" height="full" color="orange">}} - -
- -

Apache - HugeGraph -

- - }}"> - Learn More - - }}"> - Download - -

HugeGraph 是一套全栈图系统,覆盖 }}">图数据库}}">图计算}}">图 AI

-

支持从数据存储、实时查询到离线分析的完整图数据处理能力,并支持 }}">Gremlin}}">Cypher 查询语言。

- {{< blocks/link-down color="info" >}} -
-{{< /blocks/cover >}} - - -{{% blocks/lead color="primary" %}} -

HugeGraph 最高支持千亿级图数据高速导入与毫秒级实时查询,可与 Spark、Flink 等大数据平台深度集成,并可通过 }}">HugeGraph 工具链 快速完成导入、可视化与运维。

-

在 AI 时代,通过与大语言模型 (LLM) 结合,为智能问答、推荐系统、风控反欺诈、知识图谱等场景提供强大的图计算能力。

-{{% /blocks/lead %}} - -{{< blocks/section color="dark" >}} -{{% blocks/feature icon="fa-lightbulb" title="易用" %}} -支持 Gremlin 图查询语言与 [**RESTful API**]({{< relref "/docs/clients/restful-api" >}}),并提供图检索常用接口,具备齐全的周边工具,支持分布式存储、数据多副本及横向扩容,内置多种后端存储引擎,轻松实现各种查询、分析。 - -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-shipping-fast" title="高效" %}} -在图存储和图计算方面做了深度优化,提供 [**批量导入工具**]({{< relref "/docs/quickstart/toolchain/hugegraph-loader" >}}),轻松完成百亿级数据快速导入,通过优化过的查询达到图检索的毫秒级响应,支持数千用户并发的在线实时操作。 -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-exchange-alt" title="通用" %}} -支持 Apache Gremlin 标准图查询语言和 Property Graph 标准图建模方法,支持基于图的 OLTP 和 [**OLAP 图计算**]({{< relref "/docs/quickstart/computing/hugegraph-computer" >}}) 方案。集成 Apache Hadoop 及 Apache Spark 大数据平台,也可插件式轻松扩展后端存储引擎。 -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-brain" title="智能化" %}} -集成 LLM 实现 [**GraphRAG 能力**]({{< relref "/docs/quickstart/hugegraph-ai" >}})、自动化知识图谱构建,内置 20+ 图机器学习算法,轻松构建 AI 驱动的图应用。 -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-expand-arrows-alt" title="可扩展" %}} -支持水平扩容和分布式部署,从单机到 PB 级集群无缝迁移,提供 [**分布式存储引擎**]({{< relref "/docs/quickstart/hugegraph/hugegraph-hstore" >}}) 适配,满足不同规模和性能需求。 -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-puzzle-piece" title="开放生态" %}} -遵循 Apache TinkerPop 标准,提供 [**多语言客户端**]({{< relref "/docs/quickstart/client/hugegraph-client" >}}),兼容主流大数据平台,社区活跃持续演进。 -{{% /blocks/feature %}} - - -{{< /blocks/section >}} - - -{{< blocks/section color="blue-deep">}} -
-

首个 Apache 基金会的顶级图项目

-
- -{{< /blocks/section >}} - - - -{{< blocks/section >}} -{{% blocks/feature icon="far fa-tools" title="使用易用的**工具链**" %}} -可从[此](https://github.com/apache/hugegraph-toolchain)获取图数据导入工具, 可视化界面以及备份还原迁移工具, 欢迎使用 -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fab fa-github" title="参与开源" url="https://github.com/apache/hugegraph" %}} -我们可以在 **Github** 上提交 [Pull Request](https://github.com/apache/hugegraph/pulls). 热烈欢迎大家加入! -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fab fa-weixin" title="关注微信" %}} -关注微信公众号 "HugeGraph" 获取最新动态 - -也可以加入 [ASF Slack 频道](https://the-asf.slack.com/archives/C059UU2FJ23)参与讨论 -{{% /blocks/feature %}} - - -{{< /blocks/section >}} - -{{< blocks/section color="blue-light">}} - -
-

欢迎大家给 HugeGraph 添砖加瓦

-
- -{{< /blocks/section >}} diff --git a/content/cn/_index.md b/content/cn/_index.md new file mode 100644 index 000000000..906618637 --- /dev/null +++ b/content/cn/_index.md @@ -0,0 +1,5 @@ +--- +title: Apache HugeGraph +description: 覆盖 OLTP、OLAP 与图智能的全栈图数据库生态系统。 +--- + diff --git a/content/cn/about/_index.html b/content/cn/about/_index.html deleted file mode 100644 index d6b46c6cb..000000000 --- a/content/cn/about/_index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: About HugeGraph -linkTitle: About -draft: true -menu: - main: - weight: 10 - ---- - -> TODO: delete or update this page - -{{< blocks/cover title="About HugeGraph" image_anchor="bottom" height="min" >}} - -

A sample site using the Docsy Hugo theme. -

- -{{< /blocks/cover >}} - -{{% blocks/lead %}} -Goldydocs is a sample site using the Docsy Hugo theme that shows what it can do and provides you with a template site structure. It’s designed for you to clone and edit as much as you like. See the different sections of the documentation and site for more ideas. -{{% /blocks/lead %}} - - -{{< blocks/section >}} -
-

This is another section

-
- -{{< /blocks/section >}} - - - -{{< blocks/section >}} - -
-

This is another section

-
- -{{< /blocks/section >}} diff --git a/content/cn/about/_index.md b/content/cn/about/_index.md new file mode 100644 index 000000000..8d1a6f8aa --- /dev/null +++ b/content/cn/about/_index.md @@ -0,0 +1,8 @@ +--- +title: 关于 Apache HugeGraph +linkTitle: 关于 +layout: landing +landing: about +outputs: [HTML, print, markdown] +--- + diff --git a/content/cn/blog/_index.md b/content/cn/blog/_index.md index 28750062b..395a87967 100644 --- a/content/cn/blog/_index.md +++ b/content/cn/blog/_index.md @@ -1,9 +1,6 @@ --- title: "Blog" linkTitle: "Blog" -menu: - main: - weight: 30 --- 欢迎阅读 HugeGraph 博客! diff --git a/content/cn/community/_index.md b/content/cn/community/_index.md index e1a40e16b..5fc72bb2a 100644 --- a/content/cn/community/_index.md +++ b/content/cn/community/_index.md @@ -1,8 +1,7 @@ --- -title: Community -menu: - main: - weight: 40 +title: 社区 +linkTitle: 社区 +layout: landing +landing: community +outputs: [HTML, print, markdown] --- - -查看 [项目成熟度](/community/maturity/) 评估。 diff --git a/content/cn/docs/CLA.md b/content/cn/docs/CLA.md index 784a53a62..fb42d683b 100644 --- a/content/cn/docs/CLA.md +++ b/content/cn/docs/CLA.md @@ -1,3 +1,10 @@ +--- +title: "Contributor Agreement" +linkTitle: "Contributor Agreement" +weight: 100 +search_exclude: true +--- + ## Contributor Agreement ## Individual Contributor exclusive License Agreement diff --git a/content/cn/docs/SUMMARY.md b/content/cn/docs/SUMMARY.md index ab5e32bf9..9c574e25a 100644 --- a/content/cn/docs/SUMMARY.md +++ b/content/cn/docs/SUMMARY.md @@ -1,3 +1,8 @@ +--- +title: "旧版 GitBook 目录" +draft: true +--- + # HugeGraph Docs * [Download](download/download) @@ -55,8 +60,6 @@ * [HugeGraph API Performance-Outdated](performance/api-performance) * [v0.5.6 Stand-alone(RocksDB)](performance/api-performance/hugegraph-api-0.5.6-rocksdb) * [v0.5.6 Cluster(Cassandra)](performance/api-performance/hugegraph-api-0.5.6-cassandra) - * [v0.4.4](performance/api-performance/hugegraph-api-0.4.4) - * [v0.2](performance/api-performance/hugegraph-api-0.2) * [HugeGraph-Loader Performance](performance/hugegraph-loader-performance) ## ChangeLogs @@ -64,14 +67,3 @@ * [Release-1.2.0](changelog/hugegraph-1.2.0-release-notes) * [Release-1.0.0](changelog/hugegraph-1.0.0-release-notes) * [Release-0.12.0](changelog/hugegraph-0.12.0-release-notes) -* [Release-0.11.2](changelog/hugegraph-0.11.2-release-notes) -* [Release-0.10.4](changelog/hugegraph-0.10.4-release-notes) -* [Release-0.9.2](changelog/hugegraph-0.9.2-release-notes) -* [Release-0.8.0](changelog/hugegraph-0.8.0-release-notes) -* [Release-0.7.4](changelog/hugegraph-0.7.4-release-notes) -* [Release-0.6.1](changelog/hugegraph-0.6.1-release-notes) -* [Release-0.5.6](changelog/hugegraph-0.5.6-release-notes) -* [Release-0.4.4](changelog/hugegraph-0.4.4-release-notes) -* [Release-0.3.3](changelog/hugegraph-0.3.3-release-notes) -* [Release-0.2.4](changelog/hugegraph-0.2.4-release-notes) -* [Release-0.2](changelog/hugegraph-0.2-release-notes) diff --git a/content/cn/docs/_index.md b/content/cn/docs/_index.md index 82bd55a87..db20addea 100755 --- a/content/cn/docs/_index.md +++ b/content/cn/docs/_index.md @@ -2,9 +2,6 @@ title: "Documentation" linkTitle: "Documentation" weight: 20 -menu: - main: - weight: 20 --- ## Apache HugeGraph 文档 diff --git a/content/cn/docs/_nav/components.md b/content/cn/docs/_nav/components.md new file mode 100644 index 000000000..049eb7913 --- /dev/null +++ b/content/cn/docs/_nav/components.md @@ -0,0 +1,13 @@ +--- +title: "组件" +linkTitle: "组件" +description: "从 HugeGraph 开始,再探索工具链、计算和 AI 组件。" +manual_link: /cn/docs/quickstart/hugegraph/ +sidebar_expanded: true +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/cn/docs/_nav/develop.md b/content/cn/docs/_nav/develop.md new file mode 100644 index 000000000..d165104db --- /dev/null +++ b/content/cn/docs/_nav/develop.md @@ -0,0 +1,13 @@ +--- +title: "开发" +linkTitle: "开发" +description: "从客户端 API 开始,再查看查询语言和开发指南。" +manual_link: /cn/docs/clients/ +sidebar_expanded: true +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/cn/docs/_nav/operate.md b/content/cn/docs/_nav/operate.md new file mode 100644 index 000000000..5516b6ab7 --- /dev/null +++ b/content/cn/docs/_nav/operate.md @@ -0,0 +1,12 @@ +--- +title: "运维" +linkTitle: "运维" +description: "从配置开始,再查看安全、备份和性能调优指南。" +manual_link: /cn/docs/config/ +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/cn/docs/_nav/reference.md b/content/cn/docs/_nav/reference.md new file mode 100644 index 000000000..b80ad6e13 --- /dev/null +++ b/content/cn/docs/_nav/reference.md @@ -0,0 +1,12 @@ +--- +title: "参考" +linkTitle: "参考" +description: "从版本说明开始,再查看下载、贡献指南和法律参考。" +manual_link: /cn/docs/changelog/ +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/cn/docs/_nav/start.md b/content/cn/docs/_nav/start.md new file mode 100644 index 000000000..a01647e8d --- /dev/null +++ b/content/cn/docs/_nav/start.md @@ -0,0 +1,13 @@ +--- +title: "开始" +linkTitle: "开始" +description: "安装 HugeGraph、启动服务并完成第一次图查询。" +manual_link: /cn/docs/quickstart/ +sidebar_expanded: true +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/cn/docs/clients/restful-api/graphs.md b/content/cn/docs/clients/restful-api/graphs.md index 560efc610..5f2d94ea5 100644 --- a/content/cn/docs/clients/restful-api/graphs.md +++ b/content/cn/docs/clients/restful-api/graphs.md @@ -175,7 +175,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx **注意**!! 1. 在 1.7.0 版本中,动态创建图会导致 NPE 错误。该问题已在 [PR#2912](https://github.com/apache/hugegraph/pull/2912) 中修复。当前 master 版本和 1.7.0 之前的版本不受此问题影响。 -2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。 +2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储-hstore)。 **RocksDB 示例:** @@ -508,4 +508,4 @@ PUT http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/compact "local": "OK" } } -``` \ No newline at end of file +``` diff --git a/content/cn/docs/clients/restful-api/traverser.md b/content/cn/docs/clients/restful-api/traverser.md index 3d4f210b4..134ccd9a0 100644 --- a/content/cn/docs/clients/restful-api/traverser.md +++ b/content/cn/docs/clients/restful-api/traverser.md @@ -55,7 +55,7 @@ HugeGraph 支持的 Traverser API 包括: 使用方法中的例子,都是基于 TinkerPop 官网给出的图: -![tinkerpop 示例图](http://tinkerpop.apache.org/docs/3.4.0/images/tinkerpop-modern.png) +![TinkerPop 示例图](/images/docs/graphs/tinkerpop-modern.png) 数据导入程序如下: diff --git a/content/cn/docs/config/config-option.md b/content/cn/docs/config/config-option.md index 97acc329f..e323fd94a 100644 --- a/content/cn/docs/config/config-option.md +++ b/content/cn/docs/config/config-option.md @@ -2,6 +2,11 @@ title: "Server 完整配置手册" linkTitle: "Server 完整配置手册" weight: 2 +search_keywords: + - gremlin.graph + - rest-server.properties + - hugegraph.properties +search_boost: 1.5 --- ### Gremlin Server 配置项 @@ -196,76 +201,60 @@ weight: 2 | rocksdb.level0_stop_writes_trigger | 36 | Hard limit on number of level-0 files for stopping writes. | | rocksdb.soft_pending_compaction_bytes_limit | 68719476736 | The soft limit to impose on pending compaction in bytes. | -
-K8s 配置项 (可选) - -对应配置文件`rest-server.properties` - -| config option | default value | description | -|------------------|-------------------------------|------------------------------------------| -| server.use_k8s | false | Whether to enable K8s multi-tenancy mode. | -| k8s.namespace | hugegraph-computer-system | K8s namespace for compute jobs. | -| k8s.kubeconfig | | Path to kubeconfig file. | - -
- -
-Arthas 诊断配置项 (可选) - -对应配置文件`rest-server.properties` - -| config option | default value | description | -|--------------------|---------------|-----------------------| -| arthas.telnetPort | 8562 | Arthas telnet port. | -| arthas.httpPort | 8561 | Arthas HTTP port. | -| arthas.ip | 0.0.0.0 | Arthas bind IP. | - -
- -
-RPC Server 配置 - -| config option | default value | description | -|-----------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| rpc.client_connect_timeout | 20 | The timeout(in seconds) of rpc client connect to rpc server. | -| rpc.client_load_balancer | consistentHash | The rpc client uses a load-balancing algorithm to access multiple rpc servers in one cluster. Default value is 'consistentHash', means forwarding by request parameters. | -| rpc.client_read_timeout | 40 | The timeout(in seconds) of rpc client read from rpc server. | -| rpc.client_reconnect_period | 10 | The period(in seconds) of rpc client reconnect to rpc server. | -| rpc.client_retries | 3 | Failed retry number of rpc client calls to rpc server. | -| rpc.config_order | 999 | Sofa rpc configuration file loading order, the larger the more later loading. | -| rpc.logger_impl | com.alipay.sofa.rpc.log.SLF4JLoggerImpl | Sofa rpc log implementation class. | -| rpc.protocol | bolt | Rpc communication protocol, client and server need to be specified the same value. | -| rpc.remote_url | | The remote urls of rpc peers, it can be set to multiple addresses, which are concat by ',', empty value means not enabled. | -| rpc.server_adaptive_port | false | Whether the bound port is adaptive, if it's enabled, when the port is in use, automatically +1 to detect the next available port. Note that this process is not atomic, so there may still be port conflicts. | -| rpc.server_host | | The hosts/ips bound by rpc server to provide services, empty value means not enabled. | -| rpc.server_port | 8090 | The port bound by rpc server to provide services. | -| rpc.server_timeout | 30 | The timeout(in seconds) of rpc server execution. | - -
- -
-HBase 后端配置项 - -| config option | default value | description | -|---------------------------|--------------------------------|--------------------------------------------------------------------------| -| backend | | Must be set to `hbase`. | -| serializer | | Must be set to `hbase`. | -| hbase.hosts | localhost | The hostnames or ip addresses of HBase zookeeper, separated with commas. | -| hbase.port | 2181 | The port address of HBase zookeeper. | -| hbase.threads_max | 64 | The max threads num of hbase connections. | -| hbase.znode_parent | /hbase | The znode parent path of HBase zookeeper. | -| hbase.zk_retry | 3 | The recovery retry times of HBase zookeeper. | -| hbase.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | -| hbase.kerberos_enable | false | Is Kerberos authentication enabled for HBase. | -| hbase.kerberos_keytab | | The HBase's key tab file for kerberos authentication. | -| hbase.kerberos_principal | | The HBase's principal for kerberos authentication. | -| hbase.krb5_conf | etc/krb5.conf | Kerberos configuration file, including KDC IP, default realm, etc. | -| hbase.hbase_site | /etc/hbase/conf/hbase-site.xml | The HBase's configuration file | -| hbase.enable_partition | true | Is pre-split partitions enabled for HBase. | -| hbase.vertex_partitions | 10 | The number of partitions of the HBase vertex table. | -| hbase.edge_partitions | 30 | The number of partitions of the HBase edge table. | - -
+> [!DETAILS]- **K8s 配置项 (可选)** +> 对应配置文件`rest-server.properties` +> +> | config option | default value | description | +> |------------------|-------------------------------|------------------------------------------| +> | server.use_k8s | false | Whether to enable K8s multi-tenancy mode. | +> | k8s.namespace | hugegraph-computer-system | K8s namespace for compute jobs. | +> | k8s.kubeconfig | | Path to kubeconfig file. | + +> [!DETAILS]- **Arthas 诊断配置项 (可选)** +> 对应配置文件`rest-server.properties` +> +> | config option | default value | description | +> |--------------------|---------------|-----------------------| +> | arthas.telnetPort | 8562 | Arthas telnet port. | +> | arthas.httpPort | 8561 | Arthas HTTP port. | +> | arthas.ip | 0.0.0.0 | Arthas bind IP. | + +> [!DETAILS]- **RPC Server 配置** +> | config option | default value | description | +> |-----------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +> | rpc.client_connect_timeout | 20 | The timeout(in seconds) of rpc client connect to rpc server. | +> | rpc.client_load_balancer | consistentHash | The rpc client uses a load-balancing algorithm to access multiple rpc servers in one cluster. Default value is 'consistentHash', means forwarding by request parameters. | +> | rpc.client_read_timeout | 40 | The timeout(in seconds) of rpc client read from rpc server. | +> | rpc.client_reconnect_period | 10 | The period(in seconds) of rpc client reconnect to rpc server. | +> | rpc.client_retries | 3 | Failed retry number of rpc client calls to rpc server. | +> | rpc.config_order | 999 | Sofa rpc configuration file loading order, the larger the more later loading. | +> | rpc.logger_impl | com.alipay.sofa.rpc.log.SLF4JLoggerImpl | Sofa rpc log implementation class. | +> | rpc.protocol | bolt | Rpc communication protocol, client and server need to be specified the same value. | +> | rpc.remote_url | | The remote urls of rpc peers, it can be set to multiple addresses, which are concat by ',', empty value means not enabled. | +> | rpc.server_adaptive_port | false | Whether the bound port is adaptive, if it's enabled, when the port is in use, automatically +1 to detect the next available port. Note that this process is not atomic, so there may still be port conflicts. | +> | rpc.server_host | | The hosts/ips bound by rpc server to provide services, empty value means not enabled. | +> | rpc.server_port | 8090 | The port bound by rpc server to provide services. | +> | rpc.server_timeout | 30 | The timeout(in seconds) of rpc server execution. | + +> [!DETAILS]- **HBase 后端配置项** +> | config option | default value | description | +> |---------------------------|--------------------------------|--------------------------------------------------------------------------| +> | backend | | Must be set to `hbase`. | +> | serializer | | Must be set to `hbase`. | +> | hbase.hosts | localhost | The hostnames or ip addresses of HBase zookeeper, separated with commas. | +> | hbase.port | 2181 | The port address of HBase zookeeper. | +> | hbase.threads_max | 64 | The max threads num of hbase connections. | +> | hbase.znode_parent | /hbase | The znode parent path of HBase zookeeper. | +> | hbase.zk_retry | 3 | The recovery retry times of HBase zookeeper. | +> | hbase.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | +> | hbase.kerberos_enable | false | Is Kerberos authentication enabled for HBase. | +> | hbase.kerberos_keytab | | The HBase's key tab file for kerberos authentication. | +> | hbase.kerberos_principal | | The HBase's principal for kerberos authentication. | +> | hbase.krb5_conf | etc/krb5.conf | Kerberos configuration file, including KDC IP, default realm, etc. | +> | hbase.hbase_site | /etc/hbase/conf/hbase-site.xml | The HBase's configuration file | +> | hbase.enable_partition | true | Is pre-split partitions enabled for HBase. | +> | hbase.vertex_partitions | 10 | The number of partitions of the HBase vertex table. | +> | hbase.edge_partitions | 30 | The number of partitions of the HBase edge table. | --- @@ -274,70 +263,54 @@ weight: 2 以下后端存储在 1.7.0+ 版本中不再支持,仅在 1.5.x 及更早版本中可用: -
-Cassandra 后端配置项 - -| config option | default value | description | -|--------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------| -| backend | | Must be set to `cassandra`. | -| serializer | | Must be set to `cassandra`. | -| cassandra.host | localhost | The seeds hostname or ip address of cassandra cluster. | -| cassandra.port | 9042 | The seeds port address of cassandra cluster. | -| cassandra.connect_timeout | 5 | The cassandra driver connect server timeout(seconds). | -| cassandra.read_timeout | 20 | The cassandra driver read from server timeout(seconds). | -| cassandra.keyspace.strategy | SimpleStrategy | The replication strategy of keyspace, valid value is SimpleStrategy or NetworkTopologyStrategy. | -| cassandra.keyspace.replication | [3] | The keyspace replication factor of SimpleStrategy, like '[3]'.Or replicas in each datacenter of NetworkTopologyStrategy, like '[dc1:2,dc2:1]'. | -| cassandra.username | | The username to use to login to cassandra cluster. | -| cassandra.password | | The password corresponding to cassandra.username. | -| cassandra.compression_type | none | The compression algorithm of cassandra transport: none/snappy/lz4. | -| cassandra.jmx_port=7199 | 7199 | The port of JMX API service for cassandra. | -| cassandra.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | - -
- -
-ScyllaDB 后端配置项 - -| config option | default value | description | -|---------------|---------------|----------------------------| -| backend | | Must be set to `scylladb`. | -| serializer | | Must be set to `scylladb`. | - -其它与 Cassandra 后端一致。 - -
- -
-MySQL & PostgreSQL 后端配置项 - -| config option | default value | description | -|----------------------------------|-----------------------------|-------------------------------------------------------------------------------------| -| backend | | Must be set to `mysql`. | -| serializer | | Must be set to `mysql`. | -| jdbc.driver | com.mysql.jdbc.Driver | The JDBC driver class to connect database. | -| jdbc.url | jdbc:mysql://127.0.0.1:3306 | The url of database in JDBC format. | -| jdbc.username | root | The username to login database. | -| jdbc.password | ****** | The password corresponding to jdbc.username. | -| jdbc.ssl_mode | false | The SSL mode of connections with database. | -| jdbc.reconnect_interval | 3 | The interval(seconds) between reconnections when the database connection fails. | -| jdbc.reconnect_max_times | 3 | The reconnect times when the database connection fails. | -| jdbc.storage_engine | InnoDB | The storage engine of backend store database, like InnoDB/MyISAM/RocksDB for MySQL. | -| jdbc.postgresql.connect_database | template1 | The database used to connect when init store, drop store or check store exist. | - -
- -
-PostgreSQL 后端配置项 - -| config option | default value | description | -|---------------|---------------|------------------------------| -| backend | | Must be set to `postgresql`. | -| serializer | | Must be set to `postgresql`. | - -其它与 MySQL 后端一致。 - -> PostgreSQL 后端的 driver 和 url 应该设置为: -> - `jdbc.driver=org.postgresql.Driver` -> - `jdbc.url=jdbc:postgresql://localhost:5432/` - -
+> [!DETAILS]- **Cassandra 后端配置项** +> | config option | default value | description | +> |--------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------| +> | backend | | Must be set to `cassandra`. | +> | serializer | | Must be set to `cassandra`. | +> | cassandra.host | localhost | The seeds hostname or ip address of cassandra cluster. | +> | cassandra.port | 9042 | The seeds port address of cassandra cluster. | +> | cassandra.connect_timeout | 5 | The cassandra driver connect server timeout(seconds). | +> | cassandra.read_timeout | 20 | The cassandra driver read from server timeout(seconds). | +> | cassandra.keyspace.strategy | SimpleStrategy | The replication strategy of keyspace, valid value is SimpleStrategy or NetworkTopologyStrategy. | +> | cassandra.keyspace.replication | [3] | The keyspace replication factor of SimpleStrategy, like '[3]'.Or replicas in each datacenter of NetworkTopologyStrategy, like '[dc1:2,dc2:1]'. | +> | cassandra.username | | The username to use to login to cassandra cluster. | +> | cassandra.password | | The password corresponding to cassandra.username. | +> | cassandra.compression_type | none | The compression algorithm of cassandra transport: none/snappy/lz4. | +> | cassandra.jmx_port=7199 | 7199 | The port of JMX API service for cassandra. | +> | cassandra.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | + +> [!DETAILS]- **ScyllaDB 后端配置项** +> | config option | default value | description | +> |---------------|---------------|----------------------------| +> | backend | | Must be set to `scylladb`. | +> | serializer | | Must be set to `scylladb`. | +> +> 其它与 Cassandra 后端一致。 + +> [!DETAILS]- **MySQL & PostgreSQL 后端配置项** +> | config option | default value | description | +> |----------------------------------|-----------------------------|-------------------------------------------------------------------------------------| +> | backend | | Must be set to `mysql`. | +> | serializer | | Must be set to `mysql`. | +> | jdbc.driver | com.mysql.jdbc.Driver | The JDBC driver class to connect database. | +> | jdbc.url | jdbc:mysql://127.0.0.1:3306 | The url of database in JDBC format. | +> | jdbc.username | root | The username to login database. | +> | jdbc.password | ****** | The password corresponding to jdbc.username. | +> | jdbc.ssl_mode | false | The SSL mode of connections with database. | +> | jdbc.reconnect_interval | 3 | The interval(seconds) between reconnections when the database connection fails. | +> | jdbc.reconnect_max_times | 3 | The reconnect times when the database connection fails. | +> | jdbc.storage_engine | InnoDB | The storage engine of backend store database, like InnoDB/MyISAM/RocksDB for MySQL. | +> | jdbc.postgresql.connect_database | template1 | The database used to connect when init store, drop store or check store exist. | + +> [!DETAILS]- **PostgreSQL 后端配置项** +> | config option | default value | description | +> |---------------|---------------|------------------------------| +> | backend | | Must be set to `postgresql`. | +> | serializer | | Must be set to `postgresql`. | +> +> 其它与 MySQL 后端一致。 +> +> > PostgreSQL 后端的 driver 和 url 应该设置为: +> > - `jdbc.driver=org.postgresql.Driver` +> > - `jdbc.url=jdbc:postgresql://localhost:5432/` diff --git a/content/cn/docs/contribution-guidelines/contribute.md b/content/cn/docs/contribution-guidelines/contribute.md index 5f4407c17..e72526999 100644 --- a/content/cn/docs/contribution-guidelines/contribute.md +++ b/content/cn/docs/contribution-guidelines/contribute.md @@ -10,7 +10,8 @@ Thanks for taking the time to contribute! As an open source project, HugeGraph i The following is a contribution guide for HugeGraph: -image +![在 GitHub 上 Fork HugeGraph 仓库](/images/docs/contribution/github-fork.png) +{width="884" height="462"} ## 1. Preparation @@ -123,14 +124,18 @@ git push origin bugfix-branch:bugfix-branch ``` Note that since GitHub requires submitting code through `username + token` (instead of using `username + password` directly), you need to create a GitHub token from https://github.com/settings/tokens: -image + +![使用个人访问令牌认证 Git 推送](/images/docs/contribution/github-authentication.png) +{width="1280" height="422"} ## 4. Create a Pull Request Go to the web page of GitHub fork repo, there would be a chance to create a Pull Request after pushing to a new branch, just click button "Compare & pull request" to do it. Then edit the description for proposed changes, which can just be copied from the commit message. Note: please make sure the email address you used to submit the code is bound to the GitHub account. For how to bind the email address, please refer to https://github.com/settings/emails: -image + +![在 GitHub 中验证提交邮箱](/images/docs/contribution/github-email.png) +{width="1280" height="592"} ## 5. Code review diff --git a/content/cn/docs/introduction/_index.md b/content/cn/docs/introduction/_index.md index a586f1081..169b6bfeb 100644 --- a/content/cn/docs/introduction/_index.md +++ b/content/cn/docs/introduction/_index.md @@ -3,8 +3,9 @@ title: "Introduction with HugeGraph" linkTitle: "Introduction" weight: 1 aliases: - - /cn/docs/introduction/readme/ - - /cn/docs/introduction/README/ + # Hugo 0.165 prefixes aliases with the current language path. + - /docs/introduction/readme/ + - /docs/introduction/README/ --- ### 什么是 Apache HugeGraph? @@ -145,4 +146,5 @@ docker run -itd --name=hugegraph -p 8080:8080 hugegraph/hugegraph - 安全问题:[security@hugegraph.apache.org](mailto:security@hugegraph.apache.org) - 微信公众号:Apache HugeGraph -微信公众号二维码 +![微信公众号二维码](/images/docs/community/wechat.png) +{width="300" height="94"} diff --git a/content/cn/docs/performance/hugegraph-benchmark-0.4.4.md b/content/cn/docs/performance/hugegraph-benchmark-0.4.4.md index 08e951db5..8ba9369ab 100644 --- a/content/cn/docs/performance/hugegraph-benchmark-0.4.4.md +++ b/content/cn/docs/performance/hugegraph-benchmark-0.4.4.md @@ -1,3 +1,9 @@ +--- +title: "HugeGraph 0.4.4 性能测试" +linkTitle: "HugeGraph 0.4.4 性能测试" +weight: 100 +--- + ### 1 测试环境 #### 1.1 硬件信息 diff --git a/content/cn/docs/quickstart/computing/hugegraph-computer.md b/content/cn/docs/quickstart/computing/hugegraph-computer.md index c401ff844..8f1596d02 100644 --- a/content/cn/docs/quickstart/computing/hugegraph-computer.md +++ b/content/cn/docs/quickstart/computing/hugegraph-computer.md @@ -65,7 +65,7 @@ mvn clean package -DskipTests #### 3.1.3 启动 master 节点 -> 您可以使用 `-c` 参数指定配置文件,更多 computer 配置请看:[Computer Config Options](/docs/quickstart/computing/hugegraph-computer-config#computer-config-options) +> 您可以使用 `-c` 参数指定配置文件,更多 computer 配置请看:[Computer Config Options](/cn/docs/quickstart/computing/hugegraph-computer-config#computer-配置选项) ```bash cd hugegraph-computer @@ -82,7 +82,7 @@ bin/start-computer.sh -d local -r worker 2.5.1 为 server 启用 `OLAP` 索引查询 -如果没有启用 OLAP 索引,则需要启用,更多参考:[modify-graphs-read-mode](/docs/clients/restful-api/graphs/#634-modify-graphs-read-mode-this-operation-requires-administrator-privileges) +如果没有启用 OLAP 索引,则需要启用,更多参考:[modify-graphs-read-mode](/cn/docs/clients/restful-api/graphs/#634-设置某个图的读模式该操作需要管理员权限) ```http PUT http://localhost:8080/graphs/hugegraph/graph_read_mode @@ -139,7 +139,7 @@ hugegraph-computer-operator-etcd-28lm67jxk5 1/1 Runnin > 更多 computer crd spec 请看:[Computer CRD](/docs/quickstart/computing/hugegraph-computer-config#hugegraph-computer-crd) > -> 更多 Computer 配置请看:[Computer Config Options](/docs/quickstart/computing/hugegraph-computer-config#computer-config-options) +> 更多 Computer 配置请看:[Computer Config Options](/cn/docs/quickstart/computing/hugegraph-computer-config#computer-配置选项) ```yaml cat < DeepWiki 提供实时更新的项目文档,内容更全面准确,适合快速了解项目最新情况。 > @@ -124,7 +123,7 @@ from pyhugegraph.client import PyHugeClient ## 📦 模块 -### [hugegraph-llm](https://github.com/apache/hugegraph-ai/tree/main/hugegraph-llm) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/apache/hugegraph-ai) +### [hugegraph-llm](https://github.com/apache/hugegraph-ai/tree/main/hugegraph-llm) ([Ask DeepWiki](https://deepwiki.com/apache/hugegraph-ai)) 用于图应用的大语言模型集成: - **GraphRAG**:基于图数据的检索增强生成 - **知识图谱构建**:从文本自动构建知识图谱 @@ -168,7 +167,7 @@ from pyhugegraph.client import PyHugeClient - 提交 PR 前运行 `./style/code_format_and_analysis.sh` - 报告错误前检查现有问题 -[![contributors graph](https://contrib.rocks/image?repo=apache/hugegraph-ai)](https://github.com/apache/hugegraph-ai/graphs/contributors) +[查看 HugeGraph-AI 贡献者列表](https://github.com/apache/hugegraph-ai/graphs/contributors)。 ## 📄 许可证 @@ -180,4 +179,5 @@ hugegraph-ai 采用 [Apache 2.0 许可证](https://github.com/apache/hugegraph-a - **电子邮件**:[dev@hugegraph.apache.org](mailto:dev@hugegraph.apache.org)([需要订阅](https://hugegraph.apache.org/docs/contribution-guidelines/subscribe/)) - **微信**:关注 "Apache HugeGraph" 微信公众号 -Apache HugeGraph WeChat QR Code +![Apache HugeGraph 微信公众号二维码](/images/docs/community/wechat.png) +{width="200" height="63"} diff --git a/content/cn/docs/quickstart/hugegraph-ai/hugegraph-llm.md b/content/cn/docs/quickstart/hugegraph-ai/hugegraph-llm.md index d376b3de1..14054e4b0 100644 --- a/content/cn/docs/quickstart/hugegraph-ai/hugegraph-llm.md +++ b/content/cn/docs/quickstart/hugegraph-ai/hugegraph-llm.md @@ -8,7 +8,7 @@ weight: 1 > **连接图数据库与大语言模型的桥梁** -> AI 总结项目文档:[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/apache/hugegraph-ai) +> AI 总结项目文档:[Ask DeepWiki](https://deepwiki.com/apache/hugegraph-ai) ## 🎯 概述 @@ -134,7 +134,7 @@ python -m hugegraph_llm.config.generate --update - **自定义 Schema**:遵循我们[模板](https://github.com/apache/hugegraph-ai/blob/aff3bbe25fa91c3414947a196131be812c20ef11/hugegraph-llm/src/hugegraph_llm/config/config_data.py#L125)的 JSON 格式 - **HugeGraph Schema**:使用现有图实例的 Schema(例如,“hugegraph”) -![知识图谱构建器](https://hugegraph.apache.org/docs/images/gradio-kg.png) +![知识图谱构建器](/images/docs/hugegraph-ai/gradio-kg.jpg) #### 代码构建 diff --git a/content/cn/docs/quickstart/hugegraph-ai/quick_start.md b/content/cn/docs/quickstart/hugegraph-ai/quick_start.md index da148f7e7..112880dc8 100644 --- a/content/cn/docs/quickstart/hugegraph-ai/quick_start.md +++ b/content/cn/docs/quickstart/hugegraph-ai/quick_start.md @@ -21,7 +21,7 @@ weight: 4 从文本构建知识图谱、分块向量和图顶点向量。 -![image](https://github.com/user-attachments/assets/f3366d46-2e31-4638-94c4-7214951ef77a) +![GraphRAG 索引构建流程](/images/docs/hugegraph-ai/quick-start-01.png) ```mermaid graph TD; @@ -79,7 +79,7 @@ graph TD; 第一部分处理单个查询,第二部分同时处理多个查询。以下是第一部分的说明。 -![image](https://github.com/user-attachments/assets/33698062-e46b-4757-8b5e-93e8f10eae65) +![HugeGraph RAG 查询界面](/images/docs/hugegraph-ai/quick-start-02.png) ```mermaid graph TD; @@ -109,7 +109,7 @@ graph TD; - **仅图答案:** 仅使用基于图的检索(在向量数据库中查询图顶点向量和图数据库) - **图-向量答案:** 同时使用基于图和基于向量的检索 -![image](https://github.com/user-attachments/assets/26641e09-249f-4b3a-8013-16dc9383d333) +![RAG 查询范围选择](/images/docs/hugegraph-ai/quick-start-03.jpg) ### 执行流程: @@ -117,7 +117,7 @@ graph TD; - 使用**关键词提取提示词**从**问题**中提取关键词。 -![image](https://github.com/user-attachments/assets/b49e269f-eaec-40b1-8d8f-9e409821d75d) +![RAG 界面中抽取的关键词](/images/docs/hugegraph-ai/quick-start-04.png) - 使用提取的关键词: - 首先,在图数据库中进行精确匹配。 @@ -141,7 +141,7 @@ graph TD; - **仅图答案** - **图-向量答案** -![image](https://github.com/user-attachments/assets/7d4496a3-d44c-4491-9463-8e93595dfa45) +![RAG 回答模式对比](/images/docs/hugegraph-ai/quick-start-05.jpg) # 4. (处理流程)Text2Gremlin @@ -154,7 +154,7 @@ graph TD; 第一部分较为简单,因此重点介绍第二部分。 -![image](https://github.com/user-attachments/assets/fc678369-261d-49ea-a289-1ca6ade5ca55) +![Text2Gremlin 界面](/images/docs/hugegraph-ai/quick-start-06.png) ```mermaid graph TD; @@ -169,7 +169,7 @@ graph TD; - **自然语言查询:** 输入要转换为 Gremlin 的自然语言文本。 -![image](https://github.com/user-attachments/assets/d2a72f45-488c-4499-968b-a11816655ba0) +![自然语言查询输入](/images/docs/hugegraph-ai/quick-start-07.png) - **Schema:** 输入图 schema。 @@ -183,7 +183,7 @@ graph TD; - 检索**图 schema**。 - 在向量数据库中查询示例向量,检索与输入查询相似的查询-gremlin 对(如果向量数据库中缺少示例,将自动使用**resources**文件夹中的示例进行初始化)。 -![image](https://github.com/user-attachments/assets/fd150f87-27f8-48e5-8a55-319ec039b7e0) +![生成的 Gremlin 查询](/images/docs/hugegraph-ai/quick-start-08.png) - 使用构建的提示词生成 Gremlin 查询。 diff --git a/content/cn/docs/quickstart/hugegraph/hugegraph-hstore.md b/content/cn/docs/quickstart/hugegraph/hugegraph-hstore.md index 79a0ddfc5..b2108739d 100644 --- a/content/cn/docs/quickstart/hugegraph/hugegraph-hstore.md +++ b/content/cn/docs/quickstart/hugegraph/hugegraph-hstore.md @@ -2,6 +2,11 @@ title: "HugeGraph-Store Quick Start" linkTitle: "安装/构建 HugeGraph-Store" weight: 3 +search_keywords: + - server.port + - REST 端口 + - Store REST 端口 +search_boost: 1.5 --- ### 1 HugeGraph-Store 概述 diff --git a/content/cn/docs/quickstart/hugegraph/hugegraph-server.md b/content/cn/docs/quickstart/hugegraph/hugegraph-server.md index 2be45ba4f..c8feffd38 100644 --- a/content/cn/docs/quickstart/hugegraph/hugegraph-server.md +++ b/content/cn/docs/quickstart/hugegraph/hugegraph-server.md @@ -2,9 +2,11 @@ title: "HugeGraph-Server Quick Start" linkTitle: "安装/构建 HugeGraph-Server" weight: 1 +aliases: + - /docs/quickstart/hugegraph-server/ --- -### 1 HugeGraph-Server 概述 +## 1 HugeGraph-Server 概述 HugeGraph-Server 是 HugeGraph 项目的核心部分,包含 graph-core、backend、API 等子模块。 @@ -15,9 +17,9 @@ Core 模块是 Tinkerpop 接口的实现,Backend 模块用于管理数据存 > 文档中会出现 `HugeGraph-Server` 与 `HugeGraphServer` 两种写法,其他组件也类似。 > 两者在含义上并无明显差异,可简单区分为:`HugeGraph-Server` 表示服务端相关组件代码,`HugeGraphServer` 表示服务进程。 -### 2 依赖 +## 2 依赖 -#### 2.1 安装 Java 11 (JDK 11) +### 2.1 安装 Java 11 (JDK 11) 建议在 Java 11 环境中运行 `HugeGraph-Server`(1.5.0 之前的版本仍保留对 Java 8 的基本兼容)。 @@ -25,7 +27,7 @@ Core 模块是 Tinkerpop 接口的实现,Backend 模块用于管理数据存 > 注:使用 Java 8 启动 HugeGraph-Server 会失去部分**安全性**保障,也会影响性能表现。请尽早升级或迁移,1.7.0 起已不再支持 Java 8。 -### 3 部署 +## 3 部署 有四种方式可以部署 HugeGraph-Server 组件: @@ -36,7 +38,7 @@ Core 模块是 Tinkerpop 接口的实现,Backend 模块用于管理数据存 > ⚠️ **SEC 提醒**:由于图查询语言 (如 Gremlin/Cypher) 的高度灵活性,直接暴露原生查询接口会带来潜在的安全隐患,因此**请避免直接在公网环境中暴露任何查询相关接口**。生产环境中务必开启 **[鉴权体系 (Auth)](/cn/docs/config/config-authentication/)** 配合 **IP 白名单** 构成双重保障机制,同时建议辅以 Audit Log (审计日志) 追踪具体查询语句。推荐整体采用 **[容器化环境 (Docker/K8s)](#31-使用-docker-容器-便于测试)** 进行部署以获得更好的系统级安全隔离。 -#### 3.1 使用 Docker 容器 (便于**测试**) +### 3.1 使用 Docker 容器 (便于**测试**) 可参考 [Docker 部署方式](https://github.com/apache/hugegraph/blob/master/docker/README.md)。 @@ -51,7 +53,7 @@ Core 模块是 Tinkerpop 接口的实现,Backend 模块用于管理数据存 如果使用 Docker Desktop,则可以按如下方式设置相关选项:
- image + Docker Desktop 中 HugeGraph 容器的运行设置
@@ -79,7 +81,7 @@ HUGEGRAPH_VERSION=1.7.0 docker compose up -d > > 2. 推荐使用 `release tag` (如 `1.7.0/1.x.0`) 以获取稳定版。使用 `latest` tag 可以使用开发中的最新功能。 -#### 3.2 下载 tar 包 +### 3.2 下载 tar 包 ```bash # use the latest version, here is 1.7.0 for example @@ -87,7 +89,7 @@ wget https://downloads.apache.org/hugegraph/{version}/apache-hugegraph-incubatin tar zxf *hugegraph*.tar.gz ``` -#### 3.3 源码编译 +### 3.3 源码编译 源码编译前请确保本机有安装 `wget/curl` 命令 @@ -132,41 +134,38 @@ mvn package -DskipTests 执行成功后,在 hugegraph 目录下生成 `*hugegraph-*.tar.gz` 文件,就是编译生成的 tar 包。 -
-过时的 tools 工具安装 - -#### 3.4 使用 tools 工具部署 (Outdated) - -HugeGraph-Tools 提供了一键部署的命令行工具,用户可以使用该工具快速地一键下载、解压、配置并启动 HugeGraph-Server 和 HugeGraph-Hubble,最新的 HugeGraph-Toolchain 中已经包含所有的这些工具,直接下载它解压就有工具包集合了 - -```bash -# download toolchain package, it includes loader + tool + hubble, please check the latest version (here is 1.7.0) -wget https://downloads.apache.org/hugegraph/1.7.0/apache-hugegraph-toolchain-incubating-1.7.0.tar.gz -tar zxf *hugegraph-*.tar.gz -# enter the tool's package -cd *hugegraph*/*tool* -``` - -> 注:`${version}` 为版本号,最新版本号可参考 [Download 页面](/docs/download/download),或直接从 Download 页面点击链接下载 - -HugeGraph-Tools 的总入口脚本是 `bin/hugegraph`,用户可以使用 `help` 子命令查看其用法,这里只介绍一键部署的命令。 - -```bash -bin/hugegraph deploy -v {hugegraph-version} -p {install-path} [-u {download-path-prefix}] -``` - -`{hugegraph-version}` 表示要部署的 HugeGraphServer 及 HugeGraphStudio 的版本,用户可查看 `conf/version-mapping.yaml` 文件获取版本信息,`{install-path}` 指定 HugeGraphServer 及 HugeGraphStudio 的安装目录,`{download-path-prefix}` 可选,指定 HugeGraphServer 及 HugeGraphStudio tar 包的下载地址,不提供时使用默认下载地址,比如要启动 0.6 版本的 HugeGraph-Server 及 HugeGraphStudio 将上述命令写为 `bin/hugegraph deploy -v 0.6 -p services` 即可。 -
+> [!DETAILS]- 过时的 tools 工具安装 +> #### 3.4 使用 tools 工具部署 (Outdated) +> +> HugeGraph-Tools 提供了一键部署的命令行工具,用户可以使用该工具快速地一键下载、解压、配置并启动 HugeGraph-Server 和 HugeGraph-Hubble,最新的 HugeGraph-Toolchain 中已经包含所有的这些工具,直接下载它解压就有工具包集合了 +> +> ```bash +> # download toolchain package, it includes loader + tool + hubble, please check the latest version (here is 1.7.0) +> wget https://downloads.apache.org/hugegraph/1.7.0/apache-hugegraph-toolchain-incubating-1.7.0.tar.gz +> tar zxf *hugegraph-*.tar.gz +> # enter the tool's package +> cd *hugegraph*/*tool* +> ``` +> +> > 注:`${version}` 为版本号,最新版本号可参考 [Download 页面](/docs/download/download),或直接从 Download 页面点击链接下载 +> +> HugeGraph-Tools 的总入口脚本是 `bin/hugegraph`,用户可以使用 `help` 子命令查看其用法,这里只介绍一键部署的命令。 +> +> ```bash +> bin/hugegraph deploy -v {hugegraph-version} -p {install-path} [-u {download-path-prefix}] +> ``` +> +> `{hugegraph-version}` 表示要部署的 HugeGraphServer 及 HugeGraphStudio 的版本,用户可查看 `conf/version-mapping.yaml` 文件获取版本信息,`{install-path}` 指定 HugeGraphServer 及 HugeGraphStudio 的安装目录,`{download-path-prefix}` 可选,指定 HugeGraphServer 及 HugeGraphStudio tar 包的下载地址,不提供时使用默认下载地址,比如要启动 0.6 版本的 HugeGraph-Server 及 HugeGraphStudio 将上述命令写为 `bin/hugegraph deploy -v 0.6 -p services` 即可。 -### 4 配置 +## 4 配置 如果需要快速启动 HugeGraph 仅用于测试,那么只需要进行少数几个配置项的修改即可(见下一节)。 详细的配置介绍请参考[配置文档](/docs/config/config-guide)及[配置项介绍](/docs/config/config-option)。 -### 5 启动 +## 5 启动 -#### 5.1 使用启动脚本启动 +### 5.1 使用启动脚本启动 启动流程分为“首次启动”和“非首次启动”。首次启动前需要先初始化后端数据库,然后再启动服务。 @@ -180,423 +179,395 @@ HugeGraphServer 启动时会连接后端存储并检查其版本信息。如果 **注:** 如果想要开启 HugeGraph 权限系统,在启动 Server 之前应按照 [Server 鉴权配置](/cn/docs/config/config-authentication/) 进行配置。(尤其是生产环境/外网环境须开启) -##### 5.1.1 分布式存储 (HStore) - -
-点击展开/折叠 分布式存储 配置及启动方法 - -> 分布式存储是 HugeGraph 1.5.0 之后推出的新特性,它基于 HugeGraph-PD 和 HugeGraph-Store 组件实现了分布式的数据存储和计算。 - -要使用分布式存储引擎,需要先部署 HugeGraph-PD 和 HugeGraph-Store,详见 [HugeGraph-PD 快速入门](/cn/docs/quickstart/hugegraph/hugegraph-pd/) 和 [HugeGraph-Store 快速入门](/cn/docs/quickstart/hugegraph/hugegraph-hstore/)。 - -确保 PD 和 Store 服务均已启动后 - -1. 修改 HugeGraph-Server 的 `hugegraph.properties` 配置: - -```properties -backend=hstore -serializer=binary -task.scheduler_type=distributed - -# PD 服务地址,多个 PD 地址用逗号分割,配置 PD 的 RPC 端口 -pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 -``` - -```properties -# 简单示例(带鉴权) -gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy - -# 指定存储 hstore(必须) -backend=hstore -serializer=binary -store=hugegraph - -# 指定任务调度器(1.7.0及之前,hstore 存储必须) -task.scheduler_type=distributed - -# pd config -pd.peers=127.0.0.1:8686 -``` - -2. 修改 HugeGraph-Server 的 `rest-server.properties` 配置: - -```properties -usePD=true -# 注意,1.7.0 必须在 rest-server.properties 配置 pd.peers -pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 - -# 若需要 auth -# auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator -``` - -如果配置多个 HugeGraph-Server 节点,需要为每个节点修改 `rest-server.properties` 配置文件,例如: - -节点 1(主节点): -```properties -usePD=true -restserver.url=http://127.0.0.1:8081 -gremlinserver.url=http://127.0.0.1:8181 -pd.peers=127.0.0.1:8686 - -rpc.server_host=127.0.0.1 -rpc.server_port=8091 - -server.id=server-1 -server.role=master -``` - -节点 2(工作节点): -```properties -usePD=true -restserver.url=http://127.0.0.1:8082 -gremlinserver.url=http://127.0.0.1:8182 -pd.peers=127.0.0.1:8686 - -rpc.server_host=127.0.0.1 -rpc.server_port=8092 - -server.id=server-2 -server.role=worker -``` - -同时,还需要修改每个节点的 `gremlin-server.yaml` 中的端口配置: - -节点 1: -```yaml -host: 127.0.0.1 -port: 8181 -``` - -节点 2: -```yaml -host: 127.0.0.1 -port: 8182 -``` - -初始化数据库: - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -启动 Server: - -```bash -bin/start-hugegraph.sh -``` - -使用分布式存储引擎的启动顺序为: -1. 启动 HugeGraph-PD -2. 启动 HugeGraph-Store -3. 初始化数据库(仅首次) -4. 启动 HugeGraph-Server - -验证服务是否正常启动: - -```bash -curl http://localhost:8081/graphs -# 应返回:{"graphs":["hugegraph"]} -``` - -停止服务的顺序应该与启动顺序相反: -1. 停止 HugeGraph-Server -2. 停止 HugeGraph-Store -3. 停止 HugeGraph-PD - -```bash -bin/stop-hugegraph.sh -``` - -###### Docker 分布式集群 - -通过 Docker-Compose 运行完整的分布式集群(3 PD + 3 Store + 3 Server): +#### 5.1.1 分布式存储 (HStore) +> [!DETAILS]- 点击展开/折叠 分布式存储 配置及启动方法 +> > 分布式存储是 HugeGraph 1.5.0 之后推出的新特性,它基于 HugeGraph-PD 和 HugeGraph-Store 组件实现了分布式的数据存储和计算。 +> +> 要使用分布式存储引擎,需要先部署 HugeGraph-PD 和 HugeGraph-Store,详见 [HugeGraph-PD 快速入门](/cn/docs/quickstart/hugegraph/hugegraph-pd/) 和 [HugeGraph-Store 快速入门](/cn/docs/quickstart/hugegraph/hugegraph-hstore/)。 +> +> 确保 PD 和 Store 服务均已启动后 +> +> 1. 修改 HugeGraph-Server 的 `hugegraph.properties` 配置: +> +> ```properties +> backend=hstore +> serializer=binary +> task.scheduler_type=distributed +> +> # PD 服务地址,多个 PD 地址用逗号分割,配置 PD 的 RPC 端口 +> pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 +> ``` +> +> ```properties +> # 简单示例(带鉴权) +> gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy +> +> # 指定存储 hstore(必须) +> backend=hstore +> serializer=binary +> store=hugegraph +> +> # 指定任务调度器(1.7.0及之前,hstore 存储必须) +> task.scheduler_type=distributed +> +> # pd config +> pd.peers=127.0.0.1:8686 +> ``` +> +> 2. 修改 HugeGraph-Server 的 `rest-server.properties` 配置: +> +> ```properties +> usePD=true +> # 注意,1.7.0 必须在 rest-server.properties 配置 pd.peers +> pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 +> +> # 若需要 auth +> # auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator +> ``` +> +> 如果配置多个 HugeGraph-Server 节点,需要为每个节点修改 `rest-server.properties` 配置文件,例如: +> +> 节点 1(主节点): +> ```properties +> usePD=true +> restserver.url=http://127.0.0.1:8081 +> gremlinserver.url=http://127.0.0.1:8181 +> pd.peers=127.0.0.1:8686 +> +> rpc.server_host=127.0.0.1 +> rpc.server_port=8091 +> +> server.id=server-1 +> server.role=master +> ``` +> +> 节点 2(工作节点): +> ```properties +> usePD=true +> restserver.url=http://127.0.0.1:8082 +> gremlinserver.url=http://127.0.0.1:8182 +> pd.peers=127.0.0.1:8686 +> +> rpc.server_host=127.0.0.1 +> rpc.server_port=8092 +> +> server.id=server-2 +> server.role=worker +> ``` +> +> 同时,还需要修改每个节点的 `gremlin-server.yaml` 中的端口配置: +> +> 节点 1: +> ```yaml +> host: 127.0.0.1 +> port: 8181 +> ``` +> +> 节点 2: +> ```yaml +> host: 127.0.0.1 +> port: 8182 +> ``` +> +> 初始化数据库: +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> 启动 Server: +> +> ```bash +> bin/start-hugegraph.sh +> ``` +> +> 使用分布式存储引擎的启动顺序为: +> 1. 启动 HugeGraph-PD +> 2. 启动 HugeGraph-Store +> 3. 初始化数据库(仅首次) +> 4. 启动 HugeGraph-Server +> +> 验证服务是否正常启动: +> +> ```bash +> curl http://localhost:8081/graphs +> # 应返回:{"graphs":["hugegraph"]} +> ``` +> +> 停止服务的顺序应该与启动顺序相反: +> 1. 停止 HugeGraph-Server +> 2. 停止 HugeGraph-Store +> 3. 停止 HugeGraph-PD +> +> ```bash +> bin/stop-hugegraph.sh +> ``` +> +> ##### Docker 分布式集群 +> +> 通过 Docker-Compose 运行完整的分布式集群(3 PD + 3 Store + 3 Server): +> +> +> ```bash +> cd hugegraph/docker +> HUGEGRAPH_VERSION=1.7.0 docker compose -f docker-compose-3pd-3store-3server.yml up -d +> ``` +> +> 服务通过 `hg-net` 桥接网络上的容器主机名进行通信。配置通过环境变量注入: +> +> ```yaml +> # Server 配置 +> HG_SERVER_BACKEND: hstore +> HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686 +> ``` +> +> 验证集群: +> ```bash +> curl http://localhost:8080/versions +> curl http://localhost:8620/v1/stores +> ``` +> +> 运行时日志可通过 `docker logs `(如 `docker logs hg-pd0`)直接查看,无需进入容器。 +> +> 完整的环境变量参考、端口表和故障排查指南请参阅 [docker/README.md](https://github.com/apache/hugegraph/blob/master/docker/README.md)。 -```bash -cd hugegraph/docker -HUGEGRAPH_VERSION=1.7.0 docker compose -f docker-compose-3pd-3store-3server.yml up -d -``` - -服务通过 `hg-net` 桥接网络上的容器主机名进行通信。配置通过环境变量注入: - -```yaml -# Server 配置 -HG_SERVER_BACKEND: hstore -HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686 -``` - -验证集群: -```bash -curl http://localhost:8080/versions -curl http://localhost:8620/v1/stores -``` - -运行时日志可通过 `docker logs `(如 `docker logs hg-pd0`)直接查看,无需进入容器。 - -完整的环境变量参考、端口表和故障排查指南请参阅 [docker/README.md](https://github.com/apache/hugegraph/blob/master/docker/README.md)。 -
- -##### 5.1.2 RocksDB / ToplingDB - -
-点击展开/折叠 RocksDB 配置及启动方法 - - -> RocksDB 是一个嵌入式的数据库,不需要手动安装部署,要求 GCC 版本 >= 4.3.0(GLIBCXX_3.4.10),如不满足,需要提前升级 GCC - -修改 `hugegraph.properties` - -```properties -backend=rocksdb -serializer=binary -rocksdb.data_path=. -rocksdb.wal_path=. -``` - -初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -启动 server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -提示的 url 与 `rest-server.properties` 中配置的 `restserver.url` 一致 - -**ToplingDB (Beta)**: 作为 RocksDB 的高性能替代方案,配置方式请参考: [ToplingDB Quick Start]({{< ref path="/blog/hugegraph/toplingdb/toplingdb-quick-start.md" lang="cn">}}) - -
- -##### 5.1.3 HBase - -
-点击展开/折叠 HBase 配置及启动方法 - -> 用户需自行安装 HBase,要求版本 2.0 以上,[下载地址](https://hbase.apache.org/downloads.html) - -修改 hugegraph.properties - -```properties -backend=hbase -serializer=hbase - -# hbase backend config -hbase.hosts=localhost -hbase.port=2181 -# Note: recommend to modify the HBase partition number by the actual/env data amount & RS amount before init store -# it may influence the loading speed a lot -#hbase.enable_partition=true -#hbase.vertex_partitions=10 -#hbase.edge_partitions=30 -``` - -初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -启动 server +#### 5.1.2 RocksDB / ToplingDB -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` +> [!DETAILS]- 点击展开/折叠 RocksDB 配置及启动方法 +> > RocksDB 是一个嵌入式的数据库,不需要手动安装部署,要求 GCC 版本 >= 4.3.0(GLIBCXX_3.4.10),如不满足,需要提前升级 GCC +> +> 修改 `hugegraph.properties` +> +> ```properties +> backend=rocksdb +> serializer=binary +> rocksdb.data_path=. +> rocksdb.wal_path=. +> ``` +> +> 初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> 启动 server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` +> +> 提示的 url 与 `rest-server.properties` 中配置的 `restserver.url` 一致 +> +> **ToplingDB (Beta)**: 作为 RocksDB 的高性能替代方案,配置方式请参考: [ToplingDB Quick Start]({{< ref path="/blog/hugegraph/toplingdb/toplingdb-quick-start.md" lang="cn">}}) -> 更多其它后端配置可参考[配置项介绍](/docs/config/config-option) +#### 5.1.3 HBase -
+> [!DETAILS]- 点击展开/折叠 HBase 配置及启动方法 +> > 用户需自行安装 HBase,要求版本 2.0 以上,[下载地址](https://hbase.apache.org/downloads.html) +> +> 修改 hugegraph.properties +> +> ```properties +> backend=hbase +> serializer=hbase +> +> # hbase backend config +> hbase.hosts=localhost +> hbase.port=2181 +> # Note: recommend to modify the HBase partition number by the actual/env data amount & RS amount before init store +> # it may influence the loading speed a lot +> #hbase.enable_partition=true +> #hbase.vertex_partitions=10 +> #hbase.edge_partitions=30 +> ``` +> +> 初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> 启动 server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` +> +> > 更多其它后端配置可参考[配置项介绍](/docs/config/config-option) -##### 5.1.4 MySQL +#### 5.1.4 MySQL > ⚠️ **已废弃**: 此后端从 HugeGraph 1.7.0 版本开始已移除。如需使用,请参考 1.5.x 版本文档。 -
-点击展开/折叠 MySQL 配置及启动方法 - -> 由于 MySQL 是在 GPL 协议下,与 Apache 协议不兼容,用户需自行安装 MySQL,[下载地址](https://dev.mysql.com/downloads/mysql/) - -下载 MySQL 的[驱动包](https://repo1.maven.org/maven2/mysql/mysql-connector-java/),比如 `mysql-connector-java-8.0.30.jar`,并放入 HugeGraph-Server 的 `lib` 目录下。 - -修改 `hugegraph.properties`,配置数据库 URL,用户名和密码,`store` 是数据库名,如果没有会被自动创建。 - -```properties -backend=mysql -serializer=mysql - -store=hugegraph - -# mysql backend config -jdbc.driver=com.mysql.cj.jdbc.Driver -jdbc.url=jdbc:mysql://127.0.0.1:3306 -jdbc.username= -jdbc.password= -jdbc.reconnect_max_times=3 -jdbc.reconnect_interval=3 -jdbc.ssl_mode=false -``` - -初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -启动 server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -
+> [!DETAILS]- 点击展开/折叠 MySQL 配置及启动方法 +> > 由于 MySQL 是在 GPL 协议下,与 Apache 协议不兼容,用户需自行安装 MySQL,[下载地址](https://dev.mysql.com/downloads/mysql/) +> +> 下载 MySQL 的[驱动包](https://repo1.maven.org/maven2/mysql/mysql-connector-java/),比如 `mysql-connector-java-8.0.30.jar`,并放入 HugeGraph-Server 的 `lib` 目录下。 +> +> 修改 `hugegraph.properties`,配置数据库 URL,用户名和密码,`store` 是数据库名,如果没有会被自动创建。 +> +> ```properties +> backend=mysql +> serializer=mysql +> +> store=hugegraph +> +> # mysql backend config +> jdbc.driver=com.mysql.cj.jdbc.Driver +> jdbc.url=jdbc:mysql://127.0.0.1:3306 +> jdbc.username= +> jdbc.password= +> jdbc.reconnect_max_times=3 +> jdbc.reconnect_interval=3 +> jdbc.ssl_mode=false +> ``` +> +> 初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> 启动 server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` -##### 5.1.5 Cassandra +#### 5.1.5 Cassandra > ⚠️ **已废弃**: 此后端从 HugeGraph 1.7.0 版本开始已移除。如需使用,请参考 1.5.x 版本文档。 -
-点击展开/折叠 Cassandra 配置及启动方法 - -> 用户需自行安装 Cassandra,要求版本 3.0 以上,[下载地址](http://cassandra.apache.org/download/) - -修改 hugegraph.properties - -```properties -backend=cassandra -serializer=cassandra - -# cassandra backend config -cassandra.host=localhost -cassandra.port=9042 -cassandra.username= -cassandra.password= -#cassandra.connect_timeout=5 -#cassandra.read_timeout=20 - -#cassandra.keyspace.strategy=SimpleStrategy -#cassandra.keyspace.replication=3 -``` - -初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) - -```bash -cd *hugegraph-${version} -bin/init-store.sh -Initing HugeGraph Store... -2017-12-01 11:26:51 1424 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' -2017-12-01 11:26:52 2389 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later -2017-12-01 11:26:52 2472 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later -2017-12-01 11:26:52 2557 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later -2017-12-01 11:26:53 2797 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph -2017-12-01 11:26:53 2945 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema -2017-12-01 11:26:53 3044 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index -2017-12-01 11:26:53 3046 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' -2017-12-01 11:26:59 9720 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' -2017-12-01 11:27:00 9805 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later -2017-12-01 11:27:00 9886 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later -2017-12-01 11:27:00 9955 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later -2017-12-01 11:27:00 10175 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph -2017-12-01 11:27:00 10321 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema -2017-12-01 11:27:00 10413 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index -2017-12-01 11:27:00 10413 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' -``` - -启动 server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -
- -##### 5.1.6 Memory - -
-点击展开/折叠 Memory 配置及启动方法 - -修改 hugegraph.properties - -```properties -backend=memory -serializer=text -``` - -> Memory 后端的数据是保存在内存中无法持久化的,不需要初始化后端,这也是唯一一个不需要初始化的后端。 - -启动 server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` +> [!DETAILS]- 点击展开/折叠 Cassandra 配置及启动方法 +> > 用户需自行安装 Cassandra,要求版本 3.0 以上,[下载地址](http://cassandra.apache.org/download/) +> +> 修改 hugegraph.properties +> +> ```properties +> backend=cassandra +> serializer=cassandra +> +> # cassandra backend config +> cassandra.host=localhost +> cassandra.port=9042 +> cassandra.username= +> cassandra.password= +> #cassandra.connect_timeout=5 +> #cassandra.read_timeout=20 +> +> #cassandra.keyspace.strategy=SimpleStrategy +> #cassandra.keyspace.replication=3 +> ``` +> +> 初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> Initing HugeGraph Store... +> 2017-12-01 11:26:51 1424 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' +> 2017-12-01 11:26:52 2389 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later +> 2017-12-01 11:26:52 2472 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later +> 2017-12-01 11:26:52 2557 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later +> 2017-12-01 11:26:53 2797 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph +> 2017-12-01 11:26:53 2945 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema +> 2017-12-01 11:26:53 3044 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index +> 2017-12-01 11:26:53 3046 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' +> 2017-12-01 11:26:59 9720 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' +> 2017-12-01 11:27:00 9805 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later +> 2017-12-01 11:27:00 9886 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later +> 2017-12-01 11:27:00 9955 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later +> 2017-12-01 11:27:00 10175 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph +> 2017-12-01 11:27:00 10321 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema +> 2017-12-01 11:27:00 10413 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index +> 2017-12-01 11:27:00 10413 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' +> ``` +> +> 启动 server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` -提示的 url 与 rest-server.properties 中配置的 restserver.url 一致 +#### 5.1.6 Memory -
+> [!DETAILS]- 点击展开/折叠 Memory 配置及启动方法 +> 修改 hugegraph.properties +> +> ```properties +> backend=memory +> serializer=text +> ``` +> +> > Memory 后端的数据是保存在内存中无法持久化的,不需要初始化后端,这也是唯一一个不需要初始化的后端。 +> +> 启动 server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` +> +> 提示的 url 与 rest-server.properties 中配置的 restserver.url 一致 -##### 5.1.7 ScyllaDB +#### 5.1.7 ScyllaDB > ⚠️ **已废弃**: 此后端从 HugeGraph 1.7.0 版本开始已移除。如需使用,请参考 1.5.x 版本文档。 -
-点击展开/折叠 ScyllaDB 配置及启动方法 - -> 用户需自行安装 ScyllaDB,推荐版本 2.1 以上,[下载地址](https://docs.scylladb.com/getting-started/) - -修改 hugegraph.properties - -```properties -backend=scylladb -serializer=scylladb - -# cassandra backend config -cassandra.host=localhost -cassandra.port=9042 -cassandra.username= -cassandra.password= -#cassandra.connect_timeout=5 -#cassandra.read_timeout=20 - -#cassandra.keyspace.strategy=SimpleStrategy -#cassandra.keyspace.replication=3 -``` - -由于 scylladb 数据库本身就是基于 cassandra 的"优化版",如果用户未安装 scylladb,也可以直接使用 cassandra 作为后端存储,只需要把 backend 和 serializer 修改为 scylladb,host 和 post 指向 cassandra 集群的 seeds 和 port 即可,但是并不建议这样做,这样发挥不出 scylladb 本身的优势了。 - -初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -启动 server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -
+> [!DETAILS]- 点击展开/折叠 ScyllaDB 配置及启动方法 +> > 用户需自行安装 ScyllaDB,推荐版本 2.1 以上,[下载地址](https://docs.scylladb.com/getting-started/) +> +> 修改 hugegraph.properties +> +> ```properties +> backend=scylladb +> serializer=scylladb +> +> # cassandra backend config +> cassandra.host=localhost +> cassandra.port=9042 +> cassandra.username= +> cassandra.password= +> #cassandra.connect_timeout=5 +> #cassandra.read_timeout=20 +> +> #cassandra.keyspace.strategy=SimpleStrategy +> #cassandra.keyspace.replication=3 +> ``` +> +> 由于 scylladb 数据库本身就是基于 cassandra 的"优化版",如果用户未安装 scylladb,也可以直接使用 cassandra 作为后端存储,只需要把 backend 和 serializer 修改为 scylladb,host 和 post 指向 cassandra 集群的 seeds 和 port 即可,但是并不建议这样做,这样发挥不出 scylladb 本身的优势了。 +> +> 初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> 启动 server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` -##### 5.1.8 启动 server 的时候创建示例图 +#### 5.1.8 启动 server 的时候创建示例图 在启动脚本时携带 `-p true` 参数,表示开启 preload,即创建示例图。 @@ -616,77 +587,73 @@ Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)......OK 代表创建示例图成功。 -#### 5.2 使用 Docker +### 5.2 使用 Docker 在 [3.1 使用 Docker 容器](#31-使用-docker-容器-便于测试) 中,我们已经介绍了如何使用 `docker` 部署 `hugegraph-server`。此外,也可以通过切换后端存储或设置参数,在 Server 启动时加载样例图。 -##### 5.2.1 使用 Cassandra 作为后端 +#### 5.2.1 使用 Cassandra 作为后端 > ⚠️ **已废弃**: Cassandra 后端从 HugeGraph 1.7.0 版本开始已移除。如需使用,请参考 1.5.x 版本文档。 -
-点击展开/折叠 Cassandra 配置及启动方法 - -在使用 Docker 的时候,我们可以使用 Cassandra 作为后端存储。我们更加推荐直接使用 docker-compose 来对于 server 以及 Cassandra 进行统一管理 - -样例的 `docker-compose.yml` 可以在 [github](https://github.com/apache/hugegraph/blob/master/hugegraph-server/hugegraph-dist/docker/example/docker-compose-cassandra.yml) 中获取,使用 `docker-compose up -d` 启动。(如果使用 cassandra 4.0 版本作为后端存储,则需要大约两个分钟初始化,请耐心等待) - -```yaml -version: "3" - -services: - server: - image: hugegraph/hugegraph - container_name: cas-server - ports: - - 8080:8080 - environment: - hugegraph.backend: cassandra - hugegraph.serializer: cassandra - hugegraph.cassandra.host: cas-cassandra - hugegraph.cassandra.port: 9042 - networks: - - ca-network - depends_on: - - cassandra - healthcheck: - test: ["CMD", "bin/gremlin-console.sh", "--" ,"-e", "scripts/remote-connect.groovy"] - interval: 10s - timeout: 30s - retries: 3 - - cassandra: - image: cassandra:4 - container_name: cas-cassandra - ports: - - 7000:7000 - - 9042:9042 - security_opt: - - seccomp:unconfined - networks: - - ca-network - healthcheck: - test: ["CMD", "cqlsh", "--execute", "describe keyspaces;"] - interval: 10s - timeout: 30s - retries: 5 - -networks: - ca-network: - -volumes: - hugegraph-data: -``` - -在这个 yaml 中,需要在环境变量中以 `hugegraph.`的形式进行参数传递,配置 Cassandra 相关的参数。 - -具体来说,在 `hugegraph.properties` 配置文件中,提供了 `backend=xxx`、`cassandra.host=xxx` 等配置项。为了通过环境变量传递这些配置,需要在配置项前加上 `hugegraph.`,例如 `hugegraph.backend` 和 `hugegraph.cassandra.host`。 - -其他配置可以参照 [4 配置](#4-配置) - -
+> [!DETAILS]- 点击展开/折叠 Cassandra 配置及启动方法 +> 在使用 Docker 的时候,我们可以使用 Cassandra 作为后端存储。我们更加推荐直接使用 docker-compose 来对于 server 以及 Cassandra 进行统一管理 +> +> 样例的 `docker-compose.yml` 可以在 [github](https://github.com/apache/hugegraph/blob/master/hugegraph-server/hugegraph-dist/docker/example/docker-compose-cassandra.yml) 中获取,使用 `docker-compose up -d` 启动。(如果使用 cassandra 4.0 版本作为后端存储,则需要大约两个分钟初始化,请耐心等待) +> +> ```yaml +> version: "3" +> +> services: +> server: +> image: hugegraph/hugegraph +> container_name: cas-server +> ports: +> - 8080:8080 +> environment: +> hugegraph.backend: cassandra +> hugegraph.serializer: cassandra +> hugegraph.cassandra.host: cas-cassandra +> hugegraph.cassandra.port: 9042 +> networks: +> - ca-network +> depends_on: +> - cassandra +> healthcheck: +> test: ["CMD", "bin/gremlin-console.sh", "--" ,"-e", "scripts/remote-connect.groovy"] +> interval: 10s +> timeout: 30s +> retries: 3 +> +> cassandra: +> image: cassandra:4 +> container_name: cas-cassandra +> ports: +> - 7000:7000 +> - 9042:9042 +> security_opt: +> - seccomp:unconfined +> networks: +> - ca-network +> healthcheck: +> test: ["CMD", "cqlsh", "--execute", "describe keyspaces;"] +> interval: 10s +> timeout: 30s +> retries: 5 +> +> networks: +> ca-network: +> +> volumes: +> hugegraph-data: +> ``` +> +> 在这个 yaml 中,需要在环境变量中以 `hugegraph.`的形式进行参数传递,配置 Cassandra 相关的参数。 +> +> 具体来说,在 `hugegraph.properties` 配置文件中,提供了 `backend=xxx`、`cassandra.host=xxx` 等配置项。为了通过环境变量传递这些配置,需要在配置项前加上 `hugegraph.`,例如 `hugegraph.backend` 和 `hugegraph.cassandra.host`。 +> +> 其他配置可以参照 [4 配置](#4-配置) -##### 5.2.2 启动 server 的时候创建示例图 +#### 5.2.2 启动 server 的时候创建示例图 在 Docker 启动时设置环境变量 `PRELOAD=true`,即可在启动脚本执行过程中加载样例数据。 @@ -726,9 +693,9 @@ volumes: 代表创建示例图成功。 -### 6 访问 Server +## 6 访问 Server -#### 6.1 服务启动状态校验 +### 6.1 服务启动状态校验 `jps` 查看服务进程 @@ -745,7 +712,7 @@ echo `curl -o /dev/null -s -w %{http_code} "http://localhost:8080/graphs/hugegra 返回结果 200,代表 server 启动正常 -#### 6.2 请求 Server +### 6.2 请求 Server HugeGraphServer 的 RESTful API 包括多种类型的资源,典型的包括 graph、schema、gremlin、traverser 和 task @@ -755,7 +722,7 @@ HugeGraphServer 的 RESTful API 包括多种类型的资源,典型的包括 gr - `traverser` 包含各种高级查询,包括最短路径、交叉点、N 步可达邻居等 - `task` 包含异步任务的查询和删除 -##### 6.2.1 获取 `hugegraph` 的顶点及相关属性 +#### 6.2.1 获取 `hugegraph` 的顶点及相关属性 ```bash curl http://localhost:8080/graphs/hugegraph/graph/vertices @@ -838,28 +805,28 @@ _说明_ 另外也可以通过访问 `localhost:8080/swagger-ui/index.html` 查看 API。
- image + Swagger UI 中的 HugeGraph RESTful API 接口列表
在使用 Swagger UI 调试 HugeGraph 提供的 API 时,如果 HugeGraph Server 开启了鉴权模式,可以在 Swagger 页面输入鉴权信息。
- image + HugeGraph Swagger UI 中的 Authorize 按钮
当前 HugeGraph 支持基于 Basic 和 Bearer 两种形式设置鉴权信息。
- image + Swagger UI 授权对话框中的 Basic 和 Bearer 凭据输入框
-### 7 停止 Server +## 7 停止 Server ```bash $cd *hugegraph-${version} $bin/stop-hugegraph.sh ``` -### 8 使用 IntelliJ IDEA 调试 Server +## 8 使用 IntelliJ IDEA 调试 Server 请参考[在 IDEA 中配置 Server 开发环境](/docs/contribution-guidelines/hugegraph-server-idea-setup) diff --git a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md index 622fb8fd1..a38c45a67 100644 --- a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md @@ -93,20 +93,16 @@ git clone https://github.com/apache/hugegraph-toolchain.git wget https://downloads.apache.org/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}-src.tar.gz ``` -
-点击展开/折叠 手动安装 ojdbc 方法 - -由于 Oracle ojdbc license 的限制,需要手动安装 ojdbc 到本地 maven 仓库。 -访问 [Oracle jdbc 下载](https://www.oracle.com/database/technologies/appdev/jdbc-drivers-archive.html) 页面。选择 Oracle Database 12c Release 2 (12.2.0.1) drivers,如下图所示。 - -打开链接后,选择“ojdbc8.jar” - -把 ojdbc8 安装到本地 maven 仓库,进入`ojdbc8.jar`所在目录,执行以下命令。 -``` -mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar -``` - -
+> [!DETAILS]- 点击展开/折叠 手动安装 ojdbc 方法 +> 由于 Oracle ojdbc license 的限制,需要手动安装 ojdbc 到本地 maven 仓库。 +> 访问 [Oracle jdbc 下载](https://www.oracle.com/database/technologies/appdev/jdbc-drivers-archive.html) 页面。选择 Oracle Database 12c Release 2 (12.2.0.1) drivers,如下图所示。 +> +> 打开链接后,选择“ojdbc8.jar” +> +> 把 ojdbc8 安装到本地 maven 仓库,进入`ojdbc8.jar`所在目录,执行以下命令。 +> ``` +> mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar +> ``` 编译生成 tar 包: @@ -132,7 +128,7 @@ mvn clean package -DskipTests "软件"有:"名字"、"售卖价格"等属性;边"认识"有:"日期"属性等。
- image + 由“认识”和“创建”边连接人物与软件顶点的示例图

示例图模型

@@ -295,302 +291,290 @@ Office,388 > 注意:0.11.0 版本以前的映射文件与 0.11.0 以后的格式变化较大,为表述方便,下面称 0.11.0 以前的映射文件(格式)为 1.0 版本,0.11.0 以后的为 2.0 版本。并且若无特殊说明,“映射文件”表示的是 2.0 版本的。 -
-点击展开/折叠 2.0 版本的映射文件的框架 - -```json -{ - "version": "2.0", - "structs": [ - { - "id": "1", - "input": { - }, - "vertices": [ - {}, - {} - ], - "edges": [ - {}, - {} - ] - } - ] -} -``` - -
+> [!DETAILS]- 点击展开/折叠 2.0 版本的映射文件的框架 +> ```json +> { +> "version": "2.0", +> "structs": [ +> { +> "id": "1", +> "input": { +> }, +> "vertices": [ +> {}, +> {} +> ], +> "edges": [ +> {}, +> {} +> ] +> } +> ] +> } +> ```
这里直接给出两个版本的映射文件(描述了上面图模型和数据文件) -
-点击展开/折叠 2.0 版本的映射文件 - -```json -{ - "version": "2.0", - "structs": [ - { - "id": "1", - "skip": false, - "input": { - "type": "FILE", - "path": "vertex_person.csv", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "CSV", - "delimiter": ",", - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": [ - "name", - "age", - "city" - ], - "charset": "UTF-8", - "list_format": { - "start_symbol": "[", - "elem_delimiter": "|", - "end_symbol": "]" - } - }, - "vertices": [ - { - "label": "person", - "skip": false, - "id": null, - "unfold": false, - "field_mapping": {}, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ], - "edges": [] - }, - { - "id": "2", - "skip": false, - "input": { - "type": "FILE", - "path": "vertex_software.csv", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "CSV", - "delimiter": ",", - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": null, - "charset": "UTF-8", - "list_format": { - "start_symbol": "", - "elem_delimiter": ",", - "end_symbol": "" - } - }, - "vertices": [ - { - "label": "software", - "skip": false, - "id": null, - "unfold": false, - "field_mapping": {}, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ], - "edges": [] - }, - { - "id": "3", - "skip": false, - "input": { - "type": "FILE", - "path": "edge_knows.json", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "JSON", - "delimiter": null, - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": null, - "charset": "UTF-8", - "list_format": null - }, - "vertices": [], - "edges": [ - { - "label": "knows", - "skip": false, - "source": [ - "source_name" - ], - "unfold_source": false, - "target": [ - "target_name" - ], - "unfold_target": false, - "field_mapping": { - "source_name": "name", - "target_name": "name" - }, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ] - }, - { - "id": "4", - "skip": false, - "input": { - "type": "FILE", - "path": "edge_created.json", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "JSON", - "delimiter": null, - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": null, - "charset": "UTF-8", - "list_format": null - }, - "vertices": [], - "edges": [ - { - "label": "created", - "skip": false, - "source": [ - "source_name" - ], - "unfold_source": false, - "target": [ - "target_name" - ], - "unfold_target": false, - "field_mapping": { - "source_name": "name", - "target_name": "name" - }, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ] - } - ] -} -``` - -
+> [!DETAILS]- 点击展开/折叠 2.0 版本的映射文件 +> ```json +> { +> "version": "2.0", +> "structs": [ +> { +> "id": "1", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "vertex_person.csv", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "CSV", +> "delimiter": ",", +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": [ +> "name", +> "age", +> "city" +> ], +> "charset": "UTF-8", +> "list_format": { +> "start_symbol": "[", +> "elem_delimiter": "|", +> "end_symbol": "]" +> } +> }, +> "vertices": [ +> { +> "label": "person", +> "skip": false, +> "id": null, +> "unfold": false, +> "field_mapping": {}, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ], +> "edges": [] +> }, +> { +> "id": "2", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "vertex_software.csv", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "CSV", +> "delimiter": ",", +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": null, +> "charset": "UTF-8", +> "list_format": { +> "start_symbol": "", +> "elem_delimiter": ",", +> "end_symbol": "" +> } +> }, +> "vertices": [ +> { +> "label": "software", +> "skip": false, +> "id": null, +> "unfold": false, +> "field_mapping": {}, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ], +> "edges": [] +> }, +> { +> "id": "3", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "edge_knows.json", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "JSON", +> "delimiter": null, +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": null, +> "charset": "UTF-8", +> "list_format": null +> }, +> "vertices": [], +> "edges": [ +> { +> "label": "knows", +> "skip": false, +> "source": [ +> "source_name" +> ], +> "unfold_source": false, +> "target": [ +> "target_name" +> ], +> "unfold_target": false, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> }, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ] +> }, +> { +> "id": "4", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "edge_created.json", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "JSON", +> "delimiter": null, +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": null, +> "charset": "UTF-8", +> "list_format": null +> }, +> "vertices": [], +> "edges": [ +> { +> "label": "created", +> "skip": false, +> "source": [ +> "source_name" +> ], +> "unfold_source": false, +> "target": [ +> "target_name" +> ], +> "unfold_target": false, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> }, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ] +> } +> ] +> } +> ```
-
-点击展开/折叠 1.0 版本的映射文件 - -```json -{ - "vertices": [ - { - "label": "person", - "input": { - "type": "file", - "path": "vertex_person.csv", - "format": "CSV", - "header": ["name", "age", "city"], - "charset": "UTF-8" - } - }, - { - "label": "software", - "input": { - "type": "file", - "path": "vertex_software.csv", - "format": "CSV" - } - } - ], - "edges": [ - { - "label": "knows", - "source": ["source_name"], - "target": ["target_name"], - "input": { - "type": "file", - "path": "edge_knows.json", - "format": "JSON" - }, - "field_mapping": { - "source_name": "name", - "target_name": "name" - } - }, - { - "label": "created", - "source": ["source_name"], - "target": ["target_name"], - "input": { - "type": "file", - "path": "edge_created.json", - "format": "JSON" - }, - "field_mapping": { - "source_name": "name", - "target_name": "name" - } - } - ] -} -``` - -
+> [!DETAILS]- 点击展开/折叠 1.0 版本的映射文件 +> ```json +> { +> "vertices": [ +> { +> "label": "person", +> "input": { +> "type": "file", +> "path": "vertex_person.csv", +> "format": "CSV", +> "header": ["name", "age", "city"], +> "charset": "UTF-8" +> } +> }, +> { +> "label": "software", +> "input": { +> "type": "file", +> "path": "vertex_software.csv", +> "format": "CSV" +> } +> } +> ], +> "edges": [ +> { +> "label": "knows", +> "source": ["source_name"], +> "target": ["target_name"], +> "input": { +> "type": "file", +> "path": "edge_knows.json", +> "format": "JSON" +> }, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> } +> }, +> { +> "label": "created", +> "source": ["source_name"], +> "target": ["target_name"], +> "input": { +> "type": "file", +> "path": "edge_created.json", +> "format": "JSON" +> }, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> } +> } +> ] +> } +> ```
映射文件 1.0 版本是以顶点和边为中心,设置输入源;而 2.0 版本是以输入源为中心,设置顶点和边映射。有些输入源(比如一个文件)既能生成顶点,也能生成边,如果用 1.0 版的格式写,就需要在 vertex 和 edge 映射块中各写一次 input 块,这两次的 input 块是完全一样的;而 2.0 版本只需要写一次 input。所以 2.0 版相比于 1.0 版,能省掉一些 input 的重复书写。 @@ -956,104 +940,98 @@ id|name|lang|price|ISBN #### 4.2 编写 schema -
-点击展开/折叠 schema 文件:example/file/schema.groovy - -```groovy -schema.propertyKey("name").asText().ifNotExist().create(); -schema.propertyKey("age").asInt().ifNotExist().create(); -schema.propertyKey("city").asText().ifNotExist().create(); -schema.propertyKey("weight").asDouble().ifNotExist().create(); -schema.propertyKey("lang").asText().ifNotExist().create(); -schema.propertyKey("date").asText().ifNotExist().create(); -schema.propertyKey("price").asDouble().ifNotExist().create(); - -schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create(); -schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create(); - -schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create(); -schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create(); -schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create(); -schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create(); - -schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create(); -schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create(); - -schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create(); -schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create(); -schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create(); -``` -
+> [!DETAILS]- 点击展开/折叠 schema 文件:example/file/schema.groovy +> ```groovy +> schema.propertyKey("name").asText().ifNotExist().create(); +> schema.propertyKey("age").asInt().ifNotExist().create(); +> schema.propertyKey("city").asText().ifNotExist().create(); +> schema.propertyKey("weight").asDouble().ifNotExist().create(); +> schema.propertyKey("lang").asText().ifNotExist().create(); +> schema.propertyKey("date").asText().ifNotExist().create(); +> schema.propertyKey("price").asDouble().ifNotExist().create(); +> +> schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create(); +> schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create(); +> +> schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create(); +> schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create(); +> schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create(); +> schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create(); +> +> schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create(); +> schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create(); +> +> schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create(); +> schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create(); +> schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create(); +> ``` #### 4.3 编写输入源映射文件`example/file/struct.json` -
-点击展开/折叠 源映射文件 example/file/struct.json - -```json -{ - "vertices": [ - { - "label": "person", - "input": { - "type": "file", - "path": "example/file/vertex_person.csv", - "format": "CSV", - "header": ["name", "age", "city"], - "charset": "UTF-8", - "skipped_line": { - "regex": "(^#|^//).*" - } - }, - "null_values": ["NULL", "null", ""] - }, - { - "label": "software", - "input": { - "type": "file", - "path": "example/file/vertex_software.txt", - "format": "TEXT", - "delimiter": "|", - "charset": "GBK" - }, - "id": "id", - "ignored": ["ISBN"] - } - ], - "edges": [ - { - "label": "knows", - "source": ["source_name"], - "target": ["target_name"], - "input": { - "type": "file", - "path": "example/file/edge_knows.json", - "format": "JSON", - "date_format": "yyyyMMdd" - }, - "field_mapping": { - "source_name": "name", - "target_name": "name" - } - }, - { - "label": "created", - "source": ["source_name"], - "target": ["target_id"], - "input": { - "type": "file", - "path": "example/file/edge_created.json", - "format": "JSON", - "date_format": "yyyy-MM-dd" - }, - "field_mapping": { - "source_name": "name" - } - } - ] -} -``` -
+> [!DETAILS]- 点击展开/折叠 源映射文件 example/file/struct.json +> ```json +> { +> "vertices": [ +> { +> "label": "person", +> "input": { +> "type": "file", +> "path": "example/file/vertex_person.csv", +> "format": "CSV", +> "header": ["name", "age", "city"], +> "charset": "UTF-8", +> "skipped_line": { +> "regex": "(^#|^//).*" +> } +> }, +> "null_values": ["NULL", "null", ""] +> }, +> { +> "label": "software", +> "input": { +> "type": "file", +> "path": "example/file/vertex_software.txt", +> "format": "TEXT", +> "delimiter": "|", +> "charset": "GBK" +> }, +> "id": "id", +> "ignored": ["ISBN"] +> } +> ], +> "edges": [ +> { +> "label": "knows", +> "source": ["source_name"], +> "target": ["target_name"], +> "input": { +> "type": "file", +> "path": "example/file/edge_knows.json", +> "format": "JSON", +> "date_format": "yyyyMMdd" +> }, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> } +> }, +> { +> "label": "created", +> "source": ["source_name"], +> "target": ["target_id"], +> "input": { +> "type": "file", +> "path": "example/file/edge_created.json", +> "format": "JSON", +> "date_format": "yyyy-MM-dd" +> }, +> "field_mapping": { +> "source_name": "name" +> } +> } +> ] +> } +> ``` #### 4.4 执行命令导入 diff --git a/content/cn/featured-background.jpg b/content/cn/featured-background.jpg index 8efa5cad4..a67fd5e3c 100644 Binary files a/content/cn/featured-background.jpg and b/content/cn/featured-background.jpg differ diff --git a/content/en/_index.html b/content/en/_index.html deleted file mode 100644 index c4ecb2f90..000000000 --- a/content/en/_index.html +++ /dev/null @@ -1,101 +0,0 @@ -+++ -title = "HugeGraph Website" -linkTitle = "Huge Docs" - -+++ -{{< blocks/cover image_anchor="top" height="full" color="orange">}} - -
- -

Apache - HugeGraph -

- - }}"> - Learn More - - }}"> - Download - -

HugeGraph is a full-stack graph system covering }}">graph database, }}">graph computing, and }}">graph AI.

-

It provides complete graph data processing capabilities from storage and real-time querying to offline analysis, and supports both }}">Gremlin and }}">Cypher query languages.

- {{< blocks/link-down color="info" >}} -
-{{< /blocks/cover >}} - - -{{% blocks/lead color="primary" %}} -

HugeGraph supports high-speed import and millisecond-level real-time queries for up to hundreds of billions of graph data, with deep integration with big data platforms like Spark and Flink, and can use the }}">HugeGraph toolchain for data import, visualization, and operations.

-

In the AI era, combined with Large Language Models (LLMs), it provides powerful graph computing capabilities for intelligent Q&A, recommendation systems, fraud detection, and knowledge graph applications.

-{{% /blocks/lead %}} - -{{< blocks/section color="dark" >}} -{{% blocks/feature icon="fa-lightbulb" title="Convenient" %}} -Supports Gremlin graph query language and [**RESTful API**]({{< relref "/docs/clients/restful-api" >}}), and provides commonly used graph retrieval interfaces. It includes a complete set of supporting tools with distributed storage, data replication, horizontal scaling, and multiple built-in backend storage engines for efficient query and analysis workflows. -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-shipping-fast" title="Efficient" %}} -Deeply optimized for graph storage and graph computing, it provides [**batch import tools**]({{< relref "/docs/quickstart/toolchain/hugegraph-loader" >}}) to efficiently ingest massive data, achieves millisecond-level graph retrieval latency with optimized queries, and supports concurrent online operations for thousands of users. -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-exchange-alt" title="Adaptable" %}} -Supports the Apache Gremlin standard graph query language and the Property Graph modeling method, with both OLTP and [**OLAP graph computing**]({{< relref "/docs/quickstart/computing/hugegraph-computer" >}}) scenarios. It can be integrated with Hadoop and Spark and can extend backend storage engines through plug-ins. -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-brain" title="AI-Ready" %}} -Integrates LLM with [**GraphRAG capabilities**]({{< relref "/docs/quickstart/hugegraph-ai" >}}), automated knowledge graph construction, and 20+ built-in graph machine learning algorithms to build AI-driven graph applications. -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-expand-arrows-alt" title="Scalable" %}} -Supports horizontal scaling and distributed deployment, seamlessly migrating from standalone to PB-level clusters, and provides [**distributed storage engine**]({{< relref "/docs/quickstart/hugegraph/hugegraph-hstore" >}}) options for different scale and performance requirements. -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fa-puzzle-piece" title="Open Ecosystem" %}} -Adheres to Apache TinkerPop standards, provides [**multi-language clients**]({{< relref "/docs/quickstart/client/hugegraph-client" >}}), is compatible with mainstream big data platforms, and is backed by an active and evolving community. -{{% /blocks/feature %}} - - -{{< /blocks/section >}} - - -{{< blocks/section color="blue-deep">}} -
-

The First Apache Foundation Top-Level Graph Project

-
- -{{< /blocks/section >}} - - - -{{< blocks/section >}} -{{% blocks/feature icon="far fa-tools" title="Get The **Toolchain**" %}} -[It](https://github.com/apache/hugegraph-toolchain) includes graph loader & dashboard & backup tools -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fab fa-github" title="Efficient" url="https://github.com/apache/hugegraph" %}} -We do a [Pull Request](https://github.com/apache/hugegraph/pulls) contributions workflow on **GitHub**. New users are always welcome! -{{% /blocks/feature %}} - - -{{% blocks/feature icon="fab fa-slack" title="Join us on Slack!" url="https://the-asf.slack.com/archives/C059UU2FJ23" %}} -Join the [ASF Slack channel](https://the-asf.slack.com/archives/C059UU2FJ23) for community discussions - -Could also follow the WeChat account "HugeGraph" for updates -{{% /blocks/feature %}} - - -{{< /blocks/section >}} - -{{< blocks/section color="blue-light">}} - -
-

Welcome to the HugeGraph open source community!

-
- -{{< /blocks/section >}} diff --git a/content/en/_index.md b/content/en/_index.md new file mode 100644 index 000000000..aa8e0480c --- /dev/null +++ b/content/en/_index.md @@ -0,0 +1,5 @@ +--- +title: Apache HugeGraph +description: A full-stack graph database ecosystem for OLTP, OLAP, and graph AI. +--- + diff --git a/content/en/about/_index.html b/content/en/about/_index.html deleted file mode 100644 index 3e7e87732..000000000 --- a/content/en/about/_index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: About Apache HugeGraph -linkTitle: About -draft: true -menu: - main: - weight: 10 - ---- - -> TODO: delete or update this page - -{{< blocks/cover title="About Apache HugeGraph" image_anchor="bottom" height="min" >}} - -

A sample site using the Docsy Hugo theme. -

- -{{< /blocks/cover >}} - -{{% blocks/lead %}} -Goldydocs is a sample site using the Docsy Hugo theme that shows what it can do and provides you with a template site structure. It’s designed for you to clone and edit as much as you like. See the different sections of the documentation and site for more ideas. -{{% /blocks/lead %}} - - -{{< blocks/section >}} -
-

This is another section

-
- -{{< /blocks/section >}} - - - -{{< blocks/section >}} - -
-

This is another section

-
- -{{< /blocks/section >}} diff --git a/content/en/about/_index.md b/content/en/about/_index.md new file mode 100644 index 000000000..219e9005d --- /dev/null +++ b/content/en/about/_index.md @@ -0,0 +1,8 @@ +--- +title: About Apache HugeGraph +linkTitle: About +layout: landing +landing: about +outputs: [HTML, print, markdown] +--- + diff --git a/content/en/blog/_index.md b/content/en/blog/_index.md index f6b7ad3d2..056b3c978 100644 --- a/content/en/blog/_index.md +++ b/content/en/blog/_index.md @@ -1,9 +1,6 @@ --- title: "Blog" linkTitle: "Blog" -menu: - main: - weight: 30 --- Welcome to HugeGraph Blog! diff --git a/content/en/community/_index.md b/content/en/community/_index.md index 1ae39a248..b2db429c7 100644 --- a/content/en/community/_index.md +++ b/content/en/community/_index.md @@ -1,8 +1,7 @@ --- title: Community -menu: - main: - weight: 40 +linkTitle: Community +layout: landing +landing: community +outputs: [HTML, print, markdown] --- - -Visit the [Project Maturity]({{< relref "maturity" >}}) assessment. diff --git a/content/en/docs/CLA.md b/content/en/docs/CLA.md index 784a53a62..fb42d683b 100644 --- a/content/en/docs/CLA.md +++ b/content/en/docs/CLA.md @@ -1,3 +1,10 @@ +--- +title: "Contributor Agreement" +linkTitle: "Contributor Agreement" +weight: 100 +search_exclude: true +--- + ## Contributor Agreement ## Individual Contributor exclusive License Agreement diff --git a/content/en/docs/SUMMARY.md b/content/en/docs/SUMMARY.md index 44321bcfe..849b03b08 100644 --- a/content/en/docs/SUMMARY.md +++ b/content/en/docs/SUMMARY.md @@ -1,3 +1,8 @@ +--- +title: "Legacy GitBook Summary" +draft: true +--- + # HugeGraph Docs * [Download](download/download) @@ -55,12 +60,9 @@ * [HugeGraph API Performance—Outdated](performance/api-performance) * [v0.5.6 Stand-alone(RocksDB)](performance/api-performance/hugegraph-api-0.5.6-rocksdb) * [v0.5.6 Cluster(Cassandra)](performance/api-performance/hugegraph-api-0.5.6-cassandra) - * [v0.4.4](performance/api-performance/hugegraph-api-0.4.4) - * [v0.2](performance/api-performance/hugegraph-api-0.2) * [HugeGraph-Loader Performance](performance/hugegraph-loader-performance) ## ChangeLogs * [Release-1.3.0](changelog/hugegraph-1.3.0-release-notes) * [Release-1.2.0](changelog/hugegraph-1.2.0-release-notes) * [Release-1.0.0](changelog/hugegraph-1.0.0-release-notes) -* [Release-0.12.0](changelog/hugegraph-0.12.0-release-notes) diff --git a/content/en/docs/_index.md b/content/en/docs/_index.md index 764881c01..ea8f7bf37 100755 --- a/content/en/docs/_index.md +++ b/content/en/docs/_index.md @@ -2,9 +2,6 @@ title: "Documentation" linkTitle: "Documentation" weight: 20 -menu: - main: - weight: 20 --- ## Apache HugeGraph Documentation diff --git a/content/en/docs/_nav/components.md b/content/en/docs/_nav/components.md new file mode 100644 index 000000000..1e5d9bdaf --- /dev/null +++ b/content/en/docs/_nav/components.md @@ -0,0 +1,13 @@ +--- +title: "Components" +linkTitle: "Components" +description: "Start with HugeGraph, then explore toolchain, computing, and AI components." +manual_link: /docs/quickstart/hugegraph/ +sidebar_expanded: true +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/en/docs/_nav/develop.md b/content/en/docs/_nav/develop.md new file mode 100644 index 000000000..8bba52ba1 --- /dev/null +++ b/content/en/docs/_nav/develop.md @@ -0,0 +1,13 @@ +--- +title: "Develop" +linkTitle: "Develop" +description: "Start with client APIs, then browse query languages and development guides." +manual_link: /docs/clients/ +sidebar_expanded: true +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/en/docs/_nav/operate.md b/content/en/docs/_nav/operate.md new file mode 100644 index 000000000..e2b1ec1a1 --- /dev/null +++ b/content/en/docs/_nav/operate.md @@ -0,0 +1,12 @@ +--- +title: "Operate" +linkTitle: "Operate" +description: "Start with configuration, then browse security, backup, and performance guidance." +manual_link: /docs/config/ +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/en/docs/_nav/reference.md b/content/en/docs/_nav/reference.md new file mode 100644 index 000000000..9195ec705 --- /dev/null +++ b/content/en/docs/_nav/reference.md @@ -0,0 +1,12 @@ +--- +title: "Reference" +linkTitle: "Reference" +description: "Start with release notes, then browse downloads, contribution, and legal references." +manual_link: /docs/changelog/ +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/en/docs/_nav/start.md b/content/en/docs/_nav/start.md new file mode 100644 index 000000000..cb9ae9a48 --- /dev/null +++ b/content/en/docs/_nav/start.md @@ -0,0 +1,13 @@ +--- +title: "Get Started" +linkTitle: "Get Started" +description: "Install HugeGraph, run the server, and make your first graph query." +manual_link: /docs/quickstart/ +sidebar_expanded: true +search_exclude: true +toc_hide: true +pager: false +build: + render: link + list: never +--- diff --git a/content/en/docs/clients/restful-api/traverser.md b/content/en/docs/clients/restful-api/traverser.md index 1f7a1e49f..605917741 100644 --- a/content/en/docs/clients/restful-api/traverser.md +++ b/content/en/docs/clients/restful-api/traverser.md @@ -59,7 +59,7 @@ In the following, we provide a detailed explanation of the Traverser API: The usage examples provided in this section are based on the graph presented on the TinkerPop official website: -![tinkerpop example graph](http://tinkerpop.apache.org/docs/3.4.0/images/tinkerpop-modern.png) +![TinkerPop example graph](/images/docs/graphs/tinkerpop-modern.png) The data import program is as follows: diff --git a/content/en/docs/config/config-option.md b/content/en/docs/config/config-option.md index 43343481d..c19057b44 100644 --- a/content/en/docs/config/config-option.md +++ b/content/en/docs/config/config-option.md @@ -2,6 +2,11 @@ title: "Server Complete Configuration Manual" linkTitle: "Server Complete Configuration Manual" weight: 2 +search_keywords: + - gremlin.graph + - rest-server.properties + - hugegraph.properties +search_boost: 1.5 --- ### Gremlin Server Config Options @@ -196,55 +201,43 @@ Basic Config Options and Backend Config Options correspond to configuration file | rocksdb.level0_stop_writes_trigger | 36 | Hard limit on number of level-0 files for stopping writes. | | rocksdb.soft_pending_compaction_bytes_limit | 68719476736 | The soft limit to impose on pending compaction in bytes. | -
-K8s Config Options (Optional) - -Corresponding configuration file `rest-server.properties` - -| config option | default value | description | -|------------------|-------------------------------|------------------------------------------| -| server.use_k8s | false | Whether to enable K8s multi-tenancy mode. | -| k8s.namespace | hugegraph-computer-system | K8s namespace for compute jobs. | -| k8s.kubeconfig | | Path to kubeconfig file. | - -
- -
-Arthas Diagnostic Config Options (Optional) - -Corresponding configuration file `rest-server.properties` - -| config option | default value | description | -|--------------------|---------------|-----------------------| -| arthas.telnetPort | 8562 | Arthas telnet port. | -| arthas.httpPort | 8561 | Arthas HTTP port. | -| arthas.ip | 0.0.0.0 | Arthas bind IP. | - -
- -
-HBase Backend Config Options - -| config option | default value | description | -|---------------------------|--------------------------------|--------------------------------------------------------------------------| -| backend | | Must be set to `hbase`. | -| serializer | | Must be set to `hbase`. | -| hbase.hosts | localhost | The hostnames or ip addresses of HBase zookeeper, separated with commas. | -| hbase.port | 2181 | The port address of HBase zookeeper. | -| hbase.threads_max | 64 | The max threads num of hbase connections. | -| hbase.znode_parent | /hbase | The znode parent path of HBase zookeeper. | -| hbase.zk_retry | 3 | The recovery retry times of HBase zookeeper. | -| hbase.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | -| hbase.kerberos_enable | false | Is Kerberos authentication enabled for HBase. | -| hbase.kerberos_keytab | | The HBase's key tab file for kerberos authentication. | -| hbase.kerberos_principal | | The HBase's principal for kerberos authentication. | -| hbase.krb5_conf | etc/krb5.conf | Kerberos configuration file, including KDC IP, default realm, etc. | -| hbase.hbase_site | /etc/hbase/conf/hbase-site.xml | The HBase's configuration file | -| hbase.enable_partition | true | Is pre-split partitions enabled for HBase. | -| hbase.vertex_partitions | 10 | The number of partitions of the HBase vertex table. | -| hbase.edge_partitions | 30 | The number of partitions of the HBase edge table. | - -
+> [!DETAILS]- **K8s Config Options (Optional)** +> Corresponding configuration file `rest-server.properties` +> +> | config option | default value | description | +> |------------------|-------------------------------|------------------------------------------| +> | server.use_k8s | false | Whether to enable K8s multi-tenancy mode. | +> | k8s.namespace | hugegraph-computer-system | K8s namespace for compute jobs. | +> | k8s.kubeconfig | | Path to kubeconfig file. | + +> [!DETAILS]- **Arthas Diagnostic Config Options (Optional)** +> Corresponding configuration file `rest-server.properties` +> +> | config option | default value | description | +> |--------------------|---------------|-----------------------| +> | arthas.telnetPort | 8562 | Arthas telnet port. | +> | arthas.httpPort | 8561 | Arthas HTTP port. | +> | arthas.ip | 0.0.0.0 | Arthas bind IP. | + +> [!DETAILS]- **HBase Backend Config Options** +> | config option | default value | description | +> |---------------------------|--------------------------------|--------------------------------------------------------------------------| +> | backend | | Must be set to `hbase`. | +> | serializer | | Must be set to `hbase`. | +> | hbase.hosts | localhost | The hostnames or ip addresses of HBase zookeeper, separated with commas. | +> | hbase.port | 2181 | The port address of HBase zookeeper. | +> | hbase.threads_max | 64 | The max threads num of hbase connections. | +> | hbase.znode_parent | /hbase | The znode parent path of HBase zookeeper. | +> | hbase.zk_retry | 3 | The recovery retry times of HBase zookeeper. | +> | hbase.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | +> | hbase.kerberos_enable | false | Is Kerberos authentication enabled for HBase. | +> | hbase.kerberos_keytab | | The HBase's key tab file for kerberos authentication. | +> | hbase.kerberos_principal | | The HBase's principal for kerberos authentication. | +> | hbase.krb5_conf | etc/krb5.conf | Kerberos configuration file, including KDC IP, default realm, etc. | +> | hbase.hbase_site | /etc/hbase/conf/hbase-site.xml | The HBase's configuration file | +> | hbase.enable_partition | true | Is pre-split partitions enabled for HBase. | +> | hbase.vertex_partitions | 10 | The number of partitions of the HBase vertex table. | +> | hbase.edge_partitions | 30 | The number of partitions of the HBase edge table. | --- @@ -253,70 +246,54 @@ Corresponding configuration file `rest-server.properties` The following backend stores are no longer supported in version 1.7.0+ and are only available in version 1.5.x and earlier: -
-Cassandra Backend Config Options - -| config option | default value | description | -|--------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------| -| backend | | Must be set to `cassandra`. | -| serializer | | Must be set to `cassandra`. | -| cassandra.host | localhost | The seeds hostname or ip address of cassandra cluster. | -| cassandra.port | 9042 | The seeds port address of cassandra cluster. | -| cassandra.connect_timeout | 5 | The cassandra driver connect server timeout(seconds). | -| cassandra.read_timeout | 20 | The cassandra driver read from server timeout(seconds). | -| cassandra.keyspace.strategy | SimpleStrategy | The replication strategy of keyspace, valid value is SimpleStrategy or NetworkTopologyStrategy. | -| cassandra.keyspace.replication | [3] | The keyspace replication factor of SimpleStrategy, like '[3]'.Or replicas in each datacenter of NetworkTopologyStrategy, like '[dc1:2,dc2:1]'. | -| cassandra.username | | The username to use to login to cassandra cluster. | -| cassandra.password | | The password corresponding to cassandra.username. | -| cassandra.compression_type | none | The compression algorithm of cassandra transport: none/snappy/lz4. | -| cassandra.jmx_port=7199 | 7199 | The port of JMX API service for cassandra. | -| cassandra.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | - -
- -
-ScyllaDB Backend Config Options - -| config option | default value | description | -|---------------|---------------|----------------------------| -| backend | | Must be set to `scylladb`. | -| serializer | | Must be set to `scylladb`. | - -Other options are consistent with the Cassandra backend. - -
- -
-MySQL & PostgreSQL Backend Config Options - -| config option | default value | description | -|----------------------------------|-----------------------------|-------------------------------------------------------------------------------------| -| backend | | Must be set to `mysql`. | -| serializer | | Must be set to `mysql`. | -| jdbc.driver | com.mysql.jdbc.Driver | The JDBC driver class to connect database. | -| jdbc.url | jdbc:mysql://127.0.0.1:3306 | The url of database in JDBC format. | -| jdbc.username | root | The username to login database. | -| jdbc.password | ****** | The password corresponding to jdbc.username. | -| jdbc.ssl_mode | false | The SSL mode of connections with database. | -| jdbc.reconnect_interval | 3 | The interval(seconds) between reconnections when the database connection fails. | -| jdbc.reconnect_max_times | 3 | The reconnect times when the database connection fails. | -| jdbc.storage_engine | InnoDB | The storage engine of backend store database, like InnoDB/MyISAM/RocksDB for MySQL. | -| jdbc.postgresql.connect_database | template1 | The database used to connect when init store, drop store or check store exist. | - -
- -
-PostgreSQL Backend Config Options - -| config option | default value | description | -|---------------|---------------|------------------------------| -| backend | | Must be set to `postgresql`. | -| serializer | | Must be set to `postgresql`. | - -Other options are consistent with the MySQL backend. - -> The driver and url of the PostgreSQL backend should be set to: -> - `jdbc.driver=org.postgresql.Driver` -> - `jdbc.url=jdbc:postgresql://localhost:5432/` - -
+> [!DETAILS]- **Cassandra Backend Config Options** +> | config option | default value | description | +> |--------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------| +> | backend | | Must be set to `cassandra`. | +> | serializer | | Must be set to `cassandra`. | +> | cassandra.host | localhost | The seeds hostname or ip address of cassandra cluster. | +> | cassandra.port | 9042 | The seeds port address of cassandra cluster. | +> | cassandra.connect_timeout | 5 | The cassandra driver connect server timeout(seconds). | +> | cassandra.read_timeout | 20 | The cassandra driver read from server timeout(seconds). | +> | cassandra.keyspace.strategy | SimpleStrategy | The replication strategy of keyspace, valid value is SimpleStrategy or NetworkTopologyStrategy. | +> | cassandra.keyspace.replication | [3] | The keyspace replication factor of SimpleStrategy, like '[3]'.Or replicas in each datacenter of NetworkTopologyStrategy, like '[dc1:2,dc2:1]'. | +> | cassandra.username | | The username to use to login to cassandra cluster. | +> | cassandra.password | | The password corresponding to cassandra.username. | +> | cassandra.compression_type | none | The compression algorithm of cassandra transport: none/snappy/lz4. | +> | cassandra.jmx_port=7199 | 7199 | The port of JMX API service for cassandra. | +> | cassandra.aggregation_timeout | 43200 | The timeout in seconds of waiting for aggregation. | + +> [!DETAILS]- **ScyllaDB Backend Config Options** +> | config option | default value | description | +> |---------------|---------------|----------------------------| +> | backend | | Must be set to `scylladb`. | +> | serializer | | Must be set to `scylladb`. | +> +> Other options are consistent with the Cassandra backend. + +> [!DETAILS]- **MySQL & PostgreSQL Backend Config Options** +> | config option | default value | description | +> |----------------------------------|-----------------------------|-------------------------------------------------------------------------------------| +> | backend | | Must be set to `mysql`. | +> | serializer | | Must be set to `mysql`. | +> | jdbc.driver | com.mysql.jdbc.Driver | The JDBC driver class to connect database. | +> | jdbc.url | jdbc:mysql://127.0.0.1:3306 | The url of database in JDBC format. | +> | jdbc.username | root | The username to login database. | +> | jdbc.password | ****** | The password corresponding to jdbc.username. | +> | jdbc.ssl_mode | false | The SSL mode of connections with database. | +> | jdbc.reconnect_interval | 3 | The interval(seconds) between reconnections when the database connection fails. | +> | jdbc.reconnect_max_times | 3 | The reconnect times when the database connection fails. | +> | jdbc.storage_engine | InnoDB | The storage engine of backend store database, like InnoDB/MyISAM/RocksDB for MySQL. | +> | jdbc.postgresql.connect_database | template1 | The database used to connect when init store, drop store or check store exist. | + +> [!DETAILS]- **PostgreSQL Backend Config Options** +> | config option | default value | description | +> |---------------|---------------|------------------------------| +> | backend | | Must be set to `postgresql`. | +> | serializer | | Must be set to `postgresql`. | +> +> Other options are consistent with the MySQL backend. +> +> > The driver and url of the PostgreSQL backend should be set to: +> > - `jdbc.driver=org.postgresql.Driver` +> > - `jdbc.url=jdbc:postgresql://localhost:5432/` diff --git a/content/en/docs/contribution-guidelines/contribute.md b/content/en/docs/contribution-guidelines/contribute.md index 8f3e96973..80f91c85d 100644 --- a/content/en/docs/contribution-guidelines/contribute.md +++ b/content/en/docs/contribution-guidelines/contribute.md @@ -8,7 +8,8 @@ Thanks for taking the time to contribute! As an open source project, HugeGraph i The following is a contribution guide for HugeGraph: -image +![Fork the HugeGraph repository on GitHub](/images/docs/contribution/github-fork.png) +{width="884" height="462"} ## 1. Preparation @@ -120,14 +121,18 @@ git push origin bugfix-branch:bugfix-branch ``` Note that since GitHub requires submitting code through `username + token` (instead of using `username + password` directly), you need to create a GitHub token from https://github.com/settings/tokens: -image + +![Authenticate a Git push with a personal access token](/images/docs/contribution/github-authentication.png) +{width="1280" height="422"} ## 4. Create a Pull Request Go to the web page of GitHub fork repo, there would be a chance to create a Pull Request after pushing to a new branch, just click button "Compare & pull request" to do it. Then edit the description for proposed changes, which can just be copied from the commit message. Note: please make sure the email address you used to submit the code is bound to the GitHub account. For how to bind the email address, please refer to https://github.com/settings/emails: -image + +![Verify the commit email address in GitHub](/images/docs/contribution/github-email.png) +{width="1280" height="592"} ## 5. Code review diff --git a/content/en/docs/introduction/_index.md b/content/en/docs/introduction/_index.md index 00955a612..0a5715b72 100644 --- a/content/en/docs/introduction/_index.md +++ b/content/en/docs/introduction/_index.md @@ -142,4 +142,5 @@ docker run -itd --name=hugegraph -p 8080:8080 hugegraph/hugegraph - Security: [security@hugegraph.apache.org](mailto:security@hugegraph.apache.org) (Report security issues) - WeChat Public Account: Apache HugeGraph -WeChat QR Code +![WeChat QR Code](/images/docs/community/wechat.png) +{width="300" height="94"} diff --git a/content/en/docs/performance/hugegraph-benchmark-0.4.4.md b/content/en/docs/performance/hugegraph-benchmark-0.4.4.md index 08e951db5..be506c6cb 100644 --- a/content/en/docs/performance/hugegraph-benchmark-0.4.4.md +++ b/content/en/docs/performance/hugegraph-benchmark-0.4.4.md @@ -1,3 +1,9 @@ +--- +title: "HugeGraph 0.4.4 Benchmark" +linkTitle: "HugeGraph 0.4.4 Benchmark" +weight: 100 +--- + ### 1 测试环境 #### 1.1 硬件信息 diff --git a/content/en/docs/quickstart/hugegraph-ai/_index.md b/content/en/docs/quickstart/hugegraph-ai/_index.md index 26eb46322..15e309b08 100644 --- a/content/en/docs/quickstart/hugegraph-ai/_index.md +++ b/content/en/docs/quickstart/hugegraph-ai/_index.md @@ -4,8 +4,7 @@ linkTitle: "HugeGraph-AI" weight: 3 --- -[![License](https://img.shields.io/badge/license-Apache%202-0E78BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) -[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/apache/hugegraph-ai) +[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) · [Ask DeepWiki](https://deepwiki.com/apache/hugegraph-ai) > DeepWiki provides real-time updated project documentation with more comprehensive and accurate content, suitable for quickly understanding the latest project information. > @@ -124,7 +123,7 @@ from pyhugegraph.client import PyHugeClient ## 📦 Modules -### [hugegraph-llm](https://github.com/apache/hugegraph-ai/tree/main/hugegraph-llm) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/apache/hugegraph-ai) +### [hugegraph-llm](https://github.com/apache/hugegraph-ai/tree/main/hugegraph-llm) ([Ask DeepWiki](https://deepwiki.com/apache/hugegraph-ai)) Large language model integration for graph applications: - **GraphRAG**: Retrieval-augmented generation with graph data - **Knowledge Graph Construction**: Build KGs from text automatically @@ -168,7 +167,7 @@ We welcome contributions! Please see our [contribution guidelines](https://hugeg - Run `./style/code_format_and_analysis.sh` before submitting PRs - Check existing issues before reporting bugs -[![contributors graph](https://contrib.rocks/image?repo=apache/hugegraph-ai)](https://github.com/apache/hugegraph-ai/graphs/contributors) +[View the HugeGraph-AI contributors](https://github.com/apache/hugegraph-ai/graphs/contributors). ## 📄 License @@ -180,4 +179,5 @@ hugegraph-ai is licensed under [Apache 2.0 License](https://github.com/apache/hu - **Email**: [dev@hugegraph.apache.org](mailto:dev@hugegraph.apache.org) ([subscription required](https://hugegraph.apache.org/docs/contribution-guidelines/subscribe/)) - **WeChat**: Follow "Apache HugeGraph" on WeChat -Apache HugeGraph WeChat QR Code +![Apache HugeGraph WeChat QR Code](/images/docs/community/wechat.png) +{width="200" height="63"} diff --git a/content/en/docs/quickstart/hugegraph-ai/hugegraph-llm.md b/content/en/docs/quickstart/hugegraph-ai/hugegraph-llm.md index 509bb98be..77d01557d 100644 --- a/content/en/docs/quickstart/hugegraph-ai/hugegraph-llm.md +++ b/content/en/docs/quickstart/hugegraph-ai/hugegraph-llm.md @@ -8,7 +8,7 @@ weight: 1 > **Bridge the gap between Graph Databases and Large Language Models** -> AI summarizes the project documentation: [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/apache/hugegraph-ai) +> AI summarizes the project documentation: [Ask DeepWiki](https://deepwiki.com/apache/hugegraph-ai) ## 🎯 Overview @@ -136,7 +136,7 @@ Use the Gradio interface for visual knowledge graph building: - **Custom Schema**: JSON format following our [template](https://github.com/apache/hugegraph-ai/blob/aff3bbe25fa91c3414947a196131be812c20ef11/hugegraph-llm/src/hugegraph_llm/config/config_data.py#L125) - **HugeGraph Schema**: Use existing graph instance schema (e.g., "hugegraph") -![Knowledge Graph Builder](https://hugegraph.apache.org/docs/images/gradio-kg.png) +![Knowledge Graph Builder](/images/docs/hugegraph-ai/gradio-kg.jpg) #### Programmatic Construction diff --git a/content/en/docs/quickstart/hugegraph-ai/quick_start.md b/content/en/docs/quickstart/hugegraph-ai/quick_start.md index 04852db52..8d1ac794f 100644 --- a/content/en/docs/quickstart/hugegraph-ai/quick_start.md +++ b/content/en/docs/quickstart/hugegraph-ai/quick_start.md @@ -21,7 +21,7 @@ weight: 4 Construct a knowledge graph, chunk vector, and graph vid vector from the text. -![image](https://github.com/user-attachments/assets/f3366d46-2e31-4638-94c4-7214951ef77a) +![GraphRAG index construction flow](/images/docs/hugegraph-ai/quick-start-01.png) ```mermaid graph TD; @@ -81,7 +81,7 @@ This module consists of two parts: The first part handles single queries, while the second part handles multiple queries at once. Below is an explanation of the first part. -![image](https://github.com/user-attachments/assets/33698062-e46b-4757-8b5e-93e8f10eae65) +![HugeGraph RAG query interface](/images/docs/hugegraph-ai/quick-start-02.png) ```mermaid @@ -114,7 +114,7 @@ graph TD; - **Graph-only Answer:** Uses only graph-based retrieval (queries graph vid vectors in the vector database and the graph database) - **Graph-Vector Answer:** Uses both graph-based and vector-based retrieval -![image](https://github.com/user-attachments/assets/26641e09-249f-4b3a-8013-16dc9383d333) +![RAG query scope selection](/images/docs/hugegraph-ai/quick-start-03.jpg) ### Execution Flow: @@ -122,7 +122,7 @@ graph TD; - Extract keywords from the **question** using the **Keywords Extraction Prompt**. -![image](https://github.com/user-attachments/assets/b49e269f-eaec-40b1-8d8f-9e409821d75d) +![Extracted keywords in the RAG interface](/images/docs/hugegraph-ai/quick-start-04.png) - Use the extracted keywords to: @@ -151,7 +151,7 @@ graph TD; - **Graph-only Answer** - **Graph-Vector Answer** -![image](https://github.com/user-attachments/assets/7d4496a3-d44c-4491-9463-8e93595dfa45) +![Comparison of RAG answer modes](/images/docs/hugegraph-ai/quick-start-05.jpg) # 4. (Processing Flow) Text2Gremlin @@ -164,7 +164,7 @@ This module consists of two parts: The first part is straightforward, so the focus is on the second part. -![image](https://github.com/user-attachments/assets/fc678369-261d-49ea-a289-1ca6ade5ca55) +![Text2Gremlin interface](/images/docs/hugegraph-ai/quick-start-06.png) ```mermaid @@ -180,7 +180,7 @@ graph TD; - **Natural Language** **Query**: Input the natural language text to be converted into Gremlin. -![image](https://github.com/user-attachments/assets/d2a72f45-488c-4099-968b-a11816655ba0) +![Natural language query input](/images/docs/hugegraph-ai/quick-start-07.png) - **Schema:** Input the graph schema. @@ -199,7 +199,7 @@ graph TD; - Retrieve the **graph schema**. - Query the vector database for example vectors, retrieving query-gremlin pairs similar to the input query (if the vector database lacks examples, it automatically initializes with examples from the **resources** folder). -![image](https://github.com/user-attachments/assets/fd150f87-27f8-48e5-8a55-319ec039b7e0) +![Generated Gremlin query](/images/docs/hugegraph-ai/quick-start-08.png) - Generate the Gremlin query using the constructed prompt. diff --git a/content/en/docs/quickstart/hugegraph/hugegraph-hstore.md b/content/en/docs/quickstart/hugegraph/hugegraph-hstore.md index ea2bf1bb8..4d4efcf95 100644 --- a/content/en/docs/quickstart/hugegraph/hugegraph-hstore.md +++ b/content/en/docs/quickstart/hugegraph/hugegraph-hstore.md @@ -2,6 +2,11 @@ title: "HugeGraph-Store Quick Start" linkTitle: "Install/Build HugeGraph-Store" weight: 3 +search_keywords: + - server.port + - REST port + - Store REST port +search_boost: 1.5 --- ### 1 HugeGraph-Store Overview diff --git a/content/en/docs/quickstart/hugegraph/hugegraph-server.md b/content/en/docs/quickstart/hugegraph/hugegraph-server.md index 4197acbbb..61b9d6a2e 100644 --- a/content/en/docs/quickstart/hugegraph/hugegraph-server.md +++ b/content/en/docs/quickstart/hugegraph/hugegraph-server.md @@ -2,9 +2,11 @@ title: "HugeGraph-Server Quick Start" linkTitle: "Install/Build HugeGraph-Server" weight: 1 +aliases: + - /docs/quickstart/hugegraph-server/ --- -### 1 HugeGraph-Server Overview +## 1 HugeGraph-Server Overview `HugeGraph-Server` is the core server component of the HugeGraph project. It includes submodules such as graph-core, backend, and API. @@ -14,9 +16,9 @@ The Core module implements the TinkerPop interfaces. The Backend module manages > The documentation uses both `HugeGraph-Server` and `HugeGraphServer`, and the same pattern applies to other components. The two names are nearly interchangeable: `HugeGraph-Server` usually refers to the server-side codebase, while `HugeGraphServer` refers to the running service process. -### 2 Dependency for Building/Running +## 2 Dependency for Building/Running -#### 2.1 Install Java 11 (JDK 11) +### 2.1 Install Java 11 (JDK 11) Use Java 11 to run `HugeGraph-Server`. Versions earlier than 1.5.0 kept basic compatibility with Java 8, but Java 11 is recommended. @@ -24,7 +26,7 @@ Use Java 11 to run `HugeGraph-Server`. Versions earlier than 1.5.0 kept basic co > Note: Running HugeGraph-Server on Java 8 loses some security protections and may reduce performance. Please upgrade as soon as possible. Java 8 is no longer supported starting from 1.7.0. -### 3 Deploy +## 3 Deploy There are four ways to deploy HugeGraph-Server components: @@ -35,7 +37,7 @@ There are four ways to deploy HugeGraph-Server components: > ⚠️ **SEC Reminder**: Due to the high flexibility of graph query languages (like Gremlin/Cypher), exposing native query endpoints directly presents potential security risks. Therefore, **please avoid exposing any query-related endpoints directly in public network environments**. In production environments, it is imperative to enable the **[Authentication System (Auth)](/docs/config/config-authentication/)** combined with an **IP Whitelist** to establish a dual assurance mechanism, along with an Audit Log to track specific query statements. It is strongly recommended to adopt a **[Containerized Environment (Docker/K8s)](#31-use-docker-container-convenient-for-testdev)** for deployment to achieve better system-level security isolation. -#### 3.1 Use Docker container (Convenient for Test/Dev) +### 3.1 Use Docker container (Convenient for Test/Dev) You can refer to the [Docker deployment guide](https://github.com/apache/hugegraph/blob/master/docker/README.md). @@ -49,7 +51,7 @@ Optional: If you use Docker Desktop, you can set the options as follows:
- image + Docker Desktop settings for a HugeGraph container
> **Note**: The Docker Compose files use bridge networking (`hg-net`) and work on Linux and Mac (Docker Desktop). For the 3-node distributed cluster on Mac (Docker Desktop), allocate at least **12 GB** of memory (Settings → Resources → Memory). On Linux, Docker uses host memory directly. @@ -76,7 +78,7 @@ See [docker/README.md](https://github.com/apache/hugegraph/blob/master/docker/RE > > 2. We recommend using a release tag (such as `1.7.0` or `1.x.0`) for stable deployments. Use the `latest` tag only if you want the newest features still under development. -#### 3.2 Download the binary tarball +### 3.2 Download the binary tarball You could download the binary tarball from the download page of the ASF site like this: ```bash @@ -89,7 +91,7 @@ shasum -a 512 apache-hugegraph-incubating-{version}.tar.gz curl https://downloads.apache.org/hugegraph/{version}/apache-hugegraph-incubating-{version}.tar.gz.sha512 ``` -#### 3.3 Source code compilation +### 3.3 Source code compilation Please ensure that the wget/curl commands are installed before compiling the source code @@ -146,43 +148,41 @@ The execution log is as follows: After successful execution, `*hugegraph-*.tar.gz` files will be generated in the hugegraph directory, which is the tarball generated by compilation. -
- Outdated tools -#### 3.4 One-click deployment (Outdated) - -`HugeGraph-Tools` provides a command-line tool for one-click deployment, users can use this tool to quickly download, decompress, configure and start `HugeGraphServer` and `HugeGraph-Hubble` with one click. - -Of course, you should download the tarball of `HugeGraph-Toolchain` first. - -```bash -# download toolchain binary package, it includes loader + tool + hubble -# please check the latest version (e.g. here is 1.7.0) -wget https://downloads.apache.org/hugegraph/1.7.0/apache-hugegraph-toolchain-incubating-1.7.0.tar.gz -tar zxf *hugegraph-*.tar.gz - -# enter the tool's package -cd *hugegraph*/*tool* -``` - -> note: `${version}` is the version, The latest version can refer to [Download Page](/docs/download/download), or click the link to download directly from the Download page - -The general entry script for HugeGraph-Tools is `bin/hugegraph`, Users can use the `help` command to view its usage, here only the commands for one-click deployment are introduced. - -```bash -bin/hugegraph deploy -v {hugegraph-version} -p {install-path} [-u {download-path-prefix}] -``` - -`{hugegraph-version}` indicates the version of HugeGraphServer and HugeGraphStudio to be deployed, users can view the `conf/version-mapping.yaml` file for version information, `{install-path}` specify the installation directory of HugeGraphServer and HugeGraphStudio, `{download-path-prefix}` optional, specify the download address of HugeGraphServer and HugeGraphStudio tarball, use default download URL if not provided, for example, to start HugeGraph-Server and HugeGraphStudio version 0.6, write the above command as `bin/hugegraph deploy -v 0.6 -p services`. -
+> [!DETAILS]- Outdated tools +> #### 3.4 One-click deployment (Outdated) +> +> `HugeGraph-Tools` provides a command-line tool for one-click deployment, users can use this tool to quickly download, decompress, configure and start `HugeGraphServer` and `HugeGraph-Hubble` with one click. +> +> Of course, you should download the tarball of `HugeGraph-Toolchain` first. +> +> ```bash +> # download toolchain binary package, it includes loader + tool + hubble +> # please check the latest version (e.g. here is 1.7.0) +> wget https://downloads.apache.org/hugegraph/1.7.0/apache-hugegraph-toolchain-incubating-1.7.0.tar.gz +> tar zxf *hugegraph-*.tar.gz +> +> # enter the tool's package +> cd *hugegraph*/*tool* +> ``` +> +> > note: `${version}` is the version, The latest version can refer to [Download Page](/docs/download/download), or click the link to download directly from the Download page +> +> The general entry script for HugeGraph-Tools is `bin/hugegraph`, Users can use the `help` command to view its usage, here only the commands for one-click deployment are introduced. +> +> ```bash +> bin/hugegraph deploy -v {hugegraph-version} -p {install-path} [-u {download-path-prefix}] +> ``` +> +> `{hugegraph-version}` indicates the version of HugeGraphServer and HugeGraphStudio to be deployed, users can view the `conf/version-mapping.yaml` file for version information, `{install-path}` specify the installation directory of HugeGraphServer and HugeGraphStudio, `{download-path-prefix}` optional, specify the download address of HugeGraphServer and HugeGraphStudio tarball, use default download URL if not provided, for example, to start HugeGraph-Server and HugeGraphStudio version 0.6, write the above command as `bin/hugegraph deploy -v 0.6 -p services`. -### 4 Config +## 4 Config If you need to quickly start HugeGraph just for testing, then you only need to modify a few configuration items (see next section). For detailed configuration introduction, please refer to [configuration document](/docs/config/config-guide) and [introduction to configuration items](/docs/config/config-option) -### 5 Startup +## 5 Startup -#### 5.1 Use a startup script to startup +### 5.1 Use a startup script to startup Startup is divided into "first startup" and "non-first startup". On the first startup, you need to initialize the backend database before starting the service. @@ -196,418 +196,391 @@ Since the configuration (hugegraph.properties) and startup steps required by var **Note:** Configure [Server Authentication](/docs/config/config-authentication/) before starting HugeGraphServer if you need Auth mode (especially for production or public network environments). -##### 5.1.1 Distributed Storage (HStore) - -
-Click to expand/collapse Distributed Storage configuration and startup method - -> Distributed storage is a new feature introduced after HugeGraph 1.5.0, which implements distributed data storage and computation based on HugeGraph-PD and HugeGraph-Store components. - -To use the distributed storage engine, you need to deploy HugeGraph-PD and HugeGraph-Store first. See [HugeGraph-PD Quick Start](/docs/quickstart/hugegraph/hugegraph-pd/) and [HugeGraph-Store Quick Start](/docs/quickstart/hugegraph/hugegraph-hstore/). - -After ensuring that both PD and Store services are started, modify the `hugegraph.properties` configuration of HugeGraph-Server: - -```properties -backend=hstore -serializer=binary -task.scheduler_type=distributed - -# PD service address, multiple PD addresses are separated by commas, configure PD's RPC port -pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 -``` - -```properties -# Simple example (with authentication) -gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy - -# Specify storage backend hstore -backend=hstore -serializer=binary -store=hugegraph - -# Specify the task scheduler (for versions 1.7.0 and earlier, hstore storage is required) -task.scheduler_type=distributed - -# pd config -pd.peers=127.0.0.1:8686 -``` - -Then enable PD discovery in `rest-server.properties` (required for every HugeGraph-Server node): - -```properties -usePD=true - -# notice: must have this conf in 1.7.0 -pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 -# If auth is needed -# auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator -``` - -If configuring multiple HugeGraph-Server nodes, you need to modify the `rest-server.properties` configuration file for each node, for example: - -Node 1 (Master node): -```properties -usePD=true -restserver.url=http://127.0.0.1:8081 -gremlinserver.url=http://127.0.0.1:8181 -pd.peers=127.0.0.1:8686 - -rpc.server_host=127.0.0.1 -rpc.server_port=8091 - -server.id=server-1 -server.role=master -``` - -Node 2 (Worker node): -```properties -usePD=true -restserver.url=http://127.0.0.1:8082 -gremlinserver.url=http://127.0.0.1:8182 -pd.peers=127.0.0.1:8686 - -rpc.server_host=127.0.0.1 -rpc.server_port=8092 - -server.id=server-2 -server.role=worker -``` - -Also, you need to modify the port configuration in `gremlin-server.yaml` for each node: - -Node 1: -```yaml -host: 127.0.0.1 -port: 8181 -``` - -Node 2: -```yaml -host: 127.0.0.1 -port: 8182 -``` - -Initialize the database: - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -Start the Server: - -```bash -bin/start-hugegraph.sh -``` - -The startup sequence for using the distributed storage engine is: -1. Start HugeGraph-PD -2. Start HugeGraph-Store -3. Initialize the database (only for the first time) -4. Start HugeGraph-Server - -Verify that the service is started properly: - -```bash -curl http://localhost:8081/graphs -# Should return: {"graphs":["hugegraph"]} -``` - -The sequence to stop the services should be the reverse of the startup sequence: -1. Stop HugeGraph-Server -2. Stop HugeGraph-Store -3. Stop HugeGraph-PD - -```bash -bin/stop-hugegraph.sh -``` - -###### Docker Distributed Cluster - -Run the full distributed cluster (3 PD + 3 Store + 3 Server) with Docker Compose: - -```bash -cd hugegraph/docker -HUGEGRAPH_VERSION=1.7.0 docker compose -f docker-compose-3pd-3store-3server.yml up -d -``` - -Services communicate via container hostnames on the `hg-net` bridge network. Configuration is injected via environment variables: - -```yaml -# Server configuration -HG_SERVER_BACKEND: hstore -HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686 -``` - -Verify the cluster: -```bash -curl http://localhost:8080/versions -curl http://localhost:8620/v1/stores -``` -To view runtime logs for any container use `docker logs ` (e.g. `docker logs hg-pd0`). - -See [docker/README.md](https://github.com/apache/hugegraph/blob/master/docker/README.md) for the full environment variable reference, port table, and troubleshooting guide. -
- -##### 5.1.2 Memory - -
-Click to expand/collapse Memory configuration and startup methods - -Update hugegraph.properties - -```properties -backend=memory -serializer=text -``` - -> The data of the Memory backend is stored in memory and cannot be persisted. It does not need to initialize the backend. This is the only backend that does not require initialization. - -Start server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -The prompted url is the same as the restserver.url configured in rest-server.properties - -
- -##### 5.1.3 RocksDB / ToplingDB - -
-Click to expand/collapse RocksDB configuration and startup methods - -> RocksDB is an embedded database that does not require manual installation and deployment. GCC version >= 4.3.0 (GLIBCXX_3.4.10) is required. If not, GCC needs to be upgraded in advance - -Update hugegraph.properties - -```properties -backend=rocksdb -serializer=binary -rocksdb.data_path=. -rocksdb.wal_path=. -``` - -Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') +#### 5.1.1 Distributed Storage (HStore) -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` +> [!DETAILS]- Click to expand/collapse Distributed Storage configuration and startup method +> > Distributed storage is a new feature introduced after HugeGraph 1.5.0, which implements distributed data storage and computation based on HugeGraph-PD and HugeGraph-Store components. +> +> To use the distributed storage engine, you need to deploy HugeGraph-PD and HugeGraph-Store first. See [HugeGraph-PD Quick Start](/docs/quickstart/hugegraph/hugegraph-pd/) and [HugeGraph-Store Quick Start](/docs/quickstart/hugegraph/hugegraph-hstore/). +> +> After ensuring that both PD and Store services are started, modify the `hugegraph.properties` configuration of HugeGraph-Server: +> +> ```properties +> backend=hstore +> serializer=binary +> task.scheduler_type=distributed +> +> # PD service address, multiple PD addresses are separated by commas, configure PD's RPC port +> pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 +> ``` +> +> ```properties +> # Simple example (with authentication) +> gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy +> +> # Specify storage backend hstore +> backend=hstore +> serializer=binary +> store=hugegraph +> +> # Specify the task scheduler (for versions 1.7.0 and earlier, hstore storage is required) +> task.scheduler_type=distributed +> +> # pd config +> pd.peers=127.0.0.1:8686 +> ``` +> +> Then enable PD discovery in `rest-server.properties` (required for every HugeGraph-Server node): +> +> ```properties +> usePD=true +> +> # notice: must have this conf in 1.7.0 +> pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 +> # If auth is needed +> # auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator +> ``` +> +> If configuring multiple HugeGraph-Server nodes, you need to modify the `rest-server.properties` configuration file for each node, for example: +> +> Node 1 (Master node): +> ```properties +> usePD=true +> restserver.url=http://127.0.0.1:8081 +> gremlinserver.url=http://127.0.0.1:8181 +> pd.peers=127.0.0.1:8686 +> +> rpc.server_host=127.0.0.1 +> rpc.server_port=8091 +> +> server.id=server-1 +> server.role=master +> ``` +> +> Node 2 (Worker node): +> ```properties +> usePD=true +> restserver.url=http://127.0.0.1:8082 +> gremlinserver.url=http://127.0.0.1:8182 +> pd.peers=127.0.0.1:8686 +> +> rpc.server_host=127.0.0.1 +> rpc.server_port=8092 +> +> server.id=server-2 +> server.role=worker +> ``` +> +> Also, you need to modify the port configuration in `gremlin-server.yaml` for each node: +> +> Node 1: +> ```yaml +> host: 127.0.0.1 +> port: 8181 +> ``` +> +> Node 2: +> ```yaml +> host: 127.0.0.1 +> port: 8182 +> ``` +> +> Initialize the database: +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> Start the Server: +> +> ```bash +> bin/start-hugegraph.sh +> ``` +> +> The startup sequence for using the distributed storage engine is: +> 1. Start HugeGraph-PD +> 2. Start HugeGraph-Store +> 3. Initialize the database (only for the first time) +> 4. Start HugeGraph-Server +> +> Verify that the service is started properly: +> +> ```bash +> curl http://localhost:8081/graphs +> # Should return: {"graphs":["hugegraph"]} +> ``` +> +> The sequence to stop the services should be the reverse of the startup sequence: +> 1. Stop HugeGraph-Server +> 2. Stop HugeGraph-Store +> 3. Stop HugeGraph-PD +> +> ```bash +> bin/stop-hugegraph.sh +> ``` +> +> ##### Docker Distributed Cluster +> +> Run the full distributed cluster (3 PD + 3 Store + 3 Server) with Docker Compose: +> +> ```bash +> cd hugegraph/docker +> HUGEGRAPH_VERSION=1.7.0 docker compose -f docker-compose-3pd-3store-3server.yml up -d +> ``` +> +> Services communicate via container hostnames on the `hg-net` bridge network. Configuration is injected via environment variables: +> +> ```yaml +> # Server configuration +> HG_SERVER_BACKEND: hstore +> HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686 +> ``` +> +> Verify the cluster: +> ```bash +> curl http://localhost:8080/versions +> curl http://localhost:8620/v1/stores +> ``` +> To view runtime logs for any container use `docker logs ` (e.g. `docker logs hg-pd0`). +> +> See [docker/README.md](https://github.com/apache/hugegraph/blob/master/docker/README.md) for the full environment variable reference, port table, and troubleshooting guide. -Start server +#### 5.1.2 Memory -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` +> [!DETAILS]- Click to expand/collapse Memory configuration and startup methods +> Update hugegraph.properties +> +> ```properties +> backend=memory +> serializer=text +> ``` +> +> > The data of the Memory backend is stored in memory and cannot be persisted. It does not need to initialize the backend. This is the only backend that does not require initialization. +> +> Start server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` +> +> The prompted url is the same as the restserver.url configured in rest-server.properties -**ToplingDB (Beta)**: As a high-performance alternative to RocksDB, please refer to the configuration guide: [ToplingDB Quick Start]({{< ref path="/blog/hugegraph/toplingdb/toplingdb-quick-start.md" lang="en">}}) +#### 5.1.3 RocksDB / ToplingDB -
+> [!DETAILS]- Click to expand/collapse RocksDB configuration and startup methods +> > RocksDB is an embedded database that does not require manual installation and deployment. GCC version >= 4.3.0 (GLIBCXX_3.4.10) is required. If not, GCC needs to be upgraded in advance +> +> Update hugegraph.properties +> +> ```properties +> backend=rocksdb +> serializer=binary +> rocksdb.data_path=. +> rocksdb.wal_path=. +> ``` +> +> Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> Start server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` +> +> **ToplingDB (Beta)**: As a high-performance alternative to RocksDB, please refer to the configuration guide: [ToplingDB Quick Start]({{< ref path="/blog/hugegraph/toplingdb/toplingdb-quick-start.md" lang="en">}}) -##### 5.1.4 Cassandra +#### 5.1.4 Cassandra > ⚠️ **Deprecated**: This backend has been removed starting from HugeGraph 1.7.0. If you need to use it, please refer to version 1.5.x documentation. -
-Click to expand/collapse Cassandra configuration and startup methods - -> users need to install Cassandra by themselves, requiring version 3.0 or above, [download link](http://cassandra.apache.org/download/) - -Update hugegraph.properties - -```properties -backend=cassandra -serializer=cassandra - -# cassandra backend config -cassandra.host=localhost -cassandra.port=9042 -cassandra.username= -cassandra.password= -#cassandra.connect_timeout=5 -#cassandra.read_timeout=20 - -#cassandra.keyspace.strategy=SimpleStrategy -#cassandra.keyspace.replication=3 -``` - -Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') - - -```bash -cd *hugegraph-${version} -bin/init-store.sh -Initing HugeGraph Store... -2017-12-01 11:26:51 1424 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' -2017-12-01 11:26:52 2389 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later -2017-12-01 11:26:52 2472 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later -2017-12-01 11:26:52 2557 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later -2017-12-01 11:26:53 2797 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph -2017-12-01 11:26:53 2945 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema -2017-12-01 11:26:53 3044 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index -2017-12-01 11:26:53 3046 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' -2017-12-01 11:26:59 9720 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' -2017-12-01 11:27:00 9805 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later -2017-12-01 11:27:00 9886 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later -2017-12-01 11:27:00 9955 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later -2017-12-01 11:27:00 10175 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph -2017-12-01 11:27:00 10321 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema -2017-12-01 11:27:00 10413 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index -2017-12-01 11:27:00 10413 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' -``` - -Start server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -
+> [!DETAILS]- Click to expand/collapse Cassandra configuration and startup methods +> > users need to install Cassandra by themselves, requiring version 3.0 or above, [download link](http://cassandra.apache.org/download/) +> +> Update hugegraph.properties +> +> ```properties +> backend=cassandra +> serializer=cassandra +> +> # cassandra backend config +> cassandra.host=localhost +> cassandra.port=9042 +> cassandra.username= +> cassandra.password= +> #cassandra.connect_timeout=5 +> #cassandra.read_timeout=20 +> +> #cassandra.keyspace.strategy=SimpleStrategy +> #cassandra.keyspace.replication=3 +> ``` +> +> Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') +> +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> Initing HugeGraph Store... +> 2017-12-01 11:26:51 1424 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' +> 2017-12-01 11:26:52 2389 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later +> 2017-12-01 11:26:52 2472 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later +> 2017-12-01 11:26:52 2557 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph, try init keyspace later +> 2017-12-01 11:26:53 2797 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph +> 2017-12-01 11:26:53 2945 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema +> 2017-12-01 11:26:53 3044 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index +> 2017-12-01 11:26:53 3046 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' +> 2017-12-01 11:26:59 9720 [main] [INFO ] org.apache.hugegraph.HugeGraph [] - Opening backend store: 'cassandra' +> 2017-12-01 11:27:00 9805 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later +> 2017-12-01 11:27:00 9886 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later +> 2017-12-01 11:27:00 9955 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Failed to connect keyspace: hugegraph1, try init keyspace later +> 2017-12-01 11:27:00 10175 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_graph +> 2017-12-01 11:27:00 10321 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_schema +> 2017-12-01 11:27:00 10413 [main] [INFO ] org.apache.hugegraph.backend.store.cassandra.CassandraStore [] - Store initialized: huge_index +> 2017-12-01 11:27:00 10413 [pool-3-thread-1] [INFO ] org.apache.hugegraph.backend.Transaction [] - Clear cache on event 'store.init' +> ``` +> +> Start server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` -##### 5.1.5 ScyllaDB +#### 5.1.5 ScyllaDB > ⚠️ **Deprecated**: This backend has been removed starting from HugeGraph 1.7.0. If you need to use it, please refer to version 1.5.x documentation. -
-Click to expand/collapse ScyllaDB configuration and startup methods - -> users need to install ScyllaDB by themselves, version 2.1 or above is recommended, [download link](https://docs.scylladb.com/getting-started/) - -Update hugegraph.properties - -```properties -backend=scylladb -serializer=scylladb - -# cassandra backend config -cassandra.host=localhost -cassandra.port=9042 -cassandra.username= -cassandra.password= -#cassandra.connect_timeout=5 -#cassandra.read_timeout=20 - -#cassandra.keyspace.strategy=SimpleStrategy -#cassandra.keyspace.replication=3 -``` - -Since the scylladb database itself is an "optimized version" based on cassandra, if the user does not have scylladb installed, they can also use cassandra as the backend storage directly. They only need to change the backend and serializer to scylladb, and the host and post point to the seeds and port of the cassandra cluster. Yes, but it is not recommended to do so, it will not take advantage of scylladb itself. - -Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -Start server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -
- -##### 5.1.6 HBase - -
-Click to expand/collapse HBase configuration and startup methods - -> users need to install HBase by themselves, requiring version 2.0 or above,[download link](https://hbase.apache.org/downloads.html) - -Update hugegraph.properties - -```properties -backend=hbase -serializer=hbase - -# hbase backend config -hbase.hosts=localhost -hbase.port=2181 -# Note: recommend to modify the HBase partition number by the actual/env data amount & RS amount before init store -# it may influence the loading speed a lot -#hbase.enable_partition=true -#hbase.vertex_partitions=10 -#hbase.edge_partitions=30 -``` - -Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -Start server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` +> [!DETAILS]- Click to expand/collapse ScyllaDB configuration and startup methods +> > users need to install ScyllaDB by themselves, version 2.1 or above is recommended, [download link](https://docs.scylladb.com/getting-started/) +> +> Update hugegraph.properties +> +> ```properties +> backend=scylladb +> serializer=scylladb +> +> # cassandra backend config +> cassandra.host=localhost +> cassandra.port=9042 +> cassandra.username= +> cassandra.password= +> #cassandra.connect_timeout=5 +> #cassandra.read_timeout=20 +> +> #cassandra.keyspace.strategy=SimpleStrategy +> #cassandra.keyspace.replication=3 +> ``` +> +> Since the scylladb database itself is an "optimized version" based on cassandra, if the user does not have scylladb installed, they can also use cassandra as the backend storage directly. They only need to change the backend and serializer to scylladb, and the host and post point to the seeds and port of the cassandra cluster. Yes, but it is not recommended to do so, it will not take advantage of scylladb itself. +> +> Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> Start server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` -> for more other backend configurations, please refer to[introduction to configuration options](/docs/config/config-option) +#### 5.1.6 HBase -
+> [!DETAILS]- Click to expand/collapse HBase configuration and startup methods +> > users need to install HBase by themselves, requiring version 2.0 or above,[download link](https://hbase.apache.org/downloads.html) +> +> Update hugegraph.properties +> +> ```properties +> backend=hbase +> serializer=hbase +> +> # hbase backend config +> hbase.hosts=localhost +> hbase.port=2181 +> # Note: recommend to modify the HBase partition number by the actual/env data amount & RS amount before init store +> # it may influence the loading speed a lot +> #hbase.enable_partition=true +> #hbase.vertex_partitions=10 +> #hbase.edge_partitions=30 +> ``` +> +> Initialize the database (required on the first startup, or a new configuration was manually added under 'conf/graphs/') +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> Start server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` +> +> > for more other backend configurations, please refer to[introduction to configuration options](/docs/config/config-option) -##### 5.1.7 MySQL +#### 5.1.7 MySQL > ⚠️ **Deprecated**: This backend has been removed starting from HugeGraph 1.7.0. If you need to use it, please refer to version 1.5.x documentation. -
-Click to expand/collapse MySQL configuration and startup methods - -> Because MySQL is licensed under the GPL and incompatible with the Apache License, users must install MySQL themselves, [download link](https://dev.mysql.com/downloads/mysql/) - -Download the MySQL [driver package](https://repo1.maven.org/maven2/mysql/mysql-connector-java/), such as `mysql-connector-java-8.0.30.jar`, and place it in the `lib` directory of HugeGraph-Server. - -Update `hugegraph.properties` to configure the database URL, username, and password. -`store` is the database name; it will be created automatically if it doesn't exist. - -```properties -backend=mysql -serializer=mysql - -store=hugegraph - -# mysql backend config -jdbc.driver=com.mysql.cj.jdbc.Driver -jdbc.url=jdbc:mysql://127.0.0.1:3306 -jdbc.username= -jdbc.password= -jdbc.reconnect_max_times=3 -jdbc.reconnect_interval=3 -jdbc.ssl_mode=false -``` - -Initialize the database (required for first startup or when manually adding new configurations to `conf/graphs/`) - -```bash -cd *hugegraph-${version} -bin/init-store.sh -``` - -Start server - -```bash -bin/start-hugegraph.sh -Starting HugeGraphServer... -Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK -``` - -
+> [!DETAILS]- Click to expand/collapse MySQL configuration and startup methods +> > Because MySQL is licensed under the GPL and incompatible with the Apache License, users must install MySQL themselves, [download link](https://dev.mysql.com/downloads/mysql/) +> +> Download the MySQL [driver package](https://repo1.maven.org/maven2/mysql/mysql-connector-java/), such as `mysql-connector-java-8.0.30.jar`, and place it in the `lib` directory of HugeGraph-Server. +> +> Update `hugegraph.properties` to configure the database URL, username, and password. +> `store` is the database name; it will be created automatically if it doesn't exist. +> +> ```properties +> backend=mysql +> serializer=mysql +> +> store=hugegraph +> +> # mysql backend config +> jdbc.driver=com.mysql.cj.jdbc.Driver +> jdbc.url=jdbc:mysql://127.0.0.1:3306 +> jdbc.username= +> jdbc.password= +> jdbc.reconnect_max_times=3 +> jdbc.reconnect_interval=3 +> jdbc.ssl_mode=false +> ``` +> +> Initialize the database (required for first startup or when manually adding new configurations to `conf/graphs/`) +> +> ```bash +> cd *hugegraph-${version} +> bin/init-store.sh +> ``` +> +> Start server +> +> ```bash +> bin/start-hugegraph.sh +> Starting HugeGraphServer... +> Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +> ``` -##### 5.1.8 Create an example graph when startup +#### 5.1.8 Create an example graph when startup Pass the `-p true` argument when starting the script to enable `preload`, which creates a sample graph. @@ -628,77 +601,73 @@ And use the RESTful API to request `HugeGraphServer` and get the following resul This indicates the successful creation of the sample graph. -#### 5.2 Use Docker to startup +### 5.2 Use Docker to startup In [3.1 Use Docker container](#31-use-docker-container-convenient-for-testdev), we introduced how to deploy `hugegraph-server` with Docker. You can also switch storage backends or preload a sample graph by setting the corresponding parameters. -##### 5.2.1 Uses Cassandra as storage +#### 5.2.1 Uses Cassandra as storage > ⚠️ **Deprecated**: Cassandra backend has been removed starting from HugeGraph 1.7.0. If you need to use it, please refer to version 1.5.x documentation. -
- Click to expand/collapse Cassandra configuration and startup methods - -When using Docker, we can use Cassandra as the backend storage. We highly recommend using docker-compose directly to manage both the server and Cassandra. - -The sample `docker-compose.yml` can be obtained on [GitHub](https://github.com/apache/hugegraph/blob/master/hugegraph-server/hugegraph-dist/docker/example/docker-compose-cassandra.yml), and you can start it with `docker-compose up -d`. (If using Cassandra 4.0 as the backend storage, it takes approximately two minutes to initialize. Please be patient.) - -```yaml -version: "3" - -services: - graph: - image: hugegraph/hugegraph - container_name: cas-server - ports: - - 8080:8080 - environment: - hugegraph.backend: cassandra - hugegraph.serializer: cassandra - hugegraph.cassandra.host: cas-cassandra - hugegraph.cassandra.port: 9042 - networks: - - ca-network - depends_on: - - cassandra - healthcheck: - test: ["CMD", "bin/gremlin-console.sh", "--" ,"-e", "scripts/remote-connect.groovy"] - interval: 10s - timeout: 30s - retries: 3 - - cassandra: - image: cassandra:4 - container_name: cas-cassandra - ports: - - 7000:7000 - - 9042:9042 - security_opt: - - seccomp:unconfined - networks: - - ca-network - healthcheck: - test: ["CMD", "cqlsh", "--execute", "describe keyspaces;"] - interval: 10s - timeout: 30s - retries: 5 - -networks: - ca-network: - -volumes: - hugegraph-data: -``` - -In this YAML file, configuration parameters related to Cassandra need to be passed as environment variables in the format of `hugegraph.`. - -Specifically, the `hugegraph.properties` file contains settings such as `backend=xxx` and `cassandra.host=xxx`. To pass these settings through environment variables, prepend `hugegraph.` to the configuration keys, for example `hugegraph.backend` and `hugegraph.cassandra.host`. - -Refer to [4 Config](#4-config) for the remaining settings. - -
+> [!DETAILS]- Click to expand/collapse Cassandra configuration and startup methods +> When using Docker, we can use Cassandra as the backend storage. We highly recommend using docker-compose directly to manage both the server and Cassandra. +> +> The sample `docker-compose.yml` can be obtained on [GitHub](https://github.com/apache/hugegraph/blob/master/hugegraph-server/hugegraph-dist/docker/example/docker-compose-cassandra.yml), and you can start it with `docker-compose up -d`. (If using Cassandra 4.0 as the backend storage, it takes approximately two minutes to initialize. Please be patient.) +> +> ```yaml +> version: "3" +> +> services: +> graph: +> image: hugegraph/hugegraph +> container_name: cas-server +> ports: +> - 8080:8080 +> environment: +> hugegraph.backend: cassandra +> hugegraph.serializer: cassandra +> hugegraph.cassandra.host: cas-cassandra +> hugegraph.cassandra.port: 9042 +> networks: +> - ca-network +> depends_on: +> - cassandra +> healthcheck: +> test: ["CMD", "bin/gremlin-console.sh", "--" ,"-e", "scripts/remote-connect.groovy"] +> interval: 10s +> timeout: 30s +> retries: 3 +> +> cassandra: +> image: cassandra:4 +> container_name: cas-cassandra +> ports: +> - 7000:7000 +> - 9042:9042 +> security_opt: +> - seccomp:unconfined +> networks: +> - ca-network +> healthcheck: +> test: ["CMD", "cqlsh", "--execute", "describe keyspaces;"] +> interval: 10s +> timeout: 30s +> retries: 5 +> +> networks: +> ca-network: +> +> volumes: +> hugegraph-data: +> ``` +> +> In this YAML file, configuration parameters related to Cassandra need to be passed as environment variables in the format of `hugegraph.`. +> +> Specifically, the `hugegraph.properties` file contains settings such as `backend=xxx` and `cassandra.host=xxx`. To pass these settings through environment variables, prepend `hugegraph.` to the configuration keys, for example `hugegraph.backend` and `hugegraph.cassandra.host`. +> +> Refer to [4 Config](#4-config) for the remaining settings. -##### 5.2.2 Create an example graph when starting a server +#### 5.2.2 Create an example graph when starting a server Set the environment variable `PRELOAD=true` when starting Docker so that sample data is loaded during startup. @@ -738,9 +707,9 @@ And use the RESTful API to request `HugeGraphServer` and get the following resul This indicates that the sample graph was created successfully. -### 6. Access server +## 6. Access server -#### 6.1 Service startup status check +### 6.1 Service startup status check Use `jps` to see a service process @@ -757,7 +726,7 @@ echo `curl -o /dev/null -s -w %{http_code} "http://localhost:8080/graphs/hugegra Return 200, which means the server starts normally. -#### 6.2 Request Server +### 6.2 Request Server The RESTful API of HugeGraphServer includes various types of resources, typically including graph, schema, gremlin, traverser and task. @@ -767,7 +736,7 @@ The RESTful API of HugeGraphServer includes various types of resources, typicall - `traverser` contains various advanced queries including shortest paths, intersections, N-step reachable neighbors, etc. - `task` contains query and delete with asynchronous tasks -##### 6.2.1 Get vertices and its related properties in `hugegraph` +#### 6.2.1 Get vertices and its related properties in `hugegraph` ```bash curl http://localhost:8080/graphs/hugegraph/graph/vertices @@ -850,28 +819,28 @@ For the detailed API, please refer to [RESTful-API](/docs/clients/restful-api) You can also visit `localhost:8080/swagger-ui/index.html` to check the API.
- image + HugeGraph RESTful API endpoints in Swagger UI
When using Swagger UI to debug the API provided by HugeGraph, if HugeGraph Server turns on authentication mode, you can enter authentication information on the Swagger page.
- image + Authorize button in the HugeGraph Swagger UI
Currently, HugeGraph supports setting authentication information in two forms: Basic and Bearer.
- image + Basic and Bearer credential fields in the Swagger UI authorization dialog
-### 7 Stop Server +## 7 Stop Server ```bash $cd *hugegraph-${version} $bin/stop-hugegraph.sh ``` -### 8 Debug Server with IntelliJ IDEA +## 8 Debug Server with IntelliJ IDEA Please refer to [Setup Server in IDEA](/docs/contribution-guidelines/hugegraph-server-idea-setup) diff --git a/content/en/docs/quickstart/toolchain/hugegraph-loader.md b/content/en/docs/quickstart/toolchain/hugegraph-loader.md index a079db847..1be5806be 100644 --- a/content/en/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/en/docs/quickstart/toolchain/hugegraph-loader.md @@ -81,20 +81,16 @@ git clone https://github.com/apache/hugegraph-toolchain.git wget https://downloads.apache.org/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}-src.tar.gz ``` -
-click to fold/collapse hwo to install ojdbc - -Due to the license limitation of the `Oracle OJDBC`, you need to manually install ojdbc to the local maven repository. -Visit the [Oracle jdbc downloads](https://www.oracle.com/database/technologies/appdev/jdbc-drivers-archive.html) page. Select Oracle Database 12c Release 2 (12.2.0.1) drivers, as shown in the following figure. - -After opening the link, select "ojdbc8.jar". - -Install ojdbc8 to the local maven repository, enter the directory where `ojdbc8.jar` is located, and execute the following command. -``` -mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar -``` - -
+> [!DETAILS]- How to install OJDBC +> Due to the license limitation of the `Oracle OJDBC`, you need to manually install ojdbc to the local maven repository. +> Visit the [Oracle jdbc downloads](https://www.oracle.com/database/technologies/appdev/jdbc-drivers-archive.html) page. Select Oracle Database 12c Release 2 (12.2.0.1) drivers, as shown in the following figure. +> +> After opening the link, select "ojdbc8.jar". +> +> Install ojdbc8 to the local maven repository, enter the directory where `ojdbc8.jar` is located, and execute the following command. +> ``` +> mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar +> ``` Compile and generate tar package: @@ -118,7 +114,7 @@ For example, if you want to create a graph with two types of vertices and two ty "Software" includes: "name", "sale price" and other attributes; side "knowledge" includes: "date" attribute and so on.
- image + Example graph with person and software vertices connected by knows and created edges

graph model example

@@ -282,302 +278,290 @@ In the simplest terms, each mapping block describes: where is the file to be imp -
-Click to expand/collapse the skeleton of the map file for version 2.0 - -```json -{ - "version": "2.0", - "structs": [ - { - "id": "1", - "input": { - }, - "vertices": [ - {}, - {} - ], - "edges": [ - {}, - {} - ] - } - ] -} -``` - -
+> [!DETAILS]- Click to expand/collapse the skeleton of the map file for version 2.0 +> ```json +> { +> "version": "2.0", +> "structs": [ +> { +> "id": "1", +> "input": { +> }, +> "vertices": [ +> {}, +> {} +> ], +> "edges": [ +> {}, +> {} +> ] +> } +> ] +> } +> ```
Two versions of the mapping file are given directly here (the above graph model and data file are described) -
-Click to expand/collapse the mapping file for version 2.0 - -```json -{ - "version": "2.0", - "structs": [ - { - "id": "1", - "skip": false, - "input": { - "type": "FILE", - "path": "vertex_person.csv", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "CSV", - "delimiter": ",", - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": [ - "name", - "age", - "city" - ], - "charset": "UTF-8", - "list_format": { - "start_symbol": "[", - "elem_delimiter": "|", - "end_symbol": "]" - } - }, - "vertices": [ - { - "label": "person", - "skip": false, - "id": null, - "unfold": false, - "field_mapping": {}, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ], - "edges": [] - }, - { - "id": "2", - "skip": false, - "input": { - "type": "FILE", - "path": "vertex_software.csv", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "CSV", - "delimiter": ",", - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": null, - "charset": "UTF-8", - "list_format": { - "start_symbol": "", - "elem_delimiter": ",", - "end_symbol": "" - } - }, - "vertices": [ - { - "label": "software", - "skip": false, - "id": null, - "unfold": false, - "field_mapping": {}, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ], - "edges": [] - }, - { - "id": "3", - "skip": false, - "input": { - "type": "FILE", - "path": "edge_knows.json", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "JSON", - "delimiter": null, - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": null, - "charset": "UTF-8", - "list_format": null - }, - "vertices": [], - "edges": [ - { - "label": "knows", - "skip": false, - "source": [ - "source_name" - ], - "unfold_source": false, - "target": [ - "target_name" - ], - "unfold_target": false, - "field_mapping": { - "source_name": "name", - "target_name": "name" - }, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ] - }, - { - "id": "4", - "skip": false, - "input": { - "type": "FILE", - "path": "edge_created.json", - "file_filter": { - "extensions": [ - "*" - ] - }, - "format": "JSON", - "delimiter": null, - "date_format": "yyyy-MM-dd HH:mm:ss", - "time_zone": "GMT+8", - "skipped_line": { - "regex": "(^#|^//).*|" - }, - "compression": "NONE", - "header": null, - "charset": "UTF-8", - "list_format": null - }, - "vertices": [], - "edges": [ - { - "label": "created", - "skip": false, - "source": [ - "source_name" - ], - "unfold_source": false, - "target": [ - "target_name" - ], - "unfold_target": false, - "field_mapping": { - "source_name": "name", - "target_name": "name" - }, - "value_mapping": {}, - "selected": [], - "ignored": [], - "null_values": [ - "" - ], - "update_strategies": {} - } - ] - } - ] -} -``` - -
+> [!DETAILS]- Click to expand/collapse the mapping file for version 2.0 +> ```json +> { +> "version": "2.0", +> "structs": [ +> { +> "id": "1", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "vertex_person.csv", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "CSV", +> "delimiter": ",", +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": [ +> "name", +> "age", +> "city" +> ], +> "charset": "UTF-8", +> "list_format": { +> "start_symbol": "[", +> "elem_delimiter": "|", +> "end_symbol": "]" +> } +> }, +> "vertices": [ +> { +> "label": "person", +> "skip": false, +> "id": null, +> "unfold": false, +> "field_mapping": {}, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ], +> "edges": [] +> }, +> { +> "id": "2", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "vertex_software.csv", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "CSV", +> "delimiter": ",", +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": null, +> "charset": "UTF-8", +> "list_format": { +> "start_symbol": "", +> "elem_delimiter": ",", +> "end_symbol": "" +> } +> }, +> "vertices": [ +> { +> "label": "software", +> "skip": false, +> "id": null, +> "unfold": false, +> "field_mapping": {}, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ], +> "edges": [] +> }, +> { +> "id": "3", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "edge_knows.json", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "JSON", +> "delimiter": null, +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": null, +> "charset": "UTF-8", +> "list_format": null +> }, +> "vertices": [], +> "edges": [ +> { +> "label": "knows", +> "skip": false, +> "source": [ +> "source_name" +> ], +> "unfold_source": false, +> "target": [ +> "target_name" +> ], +> "unfold_target": false, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> }, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ] +> }, +> { +> "id": "4", +> "skip": false, +> "input": { +> "type": "FILE", +> "path": "edge_created.json", +> "file_filter": { +> "extensions": [ +> "*" +> ] +> }, +> "format": "JSON", +> "delimiter": null, +> "date_format": "yyyy-MM-dd HH:mm:ss", +> "time_zone": "GMT+8", +> "skipped_line": { +> "regex": "(^#|^//).*|" +> }, +> "compression": "NONE", +> "header": null, +> "charset": "UTF-8", +> "list_format": null +> }, +> "vertices": [], +> "edges": [ +> { +> "label": "created", +> "skip": false, +> "source": [ +> "source_name" +> ], +> "unfold_source": false, +> "target": [ +> "target_name" +> ], +> "unfold_target": false, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> }, +> "value_mapping": {}, +> "selected": [], +> "ignored": [], +> "null_values": [ +> "" +> ], +> "update_strategies": {} +> } +> ] +> } +> ] +> } +> ```
-
-Click to expand/collapse the mapping file for version 1.0 - -```json -{ - "vertices": [ - { - "label": "person", - "input": { - "type": "file", - "path": "vertex_person.csv", - "format": "CSV", - "header": ["name", "age", "city"], - "charset": "UTF-8" - } - }, - { - "label": "software", - "input": { - "type": "file", - "path": "vertex_software.csv", - "format": "CSV" - } - } - ], - "edges": [ - { - "label": "knows", - "source": ["source_name"], - "target": ["target_name"], - "input": { - "type": "file", - "path": "edge_knows.json", - "format": "JSON" - }, - "field_mapping": { - "source_name": "name", - "target_name": "name" - } - }, - { - "label": "created", - "source": ["source_name"], - "target": ["target_name"], - "input": { - "type": "file", - "path": "edge_created.json", - "format": "JSON" - }, - "field_mapping": { - "source_name": "name", - "target_name": "name" - } - } - ] -} -``` - -
+> [!DETAILS]- Click to expand/collapse the mapping file for version 1.0 +> ```json +> { +> "vertices": [ +> { +> "label": "person", +> "input": { +> "type": "file", +> "path": "vertex_person.csv", +> "format": "CSV", +> "header": ["name", "age", "city"], +> "charset": "UTF-8" +> } +> }, +> { +> "label": "software", +> "input": { +> "type": "file", +> "path": "vertex_software.csv", +> "format": "CSV" +> } +> } +> ], +> "edges": [ +> { +> "label": "knows", +> "source": ["source_name"], +> "target": ["target_name"], +> "input": { +> "type": "file", +> "path": "edge_knows.json", +> "format": "JSON" +> }, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> } +> }, +> { +> "label": "created", +> "source": ["source_name"], +> "target": ["target_name"], +> "input": { +> "type": "file", +> "path": "edge_created.json", +> "format": "JSON" +> }, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> } +> } +> ] +> } +> ```
The 1.0 version of the mapping file is centered on the vertex and edge, and sets the input source; while the 2.0 version is centered on the input source, and sets the vertex and edge mapping. Some input sources (such as a file) can generate both vertices and edges. If you write in the 1.0 format, you need to write an input block in each of the vertex and edge mapping blocks. The two input blocks are exactly the same; and the 2.0 version only needs to write input once. Therefore, compared with version 1.0, version 2.0 can save some repetitive writing of input. @@ -942,106 +926,98 @@ Edge file: `example/file/edge_created.json` #### 4.2 Write schema -
-Click to expand/collapse the schema file: example/file/schema.groovy - -```groovy -schema.propertyKey("name").asText().ifNotExist().create(); -schema.propertyKey("age").asInt().ifNotExist().create(); -schema.propertyKey("city").asText().ifNotExist().create(); -schema.propertyKey("weight").asDouble().ifNotExist().create(); -schema.propertyKey("lang").asText().ifNotExist().create(); -schema.propertyKey("date").asText().ifNotExist().create(); -schema.propertyKey("price").asDouble().ifNotExist().create(); - -schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create(); -schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create(); - -schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create(); -schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create(); -schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create(); -schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create(); - -schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create(); -schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create(); - -schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create(); -schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create(); -schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create(); -``` - -
+> [!DETAILS]- Click to expand/collapse the schema file: example/file/schema.groovy +> ```groovy +> schema.propertyKey("name").asText().ifNotExist().create(); +> schema.propertyKey("age").asInt().ifNotExist().create(); +> schema.propertyKey("city").asText().ifNotExist().create(); +> schema.propertyKey("weight").asDouble().ifNotExist().create(); +> schema.propertyKey("lang").asText().ifNotExist().create(); +> schema.propertyKey("date").asText().ifNotExist().create(); +> schema.propertyKey("price").asDouble().ifNotExist().create(); +> +> schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create(); +> schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create(); +> +> schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create(); +> schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create(); +> schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create(); +> schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create(); +> +> schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create(); +> schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create(); +> +> schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create(); +> schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create(); +> schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create(); +> ``` #### 4.3 Write the input source mapping file `example/file/struct.json` -
-Click to expand/collapse the input source mapping file example/file/struct.json - -```json -{ - "vertices": [ - { - "label": "person", - "input": { - "type": "file", - "path": "example/file/vertex_person.csv", - "format": "CSV", - "header": ["name", "age", "city"], - "charset": "UTF-8", - "skipped_line": { - "regex": "(^#|^//).*" - } - }, - "null_values": ["NULL", "null", ""] - }, - { - "label": "software", - "input": { - "type": "file", - "path": "example/file/vertex_software.txt", - "format": "TEXT", - "delimiter": "|", - "charset": "GBK" - }, - "id": "id", - "ignored": ["ISBN"] - } - ], - "edges": [ - { - "label": "knows", - "source": ["source_name"], - "target": ["target_name"], - "input": { - "type": "file", - "path": "example/file/edge_knows.json", - "format": "JSON", - "date_format": "yyyyMMdd" - }, - "field_mapping": { - "source_name": "name", - "target_name": "name" - } - }, - { - "label": "created", - "source": ["source_name"], - "target": ["target_id"], - "input": { - "type": "file", - "path": "example/file/edge_created.json", - "format": "JSON", - "date_format": "yyyy-MM-dd" - }, - "field_mapping": { - "source_name": "name" - } - } - ] -} -``` - -
+> [!DETAILS]- Click to expand/collapse the input source mapping file example/file/struct.json +> ```json +> { +> "vertices": [ +> { +> "label": "person", +> "input": { +> "type": "file", +> "path": "example/file/vertex_person.csv", +> "format": "CSV", +> "header": ["name", "age", "city"], +> "charset": "UTF-8", +> "skipped_line": { +> "regex": "(^#|^//).*" +> } +> }, +> "null_values": ["NULL", "null", ""] +> }, +> { +> "label": "software", +> "input": { +> "type": "file", +> "path": "example/file/vertex_software.txt", +> "format": "TEXT", +> "delimiter": "|", +> "charset": "GBK" +> }, +> "id": "id", +> "ignored": ["ISBN"] +> } +> ], +> "edges": [ +> { +> "label": "knows", +> "source": ["source_name"], +> "target": ["target_name"], +> "input": { +> "type": "file", +> "path": "example/file/edge_knows.json", +> "format": "JSON", +> "date_format": "yyyyMMdd" +> }, +> "field_mapping": { +> "source_name": "name", +> "target_name": "name" +> } +> }, +> { +> "label": "created", +> "source": ["source_name"], +> "target": ["target_id"], +> "input": { +> "type": "file", +> "path": "example/file/edge_created.json", +> "format": "JSON", +> "date_format": "yyyy-MM-dd" +> }, +> "field_mapping": { +> "source_name": "name" +> } +> } +> ] +> } +> ``` #### 4.4 Command to import diff --git a/content/en/featured-background.jpg b/content/en/featured-background.jpg index 8efa5cad4..a67fd5e3c 100644 Binary files a/content/en/featured-background.jpg and b/content/en/featured-background.jpg differ diff --git a/contribution.md b/contribution.md index a0e662aad..864c4a675 100644 --- a/contribution.md +++ b/contribution.md @@ -1,94 +1,74 @@ -# Contribution Guide - Detailed Reference +# HugeGraph documentation contribution guide -> **快速开始请看 [README.md](./README.md)**,这里是详细的参考文档。 +For the short workflow, start with [README.md](./README.md). This file records the production-equivalent checks for changes to the documentation website. -## PR 检查清单 +## Pull request checklist -提交 Pull Request 前请确认: +- [ ] Build the site with the strict production command and keep the complete exit status. +- [ ] Update both `content/en/` and `content/cn/` when the change applies to both languages. +- [ ] Include before/after screenshots for visual or navigation changes. +- [ ] Preserve public English routes under `/docs/...` and Chinese routes under `/cn/docs/...`. +- [ ] Link the related issue when one exists. -- [ ] 本地构建并验证了修改效果 -- [ ] 同时更新了中文 (`content/cn/`) 和英文 (`content/en/`) 版本 -- [ ] PR 描述中包含修改前后的截图对比 -- [ ] 如有相关 Issue,已在 PR 中关联 +## Pinned toolchain ---- +The site uses the Hugo Module recorded in `go.mod` and `go.sum`: -## How to help us (如何参与) - -1. 在本地 3 步快速构建官网环境,启动起来看下目前效果 (Auto reload) -2. 先 fork 仓库,然后基于 `master` 创建一个**新的**分支,修改完成后提交 PR ✅ (请在 PR 内**截图**对比一下修改**前后**的效果 & 简要说明,感谢) -3. 新增/修改网站/文档 (提供**中/英文**页面翻译,基本为 `markdown` 格式) - -Refer: 不熟悉 **github-pr** 流程的同学, 可参考[贡献流程](https://github.com/apache/hugegraph/blob/master/CONTRIBUTING.md)文档, 推荐使用 [github desktop](https://desktop.github.com/) 应用, 会简单方便许多~ - -**PS:** 可以参考其他官网的[源码](https://www.docsy.dev/docs/examples), 方便快速了解 docsy 主题结构. - -# How to start the website locally (hugo) +```text +Go: 1.27.0 or newer +Hugo Extended: 0.165.0 +OINK: v1.0.0 +``` -Only **3 steps** u can easily to get start~ +Node.js, npm, PostCSS, and a vendored Docsy checkout are not part of the build. -U should ensure NPM & Hugo binary [download url](https://github.com/gohugoio/hugo/releases) before start, -hugo binary must end with "**extended**" suffix, and we don't need to install go env, -just download hugo binary is fine (Note: the Hugo version can't be **too high**, try downgrade if failed) +Verify the resolved theme before editing: ```bash -# 0. install npm & hugo if you don't have it - -# Mac version (0.95 extend) -wget https://github.com/gohugoio/hugo/releases/download/v0.95.0/hugo_extended_0.95.0_macOS-64bit.tar.gz - -# Linux version (0.95 extend) -wget https://github.com/gohugoio/hugo/releases/download/v0.95.0/hugo_extended_0.95.0_Linux-64bit.tar.gz - -# 解压后 hugo 是单二进制文件, 可直接使用, 或推荐放 /usr/bin 及环境变量下. -sudo install hugo /usr/bin # 如果 mac 提示没有权限, 可以 sudo mv hugo /usr/local/bin - -# 1. download website's source code -git clone https://github.com/apache/hugegraph-doc.git website +hugo version +go version +hugo mod graph +``` -# (Optional) if download slowly or failed, try the proxy url -git clone https://api.mtr.pub/apache/hugegraph-doc.git website # or https://github.do/https://github.com/apache/hugegraph-doc.git +The module graph must contain exactly the pinned `github.com/pgsty/oink@v1.0.0` dependency for this site. -# 2. install npm dependencies in project root dir -cd website && npm install +## Local preview -# 3. just start server in localhost now (Don't need do anything else) +```bash +git clone https://github.com/apache/hugegraph-doc.git +cd hugegraph-doc hugo server - -# (optional) if you want modify ip or port, try like this -hugo server -b http://127.0.0.1 -p 80 --bind=0.0.0.0 - ``` -# How to modify the docsy theme (**Important**) - -Here we need FE to modify / enhance the css/js/theme config, and we also need to translate doc and website - -You can find detailed **theme instructions** in the [Docsy user guide - Content and Customization](https://www.docsy.dev/docs/adding-content/) +Open . The local preview includes the language-aware search index so search behavior can be checked before publication. -1. `config.toml` in the **root dir** is global config -2. `config.toml` in the `./themes/docsy` is theme config -3. `content` dir contains multi-language contents (docs/index-html/blog/about/bg-image), it's the most important dir - - `content/en` represent english site, we do need to translate the `doc` in it (可先用 Google/GPT 翻译) - - `content/cn` represent chinese site (需要汉化其中英文部分) +## Strict production build -We can see some [example website](https://www.docsy.dev/docs/examples/) & refer to their GitHub **source code** to reduce time to design +Run the same warning-strict build used by CI: -image +```bash +hugo --cleanDestinationDir --gc --minify \ + --environment production \ + --printPathWarnings \ + --printI18nWarnings \ + --panicOnWarning \ + --logLevel info +``` +A successful command proves that Hugo rendered the configured outputs. It does not replace browser checks for navigation, search, language switching, accessibility, mobile layout, print, or Content Security Policy behavior. -## Troubleshooting +## Repository structure -If you run into the following error: +- `content/en/` and `content/cn/` contain the bilingual source pages. +- `hugo.yaml` owns routing, languages, outputs, search, navigation, and OINK parameters. +- `data/home/.yaml` owns the bilingual homepage. +- `data/footer/.yaml` owns the bilingual footer. +- `i18n/cn.yaml` maps the preserved `cn` URL language key to the Simplified Chinese OINK interface catalogue. +- `assets/` and `static/` contain site-owned brand and compatibility assets. -``` -➜ hugo server +OINK is a module dependency. Do not copy or edit generated module-cache files. Site-specific overrides belong in the corresponding root `layouts/`, `assets/`, or data path and require focused regression evidence. -Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): -resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache -``` +## 中文说明 -This error occurs if you have not installed the extended version of [Hugo](https://github.com/gohugoio/hugo/releases). +提交前请同时检查中英文页面、公开 URL、搜索结果和语言切换。视觉或导航变更必须提供修改前后的桌面与移动端截图。构建成功只证明模板可以渲染,不能替代真实浏览器、无障碍、打印和 CSP 检查。 -[Docsy]: https://github.com/google/docsy -[example.docsy.dev]: https://example.docsy.dev diff --git a/data/docs_nav.json b/data/docs_nav.json new file mode 100644 index 000000000..1b13fd3bf --- /dev/null +++ b/data/docs_nav.json @@ -0,0 +1,1333 @@ +{ + "schemaVersion": 1, + "groups": [ + { + "id": "start", + "page": "/docs/_nav/start", + "children": [ + { + "page": "/docs/quickstart" + }, + { + "page": "/docs/introduction" + }, + { + "page": "/docs/quickstart/hugegraph/hugegraph-server" + }, + { + "page": "/docs/language/hugegraph-example" + }, + { + "page": "/docs/guides/hugegraph-docker-cluster" + } + ] + }, + { + "id": "components", + "page": "/docs/_nav/components", + "children": [ + { + "page": "/docs/quickstart/hugegraph", + "children": [ + { + "page": "/docs/quickstart/hugegraph/hugegraph-hstore" + }, + { + "page": "/docs/quickstart/hugegraph/hugegraph-pd" + } + ] + }, + { + "page": "/docs/quickstart/toolchain", + "children": [ + { + "page": "/docs/quickstart/toolchain/hugegraph-hubble" + }, + { + "page": "/docs/quickstart/toolchain/hugegraph-loader" + }, + { + "page": "/docs/quickstart/toolchain/hugegraph-spark-connector" + }, + { + "page": "/docs/quickstart/toolchain/hugegraph-tools" + } + ] + }, + { + "page": "/docs/quickstart/computing", + "children": [ + { + "page": "/docs/quickstart/computing/hugegraph-computer" + }, + { + "page": "/docs/quickstart/computing/hugegraph-computer-config" + }, + { + "page": "/docs/quickstart/computing/hugegraph-vermeer" + } + ] + }, + { + "page": "/docs/quickstart/hugegraph-ai", + "children": [ + { + "page": "/docs/quickstart/hugegraph-ai/quick_start" + }, + { + "page": "/docs/quickstart/hugegraph-ai/hugegraph-llm" + }, + { + "page": "/docs/quickstart/hugegraph-ai/hugegraph-ml" + }, + { + "page": "/docs/quickstart/hugegraph-ai/config-reference" + }, + { + "page": "/docs/quickstart/hugegraph-ai/rest-api" + } + ] + }, + { + "page": "/docs/quickstart/hugegraph-spark" + }, + { + "page": "/docs/quickstart/hugegraph-studio" + } + ] + }, + { + "id": "develop", + "page": "/docs/_nav/develop", + "children": [ + { + "page": "/docs/clients", + "children": [ + { + "page": "/docs/clients/hugegraph-client" + }, + { + "page": "/docs/clients/gremlin-console" + }, + { + "page": "/docs/clients/restful-api", + "children": [ + { + "page": "/docs/clients/restful-api/graphs" + }, + { + "page": "/docs/clients/restful-api/graphspace" + }, + { + "page": "/docs/clients/restful-api/auth" + }, + { + "page": "/docs/clients/restful-api/schema" + }, + { + "page": "/docs/clients/restful-api/propertykey" + }, + { + "page": "/docs/clients/restful-api/vertexlabel" + }, + { + "page": "/docs/clients/restful-api/edgelabel" + }, + { + "page": "/docs/clients/restful-api/indexlabel" + }, + { + "page": "/docs/clients/restful-api/vertex" + }, + { + "page": "/docs/clients/restful-api/edge" + }, + { + "page": "/docs/clients/restful-api/variable" + }, + { + "page": "/docs/clients/restful-api/gremlin" + }, + { + "page": "/docs/clients/restful-api/cypher" + }, + { + "page": "/docs/clients/restful-api/traverser" + }, + { + "page": "/docs/clients/restful-api/task" + }, + { + "page": "/docs/clients/restful-api/rebuild" + }, + { + "page": "/docs/clients/restful-api/rank" + }, + { + "page": "/docs/clients/restful-api/metrics" + }, + { + "page": "/docs/clients/restful-api/other" + } + ] + } + ] + }, + { + "page": "/docs/quickstart/client", + "children": [ + { + "page": "/docs/quickstart/client/hugegraph-client" + }, + { + "page": "/docs/quickstart/client/hugegraph-client-python" + }, + { + "page": "/docs/quickstart/client/hugegraph-client-go" + } + ] + }, + { + "page": "/docs/language", + "children": [ + { + "page": "/docs/language/hugegraph-gremlin" + } + ] + }, + { + "page": "/docs/guides/architectural" + }, + { + "page": "/docs/guides/desgin-concept" + }, + { + "page": "/docs/guides/custom-plugin" + }, + { + "page": "/docs/guides/toolchain-local-test" + } + ] + }, + { + "id": "operate", + "page": "/docs/_nav/operate", + "children": [ + { + "page": "/docs/config", + "children": [ + { + "page": "/docs/config/config-guide" + }, + { + "page": "/docs/config/config-option" + }, + { + "page": "/docs/config/config-authentication" + }, + { + "page": "/docs/config/config-https" + } + ] + }, + { + "page": "/docs/guides/backup-restore" + }, + { + "page": "/docs/guides/security" + }, + { + "page": "/docs/guides/faq" + }, + { + "page": "/docs/performance", + "children": [ + { + "page": "/docs/performance/api-performance", + "children": [ + { + "page": "/docs/performance/api-performance/hugegraph-api-0.2" + }, + { + "page": "/docs/performance/api-performance/hugegraph-api-0.4.4" + }, + { + "page": "/docs/performance/api-performance/hugegraph-api-0.5.6-cassandra" + }, + { + "page": "/docs/performance/api-performance/hugegraph-api-0.5.6-rocksdb" + } + ] + }, + { + "page": "/docs/performance/hugegraph-benchmark-0.4.4" + }, + { + "page": "/docs/performance/hugegraph-benchmark-0.5.6" + }, + { + "page": "/docs/performance/hugegraph-loader-performance" + } + ] + } + ] + }, + { + "id": "reference", + "page": "/docs/_nav/reference", + "children": [ + { + "page": "/docs/guides" + }, + { + "page": "/docs/changelog", + "children": [ + { + "page": "/docs/changelog/hugegraph-1.0.0-release-notes" + }, + { + "page": "/docs/changelog/hugegraph-1.2.0-release-notes" + }, + { + "page": "/docs/changelog/hugegraph-1.3.0-release-notes" + }, + { + "page": "/docs/changelog/hugegraph-1.5.0-release-notes" + }, + { + "page": "/docs/changelog/hugegraph-1.7.0-release-notes" + } + ] + }, + { + "page": "/docs/download/download" + }, + { + "page": "/docs/contribution-guidelines", + "children": [ + { + "page": "/docs/contribution-guidelines/contribute" + }, + { + "page": "/docs/contribution-guidelines/committer-guidelines" + }, + { + "page": "/docs/contribution-guidelines/subscribe" + }, + { + "page": "/docs/contribution-guidelines/validate-release" + }, + { + "page": "/docs/contribution-guidelines/hugegraph-server-idea-setup" + } + ] + }, + { + "page": "/docs/cla" + } + ] + } + ], + "sections": [ + { + "page": "/docs/_nav/start", + "url": "@group/start", + "children": [ + { + "page": "/docs/quickstart", + "url": "/docs/quickstart/", + "children": [] + }, + { + "page": "/docs/introduction", + "url": "/docs/introduction/", + "children": [] + }, + { + "page": "/docs/quickstart/hugegraph/hugegraph-server", + "url": "/docs/quickstart/hugegraph/hugegraph-server/", + "children": [] + }, + { + "page": "/docs/language/hugegraph-example", + "url": "/docs/language/hugegraph-example/", + "children": [] + }, + { + "page": "/docs/guides/hugegraph-docker-cluster", + "url": "/docs/guides/hugegraph-docker-cluster/", + "children": [] + } + ], + "group": "start" + }, + { + "page": "/docs/_nav/components", + "url": "@group/components", + "children": [ + { + "page": "/docs/quickstart/hugegraph", + "url": "/docs/quickstart/hugegraph/", + "children": [ + { + "page": "/docs/quickstart/hugegraph/hugegraph-hstore", + "url": "/docs/quickstart/hugegraph/hugegraph-hstore/", + "children": [] + }, + { + "page": "/docs/quickstart/hugegraph/hugegraph-pd", + "url": "/docs/quickstart/hugegraph/hugegraph-pd/", + "children": [] + } + ] + }, + { + "page": "/docs/quickstart/toolchain", + "url": "/docs/quickstart/toolchain/", + "children": [ + { + "page": "/docs/quickstart/toolchain/hugegraph-hubble", + "url": "/docs/quickstart/toolchain/hugegraph-hubble/", + "children": [] + }, + { + "page": "/docs/quickstart/toolchain/hugegraph-loader", + "url": "/docs/quickstart/toolchain/hugegraph-loader/", + "children": [] + }, + { + "page": "/docs/quickstart/toolchain/hugegraph-spark-connector", + "url": "/docs/quickstart/toolchain/hugegraph-spark-connector/", + "children": [] + }, + { + "page": "/docs/quickstart/toolchain/hugegraph-tools", + "url": "/docs/quickstart/toolchain/hugegraph-tools/", + "children": [] + } + ] + }, + { + "page": "/docs/quickstart/computing", + "url": "/docs/quickstart/computing/", + "children": [ + { + "page": "/docs/quickstart/computing/hugegraph-computer", + "url": "/docs/quickstart/computing/hugegraph-computer/", + "children": [] + }, + { + "page": "/docs/quickstart/computing/hugegraph-computer-config", + "url": "/docs/quickstart/computing/hugegraph-computer-config/", + "children": [] + }, + { + "page": "/docs/quickstart/computing/hugegraph-vermeer", + "url": "/docs/quickstart/computing/hugegraph-vermeer/", + "children": [] + } + ] + }, + { + "page": "/docs/quickstart/hugegraph-ai", + "url": "/docs/quickstart/hugegraph-ai/", + "children": [ + { + "page": "/docs/quickstart/hugegraph-ai/quick_start", + "url": "/docs/quickstart/hugegraph-ai/quick_start/", + "children": [] + }, + { + "page": "/docs/quickstart/hugegraph-ai/hugegraph-llm", + "url": "/docs/quickstart/hugegraph-ai/hugegraph-llm/", + "children": [] + }, + { + "page": "/docs/quickstart/hugegraph-ai/hugegraph-ml", + "url": "/docs/quickstart/hugegraph-ai/hugegraph-ml/", + "children": [] + }, + { + "page": "/docs/quickstart/hugegraph-ai/config-reference", + "url": "/docs/quickstart/hugegraph-ai/config-reference/", + "children": [] + }, + { + "page": "/docs/quickstart/hugegraph-ai/rest-api", + "url": "/docs/quickstart/hugegraph-ai/rest-api/", + "children": [] + } + ] + } + ], + "group": "components" + }, + { + "page": "/docs/_nav/develop", + "url": "@group/develop", + "children": [ + { + "page": "/docs/clients", + "url": "/docs/clients/", + "children": [ + { + "page": "/docs/clients/hugegraph-client", + "url": "/docs/clients/hugegraph-client/", + "children": [] + }, + { + "page": "/docs/clients/gremlin-console", + "url": "/docs/clients/gremlin-console/", + "children": [] + }, + { + "page": "/docs/clients/restful-api", + "url": "/docs/clients/restful-api/", + "children": [ + { + "page": "/docs/clients/restful-api/graphs", + "url": "/docs/clients/restful-api/graphs/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/graphspace", + "url": "/docs/clients/restful-api/graphspace/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/auth", + "url": "/docs/clients/restful-api/auth/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/schema", + "url": "/docs/clients/restful-api/schema/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/propertykey", + "url": "/docs/clients/restful-api/propertykey/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/vertexlabel", + "url": "/docs/clients/restful-api/vertexlabel/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/edgelabel", + "url": "/docs/clients/restful-api/edgelabel/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/indexlabel", + "url": "/docs/clients/restful-api/indexlabel/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/vertex", + "url": "/docs/clients/restful-api/vertex/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/edge", + "url": "/docs/clients/restful-api/edge/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/variable", + "url": "/docs/clients/restful-api/variable/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/gremlin", + "url": "/docs/clients/restful-api/gremlin/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/cypher", + "url": "/docs/clients/restful-api/cypher/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/traverser", + "url": "/docs/clients/restful-api/traverser/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/task", + "url": "/docs/clients/restful-api/task/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/rebuild", + "url": "/docs/clients/restful-api/rebuild/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/rank", + "url": "/docs/clients/restful-api/rank/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/metrics", + "url": "/docs/clients/restful-api/metrics/", + "children": [] + }, + { + "page": "/docs/clients/restful-api/other", + "url": "/docs/clients/restful-api/other/", + "children": [] + } + ] + } + ] + }, + { + "page": "/docs/quickstart/client", + "url": "/docs/quickstart/client/", + "children": [ + { + "page": "/docs/quickstart/client/hugegraph-client", + "url": "/docs/quickstart/client/hugegraph-client/", + "children": [] + }, + { + "page": "/docs/quickstart/client/hugegraph-client-python", + "url": "/docs/quickstart/client/hugegraph-client-python/", + "children": [] + }, + { + "page": "/docs/quickstart/client/hugegraph-client-go", + "url": "/docs/quickstart/client/hugegraph-client-go/", + "children": [] + } + ] + }, + { + "page": "/docs/language", + "url": "/docs/language/", + "children": [ + { + "page": "/docs/language/hugegraph-gremlin", + "url": "/docs/language/hugegraph-gremlin/", + "children": [] + } + ] + }, + { + "page": "/docs/guides/architectural", + "url": "/docs/guides/architectural/", + "children": [] + }, + { + "page": "/docs/guides/desgin-concept", + "url": "/docs/guides/desgin-concept/", + "children": [] + }, + { + "page": "/docs/guides/custom-plugin", + "url": "/docs/guides/custom-plugin/", + "children": [] + }, + { + "page": "/docs/guides/toolchain-local-test", + "url": "/docs/guides/toolchain-local-test/", + "children": [] + } + ], + "group": "develop" + }, + { + "page": "/docs/_nav/operate", + "url": "@group/operate", + "children": [ + { + "page": "/docs/config", + "url": "/docs/config/", + "children": [ + { + "page": "/docs/config/config-guide", + "url": "/docs/config/config-guide/", + "children": [] + }, + { + "page": "/docs/config/config-option", + "url": "/docs/config/config-option/", + "children": [] + }, + { + "page": "/docs/config/config-authentication", + "url": "/docs/config/config-authentication/", + "children": [] + }, + { + "page": "/docs/config/config-https", + "url": "/docs/config/config-https/", + "children": [] + } + ] + }, + { + "page": "/docs/guides/backup-restore", + "url": "/docs/guides/backup-restore/", + "children": [] + }, + { + "page": "/docs/guides/security", + "url": "/docs/guides/security/", + "children": [] + }, + { + "page": "/docs/guides/faq", + "url": "/docs/guides/faq/", + "children": [] + }, + { + "page": "/docs/performance", + "url": "/docs/performance/", + "children": [ + { + "page": "/docs/performance/api-performance", + "url": "/docs/performance/api-performance/", + "children": [ + { + "page": "/docs/performance/api-performance/hugegraph-api-0.5.6-cassandra", + "url": "/docs/performance/api-performance/hugegraph-api-0.5.6-cassandra/", + "children": [] + }, + { + "page": "/docs/performance/api-performance/hugegraph-api-0.5.6-rocksdb", + "url": "/docs/performance/api-performance/hugegraph-api-0.5.6-rocksdb/", + "children": [] + } + ] + }, + { + "page": "/docs/performance/hugegraph-benchmark-0.4.4", + "url": "/docs/performance/hugegraph-benchmark-0.4.4/", + "children": [] + }, + { + "page": "/docs/performance/hugegraph-benchmark-0.5.6", + "url": "/docs/performance/hugegraph-benchmark-0.5.6/", + "children": [] + }, + { + "page": "/docs/performance/hugegraph-loader-performance", + "url": "/docs/performance/hugegraph-loader-performance/", + "children": [] + } + ] + } + ], + "group": "operate" + }, + { + "page": "/docs/_nav/reference", + "url": "@group/reference", + "children": [ + { + "page": "/docs/guides", + "url": "/docs/guides/", + "children": [] + }, + { + "page": "/docs/changelog", + "url": "/docs/changelog/", + "children": [ + { + "page": "/docs/changelog/hugegraph-1.0.0-release-notes", + "url": "/docs/changelog/hugegraph-1.0.0-release-notes/", + "children": [] + }, + { + "page": "/docs/changelog/hugegraph-1.2.0-release-notes", + "url": "/docs/changelog/hugegraph-1.2.0-release-notes/", + "children": [] + }, + { + "page": "/docs/changelog/hugegraph-1.3.0-release-notes", + "url": "/docs/changelog/hugegraph-1.3.0-release-notes/", + "children": [] + }, + { + "page": "/docs/changelog/hugegraph-1.5.0-release-notes", + "url": "/docs/changelog/hugegraph-1.5.0-release-notes/", + "children": [] + }, + { + "page": "/docs/changelog/hugegraph-1.7.0-release-notes", + "url": "/docs/changelog/hugegraph-1.7.0-release-notes/", + "children": [] + } + ] + }, + { + "page": "/docs/download/download", + "url": "/docs/download/download/", + "children": [] + }, + { + "page": "/docs/contribution-guidelines", + "url": "/docs/contribution-guidelines/", + "children": [ + { + "page": "/docs/contribution-guidelines/contribute", + "url": "/docs/contribution-guidelines/contribute/", + "children": [] + }, + { + "page": "/docs/contribution-guidelines/committer-guidelines", + "url": "/docs/contribution-guidelines/committer-guidelines/", + "children": [] + }, + { + "page": "/docs/contribution-guidelines/subscribe", + "url": "/docs/contribution-guidelines/subscribe/", + "children": [] + }, + { + "page": "/docs/contribution-guidelines/validate-release", + "url": "/docs/contribution-guidelines/validate-release/", + "children": [] + }, + { + "page": "/docs/contribution-guidelines/hugegraph-server-idea-setup", + "url": "/docs/contribution-guidelines/hugegraph-server-idea-setup/", + "children": [] + } + ] + }, + { + "page": "/docs/cla", + "url": "/docs/cla/", + "children": [] + } + ], + "group": "reference" + } + ], + "active_path_by_url": { + "/docs/quickstart/": [ + "@group/start", + "/docs/quickstart/" + ], + "/docs/introduction/": [ + "@group/start", + "/docs/introduction/" + ], + "/docs/quickstart/hugegraph/hugegraph-server/": [ + "@group/start", + "/docs/quickstart/hugegraph/hugegraph-server/" + ], + "/docs/language/hugegraph-example/": [ + "@group/start", + "/docs/language/hugegraph-example/" + ], + "/docs/guides/hugegraph-docker-cluster/": [ + "@group/start", + "/docs/guides/hugegraph-docker-cluster/" + ], + "/docs/quickstart/hugegraph/": [ + "@group/components", + "/docs/quickstart/hugegraph/" + ], + "/docs/quickstart/hugegraph/hugegraph-hstore/": [ + "@group/components", + "/docs/quickstart/hugegraph/", + "/docs/quickstart/hugegraph/hugegraph-hstore/" + ], + "/docs/quickstart/hugegraph/hugegraph-pd/": [ + "@group/components", + "/docs/quickstart/hugegraph/", + "/docs/quickstart/hugegraph/hugegraph-pd/" + ], + "/docs/quickstart/toolchain/": [ + "@group/components", + "/docs/quickstart/toolchain/" + ], + "/docs/quickstart/toolchain/hugegraph-hubble/": [ + "@group/components", + "/docs/quickstart/toolchain/", + "/docs/quickstart/toolchain/hugegraph-hubble/" + ], + "/docs/quickstart/toolchain/hugegraph-loader/": [ + "@group/components", + "/docs/quickstart/toolchain/", + "/docs/quickstart/toolchain/hugegraph-loader/" + ], + "/docs/quickstart/toolchain/hugegraph-spark-connector/": [ + "@group/components", + "/docs/quickstart/toolchain/", + "/docs/quickstart/toolchain/hugegraph-spark-connector/" + ], + "/docs/quickstart/toolchain/hugegraph-tools/": [ + "@group/components", + "/docs/quickstart/toolchain/", + "/docs/quickstart/toolchain/hugegraph-tools/" + ], + "/docs/quickstart/computing/": [ + "@group/components", + "/docs/quickstart/computing/" + ], + "/docs/quickstart/computing/hugegraph-computer/": [ + "@group/components", + "/docs/quickstart/computing/", + "/docs/quickstart/computing/hugegraph-computer/" + ], + "/docs/quickstart/computing/hugegraph-computer-config/": [ + "@group/components", + "/docs/quickstart/computing/", + "/docs/quickstart/computing/hugegraph-computer-config/" + ], + "/docs/quickstart/computing/hugegraph-vermeer/": [ + "@group/components", + "/docs/quickstart/computing/", + "/docs/quickstart/computing/hugegraph-vermeer/" + ], + "/docs/quickstart/hugegraph-ai/": [ + "@group/components", + "/docs/quickstart/hugegraph-ai/" + ], + "/docs/quickstart/hugegraph-ai/quick_start/": [ + "@group/components", + "/docs/quickstart/hugegraph-ai/", + "/docs/quickstart/hugegraph-ai/quick_start/" + ], + "/docs/quickstart/hugegraph-ai/hugegraph-llm/": [ + "@group/components", + "/docs/quickstart/hugegraph-ai/", + "/docs/quickstart/hugegraph-ai/hugegraph-llm/" + ], + "/docs/quickstart/hugegraph-ai/hugegraph-ml/": [ + "@group/components", + "/docs/quickstart/hugegraph-ai/", + "/docs/quickstart/hugegraph-ai/hugegraph-ml/" + ], + "/docs/quickstart/hugegraph-ai/config-reference/": [ + "@group/components", + "/docs/quickstart/hugegraph-ai/", + "/docs/quickstart/hugegraph-ai/config-reference/" + ], + "/docs/quickstart/hugegraph-ai/rest-api/": [ + "@group/components", + "/docs/quickstart/hugegraph-ai/", + "/docs/quickstart/hugegraph-ai/rest-api/" + ], + "/docs/clients/": [ + "@group/develop", + "/docs/clients/" + ], + "/docs/clients/hugegraph-client/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/hugegraph-client/" + ], + "/docs/clients/gremlin-console/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/gremlin-console/" + ], + "/docs/clients/restful-api/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/" + ], + "/docs/clients/restful-api/graphs/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/graphs/" + ], + "/docs/clients/restful-api/graphspace/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/graphspace/" + ], + "/docs/clients/restful-api/auth/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/auth/" + ], + "/docs/clients/restful-api/schema/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/schema/" + ], + "/docs/clients/restful-api/propertykey/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/propertykey/" + ], + "/docs/clients/restful-api/vertexlabel/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/vertexlabel/" + ], + "/docs/clients/restful-api/edgelabel/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/edgelabel/" + ], + "/docs/clients/restful-api/indexlabel/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/indexlabel/" + ], + "/docs/clients/restful-api/vertex/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/vertex/" + ], + "/docs/clients/restful-api/edge/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/edge/" + ], + "/docs/clients/restful-api/variable/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/variable/" + ], + "/docs/clients/restful-api/gremlin/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/gremlin/" + ], + "/docs/clients/restful-api/cypher/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/cypher/" + ], + "/docs/clients/restful-api/traverser/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/traverser/" + ], + "/docs/clients/restful-api/task/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/task/" + ], + "/docs/clients/restful-api/rebuild/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/rebuild/" + ], + "/docs/clients/restful-api/rank/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/rank/" + ], + "/docs/clients/restful-api/metrics/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/metrics/" + ], + "/docs/clients/restful-api/other/": [ + "@group/develop", + "/docs/clients/", + "/docs/clients/restful-api/", + "/docs/clients/restful-api/other/" + ], + "/docs/quickstart/client/": [ + "@group/develop", + "/docs/quickstart/client/" + ], + "/docs/quickstart/client/hugegraph-client/": [ + "@group/develop", + "/docs/quickstart/client/", + "/docs/quickstart/client/hugegraph-client/" + ], + "/docs/quickstart/client/hugegraph-client-python/": [ + "@group/develop", + "/docs/quickstart/client/", + "/docs/quickstart/client/hugegraph-client-python/" + ], + "/docs/quickstart/client/hugegraph-client-go/": [ + "@group/develop", + "/docs/quickstart/client/", + "/docs/quickstart/client/hugegraph-client-go/" + ], + "/docs/language/": [ + "@group/develop", + "/docs/language/" + ], + "/docs/language/hugegraph-gremlin/": [ + "@group/develop", + "/docs/language/", + "/docs/language/hugegraph-gremlin/" + ], + "/docs/guides/architectural/": [ + "@group/develop", + "/docs/guides/architectural/" + ], + "/docs/guides/desgin-concept/": [ + "@group/develop", + "/docs/guides/desgin-concept/" + ], + "/docs/guides/custom-plugin/": [ + "@group/develop", + "/docs/guides/custom-plugin/" + ], + "/docs/guides/toolchain-local-test/": [ + "@group/develop", + "/docs/guides/toolchain-local-test/" + ], + "/docs/config/": [ + "@group/operate", + "/docs/config/" + ], + "/docs/config/config-guide/": [ + "@group/operate", + "/docs/config/", + "/docs/config/config-guide/" + ], + "/docs/config/config-option/": [ + "@group/operate", + "/docs/config/", + "/docs/config/config-option/" + ], + "/docs/config/config-authentication/": [ + "@group/operate", + "/docs/config/", + "/docs/config/config-authentication/" + ], + "/docs/config/config-https/": [ + "@group/operate", + "/docs/config/", + "/docs/config/config-https/" + ], + "/docs/guides/backup-restore/": [ + "@group/operate", + "/docs/guides/backup-restore/" + ], + "/docs/guides/security/": [ + "@group/operate", + "/docs/guides/security/" + ], + "/docs/guides/faq/": [ + "@group/operate", + "/docs/guides/faq/" + ], + "/docs/performance/": [ + "@group/operate", + "/docs/performance/" + ], + "/docs/performance/api-performance/": [ + "@group/operate", + "/docs/performance/", + "/docs/performance/api-performance/" + ], + "/docs/performance/api-performance/hugegraph-api-0.5.6-cassandra/": [ + "@group/operate", + "/docs/performance/", + "/docs/performance/api-performance/", + "/docs/performance/api-performance/hugegraph-api-0.5.6-cassandra/" + ], + "/docs/performance/api-performance/hugegraph-api-0.5.6-rocksdb/": [ + "@group/operate", + "/docs/performance/", + "/docs/performance/api-performance/", + "/docs/performance/api-performance/hugegraph-api-0.5.6-rocksdb/" + ], + "/docs/performance/hugegraph-benchmark-0.4.4/": [ + "@group/operate", + "/docs/performance/", + "/docs/performance/hugegraph-benchmark-0.4.4/" + ], + "/docs/performance/hugegraph-benchmark-0.5.6/": [ + "@group/operate", + "/docs/performance/", + "/docs/performance/hugegraph-benchmark-0.5.6/" + ], + "/docs/performance/hugegraph-loader-performance/": [ + "@group/operate", + "/docs/performance/", + "/docs/performance/hugegraph-loader-performance/" + ], + "/docs/guides/": [ + "@group/reference", + "/docs/guides/" + ], + "/docs/changelog/": [ + "@group/reference", + "/docs/changelog/" + ], + "/docs/changelog/hugegraph-1.0.0-release-notes/": [ + "@group/reference", + "/docs/changelog/", + "/docs/changelog/hugegraph-1.0.0-release-notes/" + ], + "/docs/changelog/hugegraph-1.2.0-release-notes/": [ + "@group/reference", + "/docs/changelog/", + "/docs/changelog/hugegraph-1.2.0-release-notes/" + ], + "/docs/changelog/hugegraph-1.3.0-release-notes/": [ + "@group/reference", + "/docs/changelog/", + "/docs/changelog/hugegraph-1.3.0-release-notes/" + ], + "/docs/changelog/hugegraph-1.5.0-release-notes/": [ + "@group/reference", + "/docs/changelog/", + "/docs/changelog/hugegraph-1.5.0-release-notes/" + ], + "/docs/changelog/hugegraph-1.7.0-release-notes/": [ + "@group/reference", + "/docs/changelog/", + "/docs/changelog/hugegraph-1.7.0-release-notes/" + ], + "/docs/download/download/": [ + "@group/reference", + "/docs/download/download/" + ], + "/docs/contribution-guidelines/": [ + "@group/reference", + "/docs/contribution-guidelines/" + ], + "/docs/contribution-guidelines/contribute/": [ + "@group/reference", + "/docs/contribution-guidelines/", + "/docs/contribution-guidelines/contribute/" + ], + "/docs/contribution-guidelines/committer-guidelines/": [ + "@group/reference", + "/docs/contribution-guidelines/", + "/docs/contribution-guidelines/committer-guidelines/" + ], + "/docs/contribution-guidelines/subscribe/": [ + "@group/reference", + "/docs/contribution-guidelines/", + "/docs/contribution-guidelines/subscribe/" + ], + "/docs/contribution-guidelines/validate-release/": [ + "@group/reference", + "/docs/contribution-guidelines/", + "/docs/contribution-guidelines/validate-release/" + ], + "/docs/contribution-guidelines/hugegraph-server-idea-setup/": [ + "@group/reference", + "/docs/contribution-guidelines/", + "/docs/contribution-guidelines/hugegraph-server-idea-setup/" + ], + "/docs/cla/": [ + "@group/reference", + "/docs/cla/" + ] + }, + "children_by_url": { + "/docs/": [ + "/docs/_nav/start", + "/docs/_nav/components", + "/docs/_nav/develop", + "/docs/_nav/operate", + "/docs/_nav/reference" + ], + "/docs/quickstart/hugegraph/": [ + "/docs/quickstart/hugegraph/hugegraph-hstore", + "/docs/quickstart/hugegraph/hugegraph-pd" + ], + "/docs/quickstart/toolchain/": [ + "/docs/quickstart/toolchain/hugegraph-hubble", + "/docs/quickstart/toolchain/hugegraph-loader", + "/docs/quickstart/toolchain/hugegraph-spark-connector", + "/docs/quickstart/toolchain/hugegraph-tools" + ], + "/docs/quickstart/computing/": [ + "/docs/quickstart/computing/hugegraph-computer", + "/docs/quickstart/computing/hugegraph-computer-config", + "/docs/quickstart/computing/hugegraph-vermeer" + ], + "/docs/quickstart/hugegraph-ai/": [ + "/docs/quickstart/hugegraph-ai/quick_start", + "/docs/quickstart/hugegraph-ai/hugegraph-llm", + "/docs/quickstart/hugegraph-ai/hugegraph-ml", + "/docs/quickstart/hugegraph-ai/config-reference", + "/docs/quickstart/hugegraph-ai/rest-api" + ], + "/docs/clients/": [ + "/docs/clients/hugegraph-client", + "/docs/clients/gremlin-console", + "/docs/clients/restful-api" + ], + "/docs/clients/restful-api/": [ + "/docs/clients/restful-api/graphs", + "/docs/clients/restful-api/graphspace", + "/docs/clients/restful-api/auth", + "/docs/clients/restful-api/schema", + "/docs/clients/restful-api/propertykey", + "/docs/clients/restful-api/vertexlabel", + "/docs/clients/restful-api/edgelabel", + "/docs/clients/restful-api/indexlabel", + "/docs/clients/restful-api/vertex", + "/docs/clients/restful-api/edge", + "/docs/clients/restful-api/variable", + "/docs/clients/restful-api/gremlin", + "/docs/clients/restful-api/cypher", + "/docs/clients/restful-api/traverser", + "/docs/clients/restful-api/task", + "/docs/clients/restful-api/rebuild", + "/docs/clients/restful-api/rank", + "/docs/clients/restful-api/metrics", + "/docs/clients/restful-api/other" + ], + "/docs/quickstart/client/": [ + "/docs/quickstart/client/hugegraph-client", + "/docs/quickstart/client/hugegraph-client-python", + "/docs/quickstart/client/hugegraph-client-go" + ], + "/docs/language/": [ + "/docs/language/hugegraph-gremlin" + ], + "/docs/config/": [ + "/docs/config/config-guide", + "/docs/config/config-option", + "/docs/config/config-authentication", + "/docs/config/config-https" + ], + "/docs/performance/": [ + "/docs/performance/api-performance", + "/docs/performance/hugegraph-benchmark-0.4.4", + "/docs/performance/hugegraph-benchmark-0.5.6", + "/docs/performance/hugegraph-loader-performance" + ], + "/docs/performance/api-performance/": [ + "/docs/performance/api-performance/hugegraph-api-0.5.6-cassandra", + "/docs/performance/api-performance/hugegraph-api-0.5.6-rocksdb" + ], + "/docs/changelog/": [ + "/docs/changelog/hugegraph-1.0.0-release-notes", + "/docs/changelog/hugegraph-1.2.0-release-notes", + "/docs/changelog/hugegraph-1.3.0-release-notes", + "/docs/changelog/hugegraph-1.5.0-release-notes", + "/docs/changelog/hugegraph-1.7.0-release-notes" + ], + "/docs/contribution-guidelines/": [ + "/docs/contribution-guidelines/contribute", + "/docs/contribution-guidelines/committer-guidelines", + "/docs/contribution-guidelines/subscribe", + "/docs/contribution-guidelines/validate-release", + "/docs/contribution-guidelines/hugegraph-server-idea-setup" + ] + } +} diff --git a/data/footer/cn.yaml b/data/footer/cn.yaml new file mode 100644 index 000000000..904dd933f --- /dev/null +++ b/data/footer/cn.yaml @@ -0,0 +1,9 @@ +brand: + name: The Apache Software Foundation + logo: img/apache_logo.svg +nav_label: Apache 链接 +links: + - { label: 基金会, url: 'https://www.apache.org/', external: true } + - { label: 许可证, url: 'https://www.apache.org/licenses/', external: true } + - { label: 安全, url: /cn/docs/guides/security/ } + - { label: 赞助, url: 'https://www.apache.org/foundation/sponsorship.html', external: true } diff --git a/data/footer/en.yaml b/data/footer/en.yaml new file mode 100644 index 000000000..7336878e0 --- /dev/null +++ b/data/footer/en.yaml @@ -0,0 +1,9 @@ +brand: + name: The Apache Software Foundation + logo: img/apache_logo.svg +nav_label: Apache links +links: + - { label: Foundation, url: 'https://www.apache.org/', external: true } + - { label: License, url: 'https://www.apache.org/licenses/', external: true } + - { label: Security, url: /docs/guides/security/ } + - { label: Sponsorship, url: 'https://www.apache.org/foundation/sponsorship.html', external: true } diff --git a/data/home/cn.yaml b/data/home/cn.yaml new file mode 100644 index 000000000..847929261 --- /dev/null +++ b/data/home/cn.yaml @@ -0,0 +1,74 @@ +sections: + - hero + - { type: markdown, key: introduction } + - { type: cards, key: capabilities } + - { type: markdown, key: tlp } + - { type: cards, key: community } + - { type: markdown, key: welcome } + +hero: + align: center + class: hg-home-hero + title: Apache HugeGraph + lead: HugeGraph 是一套全栈图系统,覆盖 [图数据库](docs/quickstart/hugegraph/hugegraph-server/)、[图计算](docs/quickstart/computing/hugegraph-computer/) 与 [图 AI](docs/quickstart/hugegraph-ai/)。 + note: 支持从数据存储、实时查询到离线分析的完整图数据处理能力,并支持 [Gremlin](docs/language/hugegraph-gremlin/) 与 [Cypher](docs/clients/restful-api/cypher/) 查询语言。 + actions: + - { label: 了解更多, url: docs/, icon: fa-solid fa-circle-arrow-right, style: primary } + - { label: 下载, url: docs/download/download/, icon: fa-brands fa-github, style: ghost } + +introduction: + class: hg-home-introduction + body: |- + HugeGraph 最高支持千亿级图数据高速导入与毫秒级实时查询,可与 Spark、Flink 等大数据平台深度集成,并可通过 [HugeGraph 工具链](docs/quickstart/toolchain/)快速完成导入、可视化与运维。 + + 在 AI 时代,通过与大语言模型 (LLM) 结合,为智能问答、推荐系统、风控反欺诈、知识图谱等场景提供强大的图计算能力。 + +capabilities: + class: hg-home-capabilities + columns: 3 + items: + - title: 易用 + icon: fa-solid fa-lightbulb + desc: 支持 Gremlin 图查询语言与 [**RESTful API**](docs/clients/restful-api/),并提供图检索常用接口,具备齐全的周边工具,支持分布式存储、数据多副本及横向扩容,内置多种后端存储引擎,轻松实现各种查询、分析。 + - title: 高效 + icon: fa-solid fa-truck-fast + desc: 在图存储和图计算方面做了深度优化,提供 [**批量导入工具**](docs/quickstart/toolchain/hugegraph-loader/),轻松完成百亿级数据快速导入,通过优化过的查询达到图检索的毫秒级响应,支持数千用户并发的在线实时操作。 + - title: 通用 + icon: fa-solid fa-arrow-right-arrow-left + desc: 支持 Apache Gremlin 标准图查询语言和 Property Graph 标准图建模方法,支持基于图的 OLTP 和 [**OLAP 图计算**](docs/quickstart/computing/hugegraph-computer/)方案。集成 Apache Hadoop 及 Apache Spark 大数据平台,也可插件式轻松扩展后端存储引擎。 + - title: 智能化 + icon: fa-solid fa-brain + desc: 集成 LLM 实现 [**GraphRAG 能力**](docs/quickstart/hugegraph-ai/)、自动化知识图谱构建,内置 20+ 图机器学习算法,轻松构建 AI 驱动的图应用。 + - title: 可扩展 + icon: fa-solid fa-up-right-and-down-left-from-center + desc: 支持水平扩容和分布式部署,从单机到 PB 级集群无缝迁移,提供 [**分布式存储引擎**](docs/quickstart/hugegraph/hugegraph-hstore/)适配,满足不同规模和性能需求。 + - title: 开放生态 + icon: fa-solid fa-puzzle-piece + desc: 遵循 Apache TinkerPop 标准,提供 [**多语言客户端**](docs/quickstart/client/hugegraph-client/),兼容主流大数据平台,社区活跃持续演进。 + +tlp: + class: hg-home-band hg-home-tlp + title: 首个 Apache 基金会的顶级图项目 + +community: + class: hg-home-community + columns: 3 + items: + - title: 使用易用的**工具链** + icon: fa-solid fa-screwdriver-wrench + desc: 可从[此](https://github.com/apache/hugegraph-toolchain)获取图数据导入工具, 可视化界面以及备份还原迁移工具, 欢迎使用 + - title: 参与开源 + icon: fa-brands fa-github + url: https://github.com/apache/hugegraph + external: true + desc: 我们可以在 **Github** 上提交 [Pull Request](https://github.com/apache/hugegraph/pulls). 热烈欢迎大家加入! + - title: 关注微信 + icon: fa-brands fa-weixin + desc: |- + 关注微信公众号 "HugeGraph" 获取最新动态 + + 也可以加入 [ASF Slack 频道](https://the-asf.slack.com/archives/C059UU2FJ23)参与讨论 + +welcome: + class: hg-home-band hg-home-welcome + title: 欢迎大家给 HugeGraph 添砖加瓦 diff --git a/data/home/en.yaml b/data/home/en.yaml new file mode 100644 index 000000000..2ddded850 --- /dev/null +++ b/data/home/en.yaml @@ -0,0 +1,76 @@ +sections: + - hero + - { type: markdown, key: introduction } + - { type: cards, key: capabilities } + - { type: markdown, key: tlp } + - { type: cards, key: community } + - { type: markdown, key: welcome } + +hero: + align: center + class: hg-home-hero + title: Apache HugeGraph + lead: HugeGraph is a full-stack graph system covering [graph database](docs/quickstart/hugegraph/hugegraph-server/), [graph computing](docs/quickstart/computing/hugegraph-computer/), and [graph AI](docs/quickstart/hugegraph-ai/). + note: It provides complete graph data processing capabilities from storage and real-time querying to offline analysis, and supports both [Gremlin](docs/language/hugegraph-gremlin/) and [Cypher](docs/clients/restful-api/cypher/) query languages. + actions: + - { label: Learn More, url: docs/, icon: fa-solid fa-circle-arrow-right, style: primary } + - { label: Download, url: docs/download/download/, icon: fa-brands fa-github, style: ghost } + +introduction: + class: hg-home-introduction + body: |- + HugeGraph supports high-speed import and millisecond-level real-time queries for up to hundreds of billions of graph data, with deep integration with big data platforms like Spark and Flink, and can use the [HugeGraph toolchain](docs/quickstart/toolchain/) for data import, visualization, and operations. + + In the AI era, combined with Large Language Models (LLMs), it provides powerful graph computing capabilities for intelligent Q&A, recommendation systems, fraud detection, and knowledge graph applications. + +capabilities: + class: hg-home-capabilities + columns: 3 + items: + - title: Convenient + icon: fa-solid fa-lightbulb + desc: Supports Gremlin graph query language and [**RESTful API**](docs/clients/restful-api/), and provides commonly used graph retrieval interfaces. It includes a complete set of supporting tools with distributed storage, data replication, horizontal scaling, and multiple built-in backend storage engines for efficient query and analysis workflows. + - title: Efficient + icon: fa-solid fa-truck-fast + desc: Deeply optimized for graph storage and graph computing, it provides [**batch import tools**](docs/quickstart/toolchain/hugegraph-loader/) to efficiently ingest massive data, achieves millisecond-level graph retrieval latency with optimized queries, and supports concurrent online operations for thousands of users. + - title: Adaptable + icon: fa-solid fa-arrow-right-arrow-left + desc: Supports the Apache Gremlin standard graph query language and the Property Graph modeling method, with both OLTP and [**OLAP graph computing**](docs/quickstart/computing/hugegraph-computer/) scenarios. It can be integrated with Hadoop and Spark and can extend backend storage engines through plug-ins. + - title: AI-Ready + icon: fa-solid fa-brain + desc: Integrates LLM with [**GraphRAG capabilities**](docs/quickstart/hugegraph-ai/), automated knowledge graph construction, and 20+ built-in graph machine learning algorithms to build AI-driven graph applications. + - title: Scalable + icon: fa-solid fa-up-right-and-down-left-from-center + desc: Supports horizontal scaling and distributed deployment, seamlessly migrating from standalone to PB-level clusters, and provides [**distributed storage engine**](docs/quickstart/hugegraph/hugegraph-hstore/) options for different scale and performance requirements. + - title: Open Ecosystem + icon: fa-solid fa-puzzle-piece + desc: Adheres to Apache TinkerPop standards, provides [**multi-language clients**](docs/quickstart/client/hugegraph-client/), is compatible with mainstream big data platforms, and is backed by an active and evolving community. + +tlp: + class: hg-home-band hg-home-tlp + title: The First Apache Foundation Top-Level Graph Project + +community: + class: hg-home-community + columns: 3 + items: + - title: Get The **Toolchain** + icon: fa-solid fa-screwdriver-wrench + desc: '[It](https://github.com/apache/hugegraph-toolchain) includes graph loader & dashboard & backup tools' + - title: Efficient + icon: fa-brands fa-github + url: https://github.com/apache/hugegraph + external: true + desc: We do a [Pull Request](https://github.com/apache/hugegraph/pulls) contributions workflow on **GitHub**. New users are always welcome! + - title: Join us on Slack! + icon: fa-brands fa-slack + url: https://the-asf.slack.com/archives/C059UU2FJ23 + external: true + desc: |- + Join the [ASF Slack channel](https://the-asf.slack.com/archives/C059UU2FJ23) for community discussions + + Could also follow the WeChat account "HugeGraph" for updates + +welcome: + class: hg-home-band hg-home-welcome + title: Welcome to the HugeGraph open source community! diff --git a/data/landing/about/cn.yaml b/data/landing/about/cn.yaml new file mode 100644 index 000000000..0af1c9483 --- /dev/null +++ b/data/landing/about/cn.yaml @@ -0,0 +1,25 @@ +sections: + - type: hero + data: + eyebrow: Apache HugeGraph + title: 连接图数据与图智能的一体化生态 + lead: HugeGraph 是 Apache 顶级项目,覆盖事务型图存储、分布式分析、可视化、数据导入和图智能。 + actions: + - { label: 阅读文档, url: /cn/docs/, style: primary } + - { label: 加入社区, url: /cn/community/, style: ghost } + - type: cards + data: + title: 项目组件 + columns: 3 + items: + - { title: Server, desc: 支持多种存储后端的实时 OLTP 图查询。, icon: fa-solid fa-database } + - { title: Computer 与 Vermeer, desc: 分布式与内存型 OLAP 图计算。, icon: fa-solid fa-chart-line } + - { title: Toolchain, desc: 客户端、Loader、Hubble 与运维工具。, icon: fa-solid fa-toolbox } + - { title: HugeGraph-AI, desc: GraphRAG、知识图谱与图学习。, icon: fa-solid fa-brain } + - type: cta + data: + title: 在 Apache 社区中开放协作 + desc: 通过 Apache HugeGraph 社区关注开发、报告问题并参与贡献。 + actions: + - { label: 在 GitHub 查看, url: 'https://github.com/apache/hugegraph', external: true, style: primary } + diff --git a/data/landing/about/en.yaml b/data/landing/about/en.yaml new file mode 100644 index 000000000..6c1a49af7 --- /dev/null +++ b/data/landing/about/en.yaml @@ -0,0 +1,25 @@ +sections: + - type: hero + data: + eyebrow: Apache HugeGraph + title: One ecosystem for graph data and graph intelligence + lead: HugeGraph is an Apache top-level project that covers transactional graph storage, distributed analytics, visualization, data loading, and graph AI. + actions: + - { label: Read the documentation, url: /docs/, style: primary } + - { label: Join the community, url: /community/, style: ghost } + - type: cards + data: + title: The project family + columns: 3 + items: + - { title: Server, desc: Real-time OLTP graph queries with pluggable storage., icon: fa-solid fa-database } + - { title: Computer and Vermeer, desc: Distributed and in-memory OLAP graph processing., icon: fa-solid fa-chart-line } + - { title: Toolchain, desc: Clients, Loader, Hubble, and operational tools., icon: fa-solid fa-toolbox } + - { title: HugeGraph-AI, desc: GraphRAG, knowledge graphs, and graph learning., icon: fa-solid fa-brain } + - type: cta + data: + title: Built in the open at Apache + desc: Follow development, report issues, and contribute through the Apache HugeGraph community. + actions: + - { label: View on GitHub, url: 'https://github.com/apache/hugegraph', external: true, style: primary } + diff --git a/data/landing/community/cn.yaml b/data/landing/community/cn.yaml new file mode 100644 index 000000000..9bf9f66f4 --- /dev/null +++ b/data/landing/community/cn.yaml @@ -0,0 +1,40 @@ +sections: + - type: hero + data: + eyebrow: Apache HugeGraph + title: 加入 Apache HugeGraph 社区 + lead: Apache HugeGraph 是一个开放的开源项目,社区中的每个人都可以使用、改进并从中受益。欢迎加入我们,通过以下方式了解项目动态并参与社区。 + actions: + - { label: 参与贡献, url: /docs/contribution-guidelines/, icon: fa-solid fa-code-pull-request, style: primary } + - { label: 前往 GitHub, url: 'https://github.com/apache/hugegraph', icon: fa-brands fa-github, external: true, style: ghost } + + - type: cards + data: + title: 参与社区 + columns: 2 + items: + - title: 了解与交流 + icon: fa-solid fa-people-group + desc: | + 正在使用或准备使用 Apache HugeGraph?可以从这里开始: + + - [项目介绍](/cn/docs/introduction/) — 了解 Apache HugeGraph 及其核心能力。 + - [快速开始](/cn/docs/quickstart/hugegraph/hugegraph-server/) — 通过简单配置开始 HugeGraph 之旅。 + - [下载](/cn/docs/download/download/) — 获取最新的 Apache HugeGraph 版本。 + - [配置文档](/cn/docs/config/) — 根据使用场景配置 HugeGraph。 + - [微信公众号](https://github.com/apache/hugegraph#community) — 关注社区并获取最新动态。 + - title: 开发与贡献 + icon: fa-solid fa-code + desc: | + 希望更深入地参与 Apache HugeGraph?可以通过以下渠道加入我们: + + - [GitHub](https://github.com/apache/hugegraph) — Apache HugeGraph 的开发在各项目仓库中公开进行。 + - [开发者邮件列表](/cn/docs/contribution-guidelines/subscribe/) — 讨论项目开发和社区事务。 + - [安全邮件列表](mailto:security@hugegraph.apache.org) — 私下报告安全问题。 + - [安全策略](/cn/docs/guides/security/) — 了解项目的安全问题报告流程。 + - [贡献指南](/cn/docs/contribution-guidelines/) — 了解如何贡献代码和文档。 + + - type: markdown + data: + title: 了解项目运作方式 + body: Apache HugeGraph 使用英文版 [项目成熟度评估](/community/maturity/) 记录社区实践。 diff --git a/data/landing/community/en.yaml b/data/landing/community/en.yaml new file mode 100644 index 000000000..9f54604f7 --- /dev/null +++ b/data/landing/community/en.yaml @@ -0,0 +1,42 @@ +sections: + - type: hero + data: + eyebrow: Apache HugeGraph + title: Join the Apache HugeGraph community + lead: Apache HugeGraph is an open source project that anyone in the community can use, improve, and enjoy. We'd love you to join us! Here are a few ways to find out what's happening and get involved. + actions: + - { label: Contribute, url: /docs/contribution-guidelines/, icon: fa-solid fa-code-pull-request, style: primary } + - { label: View on GitHub, url: 'https://github.com/apache/hugegraph', icon: fa-brands fa-github, external: true, style: ghost } + + - type: cards + data: + title: Get involved + columns: 2 + items: + - title: Learn and connect + icon: fa-solid fa-people-group + desc: | + Using or want to use Apache HugeGraph? Find out more here: + + - [Introduction](/docs/introduction/) — increase your understanding of the project. + - [Quick start](/docs/quickstart/hugegraph/hugegraph-server/) — begin your HugeGraph journey with a simple setup. + - [Download](/docs/download/download/) — get the latest Apache HugeGraph release. + - [Configuration](/docs/config/) — learn how to configure HugeGraph for your use case. + - [WeChat](https://github.com/apache/hugegraph#community) — follow the community and get the latest news. + - title: Develop and contribute + icon: fa-solid fa-code + desc: | + Want to get more involved in Apache HugeGraph? Join us here: + + - [GitHub](https://github.com/apache/hugegraph) — development takes place in the Apache HugeGraph repositories. + - [Developer mailing list](/docs/contribution-guidelines/subscribe/) — discuss project and community topics. + - [Security mailing list](mailto:security@hugegraph.apache.org) — report security issues privately. + - [Security policy](/docs/guides/security/) — follow the project's security reporting process. + - [Contribution guidelines](/docs/contribution-guidelines/) — learn how to contribute code and documentation. + + - type: cta + data: + title: Learn how the project works + desc: Review Apache HugeGraph's maturity assessment and community practices. + actions: + - { label: Project maturity, url: /community/maturity/, icon: fa-solid fa-list-check, style: primary } diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index a2c28f6b5..000000000 --- a/deploy.sh +++ /dev/null @@ -1,17 +0,0 @@ -#Copyright 2018 Google LLC -# -#Licensed under the Apache License, Version 2.0 (the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. -# -rm -rf public/ -HUGO_ENV="production" hugo --gc || exit 1 -s3deploy -source=public/ -region=eu-west-1 -bucket=bep.is -distribution-id=E8OKNT7W9ZYZ2 -path temp/td diff --git a/dist/url-contract.json b/dist/url-contract.json new file mode 100644 index 000000000..a9a88780c --- /dev/null +++ b/dist/url-contract.json @@ -0,0 +1,35 @@ +{ + "schemaVersion": 1, + "baseline": { + "origin": "https://hugegraph.apache.org/", + "verifiedAt": "2026-08-31", + "defaultStatus": 200, + "stagingOrigin": "https://hugegraph-oink.staged.apache.org/" + }, + "routes": [ + {"path": "/", "versions": ["latest", "1.7", "1.5"], "file": "index.html", "contains": ["Apache HugeGraph"]}, + {"path": "/cn/", "versions": ["latest", "1.7", "1.5"], "file": "cn/index.html", "contains": ["Apache HugeGraph"]}, + {"path": "/docs/", "versions": ["latest", "1.7", "1.5"], "file": "docs/index.html", "contains": ["Documentation"]}, + {"path": "/cn/docs/", "versions": ["latest", "1.7", "1.5"], "file": "cn/docs/index.html", "contains": ["Documentation"]}, + {"path": "/blog/", "versions": ["latest"], "file": "blog/index.html", "contains": ["Blog"]}, + {"path": "/cn/blog/", "versions": ["latest"], "file": "cn/blog/index.html", "contains": ["Blog"]}, + {"path": "/about/", "versions": ["latest"], "file": "about/index.html", "contains": ["Apache HugeGraph"]}, + {"path": "/cn/about/", "versions": ["latest"], "file": "cn/about/index.html", "contains": ["Apache HugeGraph"]}, + {"path": "/community/", "versions": ["latest"], "file": "community/index.html", "contains": ["Community"]}, + {"path": "/cn/community/", "versions": ["latest"], "file": "cn/community/index.html", "contains": ["社区"]}, + {"path": "/docs/download/download/", "versions": ["latest", "1.7", "1.5"], "file": "docs/download/download/index.html", "contains": ["Download"]}, + {"path": "/cn/docs/download/download/", "versions": ["latest", "1.7", "1.5"], "file": "cn/docs/download/download/index.html", "contains": ["下载"]}, + {"path": "/docs/quickstart/hugegraph/hugegraph-server/", "versions": ["latest", "1.7", "1.5"], "file": "docs/quickstart/hugegraph/hugegraph-server/index.html", "contains": ["HugeGraph-Server"]}, + {"path": "/cn/docs/quickstart/hugegraph/hugegraph-server/", "versions": ["latest", "1.7", "1.5"], "file": "cn/docs/quickstart/hugegraph/hugegraph-server/index.html", "contains": ["HugeGraph-Server"]}, + {"path": "/docs/config/config-guide/", "versions": ["latest", "1.7", "1.5"], "file": "docs/config/config-guide/index.html", "contains": ["GremlinServer"]}, + {"path": "/cn/docs/config/config-guide/", "versions": ["latest", "1.7", "1.5"], "file": "cn/docs/config/config-guide/index.html", "contains": ["GremlinServer"]}, + {"path": "/docs/clients/restful-api/graphs/", "versions": ["latest", "1.7", "1.5"], "file": "docs/clients/restful-api/graphs/index.html", "contains": ["REST"]}, + {"path": "/cn/docs/clients/restful-api/graphs/", "versions": ["latest", "1.7", "1.5"], "file": "cn/docs/clients/restful-api/graphs/index.html", "contains": ["REST"]}, + {"path": "/docs/guides/architectural/", "versions": ["latest", "1.7", "1.5"], "file": "docs/guides/architectural/index.html", "contains": ["HugeGraph"]}, + {"path": "/cn/docs/guides/architectural/", "versions": ["latest", "1.7", "1.5"], "file": "cn/docs/guides/architectural/index.html", "contains": ["HugeGraph"]}, + {"path": "/404.html", "versions": ["latest", "1.7", "1.5"], "file": "404.html", "contains": ["404"]}, + {"path": "/cn/404.html", "versions": ["latest", "1.7", "1.5"], "file": "cn/404.html", "contains": ["404"]}, + {"path": "/client-go/", "versions": ["latest"], "file": "client-go/index.html", "contains": ["go-import", "go-source"]}, + {"path": "/img/logo.svg", "versions": ["latest", "1.7", "1.5"], "file": "img/logo.svg", "contains": [" bool: + """Match only OINK's inert Mermaid source carrier, not authored JSON scripts.""" + + return ( + tag == "script" + and set(values) == {"type", "data-td-diagram-source"} + and values["type"].strip().lower() == "application/json" + and values["data-td-diagram-source"] == "" + ) + + +def srcset_urls(value: str) -> list[str]: + """Return URL tokens from an HTML srcset without splitting data-URL commas.""" + + urls: list[str] = [] + position = 0 + while position < len(value): + while position < len(value) and ( + value[position].isspace() or value[position] == "," + ): + position += 1 + if position == len(value): + break + + start = position + is_data_url = value[start:].lower().startswith("data:") + while position < len(value) and not value[position].isspace(): + if value[position] == "," and not is_data_url: + break + position += 1 + token = value[start:position] + trailing_commas = len(token) - len(token.rstrip(",")) + token = token.rstrip(",") + if token: + urls.append(token) + if position < len(value) and value[position] == ",": + position += 1 + continue + if trailing_commas: + continue + + # Skip width/density descriptors until the next candidate delimiter. + while position < len(value) and value[position] != ",": + position += 1 + if position < len(value): + position += 1 + return urls + + +def css_http_resources(value: str) -> list[str]: + """Find insecure HTTP resources in CSS declarations or stylesheets.""" + return [ + resource + for resource in css_resource_urls(value) + if urllib.parse.urlsplit(resource).scheme.lower() == "http" + ] + + +def css_resource_urls(value: str) -> list[str]: + """Extract CSS url() and quoted @import resources in source order.""" + pattern = re.compile( + r"url\(\s*(?P['\"]?)(?P[^'\"\s)]+)(?P=quote)\s*\)" + r"|@import\s+(?P['\"])(?P[^'\"]+)" + r"(?P=import_quote)", + re.IGNORECASE, + ) + return [ + match.group("url") or match.group("import_url") + for match in pattern.finditer(value) + ] + + +def css_external_resources( + value: str, base_parts: urllib.parse.SplitResult +) -> list[str]: + """Reject HTTPS/protocol-relative CSS resources outside the site origin.""" + resources = [] + for resource in css_resource_urls(value): + parts = urllib.parse.urlsplit(resource) + if ( + parts.netloc + and parts.netloc != base_parts.netloc + and parts.scheme.lower() != "http" + ): + resources.append(resource) + return resources + + +def image_url_allowed_by_asf_csp( + url: str, base_parts: urllib.parse.SplitResult +) -> bool: + """Return whether an external image URL is loadable by the ASF staging CSP.""" + + parts = urllib.parse.urlsplit(url) + if not parts.netloc or parts.netloc == base_parts.netloc: + return True + if parts.scheme.lower() != "https": + return False + try: + if parts.port not in {None, 443}: + return False + except ValueError: + return False + hostname = (parts.hostname or "").lower().rstrip(".") + return hostname in ASF_CSP_IMAGE_HOSTS or hostname.endswith(ASF_CSP_IMAGE_SUFFIXES) + + +def error_document_seo_errors(parser: DocumentParser, page_name: str) -> list[str]: + """Require error documents to stay out of indexes and canonical clusters.""" + + if page_name not in ERROR_DOCUMENT_PATHS: + return [] + + errors: list[str] = [] + robots = [ + meta.get("content", "") + for meta in parser.meta + if meta.get("name", "").strip().lower() == "robots" + ] + expected_directives = {"noindex", "nofollow"} + if ( + len(robots) != 1 + or { + directive.strip().lower() + for directive in robots[0].split(",") + if directive.strip() + } + != expected_directives + ): + errors.append( + f"{page_name}: expected one robots noindex,nofollow directive, " + f"found {robots!r}" + ) + if parser.canonical: + errors.append(f"{page_name}: error document must not declare canonical") + if parser.hreflang: + errors.append(f"{page_name}: error document must not declare hreflang") + return errors + + +def toc_accessibility_errors(parser: DocumentParser, page_name: str) -> list[str]: + """Require each rendered Hugo TOC nav to have one localized accessible name.""" + + if not parser.toc_nav_labels: + return [] + if len(parser.toc_nav_labels) != 1: + return [ + f"{page_name}: expected at most one TableOfContents nav, " + f"found {len(parser.toc_nav_labels)}" + ] + parts = pathlib.PurePosixPath(page_name).parts + is_chinese = bool(parts) and ( + parts[0] == "cn" + or (len(parts) >= 3 and parts[0] == "versions" and parts[2] == "cn") + ) + expected = "目录" if is_chinese else "Content" + labels = parser.toc_nav_labels[0] + if labels != [expected]: + return [ + f"{page_name}: TableOfContents nav must have exactly one localized " + f"aria-label {expected!r}, found {labels!r}" + ] + return [] + + +def docs_navigation_errors(data: dict, source: str, language: str) -> list[str]: + """Validate the five-group Docs IA in one OINK NAVJSON output.""" + errors: list[str] = [] + expected = DOCS_NAV_GROUP_TITLES.get(language) + if expected is None: + return [f"{source}: unsupported navigation language: {language}"] + docs_nodes = [ + item + for item in data.get("root", {}).get("children", []) + if isinstance(item, dict) and item.get("id") == "/docs/" + ] + if len(docs_nodes) != 1: + return [f"{source}: expected one Docs node, found {len(docs_nodes)}"] + groups = docs_nodes[0].get("children") + if not isinstance(groups, list): + return [f"{source}: Docs navigation children are missing"] + actual = tuple( + item.get("title") if isinstance(item, dict) else None for item in groups + ) + if actual != expected: + errors.append(f"{source}: Docs groups {actual!r} != {expected!r}") + for group in groups: + if not isinstance(group, dict): + continue + if group.get("kind") != "external" or not group.get("children"): + errors.append(f"{source}: Docs group is not a populated link: {group!r}") + pending = [data] + while pending: + item = pending.pop() + if isinstance(item, dict): + pending.extend(item.values()) + elif isinstance(item, list): + pending.extend(item) + elif isinstance(item, str) and "/_nav/" in item.lower(): + errors.append(f"{source}: private Docs navigation route leaked: {item}") + return errors + + +def document_security_errors( + parser: DocumentParser, page_name: str, base_parts: urllib.parse.SplitResult +) -> list[str]: + """Return fail-closed resource and authored-markup errors for one page.""" + + errors = [ + f"{page_name}: unsafe content markup: {violation}" + for violation in parser.authored_violations + ] + errors.extend( + f"{page_name}: mixed-content CSS resource: {resource}" + for resource in parser.inline_css_http_resources + ) + errors.extend( + f"{page_name}: external CSS resource is forbidden: {resource}" + for resource in css_external_resources( + "\n".join(parser.inline_css_sources), base_parts + ) + ) + errors.extend( + f"{page_name}: mixed-content <{tag}> {attribute}: {resource}" + for tag, attribute, resource in parser.resources + if urllib.parse.urlsplit(resource.strip()).scheme.lower() == "http" + ) + errors.extend( + f"{page_name}: external active resource is forbidden <{tag}> " + f"{attribute}: {resource}" + for tag, attribute, resource in parser.resources + if (tag, attribute) in EXTERNAL_ACTIVE_RESOURCE_ATTRIBUTES + and urllib.parse.urlsplit(resource.strip()).netloc + and urllib.parse.urlsplit(resource.strip()).netloc != base_parts.netloc + and urllib.parse.urlsplit(resource.strip()).scheme.lower() != "http" + ) + for tag, attribute, image_url in parser.image_urls: + parts = urllib.parse.urlsplit(image_url.strip()) + if ( + parts.scheme.lower() != "http" + and parts.netloc + and not image_url_allowed_by_asf_csp(image_url, base_parts) + ): + errors.append( + f"{page_name}: image URL is outside ASF CSP <{tag}> " + f"{attribute}: {image_url}" + ) + return errors + + +class DocumentParser(html.parser.HTMLParser): + def __init__(self) -> None: + super().__init__(convert_charrefs=True) + self.urls: list[tuple[str, str]] = [] + self.canonical: list[str] = [] + self.hreflang: list[tuple[str, str]] = [] + self.meta: list[dict[str, str]] = [] + self.resources: list[tuple[str, str, str]] = [] + self.image_urls: list[tuple[str, str, str]] = [] + self.authored_violations: list[str] = [] + self.inline_css_http_resources: list[str] = [] + self.inline_css_sources: list[str] = [] + self.toc_nav_labels: list[list[str]] = [] + self.action_manifest = "" + self._in_action_manifest = False + self._content_depth = 0 + self._in_style = False + + def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: + tag = tag.lower() + values = {key.lower(): value or "" for key, value in attrs} + if tag == "nav" and "TableOfContents" in [ + value or "" for key, value in attrs if key.lower() == "id" + ]: + self.toc_nav_labels.append( + [value or "" for key, value in attrs if key.lower() == "aria-label"] + ) + if tag in {"main", "article"}: + self._content_depth += 1 + if self._content_depth: + if tag in UNSAFE_AUTHORED_ELEMENTS and not is_inert_oink_diagram_source( + tag, values + ): + self.authored_violations.append(f"authored <{tag}>") + for attribute in values: + if attribute.startswith("on"): + self.authored_violations.append( + f"authored {attribute} event attribute on <{tag}>" + ) + + if tag in {"a", "link"} and values.get("href"): + self.urls.append(("href", values["href"])) + if tag in {"img", "script", "source"} and values.get("src"): + self.urls.append(("src", values["src"])) + resource_attributes: list[tuple[str, str]] = [] + if tag in {"img", "script", "source", "video", "audio", "track", "embed"}: + if values.get("src"): + resource_attributes.append(("src", values["src"])) + if tag == "video" and values.get("poster"): + resource_attributes.append(("poster", values["poster"])) + if tag == "object" and values.get("data"): + resource_attributes.append(("data", values["data"])) + if tag == "iframe" and values.get("src"): + resource_attributes.append(("src", values["src"])) + if ( + tag == "input" + and values.get("type", "").lower() == "image" + and values.get("src") + ): + resource_attributes.append(("src", values["src"])) + if tag == "image" and values.get("href"): + resource_attributes.append(("href", values["href"])) + if tag == "link" and values.get("href"): + rel = set(values.get("rel", "").lower().split()) + if rel & { + "stylesheet", + "preload", + "modulepreload", + "icon", + "apple-touch-icon", + "manifest", + }: + resource_attributes.append(("href", values["href"])) + self.resources.extend( + (tag, attribute, url) for attribute, url in resource_attributes + ) + + if tag in {"img", "source"}: + for attribute in ("src", "srcset"): + if not values.get(attribute): + continue + urls = ( + srcset_urls(values[attribute]) + if attribute == "srcset" + else [values[attribute]] + ) + self.image_urls.extend((tag, attribute, url) for url in urls) + if attribute == "srcset": + self.resources.extend((tag, attribute, url) for url in urls) + if tag == "video" and values.get("poster"): + self.image_urls.append((tag, "poster", values["poster"])) + if ( + tag == "input" + and values.get("type", "").lower() == "image" + and values.get("src") + ): + self.image_urls.append((tag, "src", values["src"])) + if tag == "image" and values.get("href"): + self.image_urls.append((tag, "href", values["href"])) + + if values.get("style"): + self.inline_css_sources.append(values["style"]) + self.inline_css_http_resources.extend(css_http_resources(values["style"])) + if tag == "link" and values.get("rel", "").lower() == "canonical": + self.canonical.append(values.get("href", "")) + if ( + tag == "link" + and values.get("rel", "").lower() == "alternate" + and values.get("hreflang") + ): + self.hreflang.append((values["hreflang"], values.get("href", ""))) + if tag == "meta": + self.meta.append(values) + if tag == "script" and values.get("id") == "td-action-manifest": + self._in_action_manifest = True + if tag == "style": + self._in_style = True + + def handle_data(self, data: str) -> None: + if self._in_action_manifest: + self.action_manifest += data + if self._in_style: + self.inline_css_sources.append(data) + self.inline_css_http_resources.extend(css_http_resources(data)) + + def handle_endtag(self, tag: str) -> None: + if tag == "script" and self._in_action_manifest: + self._in_action_manifest = False + if tag == "style": + self._in_style = False + if tag in {"main", "article"} and self._content_depth: + self._content_depth -= 1 + + +def output_path(root: pathlib.Path, url_path: str) -> pathlib.Path: + decoded = urllib.parse.unquote(url_path) + if "\x00" in decoded or "\\" in decoded: + raise ValueError("contains a NUL or backslash") + if ".." in pathlib.PurePosixPath(decoded).parts: + raise ValueError("contains a parent-directory segment") + relative = decoded.lstrip("/") + candidate = root / relative + if decoded.endswith("/") or not pathlib.PurePosixPath(decoded).suffix: + candidate = candidate / "index.html" + candidate = candidate.resolve() + try: + candidate.relative_to(root) + except ValueError as exc: + raise ValueError("escapes the output directory") from exc + return candidate + + +def page_url_path(root: pathlib.Path, page: pathlib.Path) -> str: + relative = page.relative_to(root).as_posix() + if relative == "index.html": + return "/" + if relative.endswith("/index.html"): + return "/" + relative.removesuffix("index.html") + return "/" + relative + + +def internal_output_target( + root: pathlib.Path, base_parts: urllib.parse.SplitResult, url: str +) -> pathlib.Path | None: + parts = urllib.parse.urlsplit(url) + if parts.scheme.lower() not in {"", "http", "https"}: + raise ValueError(f"forbidden URL scheme: {url}") + if parts.netloc and parts.netloc != base_parts.netloc: + return None + return output_path(root, parts.path or "/") + + +def refresh_target(parser: DocumentParser) -> str | None: + refresh = [ + item.get("content", "") + for item in parser.meta + if item.get("http-equiv", "").lower() == "refresh" + ] + if not refresh: + return None + if len(refresh) != 1: + raise ValueError(f"expected one refresh directive, found {len(refresh)}") + match = re.search(r"(?:^|;)\s*url\s*=\s*(.+)\s*$", refresh[0], re.IGNORECASE) + if not match: + raise ValueError(f"malformed refresh directive: {refresh[0]}") + return match.group(1).strip(" \"'") + + +def main() -> int: + argument_parser = argparse.ArgumentParser( + description="Validate a generated HugeGraph documentation artifact." + ) + argument_parser.add_argument("public_dir", type=pathlib.Path) + argument_parser.add_argument("expected_base_url") + argument_parser.add_argument( + "--security-only", + action="store_true", + help=( + "Check rendered active-content, mixed-content, and CSP image " + "boundaries only; versioning.py validates isolated URL contracts." + ), + ) + args = argument_parser.parse_args() + + root = args.public_dir.resolve() + base = args.expected_base_url.rstrip("/") + "/" + base_parts = urllib.parse.urlsplit(base) + errors: list[str] = [] + + if not root.is_dir(): + errors.append(f"missing output directory: {root}") + + if not args.security_only: + for relative in REQUIRED_FILES: + if not (root / relative).is_file(): + errors.append(f"missing required output: {relative}") + + html_files = sorted(root.rglob("*.html")) if root.is_dir() else [] + if not html_files: + errors.append("no generated HTML files found") + if not args.security_only: + for path in sorted(root.rglob("*")): + if path.is_file() and "_nav" in path.relative_to(root).parts: + errors.append( + f"private Docs navigation route was rendered: {path.relative_to(root)}" + ) + for search_path in sorted(root.rglob("offline-search-index.*.json")): + try: + search_data = json.loads(search_path.read_text(encoding="utf-8")) + except (OSError, UnicodeError, json.JSONDecodeError) as exc: + errors.append(f"{search_path.relative_to(root)}: cannot parse: {exc}") + continue + for item in search_data if isinstance(search_data, list) else []: + ref = item.get("ref") if isinstance(item, dict) else None + if isinstance(ref, str) and "/_nav/" in ref.lower(): + errors.append( + f"{search_path.relative_to(root)}: private Docs navigation " + f"route leaked into search: {ref}" + ) + + for page in html_files: + parser = DocumentParser() + try: + parser.feed(page.read_text(encoding="utf-8")) + except (OSError, UnicodeError) as exc: + errors.append(f"cannot parse {page.relative_to(root)}: {exc}") + continue + + page_name = page.relative_to(root).as_posix() + errors.extend(document_security_errors(parser, page_name, base_parts)) + errors.extend(error_document_seo_errors(parser, page_name)) + if args.security_only: + continue + errors.extend(toc_accessibility_errors(parser, page_name)) + try: + alias_target = refresh_target(parser) + except ValueError as exc: + errors.append(f"{page_name}: {exc}") + alias_target = None + is_error_document = page_name in ERROR_DOCUMENT_PATHS + if not is_error_document and page_name != "client-go/index.html": + if len(parser.canonical) != 1: + errors.append( + f"{page_name}: expected one canonical, found {len(parser.canonical)}" + ) + else: + if "_print/" in page_name: + print_parts = list(pathlib.PurePosixPath(page_name).parts) + print_parts.remove("_print") + regular_path = pathlib.PurePosixPath(*print_parts).as_posix() + if regular_path.endswith("index.html"): + regular_path = regular_path.removesuffix("index.html") + expected_canonical = urllib.parse.urljoin(base, regular_path) + elif alias_target: + expected_canonical = urllib.parse.urljoin( + base, alias_target.lstrip("/") + ) + else: + expected_canonical = urllib.parse.urljoin( + base, page_url_path(root, page).lstrip("/") + ) + if parser.canonical[0] != expected_canonical: + errors.append( + f"{page_name}: canonical {parser.canonical[0]} != " + f"{expected_canonical}" + ) + + if alias_target and page_name != "client-go/index.html": + try: + alias_output = internal_output_target(root, base_parts, alias_target) + if alias_output is None or not alias_output.is_file(): + errors.append( + f"{page_name}: alias target is absent: {alias_target}" + ) + except ValueError as exc: + errors.append(f"{page_name}: unsafe alias target {alias_target}: {exc}") + + is_regular_page = ( + "_print/" not in page_name + and not is_error_document + and page_name != "client-go/index.html" + and not alias_target + ) + if is_regular_page: + actual_hreflang = dict(parser.hreflang) + if len(actual_hreflang) != len(parser.hreflang): + errors.append(f"{page_name}: duplicate hreflang entries") + current_path = page_url_path(root, page) + english_path = ( + current_path.removeprefix("/cn") + if current_path.startswith("/cn/") + else current_path + ) + chinese_path = "/cn/" if english_path == "/" else "/cn" + english_path + expected_hreflang = { + "en-US": urllib.parse.urljoin(base, english_path.lstrip("/")), + "zh-CN": urllib.parse.urljoin(base, chinese_path.lstrip("/")), + } + for language, fallback_path in HREFLANG_FALLBACKS.get( + page_name, {} + ).items(): + expected_hreflang[language] = urllib.parse.urljoin( + base, fallback_path.lstrip("/") + ) + if actual_hreflang != expected_hreflang: + errors.append( + f"{page_name}: hreflang {actual_hreflang} != {expected_hreflang}" + ) + + if not parser.action_manifest: + errors.append(f"{page_name}: missing action manifest") + else: + try: + manifest = json.loads(parser.action_manifest) + except json.JSONDecodeError as exc: + errors.append(f"{page_name}: malformed action manifest: {exc}") + else: + actions = { + action.get("id"): action + for action in manifest.get("actions", []) + if isinstance(action, dict) + } + for action_id in ("open_chatgpt", "open_claude"): + action = actions.get(action_id) + if not action: + errors.append(f"{page_name}: missing {action_id} boundary") + continue + placements = action.get("placements", {}) + if ( + action.get("available") is not False + or action.get("url") != "" + or placements.get("page") is not False + or placements.get("palette") is not False + ): + errors.append( + f"{page_name}: {action_id} is externally enabled" + ) + + for _attribute, link_url in parser.urls: + hostname = (urllib.parse.urlsplit(link_url).hostname or "").lower() + if hostname in {"chatgpt.com", "claude.ai", "anthropic.com"}: + errors.append( + f"{page_name}: assistant link is externally enabled: {link_url}" + ) + + for attribute, raw_url in parser.urls: + url = raw_url.strip() + lower_url = url.lower() + if "/_nav/" in lower_url: + errors.append( + f"{page_name}: private Docs navigation route in {attribute}: {url}" + ) + continue + if ( + not url + or url.startswith("#") + or lower_url.startswith(("mailto:", "tel:")) + ): + continue + if url.startswith("//"): + errors.append( + f"{page_name}: protocol-relative {attribute} is forbidden: {url}" + ) + continue + + parts = urllib.parse.urlsplit(url) + if parts.scheme and parts.scheme.lower() not in {"http", "https"}: + errors.append( + f"{page_name}: forbidden URL scheme in {attribute}: {url}" + ) + continue + if parts.netloc and parts.netloc != base_parts.netloc: + continue + resolved_path = parts.path + if not parts.netloc and not parts.path.startswith("/"): + resolved_path = urllib.parse.urljoin( + page_url_path(root, page), parts.path + ) + if resolved_path.startswith("/versions/"): + errors.append(f"{page_name}: unpublished version URL: {url}") + continue + + try: + target = output_path(root, resolved_path or page_url_path(root, page)) + except ValueError as exc: + errors.append(f"{page_name}: unsafe internal {attribute} {url}: {exc}") + continue + if not target.is_file(): + errors.append( + f"{page_name}: broken internal {attribute} {url} -> " + f"{target.relative_to(root)}" + ) + + for stylesheet in sorted(root.rglob("*.css")) if root.is_dir() else []: + try: + stylesheet_text = stylesheet.read_text(encoding="utf-8") + except (OSError, UnicodeError) as exc: + errors.append(f"cannot parse {stylesheet.relative_to(root)}: {exc}") + continue + for resource in css_http_resources(stylesheet_text): + errors.append( + f"{stylesheet.relative_to(root)}: mixed-content CSS resource: {resource}" + ) + for resource in css_external_resources(stylesheet_text, base_parts): + errors.append( + f"{stylesheet.relative_to(root)}: external CSS resource is forbidden: " + f"{resource}" + ) + + if args.security_only: + if errors: + print("Generated site security validation failed:") + for error in errors: + print(f"- {error}") + return 1 + print( + f"Generated site security validation passed: {len(html_files)} HTML " + f"files, base {base}" + ) + return 0 + + client_go = root / "client-go/index.html" + if client_go.is_file(): + parser = DocumentParser() + parser.feed(client_go.read_text(encoding="utf-8")) + go_import = [ + item.get("content", "") + for item in parser.meta + if item.get("name") == "go-import" + ] + go_source = [ + item.get("content", "") + for item in parser.meta + if item.get("name") == "go-source" + ] + if go_import != [ + "hugegraph.apache.org/client-go git https://github.com/apache/hugegraph-toolchain.git" + ]: + errors.append("client-go/index.html: go-import metadata changed") + expected_go_source = ( + "hugegraph.apache.org/client-go https://github.com/apache/hugegraph-toolchain " + "https://github.com/apache/hugegraph-toolchain/tree/master/hugegraph-client-go{/dir} " + "https://github.com/apache/hugegraph-toolchain/blob/master/hugegraph-client-go{/dir}/{file}#L{line}" + ) + if go_source != [expected_go_source]: + errors.append("client-go/index.html: go-source metadata changed") + if ( + refresh_target(parser) + != "https://pkg.go.dev/hugegraph.apache.org/client-go" + ): + errors.append("client-go/index.html: refresh target changed") + client_links = [url for attribute, url in parser.urls if attribute == "href"] + if client_links != ["https://pkg.go.dev/hugegraph.apache.org/client-go"]: + errors.append("client-go/index.html: visible redirect link changed") + + for sitemap_name in ("sitemap.xml", "en/sitemap.xml", "cn/sitemap.xml"): + sitemap = root / sitemap_name + if not sitemap.is_file(): + continue + try: + locations = [ + node.text or "" + for node in ET.parse(sitemap).iter() + if node.tag.endswith("loc") + ] + except (ET.ParseError, OSError) as exc: + errors.append(f"{sitemap_name}: cannot parse sitemap: {exc}") + continue + if not locations: + errors.append(f"{sitemap_name}: sitemap has no locations") + for location in locations: + if not location.startswith(base): + errors.append(f"{sitemap_name}: location escapes base: {location}") + continue + if sitemap_name == "cn/sitemap.xml" and not urllib.parse.urlsplit( + location + ).path.startswith("/cn/"): + errors.append(f"{sitemap_name}: non-Chinese location: {location}") + if sitemap_name == "en/sitemap.xml" and urllib.parse.urlsplit( + location + ).path.startswith("/cn/"): + errors.append( + f"{sitemap_name}: Chinese location in English sitemap: {location}" + ) + target = internal_output_target(root, base_parts, location) + if target is not None and not target.is_file(): + errors.append(f"{sitemap_name}: missing location output: {location}") + + for llms_name in ("llms.txt", "cn/llms.txt"): + llms = root / llms_name + if not llms.is_file(): + continue + for url in re.findall(r"https?://[^)\s]+", llms.read_text(encoding="utf-8")): + if not url.startswith(base): + errors.append(f"{llms_name}: URL escapes base: {url}") + continue + url_path = urllib.parse.urlsplit(url).path + if ( + llms_name == "cn/llms.txt" + and not url_path.startswith("/cn/") + and url_path != "/index.md" + ): + errors.append(f"{llms_name}: non-Chinese URL: {url}") + if ( + llms_name == "llms.txt" + and url_path.startswith("/cn/") + and url_path != "/cn/index.md" + ): + errors.append(f"{llms_name}: Chinese URL in English index: {url}") + target = internal_output_target(root, base_parts, url) + if target is not None and not target.is_file(): + errors.append(f"{llms_name}: missing URL output: {url}") + + for nav_path in sorted(root.rglob("navigation.json")): + nav_name = nav_path.relative_to(root).as_posix() + parts = pathlib.PurePosixPath(nav_name).parts + language = "cn" if len(parts) >= 2 and parts[-2] == "cn" else "en" + prefix_parts = parts[:-2] if language == "cn" else parts[:-1] + nav_base = urllib.parse.urljoin( + base, "/".join(prefix_parts) + ("/" if prefix_parts else "") + ) + try: + nav = json.loads(nav_path.read_text(encoding="utf-8")) + except (OSError, UnicodeError, json.JSONDecodeError) as exc: + errors.append(f"{nav_name}: cannot parse: {exc}") + continue + if nav.get("baseURL") != nav_base or nav.get("language") != language: + errors.append(f"{nav_name}: baseURL or language changed") + expected_root_url = ( + nav_base if language == "en" else urllib.parse.urljoin(nav_base, "cn/") + ) + if nav.get("root", {}).get("url") != expected_root_url: + errors.append(f"{nav_name}: root URL is not language-scoped") + errors.extend(docs_navigation_errors(nav, nav_name, language)) + pending = [nav] + while pending: + item = pending.pop() + if isinstance(item, dict): + for key in ("url", "markdown"): + value = item.get(key) + if not isinstance(value, str): + continue + resolved_value = urllib.parse.urljoin(nav_base, value) + if not resolved_value.startswith(nav_base): + errors.append( + f"{nav_name}: {key} escapes version base: {value}" + ) + continue + url_path = urllib.parse.urlsplit(resolved_value).path + nav_path_prefix = urllib.parse.urlsplit(nav_base).path.rstrip("/") + chinese_prefix = nav_path_prefix + "/cn/" + if language == "cn" and not url_path.startswith(chinese_prefix): + errors.append(f"{nav_name}: {key} loses /cn/: {value}") + if language == "en" and url_path.startswith(chinese_prefix): + errors.append(f"{nav_name}: {key} crosses into /cn/: {value}") + target = internal_output_target(root, base_parts, value) + if target is not None and not target.is_file(): + errors.append(f"{nav_name}: missing {key} output: {value}") + pending.extend(item.values()) + elif isinstance(item, list): + pending.extend(item) + + if errors: + print("Generated site validation failed:") + for error in errors: + print(f"- {error}") + return 1 + + print( + f"Generated site validation passed: {len(html_files)} HTML files, base {base}" + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..685c7ce27 --- /dev/null +++ b/go.mod @@ -0,0 +1,6 @@ +module github.com/apache/hugegraph-doc + +go 1.27.0 + +require github.com/pgsty/oink v1.0.0 + diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..8bd5c21c7 --- /dev/null +++ b/go.sum @@ -0,0 +1,3 @@ +github.com/pgsty/oink v1.0.0 h1:E+WHFP9zSRT+5RKoIkWNp+ASRGS1BKG+rDEi9by/BjE= +github.com/pgsty/oink v1.0.0/go.mod h1:pHvbUhJCfseB41n5RGwsF7abT3i32VSTpofLQoq4b7Y= + diff --git a/hugo.yaml b/hugo.yaml new file mode 100644 index 000000000..8b0afe361 --- /dev/null +++ b/hugo.yaml @@ -0,0 +1,135 @@ +title: &siteTitle Apache HugeGraph +baseURL: https://hugegraph.apache.org/ +defaultContentLanguage: en +defaultContentLanguageInSubdir: false +enableGitInfo: true +enableMissingTranslationPlaceholders: true +enableRobotsTXT: true +enableEmoji: true + +languages: + en: + label: English + locale: en-US + contentDir: content/en + weight: 1 + title: *siteTitle + params: + description: Apache HugeGraph documentation and project updates. + version_menu: Releases + versions: + - { version: latest, name: latest, url: 'https://hugegraph.apache.org/docs/', pagelinks: false } + - { version: '1.7', name: '1.7', url: 'https://hugegraph.apache.org/versions/1.7/docs/', pagelinks: false } + - { version: '1.5', name: '1.5', url: 'https://hugegraph.apache.org/versions/1.5/docs/', pagelinks: false } + menus: + main: + - { identifier: docs, name: Documentation, pageRef: /docs, weight: 10 } + - { identifier: download, name: Download, pageRef: /docs/download/download, weight: 20 } + - { identifier: blog, name: Blog, pageRef: /blog, weight: 30 } + - { identifier: community, name: Community, pageRef: /community, weight: 40 } + - { identifier: github, name: GitHub, url: 'https://github.com/apache/hugegraph', weight: 50 } + cn: + label: 简体中文 + locale: zh-CN + contentDir: content/cn + hasCJKLanguage: true + weight: 2 + title: *siteTitle + params: + description: Apache HugeGraph 中文文档与项目动态。 + version_menu: 版本 + versions: + - { version: latest, name: latest, url: 'https://hugegraph.apache.org/cn/docs/', pagelinks: false } + - { version: '1.7', name: '1.7', url: 'https://hugegraph.apache.org/versions/1.7/cn/docs/', pagelinks: false } + - { version: '1.5', name: '1.5', url: 'https://hugegraph.apache.org/versions/1.5/cn/docs/', pagelinks: false } + menus: + main: + - { identifier: docs, name: 文档, pageRef: /docs, weight: 10 } + - { identifier: download, name: 下载, pageRef: /docs/download/download, weight: 20 } + - { identifier: blog, name: 博客, pageRef: /blog, weight: 30 } + - { identifier: community, name: 社区, pageRef: /community, weight: 40 } + - { identifier: github, name: GitHub, url: 'https://github.com/apache/hugegraph', weight: 50 } + +taxonomies: + tag: tags + category: categories + +permalinks: + blog: /:section/:year/:month/:day/:slug/ + +imaging: + resampleFilter: CatmullRom + anchor: Smart + jpeg: + quality: 75 + webp: + quality: 75 + avif: + quality: 75 + +markup: + goldmark: + renderer: + unsafe: true + parser: + attribute: + block: true + wrapStandAloneImageWithinParagraph: false + highlight: + noClasses: false + style: tango + +outputs: + home: [HTML, RSS, markdown, LLMS, NAVJSON] + page: [HTML, markdown] + section: [HTML, RSS, print, markdown] + +params: + description: Apache HugeGraph is a full-stack graph database ecosystem for OLTP, OLAP, and graph AI. + github_repo: https://github.com/apache/hugegraph-doc + github_project_repo: https://github.com/apache/hugegraph + github_branch: master + logo: img/logo.svg + # Visible navigation lockup; keep the longer site title for metadata/SEO. + brand_name: HugeGraph + version: latest + # Historical entries are enabled only after the aggregate artifact exists. + version_menu_pagelinks: false + archived_version: false + url_latest_version: https://hugegraph.apache.org/docs/ + offline_search: true + offline_search_on_serve: true + offline_search_index: summary + offline_search_summary_length: 70 + offline_search_max_results: 10 + footer_center_info: '' + # The compact ASF footer owns the legal line; global controls stay in header. + copyright: false + print: + toc: true + ui: + dark_mode: + enable: true + show_menu: true + footer_style: fat + section_index: cards + blog_index: cards + sidebar_menu_compact: true + sidebar_menu_foldable: true + sidebar_expand_levels: 2 + wide_nav_sections: [community] + sidebar_icon_policy: groups + sidebar_item_overflow: wrap + page_context_menu: + enable: true + assistant_links: false + reading_time: false + feedback: false + keyboard_nav: true + +module: + imports: + - path: github.com/pgsty/oink + hugoVersion: + extended: true + min: 0.160.1 diff --git a/i18n/cn.yaml b/i18n/cn.yaml new file mode 100644 index 000000000..d1c584ea5 --- /dev/null +++ b/i18n/cn.yaml @@ -0,0 +1,236 @@ +# Alert labels +callout_caution: 注意 +callout_important: 重要 +callout_note: 说明 +callout_tip: 提示 +callout_warning: 警告 +callout_success: 成功 +callout_danger: 危险 +callout_question: 问题 +callout_example: 示例 +callout_quote: 引用 +callout_details: 详情 + +# UI strings. Buttons and similar. +ui_pager_prev: 上一页 +ui_pager_next: 下一页 +ui_search: 搜索… +ui_search_empty: 未找到结果 +ui_search_loading: 正在加载搜索索引…… +ui_search_results: '找到 {count} 条结果' +ui_search_nav: 选择 +ui_search_open: 打开 +ui_search_close: 关闭 +ui_palette_actions: 操作 +ui_palette_page_actions: 页面操作 +ui_palette_preferences: 偏好设置 +ui_palette_commands: 命令 +ui_palette_quick_links: 快速链接 +ui_palette_no_commands: 未找到匹配命令 +ui_palette_choose: 请选择一项 +ui_palette_action_failed: 无法完成此操作 +ui_palette_pages: 页面 +ui_palette_index_unavailable: 页面索引暂不可用,操作仍可使用 +ui_sidebar_nav: 章节导航 +ui_heading_self_link: 标题锚点 +ui_field_self_link: 链接到此字段 +ui_preview_source: Markdown +ui_preview_rendered: 渲染结果 +ui_main_nav: 主导航 +ui_home: 首页 +ui_sidebar_expand: 展开侧栏 +ui_sidebar_collapse: 收起侧栏 +ui_drawer_open: 打开导航 +ui_drawer_close: 关闭导航 +ui_root_menu_label: 选择栏目 +ui_tags_title: 标签 +ui_tag_title: 标签 +ui_categories_title: 分类 +ui_category_title: 分类 +ui_modules_title: 模块 +ui_module_title: 模块 +ui_authors_title: 作者 +ui_author_title: 作者 +ui_theme_toggle: 切换配色 +ui_language: 语言切换 +ui_theme: 主题颜色 +ui_theme_auto: 跟随系统 +ui_theme_light: 亮色 +ui_theme_dark: 暗色 +ui_toc_hide: 隐藏目录 +ui_toc_show: 显示目录 +ui_language_select: 选择语言 +ui_language_switch: 切换语言 +ui_skip_to_content: 跳转到主要内容 +ui_page_actions: 操作 +ui_open_in_chatgpt: 在 ChatGPT 中打开 +ui_open_in_claude: 在 Claude 中打开 +ui_open_in_prompt: 请阅读 %s 的内容,以便我就此向你提问。 +ui_copy_markdown: 复制 Markdown 文本 +ui_copy_success: 已复制 Markdown +ui_copy_error: 无法复制 Markdown +ui_share: 分享 +ui_share_email: 邮件 +ui_copy_link: 复制链接 +ui_copy_link_success: 已复制链接 +ui_copy_link_error: 无法复制链接 +ui_code_copy: 复制 +ui_code_copy_label: 复制代码 +ui_code_copied: 已复制 +ui_code_copy_error: 复制失败 +ui_code_show_all: 显示全部 {{ .Count }} 行 +ui_code_collapse: 收起代码 +ui_tabs_label: 选项卡 +ui_pricing_featured: 推荐 +ui_pricing_included: 包含 +ui_pricing_excluded: 不包含 +ui_marquee_pause: 暂停滚动 +ui_kbd_with: 加 +ui_keyboard_shortcuts: 键盘快捷键 +ui_shortcut_tree_move: 在侧栏中移动 +ui_shortcut_tree_toggle: 收起或展开章节 +ui_shortcut_tree_open: 打开当前页面 +ui_shortcut_heading_move: 上一个或下一个标题 +ui_shortcut_page_move: 上一页或下一页 +ui_shortcut_search: 搜索 +ui_shortcut_commands: 命令面板 +ui_shortcut_reading_mode: 专注阅读模式 +ui_shortcut_language: 切换语言 +ui_shortcut_theme: 切换主题 +ui_shortcut_route: 切换顶层页面 +ui_page_annotation: 页面信息 +ui_backlinks: 反链 +ui_backlinks_more: "再显示 {{ . }} 条" +ui_field_required: 必填 +ui_action_unavailable: 暂不可用 +ui_image_zoom_dialog: 图片预览 +ui_image_zoom_open: 打开图片预览 +ui_image_zoom_close: 关闭图片预览 +ui_print_page: 打印此页面 +ui_sidebar_expand_section: 展开章节 +ui_sidebar_collapse_section: 收起章节 +ui_asciinema_timer: 播放时间 +ui_openapi_spec: OpenAPI 规格文件 +ui_release_view: 查看发布 +ui_release_source: 源码 +ui_release_compare: 比较变更 +ui_release_released: 发布于 +ui_release_checksums: 校验和 +ui_assets_file: 文件 +ui_assets_checksum: 校验和 +ui_assets_copy: 复制校验和 +ui_assets_copied: 已复制 +ui_assets_copy_all: 复制全部校验和 +ui_assets_download: 下载资产 +ui_download_channels: 下载渠道 +ui_download_unpublished: 待发布 + +# Used in sentences such as "All Tags" +ui_all: 全部 + +# Footer text +footer_all_rights_reserved: 保留所有权利 + +ui_footer_collapse: 收起页脚链接 +ui_footer_expand: 展开页脚链接 + +# Post (blog, article, etc.) +post_last_mod: 最后修改 +post_upstream: "{{ .work }},{{ .copyright }},依 {{ .license }} 授权使用,详见{{ .notice }}。" +post_upstream_adapted: 本页改编自 {{ .work }},{{ .copyright }},依 {{ .license }} 授权,详见{{ .notice }}与{{ .history }}。 +post_upstream_adapted_plain: 本页改编自 {{ .work }},{{ .copyright }},依 {{ .license }} 授权,详见{{ .notice }}。 +post_upstream_notice: 归属声明 +post_upstream_history: 修改历史 +post_translated: 本页为译文,如有出入以{{ .original }}为准。 +post_translated_original: 原文 +post_edit_this: 编辑当前页面 +post_view_markdown: 查阅 Markdown 源码 +post_create_child_page: 添加子页面 +post_create_issue: 提交文档议题 +post_create_project_issue: 提交项目议题 +post_reading_time: 分钟阅读 +post_less_than_a_minute_read: 1分钟内可阅读完 +post_word_count: '{{ .Count }} 字' +post_reading_minutes: '{{ .Minutes }} 分钟' +post_read_original: 阅读原文 + +# Print support +print_printable_section: 这是本节的多页打印视图。 +print_click_to_print: 点击此处打印 +print_show_regular: 返回本页常规视图 +print_entire_section: 打印完整章节 + +# Feedback +feedback_question: 这篇文档解决了你的问题吗? +feedback_positive: 是 +feedback_negative: 否 +feedback_thanks: 感谢反馈,我们会据此改进这篇文档。 +feedback_reason_prompt: 哪里没有解决?(可选) +feedback_reason_missing: 缺少必要信息 +feedback_reason_outdated: 内容错误或已过时 +feedback_reason_failed: 操作步骤没有生效 +feedback_reason_unclear: 内容难以理解 +feedback_details: 在评论区补充详情 +feedback_change: 修改反馈 + +# Table of contents +toc_on_this_page: 目录 + +# Error pages +error_404_title: 页面不存在 +error_404_body: >- + 抱歉,该页面不存在。可以从首页重新开始。 +error_404_home: 返回首页 + +# Version banner +version_banner_archived: >- + 文档 {{ .Version }} 版本已不再积极维护,你当前浏览的是一份归档快照。 +version_banner_latest: 最新文档请参阅 {{ .Link }}。 +version_banner_latest_link: 最新版本 + +# Comments +comments_noscript: 加载评论需要启用 JavaScript。 +comments_noscript_link: 在 GitHub 上查看讨论。 + +# LLM 页面操作 +ui_open_in_prompt_label: 就本页提问 +ui_view_history: 查阅编辑历史 +ui_table_scroll: "可横向滚动的表格" +ui_filetree_divider: "拖动以调整目录树备注列宽度" +book_figure: 图 +book_table: 表 +book_equation: 公式 +book_example: 示例 +book_toc: 全书目录 +book_draft: 草稿 +book_draft_notice: 本章仍在修订中。 +contributors_count: 位贡献者 + +# Article series +ui_series_title: 系列 +ui_series_part: 第 {{ .Part }} / 共 {{ .Total }} 篇 + +# Replace these values with reviewed translations when available. +ui_list_separator: 、 + +# Footer text +post_meta_by_in: "{{ .Authors }} 发布于 {{ .Section }}" +post_meta_in: "发布于 {{ .Section }}" + +# Replace these values with reviewed translations when available. +ui_blog_index_toggle: 切换布局 + +# Markdown output +markdown_llms_index: "LLMS 索引:" +markdown_backlinks: "反链:" +markdown_section_pages: "本节页面:" + +# Explicit English fallbacks for untranslated OINK UI strings. +# Replace these values with reviewed translations when available. +ui_diagram_expand: 放大图表 +ui_diagram_zoom_dialog: 图表预览 +ui_diagram_zoom_close: 关闭图表预览 +ui_diagram_zoom_in: 放大 +ui_diagram_zoom_out: 缩小 +ui_diagram_zoom_reset: 复位视图 +ui_diagram_error: 图表无法渲染 diff --git a/layouts/404.html b/layouts/404.html index 378b73675..ab2a5919f 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,10 +1,39 @@ -{{ define "main"}} -
-
-

Not found

-

Oops! This page doesn't exist. Try going back to our home page.

- -

You can learn how to make a 404 page like this in Custom 404 Pages.

-
-
-{{ end }} +{{- /* Keep OINK's complete interactive 404 shell and add an explicit local + search recovery action beside the home-page escape hatch. */ -}} +{{- .Page.Store.Set "tdOutputFormat" "html" -}} +{{- .Page.Store.Set "tdIsErrorDocument" true -}} + + + + {{- $head := partial "head.html" . -}} + {{- $head = replaceRE `(?i)` `` $head -}} + {{- $title := printf "%s | %s" (T "error_404_title") .Site.Title -}} + {{- replaceRE `(?s).*?` $title $head | safeHTML -}} + + + {{ partial "skip-link.html" . }} + {{ if partial "shell/navbar-enabled.html" . }}{{ partial "navbar.html" . }}{{ end }} +
+
+
+

{{ T "error_404_title" }}

+

{{ T "error_404_body" }}

+

+ {{- if partial "shell/search-enabled.html" . }} + + {{- end }} + {{ T "error_404_home" }} +

+
+
+ {{ partial "footer.html" . }} +
+ {{ partial "scripts.html" . }} + + diff --git a/layouts/_partials/footer.html b/layouts/_partials/footer.html new file mode 100644 index 000000000..94fe3c0e3 --- /dev/null +++ b/layouts/_partials/footer.html @@ -0,0 +1,44 @@ +{{- /* HugeGraph keeps the compact ASF footer used by the original site. + Global utilities live in the site header, so the footer stays focused. */ -}} +{{- $style := partial "footer-style.html" . -}} +{{- if ne $style "none" -}} + {{- if eq $style "fat" -}} + {{- $data := partial "footer-data.html" . -}} + {{- $brand := $data.brand | default dict -}} + {{- $logoURL := "" -}} + {{- with resources.Get ($brand.logo | default "img/apache_logo.svg") -}} + {{- $logoURL = .RelPermalink -}} + {{- else -}} + {{- warnf "HugeGraph footer: Apache wordmark asset is missing" -}} + {{- end -}} +
+ +
+ {{- else -}} + {{ partial "shell/footer-line.html" . }} + {{- end -}} +{{- end -}} diff --git a/layouts/_partials/navbar-item.html b/layouts/_partials/navbar-item.html new file mode 100644 index 000000000..a3f2dec9d --- /dev/null +++ b/layouts/_partials/navbar-item.html @@ -0,0 +1,79 @@ +{{- /* OINK v1.0.0 override: Documentation gains manifest-driven versions. + One top-level Hugo Menu item. Leaves keep the historical link path; + parents add a separate disclosure and one dropdown/accordion panel. */ -}} +{{- $page := .page -}} +{{- $entry := .entry -}} +{{- $mode := .mode -}} +{{- $index := .index -}} +{{- $hasChildren := $entry.HasChildren -}} +{{- $hasVersionLinks := and (eq $entry.Identifier "docs") (gt (len ($page.Site.Params.versions | default slice)) 0) -}} +{{- $taxonomyPage := false -}} +{{- with $entry.Page -}} + {{- if eq .Kind "taxonomy" }}{{ $taxonomyPage = . }}{{ end -}} +{{- end -}} +{{- /* URL-based menus predate pageRef and are still common in consumers. + Resolve their local target so a /tags/ entry gets the same taxonomy + panel without forcing a configuration migration. */ -}} +{{- if and (not $taxonomyPage) $entry.URL -}} + {{- $target := urls.Parse $entry.URL -}} + {{- if not $target.Host -}} + {{- $targetPage := $page.Site.GetPage $target.Path -}} + {{- if and (not $targetPage) $page.Site.LanguagePrefix + (hasPrefix $target.Path $page.Site.LanguagePrefix) -}} + {{- $targetPage = $page.Site.GetPage + (strings.TrimPrefix $page.Site.LanguagePrefix $target.Path) -}} + {{- end -}} + {{- with $targetPage -}} + {{- if eq .Kind "taxonomy" }}{{ $taxonomyPage = . }}{{ end -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- $hasPanel := or $hasChildren $taxonomyPage $hasVersionLinks -}} +{{- $key := $entry.Identifier | default $entry.Name | urlize -}} +{{- $panelID := printf "td-navbar-%s-%s-%d" $mode $key $index -}} + +{{- if not $hasPanel -}} + {{- if eq $mode "desktop" -}} + {{ partial "navbar-entry-link.html" (dict "page" $page "entry" $entry "class" "nav-link") }} + {{- else -}} + {{ partial "navbar-entry-link.html" (dict "page" $page "entry" $entry "class" "td-site-nav__menu-link" "region" "mobile") }} + {{- end -}} +{{- else if eq $mode "desktop" -}} +{{- /* One panel shape: a single column of icon-and-title rows. The mega + panel's columns parameter is retired; menus that still set it keep the + single column and get this targeted migration warning. */ -}} +{{- if isset $entry.Params "columns" -}} + {{- warnf "navbar menu %q: the columns parameter is retired; dropdown panels render one column of icon-and-title rows" $entry.Name -}} +{{- end -}} +{{- /* Desktop parent links navigate; hover or focus exposes the panel. */ -}} +
+ {{ partial "navbar-entry-link.html" (dict "page" $page "entry" $entry "class" "nav-link td-nav-menu__parent-link" "controls" $panelID) }} + +
+{{- else -}} + {{- /* Compact menus navigate to the parent landing; that page exposes the + hierarchy in its own shell. Without this branch taxonomy parents would + disappear whenever this partial is reused in mobile mode. */ -}} + {{ partial "navbar-entry-link.html" (dict "page" $page "entry" $entry "class" "td-site-nav__menu-link" "region" "mobile") }} +{{- end -}} diff --git a/layouts/_partials/navbar.html b/layouts/_partials/navbar.html new file mode 100644 index 000000000..bfcfca10e --- /dev/null +++ b/layouts/_partials/navbar.html @@ -0,0 +1,204 @@ +{{- /* OINK v1.0.0 override: keep keyboard help in the header and expose + version links inside the landing-page mobile drawer. */ -}} +{{- $config := partialCached "shell/config.html" . .Site.Language.Lang -}} +{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}} +{{- $targets := partialCached "language-targets.html" . .Site.BaseURL .RelPermalink .Site.Language.Lang -}} +{{- $localSearch := partial "shell/search-enabled.html" . -}} +{{- /* On shell pages with a sidebar, the compact navbar gains one extra + icon below md that opens the shell drawer (docs tree + relocated + aside). */ -}} +{{- $drawerMode := and (partial "shell/chrome-enabled.html" .) (partial "shell/sidebar-enabled.html" .) -}} +{{- /* Home and explicit Landing layouts render the drawer entry: these are + the navbar-only surfaces with no sidebar drawer to fall back on. CSS + gates the button to the below-md tier, where it joins search as the + whole right-hand contract; the centered link tree stays at every + width, so the drawer only restores the full labelled hierarchy. */ -}} +{{- $landingSurface := or .IsHome (eq .Layout "landing") -}} +{{- $githubStars := partial "landing/github-stars.html" . -}} +{{- $altSite := false -}} +{{- if le (len $targets) 1 }}{{ $altSite = partial "landing/alt-site.html" . }}{{ end -}} +{{- $autohide := partial "shell/navbar-autohide.html" . -}} +{{- $brandName := $config.brandName -}} +{{- $wideHeaderSections := .Site.Params.ui.wide_nav_sections | default (slice) -}} +{{- $wideHeader := or .IsHome (in $wideHeaderSections .Section) -}} +{{- if $autohide }} +
+{{- end }} +
+
+ +
+
+{{- if $landingSurface }} + +{{- end }} +{{- if $autohide }} +
+{{- end }} diff --git a/layouts/_partials/seo-alternates.html b/layouts/_partials/seo-alternates.html new file mode 100644 index 000000000..c92e93065 --- /dev/null +++ b/layouts/_partials/seo-alternates.html @@ -0,0 +1,16 @@ +{{- /* Error documents describe whichever missing URL Apache serves them for, so + they must not claim the generated /404.html URL as canonical or translated. */ -}} +{{- if not (.Store.Get "tdIsErrorDocument") -}} + {{- $targets := partialCached "language-targets.html" . .Site.BaseURL .RelPermalink .Site.Language.Lang -}} + {{- $outputFormat := lower (.Store.Get "tdOutputFormat" | default "html") -}} + {{- /* Print already receives the regular HTML URL as its canonical alternative. */ -}} + {{- if ne $outputFormat "print" }} + + {{- end }} + {{- range $targets }} + + {{- end }} + {{- range where $targets "active" false }} + + {{- end }} +{{- end }} diff --git a/layouts/_partials/shell/config.html b/layouts/_partials/shell/config.html new file mode 100644 index 000000000..bc01845f0 --- /dev/null +++ b/layouts/_partials/shell/config.html @@ -0,0 +1,50 @@ +{{- /* OINK v1.0.0 override: separate the visible lockup from the SEO title. */ -}} +{{- $name := .Site.Params.brand_name | default .Site.Title -}} +{{- $logoPath := .Site.Params.logo | default "icons/logo.svg" -}} +{{- $logoURL := (partial "content/url.html" (dict + "name" "shell" "parameter" "logo" "position" "site configuration" + "value" $logoPath "kind" "image" +)).href -}} +{{- with resources.Get $logoPath -}} + {{- $logoURL = .RelPermalink -}} +{{- end -}} +{{- $wordmarkPath := .Site.Params.wordmark | default "" -}} +{{- $wordmarkURL := "" -}} +{{- if $wordmarkPath -}} + {{- $wordmarkURL = (partial "content/url.html" (dict + "name" "shell" "parameter" "wordmark" "position" "site configuration" + "value" $wordmarkPath "kind" "image" + )).href -}} + {{- with resources.Get $wordmarkPath -}} + {{- $wordmarkURL = .RelPermalink -}} + {{- end -}} +{{- end -}} +{{- $projectRepo := .Site.Params.github_project_repo | default .Site.Params.github_repo -}} +{{- $docsSection := strings.Trim (.Site.Params.ui.docs_section | default "docs") "/" -}} +{{- $blogSection := strings.Trim (.Site.Params.ui.blog_section | default "blog") "/" -}} +{{- $docsRoot := "section" -}} +{{- if isset .Site.Params.ui "docs_sidebar_root" -}} + {{- $rawDocsRoot := index .Site.Params.ui "docs_sidebar_root" -}} + {{- if ne (printf "%T" $rawDocsRoot) "string" -}} + {{- warnf "params.ui.docs_sidebar_root must be a string: home or section; got %v; using section" $rawDocsRoot -}} + {{- else -}} + {{- $docsRoot = lower $rawDocsRoot -}} + {{- end -}} +{{- end -}} +{{- if not (in (slice "home" "section") $docsRoot) -}} + {{- warnf "params.ui.docs_sidebar_root must be home or section; got %q; using section" $docsRoot -}} + {{- $docsRoot = "section" -}} +{{- end -}} +{{- $shellTypes := .Site.Params.ui.shell_types | default (slice "docs" "book" "blog" "swagger") -}} +{{- $quickLinks := .Site.Params.ui.quick_links | default (slice $docsSection $blogSection) -}} +{{- return dict + "brandName" $name + "logoURL" $logoURL + "wordmarkURL" $wordmarkURL + "projectRepo" $projectRepo + "docsSection" $docsSection + "docsRoot" $docsRoot + "blogSection" $blogSection + "shellTypes" $shellTypes + "quickLinks" $quickLinks +-}} diff --git a/layouts/_partials/shell/search-enabled.html b/layouts/_partials/shell/search-enabled.html new file mode 100644 index 000000000..34c262293 --- /dev/null +++ b/layouts/_partials/shell/search-enabled.html @@ -0,0 +1,31 @@ +{{- $isLanding := eq .Layout "landing" -}} +{{- $landingSearch := true -}} +{{- if isset .Site.Params.ui "landing_search" }}{{ $landingSearch = .Site.Params.ui.landing_search }}{{ end -}} +{{- if and $isLanding (ne (printf "%T" $landingSearch) "bool") -}} + {{- warnf "params.ui.landing_search must be a boolean; using true" -}} +{{- end -}} +{{- $surface := or .IsHome (eq .Kind "404") (partial "shell/chrome-enabled.html" .) (and $isLanding $landingSearch) -}} +{{- $format := lower (.Store.Get "tdOutputFormat" | default "html") -}} +{{- $serveSearch := true -}} +{{- if isset .Site.Params "offline_search_on_serve" -}} + {{- $serveSearch = .Site.Params.offline_search_on_serve -}} +{{- end -}} +{{- /* Hugo preserves environment overrides (HUGOxPARAMSxOFFLINE_SEARCH_ON_SERVE) + as strings, so normalize only the two documented forms. */ -}} +{{- if eq (printf "%T" $serveSearch) "string" -}} + {{- if eq $serveSearch "true" -}} + {{- $serveSearch = true -}} + {{- else if eq $serveSearch "false" -}} + {{- $serveSearch = false -}} + {{- end -}} +{{- end -}} +{{- if ne (printf "%T" $serveSearch) "bool" -}} + {{- warnf "params.offline_search_on_serve must be a boolean or an exact true/false environment value; using true" -}} + {{- $serveSearch = true -}} +{{- end -}} +{{- return and + .Site.Params.offline_search + (or (not hugo.IsServer) $serveSearch) + $surface + (ne $format "print") +-}} diff --git a/layouts/_partials/shell/sidebar-panel.html b/layouts/_partials/shell/sidebar-panel.html new file mode 100644 index 000000000..ae8692525 --- /dev/null +++ b/layouts/_partials/shell/sidebar-panel.html @@ -0,0 +1,97 @@ +{{- /* OINK v1.0.0 override: the mobile Docs drawer owns global controls that + disappear from the compact header and no longer repeat in the footer. */ -}} +{{- $config := partialCached "shell/config.html" . .Site.Language.Lang -}} +{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}} +{{- $hasAlgolia := partialCached "search/algolia-enabled.html" . .Site.Language.Lang .Site.BaseURL -}} +{{- $hasOnlineSearch := or .Site.Params.gcs_engine_id $hasAlgolia -}} +{{- $localSearch := partial "shell/search-enabled.html" . -}} +{{- /* The sidebar owns its identity row even when the global navbar exists: + content hierarchy has visual priority over site-wide navigation. */ -}} +
+
+
+ + + {{- if $config.wordmarkURL }} + + {{- else }} + {{ $config.brandName }} + {{- end }} + + {{- if $localSearch }} + + {{- end }} + +
+ {{- /* The local palette has a compact desktop opener above, so its full + field belongs to the drawer at every navbar setting. Online search + has no equivalent icon contract and may keep this row on desktop. */ -}} + {{- $drawerOnly := or $localSearch (not $hasOnlineSearch) }} +
+ {{- if $localSearch }} + + {{- else if $hasOnlineSearch }} + {{ partial "search-input.html" . }} + {{- else }} + + {{- end }} + +
+ {{ partial "shell/root-menu.html" . }} +
+
+ {{ partial "shell/sidebar.html" . }} + {{/* Below xl the TOC rail is hidden; docs-shell.js parks its contents here + so the table of contents and the taxonomies stay reachable from the drawer. Empty until then. */ -}} + +
+ + +
diff --git a/layouts/_partials/shell/toc.html b/layouts/_partials/shell/toc.html new file mode 100644 index 000000000..600866385 --- /dev/null +++ b/layouts/_partials/shell/toc.html @@ -0,0 +1,9 @@ +{{- /* OINK v1.0.0 shell/toc.html with an accessible name on Hugo's TOC nav. */ -}} +{{- $toc := .TableOfContents -}} +{{- $label := T "toc_on_this_page" | htmlEscape -}} +{{- $toc = replace $toc `