Full Code of cayleygraph/cayley for AI

master 81dcd7d73e45 cached
378 files
1.8 MB
574.5k tokens
3687 symbols
1 requests
Download .txt
Showing preview only (1,916K chars total). Download the full file or copy to clipboard to get everything.
Repository: cayleygraph/cayley
Branch: master
Commit: 81dcd7d73e45
Files: 378
Total size: 1.8 MB

Directory structure:
gitextract_q4kowbxs/

├── .dockerignore
├── .gitbook.yaml
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   └── workflows/
│       └── build-and-release.yml
├── .gitignore
├── .goreleaser.yml
├── AUTHORS
├── CODEOWNERS
├── CONTRIBUTORS
├── Dockerfile
├── LICENSE
├── README.md
├── cayley_example.yml
├── client/
│   └── client.go
├── clog/
│   ├── clog.go
│   └── glog/
│       └── glog.go
├── cmd/
│   ├── cayley/
│   │   ├── cayley.go
│   │   └── command/
│   │       ├── convert.go
│   │       ├── database.go
│   │       ├── dedup.go
│   │       ├── dump.go
│   │       ├── health.go
│   │       ├── http.go
│   │       ├── repl.go
│   │       └── schema.go
│   ├── cayleyexport/
│   │   ├── cayleyexport.go
│   │   └── cayleyexport_test.go
│   ├── cayleyimport/
│   │   ├── cayleyimport.go
│   │   └── cayleyimport_test.go
│   ├── docgen/
│   │   └── docgen.go
│   └── download_ui/
│       └── download_ui.go
├── configurations/
│   ├── default.json
│   └── persisted.json
├── data/
│   ├── 30kmoviedata_gephi_meta.nq
│   ├── people.jsonld
│   ├── testdata.nq
│   └── testdata_multigraph.nq
├── docs/
│   ├── 3rd-party-apis.md
│   ├── GizmoAPI.md.in
│   ├── README.md
│   ├── SUMMARY.md
│   ├── advanced-use.md
│   ├── api/
│   │   └── swagger.yml
│   ├── cayleyexport.md
│   ├── cayleyimport.md
│   ├── configuration.md
│   ├── container.md
│   ├── contributing.md
│   ├── convert-linked-data-files.md
│   ├── deployment/
│   │   ├── container.md
│   │   └── k8s-1.md
│   ├── docker-compose/
│   │   └── docker-compose.mongo.yml
│   ├── faq.md
│   ├── gephigraphstream.md
│   ├── getting-involved/
│   │   ├── contributing.md
│   │   ├── glossary.md
│   │   ├── locations.md
│   │   └── todo.md
│   ├── getting-started.md
│   ├── gizmoapi.md
│   ├── glossary.md
│   ├── graphql.md
│   ├── gremlinapi.md
│   ├── hacking.md
│   ├── http.md
│   ├── installation.md
│   ├── k8s/
│   │   ├── README.md
│   │   ├── cayley-mongo.yml
│   │   ├── cayley-single.yml
│   │   └── k8s.md
│   ├── locations.md
│   ├── migration.md
│   ├── mql.md
│   ├── query-languages/
│   │   ├── gephigraphstream.md
│   │   ├── gizmoapi.md
│   │   ├── graphql.md
│   │   └── mql.md
│   ├── quickstart-as-application.md
│   ├── quickstart-as-lib.md
│   ├── todo.md
│   ├── tools/
│   │   └── convert-linked-data-files.md
│   ├── ui-overview.md
│   └── usage/
│       ├── 3rd-party-apis.md
│       ├── advanced-use.md
│       ├── http.md
│       ├── migration.md
│       ├── quickstart-as-lib.md
│       └── ui-overview.md
├── examples/
│   ├── README.md
│   ├── hello_bolt/
│   │   └── main.go
│   ├── hello_schema/
│   │   └── main.go
│   ├── hello_world/
│   │   └── main.go
│   └── transaction/
│       └── main.go
├── go.mod
├── go.sum
├── gogen.go
├── graph/
│   ├── all/
│   │   ├── all.go
│   │   └── all_cgo.go
│   ├── gaedatastore/
│   │   ├── config.go
│   │   ├── iterator.go
│   │   ├── quadstore.go
│   │   └── quadstore_test.go
│   ├── graphmock/
│   │   └── graphmock.go
│   ├── graphtest/
│   │   ├── graphtest.go
│   │   ├── integration.go
│   │   └── testutil/
│   │       └── testutil.go
│   ├── hasa.go
│   ├── hasa_test.go
│   ├── http/
│   │   └── httpgraph.go
│   ├── iterator/
│   │   ├── and.go
│   │   ├── and_optimize.go
│   │   ├── and_optimize_test.go
│   │   ├── and_test.go
│   │   ├── count.go
│   │   ├── count_test.go
│   │   ├── fixed.go
│   │   ├── iterate.go
│   │   ├── iterator.go
│   │   ├── iterator_test.go
│   │   ├── limit.go
│   │   ├── limit_test.go
│   │   ├── materialize.go
│   │   ├── materialize_test.go
│   │   ├── misc.go
│   │   ├── not.go
│   │   ├── not_test.go
│   │   ├── or.go
│   │   ├── or_test.go
│   │   ├── recursive.go
│   │   ├── recursive_test.go
│   │   ├── regex.go
│   │   ├── resolver.go
│   │   ├── resolver_test.go
│   │   ├── save.go
│   │   ├── skip.go
│   │   ├── skip_test.go
│   │   ├── sort.go
│   │   ├── unique.go
│   │   ├── unique_test.go
│   │   ├── value_comparison.go
│   │   ├── value_comparison_test.go
│   │   └── value_filter.go
│   ├── kv/
│   │   ├── all/
│   │   │   └── all.go
│   │   ├── all_iterator.go
│   │   ├── badger/
│   │   │   ├── badger.go
│   │   │   └── badger_test.go
│   │   ├── bbolt/
│   │   │   ├── bolt.go
│   │   │   └── bolt_test.go
│   │   ├── bolt/
│   │   │   ├── bolt.go
│   │   │   └── bolt_test.go
│   │   ├── btree/
│   │   │   ├── btree.go
│   │   │   └── btree_test.go
│   │   ├── indexing.go
│   │   ├── indexing_test.go
│   │   ├── iterators.go
│   │   ├── kvtest/
│   │   │   └── kvtest.go
│   │   ├── leveldb/
│   │   │   ├── leveldb.go
│   │   │   └── leveldb_test.go
│   │   ├── metrics.go
│   │   ├── quad_iterator.go
│   │   ├── quadstore.go
│   │   ├── quadstore_test.go
│   │   └── registry.go
│   ├── linksto.go
│   ├── linksto_test.go
│   ├── log/
│   │   └── graphlog.go
│   ├── memstore/
│   │   ├── Makefile
│   │   ├── all_iterator.go
│   │   ├── gen.go
│   │   ├── iterator.go
│   │   ├── keys.go
│   │   ├── keys_test.go
│   │   ├── quadstore.go
│   │   └── quadstore_test.go
│   ├── nosql/
│   │   ├── all/
│   │   │   ├── all.go
│   │   │   └── all_test.go
│   │   ├── elastic/
│   │   │   └── elastic.go
│   │   ├── iterator.go
│   │   ├── mongo/
│   │   │   └── mongo.go
│   │   ├── nosqltest/
│   │   │   └── nosqltest.go
│   │   ├── ouch/
│   │   │   └── ouch.go
│   │   ├── quadstore.go
│   │   ├── shapes.go
│   │   └── value_test.go
│   ├── proto/
│   │   ├── primitive.pb.go
│   │   ├── primitive.proto
│   │   ├── primitive_helpers.go
│   │   ├── serializations.pb.go
│   │   ├── serializations.proto
│   │   └── serializations_helpers.go
│   ├── quadstore.go
│   ├── quadwriter.go
│   ├── quadwriter_test.go
│   ├── refs/
│   │   └── refs.go
│   ├── registry.go
│   ├── sql/
│   │   ├── cockroach/
│   │   │   ├── cockroach.go
│   │   │   └── cockroach_test.go
│   │   ├── database.go
│   │   ├── iterator.go
│   │   ├── mysql/
│   │   │   ├── mysql.go
│   │   │   └── mysql_test.go
│   │   ├── optimizer.go
│   │   ├── postgres/
│   │   │   ├── postgres.go
│   │   │   └── postgres_test.go
│   │   ├── quadstore.go
│   │   ├── shape.go
│   │   ├── shape_test.go
│   │   ├── sqlite/
│   │   │   ├── sqlite.go
│   │   │   └── sqlite_test.go
│   │   └── sqltest/
│   │       └── sqltest.go
│   ├── transaction.go
│   └── transaction_test.go
├── imports.go
├── inference/
│   ├── inference.go
│   └── inference_test.go
├── internal/
│   ├── decompressor/
│   │   ├── decompressor.go
│   │   └── decompressor_test.go
│   ├── dock/
│   │   └── dock.go
│   ├── gephi/
│   │   ├── stream.go
│   │   └── stream_test.go
│   ├── http/
│   │   ├── api_v1.go
│   │   ├── cors.go
│   │   ├── health.go
│   │   ├── http.go
│   │   ├── http_test.go
│   │   ├── logs.go
│   │   ├── query.go
│   │   └── write.go
│   ├── linkedql/
│   │   └── schema/
│   │       ├── schema.go
│   │       └── schema_test.go
│   ├── load.go
│   ├── lru/
│   │   ├── lru.go
│   │   └── lru_test.go
│   └── repl/
│       ├── repl.go
│       └── repl_test.go
├── query/
│   ├── gizmo/
│   │   ├── environ.go
│   │   ├── errors.go
│   │   ├── finals.go
│   │   ├── gizmo.go
│   │   ├── gizmo_test.go
│   │   └── traversals.go
│   ├── graphql/
│   │   ├── graphql.go
│   │   ├── graphql_test.go
│   │   └── http.go
│   ├── linkedql/
│   │   ├── entity_identfier.go
│   │   ├── errors.go
│   │   ├── graph_pattern.go
│   │   ├── iter_docs.go
│   │   ├── iter_tags.go
│   │   ├── iter_tags_test.go
│   │   ├── iter_values.go
│   │   ├── jsonld_util.go
│   │   ├── linkedql.go
│   │   ├── property_path.go
│   │   ├── registry.go
│   │   ├── registry_test.go
│   │   ├── step_types.go
│   │   ├── steps/
│   │   │   ├── as.go
│   │   │   ├── back.go
│   │   │   ├── both.go
│   │   │   ├── collect.go
│   │   │   ├── count.go
│   │   │   ├── difference.go
│   │   │   ├── greater_than.go
│   │   │   ├── greater_than_equals.go
│   │   │   ├── has.go
│   │   │   ├── has_reverse.go
│   │   │   ├── in.go
│   │   │   ├── intersect.go
│   │   │   ├── jsonld_util.go
│   │   │   ├── jsonld_util_test.go
│   │   │   ├── labels.go
│   │   │   ├── less_than.go
│   │   │   ├── less_than_equals.go
│   │   │   ├── like.go
│   │   │   ├── limit.go
│   │   │   ├── match.go
│   │   │   ├── match_test.go
│   │   │   ├── optional.go
│   │   │   ├── order.go
│   │   │   ├── out.go
│   │   │   ├── placeholder.go
│   │   │   ├── properties.go
│   │   │   ├── property_names.go
│   │   │   ├── property_names_as.go
│   │   │   ├── regexp.go
│   │   │   ├── reverse_properties.go
│   │   │   ├── reverse_property_names.go
│   │   │   ├── reverse_property_names_as.go
│   │   │   ├── skip.go
│   │   │   ├── steps_final.go
│   │   │   ├── steps_test.go
│   │   │   ├── test-cases/
│   │   │   │   ├── all-vertices.json
│   │   │   │   ├── back.json
│   │   │   │   ├── both.json
│   │   │   │   ├── collect.json
│   │   │   │   ├── count.json
│   │   │   │   ├── difference.json
│   │   │   │   ├── documents.json
│   │   │   │   ├── greater-than-equals.json
│   │   │   │   ├── greater-than.json
│   │   │   │   ├── has-reverse.json
│   │   │   │   ├── has.json
│   │   │   │   ├── intersect.json
│   │   │   │   ├── less-than-equals.json
│   │   │   │   ├── less-than.json
│   │   │   │   ├── like.json
│   │   │   │   ├── limit.json
│   │   │   │   ├── match-all.json
│   │   │   │   ├── match-exact.json
│   │   │   │   ├── optional.json
│   │   │   │   ├── order.json
│   │   │   │   ├── properties.json
│   │   │   │   ├── property-names-as.json
│   │   │   │   ├── property-names.json
│   │   │   │   ├── reg-exp.json
│   │   │   │   ├── reverse-properties.json
│   │   │   │   ├── reverse-property-names-as.json
│   │   │   │   ├── select-with-tags.json
│   │   │   │   ├── select.json
│   │   │   │   ├── skip.json
│   │   │   │   ├── union.json
│   │   │   │   ├── unique.json
│   │   │   │   ├── view-reverse.json
│   │   │   │   ├── view.json
│   │   │   │   └── where.json
│   │   │   ├── union.go
│   │   │   ├── unique.go
│   │   │   ├── vertex.go
│   │   │   ├── visit.go
│   │   │   ├── visit_reverse.go
│   │   │   └── where.go
│   │   └── voc_util.go
│   ├── mql/
│   │   ├── build_iterator.go
│   │   ├── fill.go
│   │   ├── mql_test.go
│   │   ├── query.go
│   │   └── session.go
│   ├── path/
│   │   ├── morphism_apply_functions.go
│   │   ├── path.go
│   │   ├── path_test.go
│   │   └── pathtest/
│   │       └── pathtest.go
│   ├── session.go
│   ├── sexp/
│   │   ├── parser.go
│   │   ├── parser_test.go
│   │   └── session.go
│   └── shape/
│       ├── path.go
│       ├── shape.go
│       └── shape_test.go
├── schema/
│   ├── loader.go
│   ├── loader_test.go
│   ├── namespaces.go
│   ├── namespaces_test.go
│   ├── schema.go
│   ├── schema_test.go
│   ├── types.go
│   ├── writer.go
│   └── writer_test.go
├── server/
│   └── http/
│       ├── accept.go
│       ├── api_v2.go
│       ├── api_v2_test.go
│       └── common.go
├── ui/
│   ├── embed.go
│   └── web/
│       ├── asset-manifest.json
│       ├── gizmo.d.ts
│       ├── index.html
│       ├── manifest.json
│       ├── precache-manifest.5316e0e4a35813e95b82d4799f1bb55c.js
│       ├── robots.txt
│       ├── service-worker.js
│       └── static/
│           ├── css/
│           │   ├── 2.6b51f286.chunk.css
│           │   └── main.72fe53e6.chunk.css
│           └── js/
│               ├── 2.7d84b3fa.chunk.js
│               ├── main.84d3ab8c.chunk.js
│               └── runtime-main.0686c6e7.js
├── version/
│   └── version.go
├── vet.sh
└── writer/
    └── single.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
.idea/
vendor/

================================================
FILE: .gitbook.yaml
================================================
root: ./docs/

================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
<!--
The GitHub issue tracker is for bug reports and feature requests.
General support can be found at the following locations:

- Cayley Forum - https://discourse.cayley.io
- Slack - cayleygraph.slack.com, invites: https://cayley-slackin.herokuapp.com

Please answer these questions before submitting your issue. Thanks!
-->

**Description**

<!--
Briefly describe the problem you are having in a few paragraphs.
-->

**Steps to reproduce the issue:**
1.
2.
3.

**Received results:**

<!--
Describe results you received.

Any additional information such as logs will help.
Enclose it into following markdown:
-->
```
(program output or server response)
```

**Expected results:**


**Output of `cayley version` or commit hash:**

```
(paste your output here)
```

**Environment details:**

Backend database: `(database and version)`


================================================
FILE: .github/workflows/build-and-release.yml
================================================
name: Test and release

on:
  push:
    branches:
      - master
      - ci_tests
    tags:
      - '*'
  pull_request:
    branches:
      - master

env:
  DOCKER_IMAGE_NAME: ghcr.io/cayleygraph/cayley

jobs:

  tests:
    name: Tests
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Set up Go
      uses: actions/setup-go@v5
      with:
        go-version: '1.22'

    - name: Dependencies
      run: go mod download

    - name: Vet
      run: ./vet.sh

    - name: Build
      run: go build -v ./cmd/cayley

    - name: Test
      run: go test -v ./...

  release:
    name: Release
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/ci_tests')
    needs:
      - tests
    steps:
      - uses: actions/checkout@v4

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.22'

      - name: Dependencies
        run: go mod download

      - name: Download UI
        run: go run cmd/download_ui/download_ui.go

      - name: Release
        uses: goreleaser/goreleaser-action@v6
        if: startsWith(github.ref, 'refs/tags/v')
        with:
          version: latest
          args: release --clean
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  docker:
    name: Docker image
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/ci_tests')
    needs:
      - tests

    steps:
      - uses: actions/checkout@v4

      - name: Docker build
        run: |
          docker build -t $DOCKER_IMAGE_NAME:dev --build-arg VERSION=${{ github.ref_name }} .

      - name: Log in to the Container registry
        uses: docker/login-action@v3
        if: startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/master')
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Push latest
        if: (github.ref == 'refs/heads/master')
        run: |
          docker push $DOCKER_IMAGE_NAME:dev

      - name: Push tagged
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          docker tag $DOCKER_IMAGE_NAME:dev $DOCKER_IMAGE_NAME:${{ github.ref_name }}
          docker push $DOCKER_IMAGE_NAME:${{ github.ref_name }}

      - name: Push latest
        if: startsWith(github.ref, 'refs/tags/v')
        run: |
          docker tag $DOCKER_IMAGE_NAME:dev $DOCKER_IMAGE_NAME:latest
          docker push $DOCKER_IMAGE_NAME:latest

================================================
FILE: .gitignore
================================================
.idea/
db/
dist/
vendor/

*.swp
main
*.test
*.peg.go
cayley.cfg
cayley.yml
cayley.json
.cayley_history
.DS_Store

packrd/packed-*
# The build binary
/cayley


================================================
FILE: .goreleaser.yml
================================================
builds:
  - main: ./cmd/cayley
    binary: cayley
    env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
      - windows
    goarch:
      - amd64
      - arm64
      - arm
    ignore:
      - goos: windows
        goarch: arm
      - goos: windows
        goarch: arm64
      - goos: darwin
        goarch: arm
      - goos: darwin
        goarch: arm64
    ldflags:
      - -s -w -X github.com/cayleygraph/cayley/version.Version={{.Version}} -X github.com/cayleygraph/cayley/version.GitHash={{.FullCommit}} -X github.com/cayleygraph/cayley/version.BuildDate={{.Date}}
archives:
  - format: tar.gz
    format_overrides:
      - goos: windows
        format: zip
    wrap_in_directory: true
    files:
      - README.md
      - LICENSE
      - AUTHORS
      - CONTRIBUTORS
      - configurations/*
      - data/*
checksum:
  name_template: "checksums.txt"
snapshot:
  name_template: "{{ .Tag }}-dev"
changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^test:"
      - "^ci:"
snapcrafts:
  - name: cayley
    publish: false # TODO(dennwc): enable build when the package is reviewed
    summary: Open-source graph inspired by Freebase and Google's Knowledge Graph.
    description: |
      Cayley is an open-source graph inspired by the graph database behind Freebase and Google's Knowledge Graph.
      Its goal is to be a part of the developer's toolbox where Linked Data and graph-shaped data
      (semantic webs, social networks, etc) in general are concerned.
    grade: stable
    confinement: strict
    license: Apache-2.0
    base: core18
    apps:
      cayley:
        plugs: ["home", "network", "network-bind", "personal-files"]
    plugs:
      personal-files:
        read:
          - $HOME/.cayley
        write:
          - $HOME/.cayley


================================================
FILE: AUTHORS
================================================
# This is the official list of Cayley authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.
#
# Please keep the list sorted.

Alexander Peters <info@alexanderpeters.de>
Andrew Dunham <andrew@du.nham.ca>
Bram Leenders <bcleenders@gmail.com>
Brendan Ball <ball.brendan50@gmail.com>
Denys Smirnov <dennwc@pm.me>
Derek Liang <fr.derekliang@gmail.com>
Iddan Aaronsohn <mail@aniddan.com>
Google Inc.
Jay Graves <jaywgraves@gmail.com>
Jeremy Jay <jeremy@pbnjay.com>
Jørgen Teunis <cayley@jorgenteunis.com>
Pius Uzamere <pius+github@alum.mit.edu>
QlikTech International AB 
Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au>
Robert Melton <rmelton@gmail.com>
Stefan Koshiw <anonwasere@gmail.com>
Timothy Armstrong <armstrong.timothy@gmail.com>
Yannic Bonenberger <contact@yannic-bonenberger.com>
Zihua Li <i@zihua.li>
Gaurav Tiwari <gaurav@gauravtiwari.co.uk>


================================================
FILE: CODEOWNERS
================================================
*   @dennwc @eraserhd


================================================
FILE: CONTRIBUTORS
================================================
# The AUTHORS file lists the copyright holders; this file
# lists people.  For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# Names should be added to this file as:
#     Name <email address>
#
# Please keep the list sorted.

Alexander Peters <info@alexanderpeters.de>
Andrew Dunham <andrew@du.nham.ca>
Barak Michener <barakmich@google.com> <barak@cayley.io> <me@barakmich.com>
Bram Leenders <bcleenders@gmail.com>
Brendan Ball <ball.brendan50@gmail.com>
Connor Newton <connor@ifthenelse.io>
Denys Smirnov <dennwc@pm.me>
Derek Liang <fr.derekliang@gmail.com>
Gaurav Tiwari <gaurav@gauravtiwari.co.uk>
Iddan Aaronsohn <mail@aniddan.com>
Jay Graves <jaywgraves@gmail.com>
Jeremy Jay <jeremy@pbnjay.com>
Jørgen Teunis <cayley@jorgenteunis.com>
Olaf Conradi <olaf@conradi.org>
Pius Uzamere <pius+github@alum.mit.edu>
Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au>
Robert Melton <rmelton@gmail.com>
Stefan Koshiw <anonwasere@gmail.com>
Tad Adams <tad.adams@qlik.com>
Timothy Armstrong <armstrong.timothy@gmail.com>
Tyler Gibbons <tyler.gibbons@ideogr.am>
Yannic Bonenberger <contact@yannic-bonenberger.com>
Zihua Li <i@zihua.li>


================================================
FILE: Dockerfile
================================================
FROM golang:1.22 AS builder

ARG VERSION=v0.8.x-dev

# Create filesystem for minimal image
WORKDIR /fs

RUN mkdir -p etc/ssl/certs lib/x86_64-linux-gnu tmp bin data; \
    # Copy CA Certificates
    cp /etc/ssl/certs/ca-certificates.crt etc/ssl/certs/ca-certificates.crt; \
    # Copy C standard library
    cp /lib/x86_64-linux-gnu/libc.* lib/x86_64-linux-gnu/

# Set up workdir for compiling
WORKDIR /src

# Copy dependencies and install first
COPY go.mod go.sum ./
RUN go mod download

# Add all the other files
ADD . .

# Pass a Git short SHA as build information to be used for displaying version
RUN GIT_SHA=$(git rev-parse --short=12 HEAD); \
    go build \
    -ldflags="-linkmode external -extldflags -static -X github.com/cayleygraph/cayley/version.Version=$VERSION -X github.com/cayleygraph/cayley/version.GitHash=$GIT_SHA" \
    -a \
    -installsuffix cgo \
    -o /fs/bin/cayley \
    -v \
    ./cmd/cayley

# Move persisted configuration into filesystem
RUN mv configurations/persisted.json /fs/etc/cayley.json

WORKDIR /fs

# Initialize bolt indexes file
RUN ./bin/cayley init --config etc/cayley.json

FROM scratch

# Copy filesystem as root
COPY --from=builder /fs /

# Define volume for configuration and data persistence. If you're using a
# backend like bolt, make sure the file is saved to this directory.
VOLUME [ "/data" ]

EXPOSE 64210

HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "cayley", "health" ]

# Adding everything to entrypoint allows us to init, load and serve only with
# arguments passed to docker run. For example:
# `docker run cayleygraph/cayley --init -i /data/my_data.nq`
ENTRYPOINT ["cayley", "http", "--host=:64210"]


================================================
FILE: LICENSE
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.


================================================
FILE: README.md
================================================
<div align="center">
  <a href="https://github.com/cayleygraph/cayley">
    <img width="200" src="https://github.com/cayleygraph/branding/raw/master/cayley_bottom.png" alt="Cayley">
  </a>
</div>

![Tests](https://github.com/cayleygraph/cayley/actions/workflows/build-and-release.yml/badge.svg)

Cayley is an open-source database for [Linked Data](https://www.w3.org/standards/semanticweb/data). It is inspired by the graph database behind Google's [Knowledge Graph](https://en.wikipedia.org/wiki/Knowledge_Graph) (formerly [Freebase](https://en.wikipedia.org/wiki/Freebase_(database))).

[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/cayley)

## [Documentation](https://cayley.gitbook.io/cayley/)

## Features

- Built-in query editor, visualizer and REPL
- Multiple query languages:
  - [Gizmo](./docs/gizmoapi.md): query language inspired by [Gremlin](https://tinkerpop.apache.org/gremlin.html)
  - [GraphQL](./docs/graphql.md)-inspired query language
  - [MQL](./docs/mql.md): simplified version for [Freebase](https://en.wikipedia.org/wiki/Freebase_(database)) fans
- Modular: easy to connect to your favorite programming languages and back-end stores
- Production ready: well tested and used by various companies for their production workloads
- Fast: optimized specifically for usage in applications

### Performance

Rough performance testing shows that, on 2014 consumer hardware and an average disk, 134m quads in LevelDB is no problem and a multi-hop intersection query -- films starring X and Y -- takes ~150ms.

## Community

- Website: [cayley.io](https://cayley.io)
- Slack: [cayleygraph.slack.com](https://cayleygraph.slack.com) -- Invite [here](https://cayley-slackin.herokuapp.com/)
- Discourse list: [discourse.cayley.io](https://discourse.cayley.io) (Also acts as mailing list, enable mailing list mode)
- Twitter: [@cayleygraph](https://twitter.com/cayleygraph)
- Involvement: [Contribute](./docs/contributing.md)


================================================
FILE: cayley_example.yml
================================================
store:
  # backend to use
  backend: bolt
  # address or path for the database
  address: "./cayley.db"
  # open database in read-only mode
  read_only: false
  # backend-specific options
  options:
    nosync: false
query:
  timeout: 30s
load:
  ignore_duplicates: false
  ignore_missing: false
  batch: 10000

================================================
FILE: client/client.go
================================================
package client

import (
	"fmt"
	"io"
	"net/http"
	"net/url"

	"github.com/cayleygraph/quad"
	"github.com/cayleygraph/quad/pquads"
)

func New(addr string) *Client {
	return &Client{addr: addr, cli: http.DefaultClient}
}

// Client is a struct used for communicating with a Cayley server through HTTP
// Deprecated: Client exists for backwards compatability. New code should use
// the updated client github.com/cayleygraph/go-client
type Client struct {
	addr string
	cli  *http.Client
}

func (c *Client) SetHTTPClient(cli *http.Client) {
	c.cli = cli
}
func (c *Client) url(s string, q map[string]string) string {
	addr := c.addr + s
	if len(q) != 0 {
		p := make(url.Values, len(q))
		for k, v := range q {
			p.Set(k, v)
		}
		addr += "?" + p.Encode()
	}
	return addr
}

type errRequestFailed struct {
	Status     string
	StatusCode int
}

func (e errRequestFailed) Error() string {
	return fmt.Sprintf("request failed: %d %v", e.StatusCode, e.Status)
}
func (c *Client) QuadReader() (quad.ReadCloser, error) {
	resp, err := http.Get(c.url("/api/v2/read", map[string]string{
		"format": "pquads",
	}))
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		resp.Body.Close()
		return nil, errRequestFailed{StatusCode: resp.StatusCode, Status: resp.Status}
	}
	r := pquads.NewReader(resp.Body, 10*1024*1024)
	r.SetCloser(resp.Body)
	return r, nil
}

type funcCloser struct {
	f      func() error
	closed bool
}

func (c funcCloser) Close() error {
	if c.closed {
		return nil
	}
	c.closed = true
	return c.f()
}
func (c *Client) QuadWriter() (quad.WriteCloser, error) {
	pr, pw := io.Pipe()
	req, err := http.NewRequest("POST", c.url("/api/v2/write", nil), pr)
	if err != nil {
		return nil, err
	}
	req.Header.Set("Content-Type", pquads.ContentType)
	errc := make(chan error, 1)
	go func() {
		defer func() {
			close(errc)
			pr.Close()
		}()
		resp, err := c.cli.Do(req)
		if resp != nil && resp.Body != nil {
			defer resp.Body.Close()
		}
		if err == nil && resp.StatusCode != http.StatusOK {
			err = errRequestFailed{StatusCode: resp.StatusCode, Status: resp.Status}
		}
		errc <- err
	}()
	qw := pquads.NewWriter(pw, &pquads.Options{
		Full:   false,
		Strict: false,
	})
	qw.SetCloser(funcCloser{f: func() error {
		pw.Close()
		return <-errc
	}})
	return qw, nil
}


================================================
FILE: clog/clog.go
================================================
// Copyright 2016 The Cayley Authors. All rights reserved.
//
// 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
//
//     http://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.

// Package clog provides a logging interface for cayley packages.
package clog

import "log"

// Logger is the clog logging interface.
type Logger interface {
	Infof(format string, args ...interface{})
	Warningf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	V(int) bool
	SetV(level int)
}

var logger Logger = &stdlog{
	verbosity: 0,
}

// SetLogger set the clog logging implementation.
func SetLogger(l Logger) { logger = l }

var verbosity int

// V returns whether the current clog verbosity is above the specified level.
func V(level int) bool {
	if logger == nil {
		return false
	}
	return logger.V(level)
}

// SetV sets the clog verbosity level.
func SetV(level int) {
	if logger != nil {
		logger.SetV(level)
	}
}

// Infof logs information level messages.
func Infof(format string, args ...interface{}) {
	if logger != nil {
		logger.Infof(format, args...)
	}
}

// Warningf logs warning level messages.
func Warningf(format string, args ...interface{}) {
	if logger != nil {
		logger.Warningf(format, args...)
	}
}

// Errorf logs error level messages.
func Errorf(format string, args ...interface{}) {
	if logger != nil {
		logger.Errorf(format, args...)
	}
}

// Fatalf logs fatal messages and terminates the program.
func Fatalf(format string, args ...interface{}) {
	if logger != nil {
		logger.Fatalf(format, args...)
	}
}

// stdlog wraps the standard library logger.
type stdlog struct {
	verbosity int
}

func (stdlog) Infof(format string, args ...interface{})    { log.Printf(format, args...) }
func (stdlog) Warningf(format string, args ...interface{}) { log.Printf("WARN: "+format, args...) }
func (stdlog) Errorf(format string, args ...interface{})   { log.Printf("ERROR: "+format, args...) }
func (stdlog) Fatalf(format string, args ...interface{})   { log.Fatalf("FATAL: "+format, args...) }
func (s stdlog) V(level int) bool                          { return s.verbosity >= level }
func (s *stdlog) SetV(level int)                           { s.verbosity = level }


================================================
FILE: clog/glog/glog.go
================================================
package glog

import (
	"fmt"

	"github.com/cayleygraph/cayley/clog"
	"github.com/golang/glog"
)

func init() {
	clog.SetLogger(Logger{})
}

type Logger struct{}

func (Logger) Infof(format string, args ...interface{}) {
	glog.InfoDepth(3, fmt.Sprintf(format, args...))
}
func (Logger) Warningf(format string, args ...interface{}) {
	glog.WarningDepth(3, fmt.Sprintf(format, args...))
}
func (Logger) Errorf(format string, args ...interface{}) {
	glog.ErrorDepth(3, fmt.Sprintf(format, args...))
}
func (Logger) Fatalf(format string, args ...interface{}) {
	glog.FatalDepth(3, fmt.Sprintf(format, args...))
}

func (Logger) V(level int) bool {
	return bool(glog.V(glog.Level(level)))
}

func (Logger) SetV(v int) {
	glog.Warningf("changing log level is not supported; run command with '-v %d' flag", v)
}


================================================
FILE: cmd/cayley/cayley.go
================================================
// Copyright 2016 The Cayley Authors. All rights reserved.
//
// 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
//
//     http://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.

// +build !appengine

package main

import (
	"flag"
	"fmt"
	"net/http"
	_ "net/http/pprof"
	"os"
	"path/filepath"
	"strings"

	"github.com/cayleygraph/cayley/cmd/cayley/command"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"

	"github.com/cayleygraph/cayley/clog"
	_ "github.com/cayleygraph/cayley/clog/glog"
	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/version"
	"github.com/cayleygraph/quad"

	// Load supported backends
	_ "github.com/cayleygraph/cayley/graph/all"

	// Load all supported quad formats.
	_ "github.com/cayleygraph/quad/dot"
	_ "github.com/cayleygraph/quad/gml"
	_ "github.com/cayleygraph/quad/graphml"
	_ "github.com/cayleygraph/quad/json"
	_ "github.com/cayleygraph/quad/jsonld"
	_ "github.com/cayleygraph/quad/nquads"
	_ "github.com/cayleygraph/quad/pquads"

	// Load writer registry
	_ "github.com/cayleygraph/cayley/writer"

	// Load supported query languages
	_ "github.com/cayleygraph/cayley/query/gizmo"
	_ "github.com/cayleygraph/cayley/query/graphql"
	_ "github.com/cayleygraph/cayley/query/mql"
	_ "github.com/cayleygraph/cayley/query/sexp"
)

var (
	rootCmd = &cobra.Command{
		Use:   "cayley",
		Short: "Cayley is a graph store and graph query layer.",
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
			clog.Infof("Cayley version: %s (%s)", version.Version, version.GitHash)
			if conf, _ := cmd.Flags().GetString("config"); conf != "" {
				viper.SetConfigFile(conf)
			}
			err := viper.ReadInConfig()
			if _, ok := err.(viper.ConfigFileNotFoundError); !ok && err != nil {
				return err
			}
			if conf := viper.ConfigFileUsed(); conf != "" {
				wd, _ := os.Getwd()
				if rel, _ := filepath.Rel(wd, conf); rel != "" && strings.Count(rel, "..") < 3 {
					conf = rel
				}
				clog.Infof("using config file: %s", conf)
			}
			// force viper to load flags to variables
			graph.IgnoreDuplicates = viper.GetBool("load.ignore_duplicates")
			graph.IgnoreMissing = viper.GetBool("load.ignore_missing")
			quad.DefaultBatch = viper.GetInt("load.batch")
			if host, _ := cmd.Flags().GetString("pprof"); host != "" {
				go func() {
					if err := http.ListenAndServe(host, nil); err != nil {
						clog.Errorf("failed to run pprof handler: %v", err)
					}
				}()
			}
			if host, _ := cmd.Flags().GetString("metrics"); host != "" {
				go func() {
					if err := http.ListenAndServe(host, promhttp.Handler()); err != nil {
						clog.Errorf("failed to run metrics handler: %v", err)
					}
				}()
			}
			return nil
		},
	}
	versionCmd = &cobra.Command{
		Use:   "version",
		Short: "Prints the version of Cayley.",
		// do not execute any persistent actions
		PersistentPreRun: func(cmd *cobra.Command, args []string) {},
		Run: func(cmd *cobra.Command, args []string) {
			fmt.Println("Cayley version:", version.Version)
			fmt.Println("Git commit hash:", version.GitHash)
			if version.BuildDate != "" {
				fmt.Println("Build date:", version.BuildDate)
			}
		},
	}
)

type pFlag struct {
	flag.Value
}

func (pFlag) Type() string { return "string" }

func init() {
	// set config names and paths
	viper.SetConfigName("cayley")
	viper.SetEnvPrefix("cayley")
	viper.AddConfigPath(".")
	viper.AddConfigPath("$HOME/.cayley/")
	viper.AddConfigPath("/etc/")
	if conf := os.Getenv("CAYLEY_CFG"); conf != "" {
		viper.SetConfigFile(conf)
	}

	rootCmd.AddCommand(
		versionCmd,
		command.NewInitDatabaseCmd(),
		command.NewLoadDatabaseCmd(),
		command.NewDumpDatabaseCmd(),
		command.NewUpgradeCmd(),
		command.NewReplCmd(),
		command.NewQueryCmd(),
		command.NewHTTPCmd(),
		command.NewConvertCmd(),
		command.NewDedupCommand(),
		command.NewHealthCmd(),
		command.NewSchemaCommand(),
	)
	rootCmd.PersistentFlags().StringP("config", "c", "", "path to an explicit configuration file")

	qnames := graph.QuadStores()
	rootCmd.PersistentFlags().StringP("db", "d", "memstore", "database backend to use: "+strings.Join(qnames, ", "))
	rootCmd.PersistentFlags().StringP("dbpath", "a", "", "path or address string for database")
	rootCmd.PersistentFlags().Bool("read_only", false, "open database in read-only mode")

	rootCmd.PersistentFlags().Bool("dup", true, "don't stop loading on duplicated on add")
	rootCmd.PersistentFlags().Bool("missing", false, "don't stop loading on missing key on delete")
	rootCmd.PersistentFlags().Int("batch", quad.DefaultBatch, "size of quads batch to load at once")

	rootCmd.PersistentFlags().String("memprofile", "", "path to output memory profile")
	rootCmd.PersistentFlags().String("cpuprofile", "", "path to output cpu profile")

	rootCmd.PersistentFlags().String("pprof", "", "host to serve pprof on (disabled by default)")
	rootCmd.PersistentFlags().String("metrics", "", "host to serve metrics on (disabled by default)")

	// bind flags to config variables
	viper.BindPFlag(command.KeyBackend, rootCmd.PersistentFlags().Lookup("db"))
	viper.BindPFlag(command.KeyAddress, rootCmd.PersistentFlags().Lookup("dbpath"))
	viper.BindPFlag(command.KeyReadOnly, rootCmd.PersistentFlags().Lookup("read_only"))
	viper.BindPFlag("load.ignore_duplicates", rootCmd.PersistentFlags().Lookup("dup"))
	viper.BindPFlag("load.ignore_missing", rootCmd.PersistentFlags().Lookup("missing"))
	viper.BindPFlag(command.KeyLoadBatch, rootCmd.PersistentFlags().Lookup("batch"))

	// make both store.path and store.address work
	viper.RegisterAlias(command.KeyPath, command.KeyAddress)
	// aliases for legacy config files
	viper.RegisterAlias("database", command.KeyBackend)
	viper.RegisterAlias("db_path", command.KeyAddress)
	viper.RegisterAlias("read_only", command.KeyReadOnly)
	viper.RegisterAlias("db_options", command.KeyOptions)

	{ // re-register standard Go flags to cobra
		rf := rootCmd.PersistentFlags()
		flag.CommandLine.VisitAll(func(f *flag.Flag) {
			switch f.Name {
			case "v": // glog.v
				rf.VarP(pFlag{f.Value}, "verbose", "v", f.Usage)
			case "vmodule": // glog.vmodule
				rf.Var(pFlag{f.Value}, "vmodule", f.Usage)
			case "log_backtrace_at": // glog.log_backtrace_at
				rf.Var(pFlag{f.Value}, "backtrace", f.Usage)
			case "stderrthreshold": // glog.stderrthreshold
				rf.VarP(pFlag{f.Value}, "log", "l", f.Usage)
			case "alsologtostderr": // glog.alsologtostderr
				rf.Var(pFlag{f.Value}, f.Name, f.Usage)
			case "logtostderr": // glog.logtostderr
				f.Value.Set("true")
				rf.Var(pFlag{f.Value}, f.Name, f.Usage)
			case "log_dir": // glog.log_dir
				rf.Var(pFlag{f.Value}, "logs", f.Usage)
			}
		})
		// make sure flags parsed flag is set - parse empty args
		flag.CommandLine = flag.NewFlagSet("", flag.ContinueOnError)
		flag.CommandLine.Parse([]string{""})
	}
}

func main() {
	if err := rootCmd.Execute(); err != nil {
		clog.Errorf("%v", err)
		os.Exit(1)
	}
}


================================================
FILE: cmd/cayley/command/convert.go
================================================
package command

import (
	"errors"
	"fmt"
	"io"

	"github.com/spf13/cobra"

	"github.com/cayleygraph/cayley/clog"
	"github.com/cayleygraph/cayley/internal"
	"github.com/cayleygraph/quad"
)

func newLazyReader(open func() (quad.ReadCloser, error)) quad.ReadCloser {
	return &lazyReader{open: open}
}

type lazyReader struct {
	rc   quad.ReadCloser
	open func() (quad.ReadCloser, error)
}

func (r *lazyReader) ReadQuad() (quad.Quad, error) {
	if r.rc == nil {
		rc, err := r.open()
		if err != nil {
			return quad.Quad{}, err
		}
		r.rc = rc
	}
	return r.rc.ReadQuad()
}
func (r *lazyReader) Close() (err error) {
	if r.rc != nil {
		err = r.rc.Close()
	}
	return
}

type multiReader struct {
	rc []quad.ReadCloser
	i  int
}

func (r *multiReader) ReadQuad() (quad.Quad, error) {
	for {
		if r.i >= len(r.rc) {
			return quad.Quad{}, io.EOF
		}
		rc := r.rc[r.i]
		q, err := rc.ReadQuad()
		if err == io.EOF {
			rc.Close()
			r.i++
			continue
		}
		return q, err
	}
}
func (r *multiReader) Close() error {
	var first error
	if r.i < len(r.rc) {
		for _, rc := range r.rc[r.i:] {
			if err := rc.Close(); err != nil && first == nil {
				first = err
			}
		}
	}
	return nil
}

func NewConvertCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:     "convert",
		Aliases: []string{"conv"},
		Short:   "Convert quad files between supported formats.",
		RunE: func(cmd *cobra.Command, args []string) error {
			dump, _ := cmd.Flags().GetString(flagDump)
			dumpf, _ := cmd.Flags().GetString(flagDumpFormat)
			if dump == "" && len(args) > 0 {
				i := len(args) - 1
				dump, args = args[i], args[:i]
			}

			var files []string
			if load, _ := cmd.Flags().GetString(flagLoad); load != "" {
				files = append(files, load)
			}
			files = append(files, args...)
			if len(files) == 0 || dump == "" {
				return errors.New("both input and output files must be specified")
			}
			loadf, _ := cmd.Flags().GetString(flagLoadFormat)
			var multi multiReader
			for _, path := range files {
				path := path
				multi.rc = append(multi.rc, newLazyReader(func() (quad.ReadCloser, error) {
					if dump == "-" {
						clog.Infof("reading %q", path)
					} else {
						fmt.Printf("reading %q\n", path)
					}
					return internal.QuadReaderFor(path, loadf)
				}))
			}
			// TODO: print additional stats
			return writerQuadsTo(dump, dumpf, &multi)
		},
	}
	registerLoadFlags(cmd)
	registerDumpFlags(cmd)
	return cmd
}


================================================
FILE: cmd/cayley/command/database.go
================================================
package command

import (
	"errors"
	"fmt"
	"os"
	"runtime"
	"runtime/pprof"
	"sort"
	"strings"
	"time"

	"github.com/spf13/cobra"
	"github.com/spf13/viper"

	"github.com/cayleygraph/cayley/clog"
	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/internal"
	"github.com/cayleygraph/quad"
)

const (
	KeyBackend  = "store.backend"
	KeyAddress  = "store.address"
	KeyPath     = "store.path"
	KeyReadOnly = "store.read_only"
	KeyOptions  = "store.options"

	KeyLoadBatch = "load.batch"
)

const (
	flagLoad       = "load"
	flagLoadFormat = "load_format"
	flagDump       = "dump"
	flagDumpFormat = "dump_format"
)

var ErrNotPersistent = errors.New("database type is not persistent")

func registerLoadFlags(cmd *cobra.Command) {
	// TODO: allow to load multiple files
	cmd.Flags().StringP(flagLoad, "i", "", `quad file to load after initialization (".gz" supported, "-" for stdin)`)
	var names []string
	for _, f := range quad.Formats() {
		if f.Reader != nil {
			names = append(names, f.Name)
		}
	}
	sort.Strings(names)
	cmd.Flags().String(flagLoadFormat, "", `quad file format to use for loading instead of auto-detection ("`+strings.Join(names, `", "`)+`")`)
}

func registerDumpFlags(cmd *cobra.Command) {
	cmd.Flags().StringP(flagDump, "o", "", `quad file to dump the database to (".gz" supported, "-" for stdout)`)
	var names []string
	for _, f := range quad.Formats() {
		if f.Writer != nil {
			names = append(names, f.Name)
		}
	}
	sort.Strings(names)
	cmd.Flags().String(flagDumpFormat, "", `quad file format to use instead of auto-detection ("`+strings.Join(names, `", "`)+`")`)
}

func NewInitDatabaseCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "init",
		Short: "Create an empty database.",
		RunE: func(cmd *cobra.Command, args []string) error {
			printBackendInfo()
			name := viper.GetString(KeyBackend)
			if graph.IsRegistered(name) && !graph.IsPersistent(name) {
				return ErrNotPersistent
			}
			// TODO: maybe check read-only flag in config before that?
			if err := initDatabase(); err != nil {
				return err
			}
			return nil
		},
	}
	return cmd
}

func NewLoadDatabaseCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "load",
		Short: "Bulk-load a quad file into the database.",
		RunE: func(cmd *cobra.Command, args []string) error {
			printBackendInfo()
			p := mustSetupProfile(cmd)
			defer mustFinishProfile(p)
			load, _ := cmd.Flags().GetString(flagLoad)
			if load == "" && len(args) == 1 {
				load = args[0]
			}
			if load == "" {
				return errors.New("one quads file must be specified")
			}
			if init, err := cmd.Flags().GetBool("init"); err != nil {
				return err
			} else if init {
				if err = initDatabase(); err != nil {
					return err
				}
			}
			h, err := openDatabase()
			if err != nil {
				return err
			}
			defer h.Close()

			qw, err := h.NewQuadWriter()
			if err != nil {
				return err
			}
			defer qw.Close()

			// TODO: check read-only flag in config before that?
			typ, _ := cmd.Flags().GetString(flagLoadFormat)
			if err = internal.Load(qw, quad.DefaultBatch, load, typ); err != nil {
				return err
			}

			if dump, _ := cmd.Flags().GetString(flagDump); dump != "" {
				typ, _ := cmd.Flags().GetString(flagDumpFormat)
				if err = dumpDatabase(h, dump, typ); err != nil {
					return err
				}
			}
			return nil
		},
	}
	cmd.Flags().Bool("init", false, "initialize the database before using it")
	registerLoadFlags(cmd)
	registerDumpFlags(cmd)
	return cmd
}

func NewDumpDatabaseCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "dump",
		Short: "Bulk-dump the database into a quad file.",
		RunE: func(cmd *cobra.Command, args []string) error {
			printBackendInfo()
			dump, _ := cmd.Flags().GetString(flagDump)
			if dump == "" && len(args) == 1 {
				dump = args[0]
			}
			if dump == "" {
				dump = "-"
			}
			h, err := openDatabase()
			if err != nil {
				return err
			}
			defer h.Close()

			typ, _ := cmd.Flags().GetString(flagDumpFormat)
			return dumpDatabase(h, dump, typ)
		},
	}
	registerDumpFlags(cmd)
	return cmd
}

func NewUpgradeCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "upgrade",
		Short: "Upgrade Cayley database to current supported format.",
		RunE: func(cmd *cobra.Command, args []string) error {
			printBackendInfo()
			name := viper.GetString(KeyBackend)
			if graph.IsRegistered(name) && !graph.IsPersistent(name) {
				return ErrNotPersistent
			}
			addr := viper.GetString(KeyAddress)
			opts := graph.Options(viper.GetStringMap(KeyOptions))
			clog.Infof("upgrading database...")
			return graph.UpgradeQuadStore(name, addr, opts)
		},
	}
	return cmd
}

func printBackendInfo() {
	name := viper.GetString(KeyBackend)
	path := viper.GetString(KeyAddress)
	if path != "" {
		path = " (" + path + ")"
	}
	clog.Infof("using backend %q%s", name, path)
}

func initDatabase() error {
	name := viper.GetString(KeyBackend)
	path := viper.GetString(KeyAddress)
	opts := viper.GetStringMap(KeyOptions)
	return graph.InitQuadStore(name, path, graph.Options(opts))
}

func openDatabase() (*graph.Handle, error) {
	name := viper.GetString(KeyBackend)
	path := viper.GetString(KeyAddress)
	opts := graph.Options(viper.GetStringMap(KeyOptions))
	qs, err := graph.NewQuadStore(name, path, opts)
	if err != nil {
		return nil, err
	}
	qw, err := graph.NewQuadWriter("single", qs, opts)
	if err != nil {
		return nil, err
	}
	return &graph.Handle{QuadStore: qs, QuadWriter: qw}, nil
}

func openForQueries(cmd *cobra.Command) (*graph.Handle, error) {
	if init, err := cmd.Flags().GetBool("init"); err != nil {
		return nil, err
	} else if init {
		if err = initDatabase(); err == graph.ErrDatabaseExists {
			clog.Infof("database already initialized, skipping init")
		} else if err != nil {
			return nil, err
		}
	}
	var load string
	h, err := openDatabase()
	if err == graph.ErrQuadStoreNotPersistent {
		load = viper.GetString(KeyAddress)
		viper.Set(KeyAddress, "")
		h, err = openDatabase()
	}
	if err == graph.ErrQuadStoreNotPersistent {
		return nil, fmt.Errorf("%v; did you mean -i flag?", err)
	} else if err != nil {
		return nil, err
	}

	if load2, _ := cmd.Flags().GetString(flagLoad); load2 != "" {
		if load != "" {
			h.Close()
			return nil, fmt.Errorf("both -a and -i flags cannot be specified")
		}
		load = load2
	}
	if load != "" {
		qw, err := h.NewQuadWriter()
		if err != nil {
			h.Close()
			return nil, err
		}
		defer qw.Close()

		typ, _ := cmd.Flags().GetString(flagLoadFormat)
		// TODO: check read-only flag in config before that?
		start := time.Now()
		if err = internal.Load(qw, quad.DefaultBatch, load, typ); err != nil {
			h.Close()
			return nil, err
		}
		clog.Infof("loaded %q in %v", load, time.Since(start))
	}
	return h, nil
}

type profileData struct {
	cpuProfile *os.File
	memPath    string
}

func mustSetupProfile(cmd *cobra.Command) profileData {
	p := profileData{}
	mpp := cmd.Flag("memprofile")
	p.memPath = mpp.Value.String()
	cpp := cmd.Flag("cpuprofile")
	v := cpp.Value.String()
	if v != "" {
		f, err := os.Create(v)
		if err != nil {
			fmt.Fprintf(os.Stderr, "Could not open CPU profile file %s\n", v)
			os.Exit(1)
		}
		p.cpuProfile = f
		pprof.StartCPUProfile(f)
	}
	return p
}

func mustFinishProfile(p profileData) {
	if p.cpuProfile != nil {
		pprof.StopCPUProfile()
		p.cpuProfile.Close()
	}
	if p.memPath != "" {
		f, err := os.Create(p.memPath)
		if err != nil {
			fmt.Fprintf(os.Stderr, "Could not open memory profile file %s\n", p.memPath)
			os.Exit(1)
		}
		runtime.GC()
		if err := pprof.WriteHeapProfile(f); err != nil {
			fmt.Fprintf(os.Stderr, "Could not write memory profile file %s\n", p.memPath)
		}
		f.Close()
	}
}


================================================
FILE: cmd/cayley/command/dedup.go
================================================
package command

import (
	"context"
	"crypto/sha1"
	"errors"
	"fmt"
	"hash"
	"sort"
	"time"

	"github.com/spf13/cobra"
	"github.com/spf13/viper"

	"github.com/cayleygraph/cayley/clog"
	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/graph/refs"
	"github.com/cayleygraph/cayley/query/path"
	"github.com/cayleygraph/quad"
	"github.com/cayleygraph/quad/voc/rdf"
)

func iriFlag(s string, err error) (quad.IRI, error) {
	if err != nil {
		return "", err
	}
	return quad.IRI(s), nil
}

func NewDedupCommand() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "dedup",
		Short: "Deduplicate bnode values",
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx := context.Background()
			printBackendInfo()
			h, err := openDatabase()
			if err != nil {
				return err
			}
			defer h.Close()

			pred, _ := iriFlag(cmd.Flags().GetString("pred"))
			typ, _ := iriFlag(cmd.Flags().GetString("type"))
			if typ == "" {
				return errors.New("no type is specified")
			}
			return dedupProperties(ctx, h, pred, typ)
		},
	}
	cmd.Flags().String("pred", rdf.Type, "type predicate to use to find nodes")
	cmd.Flags().String("type", "", "type value to use to find nodes")
	return cmd
}

func valueLess(a, b graph.Ref) bool {
	// TODO(dennwc): more effective way
	s1, s2 := fmt.Sprint(a), fmt.Sprint(b)
	return s1 < s2
}

type sortVals []graph.Ref

func (a sortVals) Len() int           { return len(a) }
func (a sortVals) Less(i, j int) bool { return valueLess(a[i], a[j]) }
func (a sortVals) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

type sortProp []property

func (a sortProp) Len() int           { return len(a) }
func (a sortProp) Less(i, j int) bool { return valueLess(a[i].Pred, a[j].Pred) }
func (a sortProp) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func hashProperties(h hash.Hash, m map[interface{}]property) string {
	props := make([]property, 0, len(m))
	for _, p := range m {
		if len(p.Values) > 1 {
			sort.Sort(sortVals(p.Values))
		}
		props = append(props, p)
	}
	sort.Sort(sortProp(props))
	h.Reset()
	for _, p := range props {
		fmt.Fprint(h, p.Pred)
		h.Write([]byte{0})
		for _, v := range p.Values {
			fmt.Fprint(h, v)
			h.Write([]byte{1})
		}
	}
	res := make([]byte, 0, h.Size())
	res = h.Sum(res)
	return string(res)
}

type property struct {
	Pred   graph.Ref
	Values []graph.Ref
}

func dedupProperties(ctx context.Context, h *graph.Handle, pred, typ quad.IRI) error {
	batch := viper.GetInt(KeyLoadBatch)
	if batch == 0 {
		batch = quad.DefaultBatch
	}

	qs := h.QuadStore
	p := path.StartPath(qs).Has(pred, typ)
	ictx, cancel := context.WithCancel(ctx)
	defer cancel()
	var gerr error

	seen := make(map[string]graph.Ref)
	cnt, dedup := 0, 0
	start := time.Now()
	last := start
	hh := sha1.New()

	tx := graph.NewTransaction()
	txn := 0
	flush := func() {
		if txn == 0 {
			return
		}
		err := h.ApplyTransaction(tx)
		if err == nil {
			tx = graph.NewTransaction()
			dedup += txn
			txn = 0
		} else {
			gerr = err
			cancel()
		}
		if now := time.Now(); now.Sub(last) > time.Second*5 {
			last = now
			clog.Infof("deduplicated %d/%d nodes (%.1f nodes/sec)",
				dedup, cnt, float64(cnt)/now.Sub(start).Seconds(),
			)
		}
	}
	err := p.Iterate(ictx).Each(func(s graph.Ref) error {
		cnt++
		it := qs.QuadIterator(quad.Subject, s).Iterate()
		defer it.Close()
		m := make(map[interface{}]property)
		for it.Next(ictx) {
			q := it.Result()
			p, err := qs.QuadDirection(q, quad.Predicate)
			if err != nil {
				return err
			}
			o, err := qs.QuadDirection(q, quad.Object)
			if err != nil {
				return err
			}
			k := refs.ToKey(p)
			prop := m[k]
			prop.Pred = p
			prop.Values = append(prop.Values, o)
			m[k] = prop
		}
		if gerr = it.Err(); gerr != nil {
			cancel()
		}
		ph := hashProperties(hh, m)
		id, ok := seen[ph]
		if !ok {
			seen[ph] = s
			return nil
		}
		if gerr = dedupValueTx(ictx, h, tx, s, id); gerr != nil {
			cancel()
		}
		txn++
		if txn >= batch { // TODO(dennwc): flag
			flush()
		}
		return nil
	})
	flush()
	clog.Infof("deduplicated %d/%d nodes in %v", dedup, cnt, time.Since(start))
	if gerr != nil {
		err = gerr
	}
	return err
}

func dedupValueTx(ctx context.Context, h *graph.Handle, tx *graph.Transaction, a, b graph.Ref) error {
	v, err := h.NameOf(b)
	if err != nil {
		return err
	}
	it := h.QuadIterator(quad.Object, a).Iterate()
	defer it.Close()
	for it.Next(ctx) {
		// TODO(dennwc): we should be able to add "raw" quads without getting values for directions
		q, err := h.Quad(it.Result())
		if err != nil {
			return err
		}
		tx.RemoveQuad(q)
		q.Object = v
		tx.AddQuad(q)
	}
	if err := it.Err(); err != nil {
		return err
	}
	it.Close()

	it = h.QuadIterator(quad.Subject, a).Iterate()
	defer it.Close()
	for it.Next(ctx) {
		q, err := h.Quad(it.Result())
		if err != nil {
			return err
		}
		tx.RemoveQuad(q)
	}
	if err := it.Err(); err != nil {
		return err
	}
	return nil
}


================================================
FILE: cmd/cayley/command/dump.go
================================================
package command

import (
	"compress/gzip"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"strings"

	"github.com/cayleygraph/cayley/clog"
	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/quad"
)

func writerQuadsTo(path string, typ string, qr quad.Reader) error {
	var f *os.File
	if path == "-" {
		f = os.Stdout
		clog.Infof("writing quads to stdout")
	} else {
		var err error
		f, err = os.Create(path)
		if err != nil {
			return fmt.Errorf("could not create file %q: %v", path, err)
		}
		defer f.Close()
		fmt.Printf("writing quads to file %q\n", path)
	}

	var w io.Writer = f
	ext := filepath.Ext(path)
	if ext == ".gz" {
		ext = filepath.Ext(strings.TrimSuffix(path, ext))
		gzip := gzip.NewWriter(f)
		defer gzip.Close()
		w = gzip
	}
	var format *quad.Format
	if typ == "" {
		format = quad.FormatByExt(ext)
		if format == nil {
			typ = "nquads"
		}
	}
	if format == nil {
		format = quad.FormatByName(typ)
	}
	if format == nil {
		return fmt.Errorf("unsupported format: %q", typ)
	} else if format.Writer == nil {
		return fmt.Errorf("encoding in %s format is not supported", typ)
	}
	qw := format.Writer(w)
	defer qw.Close()

	n, err := quad.Copy(qw, qr)
	if err != nil {
		return err
	} else if err = qw.Close(); err != nil {
		return err
	}
	if path != "-" {
		fmt.Printf("%d entries were written\n", n)
	}
	return nil
}

func dumpDatabase(h *graph.Handle, path string, typ string) error {
	//TODO: add possible support for exporting specific queries only
	qr := graph.NewQuadStoreReader(h.QuadStore)
	defer qr.Close()
	return writerQuadsTo(path, typ, qr)
}


================================================
FILE: cmd/cayley/command/health.go
================================================
package command

import (
	"fmt"
	"log"
	"net/http"

	"github.com/spf13/cobra"
)

const defaultAddress = "http://localhost:64210/"

func NewHealthCmd() *cobra.Command {
	return &cobra.Command{
		Use:     "health",
		Aliases: []string{},
		Short:   "Health check HTTP server",
		RunE: func(cmd *cobra.Command, args []string) error {
			if len(args) > 1 {
				return fmt.Errorf("Too many arguments provided, expected 0 or 1")
			}
			address := defaultAddress
			if len(args) == 1 {
				address = args[0]
			}
			healthAddress := address + "health"
			resp, err := http.Get(healthAddress)
			if err != nil {
				return err
			}
			defer resp.Body.Close()
			if resp.StatusCode != 204 {
				return fmt.Errorf("/health responded with status code %d, expected 204", resp.StatusCode)
			}
			log.Printf("%s ok", healthAddress)
			return nil
		},
	}
}


================================================
FILE: cmd/cayley/command/http.go
================================================
package command

import (
	"net"
	"net/http"
	"time"

	"github.com/spf13/cobra"
	"github.com/spf13/viper"

	"github.com/cayleygraph/cayley/clog"
	chttp "github.com/cayleygraph/cayley/internal/http"
)

func NewHTTPCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "http",
		Short: "Serve an HTTP endpoint on the given host and port.",
		RunE: func(cmd *cobra.Command, args []string) error {
			printBackendInfo()
			p := mustSetupProfile(cmd)
			defer mustFinishProfile(p)

			h, err := openForQueries(cmd)
			if err != nil {
				return err
			}
			defer h.Close()

			err = chttp.SetupRoutes(h, &chttp.Config{
				Timeout:  viper.GetDuration(keyQueryTimeout),
				ReadOnly: viper.GetBool(KeyReadOnly),
			})
			if err != nil {
				return err
			}
			host, _ := cmd.Flags().GetString("host")
			phost := host
			if host, port, err := net.SplitHostPort(host); err == nil && host == "" {
				phost = net.JoinHostPort("localhost", port)
			}
			clog.Infof("listening on %s, web interface at http://%s", host, phost)
			return http.ListenAndServe(host, nil)
		},
	}
	cmd.Flags().String("host", "127.0.0.1:64210", "host:port to listen on")
	cmd.Flags().Bool("init", false, "initialize the database before using it")
	cmd.Flags().DurationP("timeout", "t", 30*time.Second, "elapsed time until an individual query times out")
	registerLoadFlags(cmd)
	viper.BindPFlag(keyQueryTimeout, cmd.Flags().Lookup("timeout"))
	return cmd
}


================================================
FILE: cmd/cayley/command/repl.go
================================================
package command

import (
	"context"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"os/signal"
	"strings"
	"time"

	"github.com/spf13/cobra"
	"github.com/spf13/viper"

	"github.com/cayleygraph/cayley/clog"
	"github.com/cayleygraph/cayley/internal/repl"
	"github.com/cayleygraph/cayley/query"
)

const (
	keyQueryTimeout = "query.timeout"
)

func getContext() (context.Context, func()) {
	ctx, cancel := context.WithCancel(context.Background())
	ch := make(chan os.Signal, 1)
	signal.Notify(ch, os.Interrupt)
	go func() {
		select {
		case <-ch:
		case <-ctx.Done():
		}
		signal.Stop(ch)
		cancel()
	}()
	return ctx, cancel
}

func registerQueryFlags(cmd *cobra.Command) {
	langs := query.Languages()
	cmd.Flags().Bool("init", false, "initialize the database before using it")
	cmd.Flags().String("lang", "gizmo", `query language to use ("`+strings.Join(langs, `", "`)+`")`)
	cmd.Flags().DurationP("timeout", "t", 30*time.Second, "elapsed time until an individual query times out")
	viper.BindPFlag(keyQueryTimeout, cmd.Flags().Lookup("timeout"))
	registerLoadFlags(cmd)
}

func NewReplCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "repl",
		Short: "Drop into a REPL of the given query language.",
		RunE: func(cmd *cobra.Command, args []string) error {
			printBackendInfo()
			p := mustSetupProfile(cmd)
			defer mustFinishProfile(p)

			h, err := openForQueries(cmd)
			if err != nil {
				return err
			}
			defer h.Close()

			ctx, cancel := getContext()
			defer cancel()

			timeout := viper.GetDuration("timeout")
			lang, _ := cmd.Flags().GetString("lang")
			return repl.Repl(ctx, h, lang, timeout)
		},
	}
	registerQueryFlags(cmd)
	return cmd
}

func NewQueryCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:     "query",
		Aliases: []string{"qu"},
		Short:   "Run a query in a specified database and print results.",
		RunE: func(cmd *cobra.Command, args []string) error {
			var querystr string
			if len(args) == 0 {
				bytes, err := ioutil.ReadAll(os.Stdin)
				if err != nil {
					return fmt.Errorf("error occured while reading from stdin : %s", err)
				}
				querystr = string(bytes)
			} else if len(args) == 1 {
				querystr = args[0]
			} else {
				return fmt.Errorf("query accepts only one argument, the query string or nothing for reading from stdin")
			}
			clog.Infof("Query:\n%s", querystr)
			printBackendInfo()
			p := mustSetupProfile(cmd)
			defer mustFinishProfile(p)

			h, err := openForQueries(cmd)
			if err != nil {
				return err
			}
			defer h.Close()

			ctx, cancel := getContext()
			defer cancel()

			timeout := viper.GetDuration("timeout")
			if timeout > 0 {
				ctx, cancel = context.WithTimeout(ctx, timeout)
				defer cancel()
			}
			lang, _ := cmd.Flags().GetString("lang")
			limit, err := cmd.Flags().GetInt("limit")
			if err != nil {
				return err
			}
			enc := json.NewEncoder(os.Stdout)
			it, err := query.Execute(ctx, h, lang, querystr, query.Options{
				Collation: query.JSON,
				Limit:     limit,
			})
			if err != nil {
				return err
			}
			defer it.Close()
			for i := 0; it.Next(ctx) && (limit <= 0 || i < limit); i++ {
				if err = enc.Encode(it.Result()); err != nil {
					return err
				}
			}
			return it.Err()
		},
	}
	registerQueryFlags(cmd)
	cmd.Flags().IntP("limit", "n", 100, "limit a number of results")
	return cmd
}


================================================
FILE: cmd/cayley/command/schema.go
================================================
package command

import (
	"bytes"
	"encoding/json"
	"fmt"

	"github.com/spf13/cobra"

	"github.com/cayleygraph/cayley/internal/linkedql/schema"
)

func NewSchemaCommand() *cobra.Command {
	root := &cobra.Command{
		Use:   "schema",
		Short: "Commands related to RDF schema",
	}
	root.AddCommand(
		NewLinkedQLSchemaCommand(),
	)
	return root
}

func NewLinkedQLSchemaCommand() *cobra.Command {
	return &cobra.Command{
		Use:   "linkedql",
		Short: "Generate LinkedQL Schema to stdout",
		RunE: func(cmd *cobra.Command, args []string) error {
			if len(args) > 0 {
				return fmt.Errorf("too many arguments provided, expected 0")
			}
			data := schema.Generate()
			buf := bytes.NewBuffer(nil)
			err := json.Indent(buf, data, "", "\t")
			if err != nil {
				return err
			}
			fmt.Println(buf)
			return nil
		},
	}
}


================================================
FILE: cmd/cayleyexport/cayleyexport.go
================================================
package main

import (
	"io"
	"net/http"
	"os"
	"path/filepath"

	"github.com/cayleygraph/cayley/clog"

	// Load all supported quad formats.
	"github.com/cayleygraph/quad"
	_ "github.com/cayleygraph/quad/jsonld"
	_ "github.com/cayleygraph/quad/nquads"

	"github.com/spf13/cobra"
)

const defaultFormat = "jsonld"

// NewCmd creates the command
func NewCmd() *cobra.Command {
	var quiet bool
	var uri, formatName, out string

	var cmd = &cobra.Command{
		Use:   "cayleyexport",
		Short: "Export data from Cayley. If no file is provided, cayleyexport writes to stdout.",
		Args:  cobra.NoArgs,
		RunE: func(cmd *cobra.Command, args []string) error {
			if quiet {
				clog.SetV(500)
			}
			var format *quad.Format
			var w io.Writer
			if formatName != "" {
				format = quad.FormatByName(formatName)
			}
			if out == "" {
				w = cmd.OutOrStdout()
			} else {
				if formatName == "" {
					format = formatByFileName(out)
					if format == nil {
						clog.Warningf("File has unknown extension %v. Defaulting to %v", out, defaultFormat)
					}
				}
				file, err := os.Create(out)
				if err != nil {
					return err
				}
				w = file
				defer file.Close()
			}
			if format == nil {
				format = quad.FormatByName(defaultFormat)
			}
			req, err := http.NewRequest(http.MethodGet, uri+"/api/v2/read", nil)
			req.Header.Set("Accept", format.Mime[0])
			if err != nil {
				return err
			}
			client := &http.Client{}
			resp, err := client.Do(req)
			if err != nil {
				return err
			}
			defer resp.Body.Close()
			_, err = io.Copy(w, resp.Body)
			if err != nil {
				return err
			}
			return nil
		},
	}

	cmd.Flags().StringVarP(&uri, "uri", "", "http://127.0.0.1:64210", "Cayley URI connection string")
	cmd.Flags().StringVarP(&formatName, "format", "", "", "format of the provided data (if can not be detected defaults to JSON-LD)")
	cmd.Flags().StringVarP(&out, "out", "o", "", "output file; if not specified, stdout is used")
	cmd.Flags().BoolVarP(&quiet, "quiet", "q", false, "hide all log output")

	return cmd
}

func main() {
	cmd := NewCmd()
	if err := cmd.Execute(); err != nil {
		os.Exit(1)
	}
}

func formatByFileName(fileName string) *quad.Format {
	ext := filepath.Ext(fileName)
	return quad.FormatByExt(ext)
}


================================================
FILE: cmd/cayleyexport/cayleyexport_test.go
================================================
package main

import (
	"bytes"
	"fmt"
	"net"
	"net/http"
	"testing"

	"github.com/cayleygraph/quad"
	"github.com/cayleygraph/quad/jsonld"
	"github.com/stretchr/testify/require"

	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/graph/memstore"
	chttp "github.com/cayleygraph/cayley/internal/http"
)

var testData = []quad.Quad{
	{
		Subject:   quad.IRI("http://example.com/alice"),
		Predicate: quad.IRI("http://example.com/likes"),
		Object:    quad.IRI("http://example.com/bob"),
		Label:     nil,
	},
}

func serializeTestData() string {
	buf := bytes.NewBuffer(nil)
	w := jsonld.NewWriter(buf)
	w.WriteQuads(testData)
	w.Close()
	return buf.String()
}

func TestCayleyExport(t *testing.T) {
	qs := memstore.New(testData...)
	qw, err := graph.NewQuadWriter("single", qs, graph.Options{})
	require.NoError(t, err)
	h := &graph.Handle{QuadStore: qs, QuadWriter: qw}
	chttp.SetupRoutes(h, &chttp.Config{})

	lis, err := net.Listen("tcp", "127.0.0.1:0")
	require.NoError(t, err)
	t.Cleanup(func() {
		lis.Close()
	})

	srv := &http.Server{
		Addr: lis.Addr().String(),
	}
	go srv.Serve(lis)

	cmd := NewCmd()
	b := bytes.NewBufferString("")
	cmd.SetOut(b)
	cmd.SetArgs([]string{
		"--uri",
		fmt.Sprintf("http://%s", lis.Addr().String()),
	})
	err = cmd.Execute()
	require.NoError(t, err)
	data := serializeTestData()
	require.NotEmpty(t, data)
	require.Equal(t, data, b.String())
}


================================================
FILE: cmd/cayleyimport/cayleyimport.go
================================================
package main

import (
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"path/filepath"

	"github.com/cayleygraph/cayley/clog"

	// Load all supported quad formats.
	"github.com/cayleygraph/quad"
	_ "github.com/cayleygraph/quad/jsonld"
	_ "github.com/cayleygraph/quad/nquads"

	"github.com/spf13/cobra"
)

const defaultFormat = "jsonld"

// NewCmd creates the command
func NewCmd() *cobra.Command {
	var quiet bool
	var uri, formatName string

	var cmd = &cobra.Command{
		Use:   "cayleyimport <file>",
		Short: "Import data into Cayley. If no file is provided, cayleyimport reads from stdin.",
		Args:  cobra.MaximumNArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			if quiet {
				clog.SetV(500)
			}
			var format *quad.Format
			var reader io.Reader
			if formatName != "" {
				format = quad.FormatByName(formatName)
			}
			if len(args) == 0 {
				in := cmd.InOrStdin()
				if !hasIn(in) {
					return errors.New("Either provide file to read from or pipe data")
				}
				reader = in
			} else {
				fileName := args[0]
				if formatName == "" {
					format = formatByFileName(fileName)
					if format == nil {
						clog.Warningf("File has unknown extension %v. Defaulting to %v", fileName, defaultFormat)
					}
				}
				file, err := os.Open(fileName)
				if err != nil {
					return err
				}
				defer file.Close()
				reader = file
			}
			if format == nil {
				format = quad.FormatByName(defaultFormat)
			}
			r, err := http.Post(uri+"/api/v2/write", format.Mime[0], reader)
			if err != nil {
				return err
			}
			defer r.Body.Close()
			body, err := ioutil.ReadAll(r.Body)
			if err != nil {
				return err
			}
			if r.StatusCode == http.StatusOK {
				var response struct {
					Result string `json:"result"`
					Count  string `json:"count"`
					Error  string `json:"error"`
				}
				json.Unmarshal(body, &response)
				if response.Error != "" {
					return errors.New(response.Error)
				}
				if !quiet {
					fmt.Println(response.Result)
				}
			} else if r.StatusCode == http.StatusNotFound {
				return errors.New("Database instance does not support write")
			}
			return nil
		},
	}

	cmd.Flags().StringVarP(&uri, "uri", "", "http://127.0.0.1:64210", "Cayley URI connection string")
	cmd.Flags().StringVarP(&formatName, "format", "", "", "format of the provided data (if can not be detected defaults to JSON-LD)")
	cmd.Flags().BoolVarP(&quiet, "quiet", "q", false, "hide all log output")
	return cmd
}

func main() {
	cmd := NewCmd()
	if err := cmd.Execute(); err != nil {
		os.Exit(1)
	}
}

func hasIn(in io.Reader) bool {
	if in == os.Stdin {
		stat, _ := os.Stdin.Stat()
		return (stat.Mode() & os.ModeCharDevice) == 0
	}
	return true
}

func formatByFileName(fileName string) *quad.Format {
	ext := filepath.Ext(fileName)
	return quad.FormatByExt(ext)
}


================================================
FILE: cmd/cayleyimport/cayleyimport_test.go
================================================
package main

import (
	"bytes"
	"context"
	"fmt"
	"net"
	"net/http"
	"path"
	"sort"
	"testing"

	"github.com/cayleygraph/quad"
	"github.com/stretchr/testify/require"

	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/graph/memstore"
	chttp "github.com/cayleygraph/cayley/internal/http"
)

var expectData = []quad.Quad{
	{quad.IRI("http://example.com/alice"), quad.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), quad.IRI("http://xmlns.com/foaf/0.1/Person"), quad.Value(nil)},
	{quad.IRI("http://example.com/alice"), quad.IRI("http://xmlns.com/foaf/0.1/knows"), quad.IRI("http://example.com/bob"), nil},
	{quad.IRI("http://example.com/alice"), quad.IRI("http://xmlns.com/foaf/0.1/name"), quad.String("Alice"), nil},
	{quad.IRI("http://example.com/bob"), quad.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), quad.IRI("http://xmlns.com/foaf/0.1/Person"), nil},
	{quad.IRI("http://example.com/bob"), quad.IRI("http://xmlns.com/foaf/0.1/knows"), quad.IRI("http://example.com/alice"), nil},
	{quad.IRI("http://example.com/bob"), quad.IRI("http://xmlns.com/foaf/0.1/name"), quad.String("Bob"), nil},
}

func allQuads(t testing.TB, qs graph.QuadStore) []quad.Quad {
	ctx := context.Background()
	it := qs.QuadsAllIterator().Iterate()
	defer it.Close()
	var out []quad.Quad
	for it.Next(ctx) {
		ref := it.Result()
		q, err := qs.Quad(ref)
		require.NoError(t, err)
		out = append(out, q)
	}
	require.NoError(t, it.Err())
	sort.Sort(quad.ByQuadString(out))
	return out
}

func TestCayleyImport(t *testing.T) {
	qs := memstore.New()
	qw, err := graph.NewQuadWriter("single", qs, graph.Options{})
	require.NoError(t, err)
	h := &graph.Handle{QuadStore: qs, QuadWriter: qw}
	chttp.SetupRoutes(h, &chttp.Config{})

	lis, err := net.Listen("tcp", "127.0.0.1:0")
	require.NoError(t, err)
	t.Cleanup(func() {
		lis.Close()
	})

	srv := &http.Server{
		Addr: lis.Addr().String(),
	}
	go srv.Serve(lis)

	cmd := NewCmd()
	b := bytes.NewBufferString("")
	cmd.SetOut(b)
	fileName := path.Join("..", "..", "data", "people.jsonld")
	cmd.SetArgs([]string{
		fileName,
		"--uri",
		fmt.Sprintf("http://%s", lis.Addr().String()),
	})
	err = cmd.Execute()
	require.NoError(t, err)
	require.Empty(t, b.String())
	sort.Sort(quad.ByQuadString(expectData))
	require.Equal(t, expectData, allQuads(t, qs))
}


================================================
FILE: cmd/docgen/docgen.go
================================================
package main

import (
	"bufio"
	"bytes"
	"flag"
	"fmt"
	"go/ast"
	"go/doc"
	"go/parser"
	"go/token"
	"io"
	"os"
	"path/filepath"
	"regexp"
	"strings"
)

var (
	packageName = flag.String("pck", "github.com/cayleygraph/cayley/query/gizmo", "")
	out         = flag.String("o", "-", "output file")
	in          = flag.String("i", "", "input file")
)

const placeholder = `#AUTOGENERATED#`

func main() {
	flag.Parse()

	fset := token.NewFileSet()
	pkgs, err := parser.ParseDir(fset, "./query/gizmo", nil, parser.ParseComments)
	if err != nil {
		panic(err)
	}
	p := pkgs[filepath.Base(*packageName)]

	dp := doc.New(p, *packageName, doc.AllDecls)

	var w io.Writer = os.Stdout
	if fname := *out; fname != "" && fname != "-" {
		f, err := os.Create(fname)
		if err != nil {
			panic(err)
		}
		defer f.Close()
		w = f
	}
	var r io.Reader = strings.NewReader(placeholder)
	if fname := *in; fname != "" {
		f, err := os.Open(fname)
		if err != nil {
			panic(err)
		}
		defer f.Close()
		r = f
	}
	sc := bufio.NewScanner(r)
	for sc.Scan() {
		line := bytes.TrimSpace(sc.Bytes())
		if bytes.Equal(line, []byte(placeholder)) {
			writeDocs(w, dp)
		} else {
			w.Write(line)
			w.Write([]byte("\n"))
		}
	}
}

func writeDocs(w io.Writer, dp *doc.Package) {
	type Type struct {
		Title string
		Name  string
	}

	names := map[string]Type{
		"graphObject": {
			Title: "The `graph` object",
			Name:  "graph",
		},
		"pathObject": {
			Title: "Path object",
			Name:  "path",
		},
	}
	for _, tp := range dp.Types {
		t, ok := names[tp.Name]
		if !ok {
			continue
		}
		s := tp.Doc
		if i := strings.IndexAny(s, "\n\r"); i >= 0 {
			s = s[i+1:]
		}
		s = strings.TrimSpace(s)
		fmt.Fprintf(w, "## %s\n\n", t.Title)
		fmt.Fprintf(w, "%s\n\n", funcDocs(s))
		for _, m := range tp.Methods {
			if !isExported(m.Name) {
				continue
			}
			m.Doc = strings.TrimSpace(m.Doc)
			sig := Signature(m)
			fmt.Fprintf(w, "### `%s.%s%s`\n\n%s\n\n", t.Name, m.Name, sig, funcDocs(m.Doc))
		}
	}
}

var reSignature = regexp.MustCompile(`Signature:\s+\((.+)\)`)

func Signature(m *doc.Func) string {
	if reSignature.MatchString(m.Doc) {
		sub := reSignature.FindStringSubmatch(m.Doc)
		m.Doc = strings.Replace(m.Doc, sub[0], "", 1)
		return "(" + sub[1] + ")"
	}
	tp := m.Decl.Type
	if isJsArgs(tp.Params) {
		return "(*)"
	}
	var names []string
	for _, a := range tp.Params.List {
		for _, name := range a.Names {
			names = append(names, name.Name)
		}
	}
	buf := bytes.NewBuffer(nil)
	buf.WriteRune('(')
	buf.WriteString(strings.Join(names, ", "))
	buf.WriteRune(')')
	return buf.String()
}

func isExported(s string) bool {
	return ast.IsExported(s)
}

func isJsArgs(f *ast.FieldList) bool {
	if len(f.List) != 1 {
		return false
	}
	p := f.List[0]
	if len(p.Names) != 1 {
		return false
	}
	sel, ok := p.Type.(*ast.SelectorExpr)
	if !ok {
		return false
	}
	return sel.Sel.Name == "FunctionCall"
}

var reScript = regexp.MustCompile(`//\s*(\w+)`)

func funcDocs(s string) string {
	if s == "" {
		return "TODO: docs"
	}
	buf := bytes.NewBuffer(nil)
	buf.Grow(len(s))
	sc := bufio.NewScanner(strings.NewReader(s))
	const defaultLang = ""
	var (
		inCode bool
		lang   string
	)
	for sc.Scan() {
		line := sc.Text()
		if code := strings.HasPrefix(line, "\t"); code {
			if !inCode {
				inCode = true
				lang = defaultLang
				skip := false
				if reScript.MatchString(line) {
					skip = true
					lang = reScript.FindStringSubmatch(line)[1]
				}
				buf.WriteString("```")
				buf.WriteString(lang)
				buf.WriteString("\n")
				if skip {
					continue
				}
			}
			line = strings.TrimPrefix(line, "\t")
		} else if inCode && !code {
			inCode = false
			buf.WriteString("```\n")
		}
		buf.WriteString(line)
		buf.WriteRune('\n')
	}
	if inCode {
		buf.WriteString("```\n")
	}
	return buf.String()
}


================================================
FILE: cmd/download_ui/download_ui.go
================================================
package main

import (
	"archive/zip"
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"path/filepath"
	"strings"
)

const (
	version       = "v0.8.0"
	fileURL       = "https://github.com/cayleygraph/web/releases/download/" + version + "/web.zip"
	fileName      = "web.zip"
	directoryName = "ui/web"
)

func main() {
	log.Printf("Downloading %s to %s...", fileURL, fileName)
	if err := DownloadFile(fileName, fileURL); err != nil {
		panic(err)
	}
	log.Printf("Downloaded %s to %s", fileURL, fileName)

	log.Printf("Extracting %s to %s...", fileName, directoryName)
	err := Unzip(fileName, directoryName)
	if err != nil {
		panic(err)
	}
	log.Printf("Extracted %s to %s/", fileName, directoryName)
	err = os.Remove(fileName)
	if err != nil {
		panic(err)
	}
	log.Printf("Removed %s", fileName)
}

// DownloadFile will download a url to a local file. It's efficient because it will
// write as it downloads and not load the whole file into memory.
func DownloadFile(filepath string, url string) error {

	// Get the data
	resp, err := http.Get(url)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	if resp.StatusCode != 200 {
		return fmt.Errorf("Received %v status code instead of 200 for %v", resp.Status, url)
	}

	// Create the file
	out, err := os.Create(filepath)
	if err != nil {
		return err
	}
	defer out.Close()

	// Write the body to file
	_, err = io.Copy(out, resp.Body)
	return err
}

// Unzip will decompress a zip archive, moving all files and folders
// within the zip file (parameter 1) to an output directory (parameter 2).
func Unzip(src string, dest string) error {
	r, err := zip.OpenReader(src)
	if err != nil {
		return err
	}
	defer r.Close()

	for _, f := range r.File {

		// Store filename/path for returning and using later on
		fpath := filepath.Join(dest, f.Name)

		// Check for ZipSlip. More Info: http://bit.ly/2MsjAWE
		if !strings.HasPrefix(fpath, filepath.Clean(dest)+string(os.PathSeparator)) {
			return fmt.Errorf("%s: illegal file path", fpath)
		}

		if f.FileInfo().IsDir() {
			// Make Folder
			os.MkdirAll(fpath, 0755)
			continue
		}

		// Make File
		if err = os.MkdirAll(filepath.Dir(fpath), os.ModePerm); err != nil {
			return err
		}

		outFile, err := os.OpenFile(fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
		if err != nil {
			return err
		}

		rc, err := f.Open()
		if err != nil {
			return err
		}

		_, err = io.Copy(outFile, rc)

		if err != nil {
			return err
		}

		// Close the file without defer to close before next iteration of loop
		err = outFile.Close()

		if err != nil {
			return err
		}

		err = rc.Close()

		if err != nil {
			return err
		}
	}
	return nil
}


================================================
FILE: configurations/default.json
================================================
{
  "store": {
    "backend": "memstore"
  }
}


================================================
FILE: configurations/persisted.json
================================================
{
  "store": {
    "backend": "bolt",
    "address": "data/cayley.db"
  }
}


================================================
FILE: data/30kmoviedata_gephi_meta.nq
================================================
</film/performance/character> <gephi:inline> "true"^^<schema:Boolean> .
<type> <gephi:inline> "true"^^<schema:Boolean> .
<name> <gephi:inline> "true"^^<schema:Boolean> .


================================================
FILE: data/people.jsonld
================================================
{
  "@context": {
    "ex": "http://example.com/",
    "@vocab": "http://xmlns.com/foaf/0.1/"
  },
  "@graph": [
    {
      "@id": "ex:alice",
      "@type": "Person",
      "name": "Alice",
      "knows": {
        "@id": "ex:bob"
      }
    },
    {
      "@id": "ex:bob",
      "@type": "Person",
      "name": "Bob",
      "knows": {
        "@id": "ex:alice"
      }
    }
  ]
}


================================================
FILE: data/testdata.nq
================================================
<alice> <follows> <bob> .
<bob> <follows> <fred> .
<bob> <status> "cool_person" .
<dani> <follows> <bob> .
<charlie> <follows> <bob> .
<charlie> <follows> <dani> .
<dani> <follows> <greg> .
<dani> <status> "cool_person" .
<emily> <follows> <fred> .
<fred> <follows> <greg> .
<greg> <status> "cool_person" .
<predicates> <are> <follows> .
<predicates> <are> <status> .
<emily> <status> "smart_person" <smart_graph> .
<greg> <status> "smart_person" <smart_graph> .


================================================
FILE: data/testdata_multigraph.nq
================================================
<alice> <follows> <bob> .
<bob> <follows> <fred> .
<bob> <status> "cool_person" .
<charlie> <follows> <bob> .
<charlie> <follows> <dani> .
<dani> <follows> <bob> .
<dani> <follows> <greg> .
<dani> <status> "cool_person" .
<emily> <follows> <fred> .
<fred> <follows> <greg> .
<greg> <status> "cool_person" .
<predicates> <are> <follows> .
<predicates> <are> <status> .
<emily> <status> "smart_person" <smart_graph> .
<greg> <status> "smart_person" <smart_graph> .
<fred> <status> "smart_person" <other_graph> .


================================================
FILE: docs/3rd-party-apis.md
================================================
# 3rd-Party-APIs

Various 3rd party APIs

* **Clojure**: [https://github.com/wgb/cayley-clj](https://github.com/wgb/cayley-clj)
* **Javascript/NodeJS**: [https://github.com/lnshi/node-cayley](https://github.com/lnshi/node-cayley), [https://github.com/villadora/cayley.js](https://github.com/villadora/cayley.js)
* **Ruby**: [https://github.com/reneklacan/cayley-ruby](https://github.com/reneklacan/cayley-ruby)
* **PHP**: [https://github.com/mcuadros/php-cayley](https://github.com/mcuadros/php-cayley)
* **Python**: [https://github.com/ziyasal/pyley](https://github.com/ziyasal/pyley)
* **.NET**: [https://github.com/ziyasal/Cayley.Net](https://github.com/ziyasal/Cayley.Net)
* **Rust** \(in early stage\): [https://github.com/shamansir/cayley-rust](https://github.com/shamansir/cayley-rust)
* **Haskell**: [https://github.com/MichelBoucey/cayley-client](https://github.com/MichelBoucey/cayley-client)



================================================
FILE: docs/GizmoAPI.md.in
================================================
# Gizmo API
![Autogenerated file](https://img.shields.io/badge/file-generated-orange.svg)

#AUTOGENERATED#

================================================
FILE: docs/README.md
================================================
# Cayley Documentation

Welcome to the Cayley Manual! Cayley is an open-source graph database designed for ease of use and storing complex data. The manual introduces key concepts in Cayley, presents the query languages, and provides operational and administrative considerations and procedures as well as comprehensive reference section.

## Introduction

* [Getting Started](getting-started.md)
* [Installation](installation.md)
* [Advanced Use](usage/advanced-use.md)
* [UI Overview](usage/ui-overview.md)
* [Project Locations](getting-involved/locations.md)

## Reference

* [Glossary](getting-involved/glossary.md)
* [Gizmo API](query-languages/gizmoapi.md)
* [GraphQL](query-languages/graphql.md)
* [MQL](query-languages/mql.md)
* [HTTP](usage/http.md)
* [GephiGraphStream](query-languages/gephigraphstream.md)

## Administrators

* [Configuration](configuration.md)
* [Migration](usage/migration.md)
* [Usage as Container](deployment/container.md)
* [Usage in Kubernetes](./k8s/k8s.md)

## Developers

* [Libraries \(3rd party\)](usage/3rd-party-apis.md)
* [Contributing](getting-involved/contributing.md)
* [Quick Start As Go Library](usage/quickstart-as-lib.md)



================================================
FILE: docs/SUMMARY.md
================================================
# Table of contents

* [Cayley Documentation](README.md)
* [Getting Started](getting-started.md)
* [Install Cayley](installation.md)
* [Configuration](configuration.md)

## Usage

* [Quickstart as Library](usage/quickstart-as-lib.md)
* [Advanced Use](usage/advanced-use.md)
* [HTTP Methods](usage/http.md)
* [3rd-Party-APIs](usage/3rd-party-apis.md)
* [UI Overview](usage/ui-overview.md)
* [Migration](usage/migration.md)

## Query Languages

* [Gizmo API](query-languages/gizmoapi.md)
* [GraphQL Guide](query-languages/graphql.md)
* [MQL Guide](query-languages/mql.md)
* [Gephi GraphStream](query-languages/gephigraphstream.md)

## Getting Involved

* [Glossary of Terms](getting-involved/glossary.md)
* [Contributing](getting-involved/contributing.md)
* [TODOs](getting-involved/todo.md)
* [Locations of parts of Cayley](getting-involved/locations.md)

## Deployment

* [Running in Docker](deployment/container.md)
* [Running in Kubernetes](deployment/k8s-1.md)

## Tools

* [Convert Linked Data files](tools/convert-linked-data-files.md)



================================================
FILE: docs/advanced-use.md
================================================
# Advanced Use

## Initialize A Graph

Now that Cayley is downloaded \(or built\), let's create our database. `init` is the subcommand to set up a database and the right indices.

You can set up a full [configuration file](configuration.md) if you'd prefer, but it will also work from the command line.

Examples for each backend can be found in `store.address` format from [config file](configuration.md).

Those two options \(db and dbpath\) are always going to be present. If you feel like not repeating yourself, setting up a configuration file for your backend might be something to do now. There's an example file, `cayley_example.yml` in the root directory.

You can repeat the `--db (-i)` and `--dbpath (-a)` flags from here forward instead of the config flag, but let's assume you created `cayley_overview.yml`

Note: when you specify parameters in the config file the config flags \(command line arguments\) are ignored.

## Load Data Into A Graph

After the database is initialized we load the data.

```bash
./cayley load -c cayley_overview.yml -i data/testdata.nq
```

And wait. It will load. If you'd like to watch it load, you can run

```bash
./cayley load -c cayley_overview.yml -i data/testdata.nq --alsologtostderr=true
```

And watch the log output go by.

If you plan to import a large dataset into Cayley and try multiple backends, it makes sense to first convert the dataset to Cayley-specific binary format by running:

```bash
./cayley conv -i dataset.nq.gz -o dataset.pq.gz
```

This will minimize parsing overhead on future imports and will compress dataset a bit better.

## Connect a REPL To Your Graph

Now it's loaded. We can use Cayley now to connect to the graph. As you might have guessed, that command is:

```bash
./cayley repl -c cayley_overview.yml
```

Where you'll be given a `cayley>` prompt. It's expecting Gizmo/JS, but that can also be configured with a flag.

New nodes and links can be added with the following command:

```bash
cayley> :a subject predicate object label .
```

Removing links works similarly:

```bash
cayley> :d subject predicate object .
```

This is great for testing, and ultimately also for scripting, but the real workhorse is the next step.

Go ahead and give it a try:

```text
// Simple math
cayley> 2 + 2

// JavaScript syntax
cayley> x = 2 * 8
cayley> x

// See all the entities in this small follow graph.
cayley> graph.Vertex().All()

// See only dani.
cayley> graph.Vertex("<dani>").All()

// See who dani follows.
cayley> graph.Vertex("<dani>").Out("<follows>").All()
```

## Serve Your Graph

Just as before:

```bash
./cayley http -c cayley_overview.yml
```

And you'll see a message not unlike

```bash
listening on :64210, web interface at http://localhost:64210
```

If you visit that address \(often, [http://localhost:64210](http://localhost:64210)\) you'll see the full web interface and also have a graph ready to serve queries via the [HTTP API](http.md)

### Access from other machines

When you want to reach the API or UI from another machine in the network you need to specify the host argument:

```bash
./cayley http --config=cayley.cfg.overview --host=0.0.0.0:64210
```

This makes it listen on all interfaces. You can also give it the specific the IP address you want Cayley to bind to.

**Warning**: for security reasons you might not want to do this on a public accessible machine.



================================================
FILE: docs/api/swagger.yml
================================================
openapi: "3.0.0"
info:
  description: ""
  version: "2.1.0"
  title: "Cayley API"
  license:
    name: "Apache 2.0"
    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
servers:
  - url: "http://{host}:{port}"
    variables:
      "host":
        default: "localhost"
      "port":
        default: "64210"
tags:
  - name: "data"
    description: "Reading and writing data"
  - name: "queries"
    description: "Querying the graph"
paths:
  /api/v2/formats:
    get:
      tags:
        - "data"
      summary: "Returns a list of supported data formats"
      description: ""
      operationId: "listFormats"
      responses:
        200:
          description: "success"
          content:
            "application/json":
              schema:
                type: "object"
                properties:
                  id:
                    description: "unique name of the format"
                    type: "string"
                  read:
                    description: "format is supported for loading quads"
                    type: "boolean"
                  write:
                    description: "format is supported for exporting quads"
                    type: "boolean"
                  nodes:
                    description: "format can be used to describe nodes"
                    type: "boolean"
                  ext:
                    description: "typical file extensions for this format"
                    type: "array"
                    items:
                      type: "string"
                  mime:
                    description: "typical content types for this format"
                    type: "array"
                    items:
                      type: "string"
                  binary:
                    description: "format uses binary encoding"
                    type: "boolean"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/v2/read:
    get:
      tags:
        - "data"
      summary: "Reads all quads from the database"
      description: ""
      operationId: "readQuads"
      parameters:
        - name: "format"
          in: "query"
          description: "Data encoder to use for response. Overrides Accept header."
          required: false
          schema:
            type: "string"
            enum:
              - "nquads"
              - "jsonld"
              - "json"
              - "json-stream"
              - "pquads"
              - "graphviz"
              - "gml"
              - "graphml"
            default: "nquads"
        - name: "sub"
          in: "query"
          description: "Subjects to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "pred"
          in: "query"
          description: "Predicates to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "obj"
          in: "query"
          description: "Objects to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "label"
          in: "query"
          description: "Labels to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "iri"
          in: "query"
          description: "IRI format to use"
          required: false
          schema:
            type: "string"
            enum: ["short", "full"]
      responses:
        200:
          description: "read successful"
          content:
            "application/n-quads":
              schema:
                $ref: "#/components/schemas/NQuads"
            "application/ld+json":
              schema:
                $ref: "#/components/schemas/JSONLD"
            "application/json":
              schema:
                $ref: "#/components/schemas/JsonQuads"
            "application/x-json-stream":
              schema:
                $ref: "#/components/schemas/JsonQuadsStream"
            "application/x-protobuf":
              schema:
                $ref: "#/components/schemas/PQuads"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/v2/write:
    post:
      tags:
        - "data"
      summary: "Writes quads to the database"
      description: ""
      operationId: "writeQuads"
      requestBody:
        description: "File in one of formats specified in Content-Type."
        required: true
        content:
          "application/n-quads":
            schema:
              $ref: "#/components/schemas/NQuads"
          "application/ld+json":
            schema:
              $ref: "#/components/schemas/JSONLD"
          "application/json":
            schema:
              $ref: "#/components/schemas/JsonQuads"
          "application/x-json-stream":
            schema:
              $ref: "#/components/schemas/JsonQuadsStream"
          "application/x-protobuf":
            schema:
              $ref: "#/components/schemas/PQuads"
      parameters:
        - name: "format"
          in: "query"
          description: "Data decoder to use for request. Overrides Content-Type."
          required: false
          schema:
            type: "string"
      responses:
        200:
          description: "write successful"
          content:
            application/json:
              schema:
                type: "object"
                properties:
                  result:
                    type: "string"
                    description: "legacy success message"
                  count:
                    type: "integer"
                    description: "number of quads received"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/v2/node/delete:
    post:
      tags:
        - "data"
      summary: "Removes a node add all associated quads"
      description: ""
      operationId: "deleteNode"
      requestBody:
        description: "File in one of formats specified in Content-Type."
        required: true
        content:
          "application/n-quads":
            schema:
              $ref: "#/components/schemas/NQuadsNode"
          "application/json":
            schema:
              $ref: "#/components/schemas/JsonNode"
          "application/x-protobuf":
            schema:
              $ref: "#/components/schemas/PNode"
      parameters:
        - name: "format"
          in: "query"
          description: "Data decoder to use for request. Overrides Content-Type."
          required: false
          schema:
            type: "string"
      responses:
        200:
          description: "delete successful"
          content:
            application/json:
              schema:
                type: "object"
                properties:
                  result:
                    type: "string"
                    description: "legacy success message"
                  count:
                    type: "integer"
                    description: "number of nodes deleted"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/v2/delete:
    post:
      tags:
        - "data"
      summary: "Delete quads from the database"
      description: ""
      operationId: "deleteQuads"
      requestBody:
        description: "File in one of formats specified in Content-Type."
        required: true
        content:
          "application/n-quads":
            schema:
              $ref: "#/components/schemas/NQuads"
          "application/ld+json":
            schema:
              $ref: "#/components/schemas/JSONLD"
          "application/json":
            schema:
              $ref: "#/components/schemas/JsonQuads"
          "application/x-json-stream":
            schema:
              $ref: "#/components/schemas/JsonQuadsStream"
          "application/x-protobuf":
            schema:
              $ref: "#/components/schemas/PQuads"
      parameters:
        - name: "format"
          in: "query"
          description: "Data decoder to use for request. Overrides Content-Type."
          required: false
          schema:
            type: "string"
      responses:
        200:
          description: "write successful"
          content:
            application/json:
              schema:
                type: "object"
                properties:
                  result:
                    type: "string"
                    description: "legacy success message"
                  count:
                    type: "integer"
                    description: "number of quads received"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/v2/query:
    get:
      tags:
        - "queries"
      summary: "Query the graph"
      description: ""
      operationId: "query-get"
      parameters:
        - name: "lang"
          in: "query"
          description: "Query language to use"
          required: true
          schema:
            type: "string"
            enum:
              - "gizmo"
              - "graphql"
              - "mql"
              - "sexp"
        - name: "qu"
          in: "query"
          description: "Query text"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "query succesful"
          content:
            "application/json":
              schema:
                $ref: "#/components/schemas/QueryResult"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      tags:
        - "queries"
      summary: "Query the graph"
      description: ""
      operationId: "query"
      parameters:
        - name: "lang"
          in: "query"
          description: "Query language to use"
          required: true
          schema:
            type: "string"
            enum:
              - "gizmo"
              - "graphql"
              - "mql"
              - "sexp"
      requestBody:
        description: "Query text"
        required: true
        content:
          "*/*":
            schema:
              type: "string"
            examples:
              gizmo:
                summary: "Gizmo: first 10 nodes"
                value: "g.V().getLimit(10)"
              graphql:
                summary: "GraphQL: first 10 nodes"
                value: "{\n  nodes(first: 10){\n    id\n  }\n}"
      responses:
        200:
          description: "query succesful"
          content:
            "application/json":
              schema:
                $ref: "#/components/schemas/QueryResult"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/v2/namespace-rules:
    get:
      tags:
        - "data"
      summary: "Reads all namespace rules from the database"
      description: ""
      operationId: "getNamespaceRules"
      responses:
        200:
          description: "Success"
          content:
            "application/json":
              schema:
                type: "array"
                items:
                  type: "object"
                  properties:
                    prefix:
                      description: "Prefix of the namespace"
                      type: "string"
                    namespace:
                      description: "The namespace prefixed"
                      type: "string"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      tags:
        - "data"
      summary: "Registers new namespace rule to the database"
      description: ""
      operationId: "registerNamespaceRule"
      responses:
        201:
          description: "Success"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /gephi/gs:
    get:
      tags:
        - "queries"
      summary: "Gephi GraphStream endpoint"
      description: ""
      operationId: "gephiGraphStream"
      parameters:
        - name: "mode"
          in: "query"
          description: "Streamer mode"
          required: false
          schema:
            type: "string"
            enum:
              - "raw"
              - "nodes"
            default: "raw"
        - name: "limit"
          in: "query"
          description: "Limit the number of nodes or quads"
          required: false
          schema:
            type: "integer"
        - name: "sub"
          in: "query"
          description: "Subjects to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "pred"
          in: "query"
          description: "Predicates to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "obj"
          in: "query"
          description: "Objects to filter quads by"
          required: false
          schema:
            type: "string"
        - name: "label"
          in: "query"
          description: "Labels to filter quads by"
          required: false
          schema:
            type: "string"
      responses:
        200:
          description: "success"
          content:
            "application/stream+json":
              schema:
                type: "string"
                format: "binary"
                description: "stream of JSON objects"
        default:
          description: "Unexpected error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    QueryResult:
      type: object
      properties:
        result:
          type: array
          nullable: true
          items:
            type: object
    NQuads:
      type: "string"
      format: "binary"
      example: |
        <alice> <follows> <bob> .
        <bob> <follows> <fred> .
        <bob> <status> "cool_person" .
        <charlie> <follows> <bob> .
        <charlie> <follows> <dani> .
        <dani> <follows> <bob> .
        <dani> <follows> <greg> .
        <dani> <status> "cool_person" .
        <emily> <follows> <fred> .
        <fred> <follows> <greg> .
        <greg> <status> "cool_person" .
        <predicates> <are> <follows> .
        <predicates> <are> <status> .
        <emily> <status> "smart_person" <smart_graph> .
        <greg> <status> "smart_person" <smart_graph> .
    NQuadsNode:
      type: "string"
      format: "binary"
      example: "<alice>"
    JSONLD:
      type: "string"
      format: "binary"
      example:
        {
          "@context": "http://schema.org/",
          "@type": "Person",
          "name": "Jane Doe",
          "jobTitle": "Professor",
          "telephone": "(425) 123-4567",
          "url": "http://www.janedoe.com",
        }
      externalDocs:
        url: "https://json-ld.org"
    JsonQuad:
      type: "object"
      properties:
        subject:
          type: "string"
        predicate:
          type: "string"
        object:
          type: "string"
        label:
          type: "string"
    JsonQuads:
      type: "array"
      items:
        type: "object"
        properties:
          subject:
            type: "string"
          predicate:
            type: "string"
          object:
            type: "string"
          label:
            type: "string"
    JsonNode:
      type: "string"
    JsonQuadsStream:
      type: "string"
      format: "binary"
      description: "stream of JsonQuad objects"
    PQuads:
      type: "string"
      format: "binary"
      description: "Cayley-specific binary encoding of quads based on protobuf"
    PNode:
      type: "string"
      format: "binary"
      description: "Cayley-specific binary encoding of node value based on protobuf"
    Error:
      type: "object"
      properties:
        error:
          type: "string"
          description: "error message"


================================================
FILE: docs/cayleyexport.md
================================================
# `cayleyexport`

```
cayleyexport <file>
```

## Synopsis

The `cayleyexport` tool exports content from a Cayley deployment.

See the [`cayleyimport`](cayleyimport.md) document for more information regarding [`cayleyimport`](cayleyimport.md), which provides the inverse “importing” capability.

Run `cayleyexport` from the system command line, not the Cayley shell.

## Arguments

## Options

### `--help`

Returns information on the options and use of **cayleyexport**.

### `--quiet`

Runs **cayleyexport** in a quiet mode that attempts to limit the amount of output.

### `--uri=<connectionString>`

Specify a resolvable URI connection string (enclose in quotes) to connect to the Cayley deployment.

```
--uri "http://host[:port]"
```

### `--format=<format>`

Format to use for the exported data (if can not be detected defaults to JSON-LD)

### `--out=<filename>`

Specifies the location and name of a file to export the data to. If you do not specify a file, **cayleyexport** writes data to the standard output (e.g. “stdout”).


================================================
FILE: docs/cayleyimport.md
================================================
# `cayleyimport`

```
cayleyimport <file>
```

## Synopsis

The `cayleyimport` tool imports content created by [`cayleyexport`](cayleyexport.md), or potentially, another third-party export tool.

See the [`cayleyexport`](cayleyexport.md) document for more information regarding [`cayleyexport`](cayleyexport.md), which provides the inverse “exporting” capability.

Run `cayleyimport` from the system command line, not the Cayley shell.

## Arguments

### `file`

Specifies the location and name of a file containing the data to import. If you do not specify a file, **cayleyimport** reads data from standard input (e.g. “stdin”).

## Options

### `--help`

Returns information on the options and use of **cayleyimport**.

### `--quiet`

Runs **cayleyimport** in a quiet mode that attempts to limit the amount of output.

### `--uri=<connectionString>`

Specify a resolvable URI connection string (enclose in quotes) to connect to the Cayley deployment.

```
--uri "http://host[:port]"
```

### `--format=<format>`

Format of the provided data (if can not be detected defaults to JSON-LD)


================================================
FILE: docs/configuration.md
================================================
# Configuration

Cayley can be configured using configuration file written in YAML / JSON or by passing flags to the command line. By default. All command line flags take precedence over the configuration file.

* [Recommended Configuration](configuration.md#Recommended-Configuration)
* [Configuration Options](configuration.md#Configuration-Options)
  * [Store](configuration.md#Store)
  * [Per-Store Options](configuration.md#Per-Store-Options)
  * [Query](configuration.md#Query)
  * [Load](configuration.md#Load)
* [Configuration File Location](configuration.md#Configuration-File-Location)

## Recommended Configuration

By default, Cayley is using the `memstore` store. `memstore` works best for datasets that can fit into the memory of the machine and workloads which doesn't require persistency. For large datasets and/or workloads with require persistency it is recommended to use the `bolt` store.

## Configuration Options

### Store

#### **`store.backend`**

* Type: String
* Default: `"memory"`

Determines the type of the underlying database. Options include:

* `memstore`: An in-memory store, based on an initial N-Quads file. Loses all changes when the process exits.

**Key-Value backends**

* `btree`: An in-memory store, used mostly to quickly verify KV backend functionality.
* `leveldb`: A persistent on-disk store backed by [LevelDB](https://github.com/google/leveldb).
* `bolt`: Stores the graph data on-disk in a [Bolt](https://github.com/boltdb/bolt) file. Uses more disk space and memory than LevelDB for smaller stores, but is often faster to write to and comparable for large ones, with faster average query times.

**NoSQL backends**

Slower, as it incurs network traffic, but multiple Cayley instances can disappear and reconnect at will, across a potentially horizontally-scaled store.

* `mongo`: Stores the graph data and indices in a [MongoDB](https://www.mongodb.com/) instance.
* `elastic`: Stores the graph data and indices in a [ElasticSearch](https://www.elastic.co/products/elasticsearch) instance.
* `couch`: Stores the graph data and indices in a [CouchDB](http://couchdb.apache.org/) instance.
* `pouch`: Stores the graph data and indices in a [PouchDB](https://pouchdb.com/). Requires building with [GopherJS](https://github.com/gopherjs/gopherjs).

**SQL backends**

* `postgres`: Stores the graph data and indices in a [PostgreSQL](https://www.postgresql.org) instance.
* `cockroach`: Stores the graph data and indices in a [CockroachDB](https://www.cockroachlabs.com/product/cockroachdb/) cluster.
* `mysql`: Stores the graph data and indices in a [MySQL](https://www.mysql.com/) or [MariaDB](https://mariadb.org/) instance.
* `sqlite`: Stores the graph data and indices in a [SQLite](https://www.sqlite.org) database.

#### **`store.address`**

* Type: String
* Default: ""
* Alias: `store.path`

Where does the database actually live? Dependent on the type of database. For each datastore:

* `memstore`: Path parameter is not supported.
* `leveldb`: Directory to hold the LevelDB database files.
* `bolt`: Path to the persistent single Bolt database file.
* `mongo`: "hostname:port" of the desired MongoDB server. More options can be provided in [mgo](https://godoc.org/github.com/globalsign/mgo#Dial) address format.
* `elastic`: `http://host:port` of the desired ElasticSearch server.
* `couch`: `http://user:pass@host:port/dbname` of the desired CouchDB server.
* `postgres`,`cockroach`: `postgres://[username:password@]host[:port]/database-name?sslmode=disable` of the PostgreSQL database and credentials. Sslmode is optional. More option available on [pq](https://godoc.org/github.com/lib/pq) page.
* `mysql`: `[username:password@]tcp(host[:3306])/database-name` of the MqSQL database and credentials. More option available on [driver](https://github.com/go-sql-driver/mysql#dsn-data-source-name) page.
* `sqlite`: `filepath` of the SQLite database. More options available on [driver](https://github.com/mattn/go-sqlite3#connection-string) page.

#### **`store.read_only`**

* Type: Boolean
* Default: false

If true, disables the ability to write to the database using the HTTP API \(will return a 400 for any write request\). Useful for testing or instances that shouldn't change.

#### **`store.options`**

* Type: Object

See Per-Database Options, below.

### Per-Store Options

The `store.options` object in the main configuration file contains any of these following options that change the behavior of the datastore.

#### Memory

No special options.

#### LevelDB

**`write_buffer_mb`**

* Type: Integer
* Default: 20

The size in MiB of the LevelDB write cache. Increasing this number allows for more/faster writes before syncing to disk. Default is 20, for large loads, a recommended value is 200+.

**`cache_size_mb`**

* Type: Integer
* Default: 2

The size in MiB of the LevelDB block cache. Increasing this number uses more memory to maintain a bigger cache of quad blocks for better performance.

#### Bolt

**`nosync`**

* Type: Boolean
* Default: false

Optionally disable syncing to disk per transaction. Nosync being true means much faster load times, but without consistency guarantees.

#### Mongo

**`database_name`**

* Type: String
* Default: "cayley"

The name of the database within MongoDB to connect to. Manages its own collections and indices therein.

#### PostgreSQL

Postgres version 9.5 or greater is required.

**`db_fill_factor`**

* Type: Integer
* Default: 50

Amount of empty space as a percentage to leave in the database when creating a table and inserting rows. See [PostgreSQL CreateTable](http://www.postgresql.org/docs/current/static/sql-createtable.html).

**`local_optimize`**

* Type: Boolean
* Default: true

Whether to skip checking quad store size.

Connection pooling options used to configure the Go sql connection. Go defaults will be used when not specified.

**`maxopenconnections`**

* Type: Integer
* Default: -1.

**`maxidleconnections`**

* Type: Integer
* Default: -1.

**`connmaxlifetime`**

* Type: String
* Default: "".

#### Per-Replication Options

The `replication_options` object in the main configuration file contains any of these following options that change the behavior of the replication manager.

### Query

#### **`timeout`**

* Type: Integer or String
* Default: 30

The maximum length of time the Javascript runtime should run until cancelling the query and returning a 408 Timeout. When timeout is an integer is is interpreted as seconds, when it is a string it is [parsed](http://golang.org/pkg/time/#ParseDuration) as a Go time.Duration. A negative duration means no limit.

### Load

#### **`load.ignore_missing`**

* Type: Boolean
* Default: false

Optionally ignore missing quad on delete.

#### **`load.ignore_duplicate`**

* Type: Boolean
* Default: false

Optionally ignore duplicated quad on add.

#### **`load.batch`**

* Type: Integer
* Default: 10000

The number of quads to buffer from a loaded file before writing a block of quads to the database. Larger numbers are good for larger loads.

## Configuration File Location

Cayley looks in the following locations for the configuration file \(named `cayley.yml` or `cayley.json`\):

* Command line flag
* The environment variable `$CAYLEY_CFG`
* Current directory
* `$HOME/.cayley/`
* `/etc/`



================================================
FILE: docs/container.md
================================================
# Container

## Running in Kubernetes

To run Cayley in K8S check [this docs section](k8s/k8s.md).

## Running in a container

A container exposing the HTTP API of Cayley is available.

### Running with default configuration

Container is configured to use BoltDB as a backend by default.

```text
docker run -p 64210:64210 -d ghcr.io/cayleygraph/cayley
```

New database will be available at [http://localhost:64210](http://localhost:64210).

### Custom configuration

To run the container one must first setup a data directory that contains the configuration file and optionally contains persistent files \(i.e. a boltdb database file\).

```text
mkdir data
cp cayley_example.yml data/cayley.yml
cp data/testdata.nq data/my_data.nq
# initialize and serve database
docker run -v $PWD/data:/data -p 64210:64210 -d ghcr.io/cayleygraph/cayley -c /data/cayley.yml --init -i /data/my_data.nq
# serve existing database
docker run -v $PWD/data:/data -p 64210:64210 -d ghcr.io/cayleygraph/cayley -c /data/cayley.yml
```

### Other commands

Container runs `cayley http` command by default. To run any other Cayley command reset the entry point for container:

```text
docker run -v $PWD/data:/data ghcr.io/cayleygraph/cayley --entrypoint=cayley version
```



================================================
FILE: docs/contributing.md
================================================
# Contributing

## Community Involvement

Join our community on [discourse.cayley.io](https://discourse.cayley.io) or other [Locations](locations.md).

## Simply building Cayley

Follow the instructions for running Cayley locally:

```text
# clone project
git clone https://github.com/cayleygraph/cayley
cd cayley

# Download dependencies
go mod download

# Update web files (optional)

go run cmd/download_ui/download_ui.go
```

# build the binary

go build ./cmd/cayley

# try the generated binary

```bash
./cayley help
```

Give it a quick test with:

```text
./cayley repl -i data/testdata.nq
```

To run the web frontend, replace the "repl" command with "http"

```text
./cayley http -i data/testdata.nq
```

You can now open the WebUI in your browser: [http://127.0.0.1:64210](http://127.0.0.1:64210)

## Hacking on Cayley

If you just want to build Cayley and check out the source, or use it as a library, a simple `go get github.com/cayleygraph/cayley` will work!

But suppose you want to contribute back on your own fork \(and pull requests are welcome!\). A good way to do this is to set up your \$GOPATH and then...

```text
git clone https://github.com/$GITHUBUSERNAME/cayley
```

...where \$GITHUBUSERNAME is, well, your GitHub username :\) You'll probably want to add

```text
cd cayley
git remote add upstream http://github.com/cayleygraph/cayley
```

So that you can keep up with the latest changes by periodically running

```text
git pull --rebase upstream
```

With that in place, that folder will reflect your local fork, be able to take changes from the official fork, and build in the Go style.

For iterating, it can be helpful to, from the directory, run

```text
go build ./cmd/cayley && ./cayley <subcommand> <your options>
```

Which will also resolve the relevant static content paths for serving HTTP.

**Reminder:** add yourself to CONTRIBUTORS and AUTHORS.

## Running Unit Tests

First, `cd` into the `cayley` project folder and run:

```text
go test ./...
```

If you have a Docker installed, you can also run tests for remote backend implementations:

```text
go test -tags docker ./...
```

If you have a Docker installed, you only want to run tests for a specific backend implementations eg. mongodb

```text
go test -tags docker ./graph/nosql/mongo
```

Integration tests can be enabled with environment variable:

```text
RUN_INTEGRATION=true go test ./...
```


================================================
FILE: docs/convert-linked-data-files.md
================================================
---
description: >-
  Linked Data has multiple representations. The Cayley CLI includes a utility to
  convert Linked Data files from one format to another.
---

# Convert Linked Data files

## Convert from one format to another

```
$ cayley convert -i data.jsonld -o data.nquads
```

`-i` is the input file to be converted. In this example it is a [JSON-LD](https://www.w3.org/TR/json-ld11/) file named `data.jsonld`.

`-o` is the file to be created in the desired format. In this example it is a [N-Quads](https://www.w3.org/TR/n-quads/) file named `data.nquads`.

### Explicitly specify formats

The formats of the input and output files are detected automatically by the file extension. In case a specific format should be used for input or output use `--load_format` and `--dump_format` respectively.

```text
$ cayley convet -i data.jsonld -o data --dump_format pquads
```

`--dump_format` is set to the P-Quads format, a binary format used internally in Cayley.



================================================
FILE: docs/deployment/container.md
================================================
# Running in Docker

## Running in Kubernetes

To run Cayley in K8S check [this docs section](k8s-1.md).

## Running in a container

A container exposing the HTTP API of Cayley is available.

### Running with default configuration

Container is configured to use BoltDB as a backend by default.

```text
docker run -p 64210:64210 -d ghcr.io/cayleygraph/cayley
```

New database will be available at [http://localhost:64210](http://localhost:64210).

### Custom configuration

To run the container one must first setup a data directory that contains the configuration file and optionally contains persistent files \(i.e. a boltdb database file\).

```text
mkdir data
cp cayley_example.yml data/cayley.yml
cp data/testdata.nq data/my_data.nq
# initialize and serve database
docker run -v $PWD/data:/data -p 64210:64210 -d ghcr.io/cayleygraph/cayley -c /data/cayley.yml --init -i /data/my_data.nq
# serve existing database
docker run -v $PWD/data:/data -p 64210:64210 -d ghcr.io/cayleygraph/cayley -c /data/cayley.yml
```

### Other commands

Container runs `cayley http` command by default. To run any other Cayley command reset the entry point for container:

```text
docker run -v $PWD/data:/data ghcr.io/cayleygraph/cayley --entrypoint=cayley version
```



================================================
FILE: docs/deployment/k8s-1.md
================================================
# Running in Kubernetes

Most examples requires Kubernetes 1.5+ and PersistentVolumes are configured.

After running scripts namespace `cayley` will be created and service with the same name will be available in cluster. Service is of type `ClusterIP` by default. If you want to expose it, consider changing type to `LoadBalancer`.

## Single instance \(Bolt\)

This is a simplest possible configuration: single Cayley instance with persistent storage, using Bolt as a backend.

```bash
kubectl create -f ./docs/k8s/cayley-single.yml
```

## Distributed \(MongoDB cluster\)

This example is based on [thesandlord/mongo-k8s-sidecar](https://github.com/thesandlord/mongo-k8s-sidecar) and runs Cayley on top of 3-node Mongo cluster.

```bash
kubectl create -f ./docs/k8s/cayley-mongo.yml
```

## Distributed

_TODO: PostgreSQL, CockroachDB_



================================================
FILE: docs/docker-compose/docker-compose.mongo.yml
================================================
version: "2.2"
services:
  cayley:
    image: cayleygraph/cayley
    command: http --db mongo --dbpath mongodb://mongo:27017
    ports:
      - 64210:64210
  mongo:
    image: mongo
    ports:
      - 27017:27017


================================================
FILE: docs/faq.md
================================================
# Frequently Asked Questiones

Coming Soon! Building the list at [https://discourse.cayley.io/t/faq-frequently-asked-questions/127](https://discourse.cayley.io/t/faq-frequently-asked-questions/127)



================================================
FILE: docs/gephigraphstream.md
================================================
# Gephi GraphStream

Cayley supports graph visualisation in Gephi using GraphStream API.

Enpoint can be accessed by adding URL `http://localhost:64210/gephi/gs` to Gephi GraphStream client.

## Options

### `limit`

Default: `10000`

Sets a maximal number of object that will be streamed. Depending on stream mode this could be either nodes or quads.

Values less than 0 interpreted as "no limit".

### `mode`

Sets streaming mode. Supported values:

* `raw` \(default\) - all or selected quads
* `nodes` - nodes with properties

#### Raw mode

In this mode Cayley directly streams selected quads to Gephi.

Example URLs:

`/gephi/gs?mode=raw&pred=<follows>&limit=-1` \(all quads\)

`/gephi/gs?mode=raw&sub=<bob>&pred=<follows>,<status>&limit=-1` \(links from `<bob>` via either `<follows>` or `<status>`\)

Parameters:

* `limit` - maximal number of quads returned
* `sub`,`pred`,`obj`,`label` - only show quads with specified values of Subject, Predicate, Object or Label

This mode may be useful to visualize small subgraphs, or graphs without metadata such as types and properties. In case of later, large number of quads will be pointing to nodes describing common types or property names. For this kind of graphs `nodes` mode should be used.

#### Nodes with properties

Example URL: `/gephi/gs?mode=nodes&limit=-1`

In this mode Cayley streams all nodes and links associated with them, but instead of streaming common quads such as types it will inline them as Gephi properties.

Limit corresponds to a number of nodes returned.

By default, all predicate will be streamed as in `raw` mode, except well-known predicates and ones with `<gephi:inline> = "true"`.

List of well-known predicates includes:

* `<rdf:type>` \(`<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>`\)
* `<rdfs:label>` \(`<http://www.w3.org/2000/01/rdf-schema#label>`\)
* `<schema:name>` \(`<http://schema.org/name>`\)

To add custom predicates, write a special triple to database:

```text
<myCustomProperty> <gephi:inline> "true"^^<schema:Boolean> .
```

This allows to partition nodes by type or specific property values.

Note: Only one value per predicate is supported for inlined properties.

By default nodes will have random positions. To specify an exact position for specific node add `<gephi:x>` and `<gephi:y>` properties:

```text
<node> <gephi:x> "10"^^<schema:Integer>
<node> <gephi:y> "-12.3"^^<schema:Float>
```



================================================
FILE: docs/getting-involved/contributing.md
================================================
# Contributing

## Contributing

### Community Involvement

Join our community on [discourse.cayley.io](https://discourse.cayley.io) or other [Locations](locations.md).

### Simply building Cayley

If your version of Go &lt; 1.13, you need to run:

```text
export GO111MODULE=on
```

Follow the instructions for running Cayley locally:

```text
# clone project
git clone https://github.com/cayleygraph/cayley
cd cayley

# Download dependencies
go mod download

# Update web files (optional)

go run cmd/download_ui/download_ui.go
```

## Generate static files go modules

packr2

## build the binary

go build ./cmd/cayley

## try the generated binary

```bash
./cayley help
```

Give it a quick test with:

```text
./cayley repl -i data/testdata.nq
```

To run the web frontend, replace the "repl" command with "http"

```text
./cayley http -i data/testdata.nq
```

You can now open the WebUI in your browser: [http://127.0.0.1:64210](http://127.0.0.1:64210)

### Hacking on Cayley

First, you'll need Go [\(version 1.11.x or greater\)](https://golang.org/doc/install) and a Go workspace. This is outlined by the Go team at [http://golang.org/doc/code.html](http://golang.org/doc/code.html) and is sort of the official way of going about it.

If your version of Go &lt; 1.13, you need to run:

```text
export GO111MODULE=on
```

If you just want to build Cayley and check out the source, or use it as a library, a simple `go get github.com/cayleygraph/cayley` will work!

But suppose you want to contribute back on your own fork \(and pull requests are welcome!\). A good way to do this is to set up your $GOPATH and then...

```text
mkdir -p $GOPATH/src/github.com/cayleygraph
cd $GOPATH/src/github.com/cayleygraph
git clone https://github.com/$GITHUBUSERNAME/cayley
```

...where $GITHUBUSERNAME is, well, your GitHub username :\) You'll probably want to add

```text
cd cayley
git remote add upstream http://github.com/cayleygraph/cayley
```

So that you can keep up with the latest changes by periodically running

```text
git pull --rebase upstream
```

With that in place, that folder will reflect your local fork, be able to take changes from the official fork, and build in the Go style.

For iterating, it can be helpful to, from the directory, run

```text
packr2 && go build ./cmd/cayley && ./cayley <subcommand> <your options>
```

Which will also resolve the relevant static content paths for serving HTTP.

**Reminder:** add yourself to CONTRIBUTORS and AUTHORS.

### Running Unit Tests

If your version of Go &lt; 1.13, you need to run:

```text
export GO111MODULE=on
```

First, `cd` into the `cayley` project folder and run:

```text
go test ./...
```

If you have a Docker installed, you can also run tests for remote backend implementations:

```text
go test -tags docker ./...
```

If you have a Docker installed, you only want to run tests for a specific backend implementations eg. mongodb

```text
go test -tags docker ./graph/nosql/mongo
```

Integration tests can be enabled with environment variable:

```text
RUN_INTEGRATION=true go test ./...
```



================================================
FILE: docs/getting-involved/glossary.md
================================================
# Glossary of Terms

_Note: this definitions in this glossary are sequenced so that they build on each other, one to the next, rather than alphabetically._

## triple

1. a data entity composed of subject-predicate-object, like "Bob is 35" or "Bob knows Fred". \(A predicate in traditional grammar...is seen as a property that a subject has or is characterized by.\) [source](https://en.wikipedia.org/wiki/Triplestore) and \[source\]\([https://en.wikipedia.org/wiki/Predicate\_\(grammar\)\#Predicates\_in\_traditional\_grammar](https://en.wikipedia.org/wiki/Predicate_%28grammar%29#Predicates_in_traditional_grammar)\)

## triplestore

1. a purpose-built database for the storage and retrieval of triples... [source](https://en.wikipedia.org/wiki/Triplestore)

## quad

1. where triples have the form `{subject, predicate, object}`, quads would have a form along the lines of `{subject, predicate, object, context}` [source](https://en.wikipedia.org/wiki/Named_graph#Named_graphs_and_quads) 
2. You can add context or extra values to triples that identifies them and makes it easy to define subgraphs, or named properties. [source](https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/)
3. From [Cayley godoc](https://godoc.org/github.com/cayleygraph/quad#Quad):

   ```go
   type Quad struct {
    Subject   Value `json:“subject”`
    Predicate Value `json:“predicate”`
    Object    Value `json:“object”`
    Label     Value `json:“label,omitempty”`
   }
   ```

## link

1. Another name for a triple, since it "links" any two nodes.
2. Given the triple `{A, knows, C}` you would say in graph terminology that `A` and `C` are "vertices" while `knows` is an "edge". You would also say that `A`, `knows`, and `C` are all "nodes", and they are "linked" to one another by the triple.

## IRI

1. IRI is an RDF Internationalized Resource Identifier. [source](https://godoc.org/github.com/cayleygraph/quad#IRI)
2. An IRI \(Internationalized Resource Identifier\) within an RDF graph is a Unicode string that conforms to the syntax defined in RFC 3987. [source](https://www.w3.org/TR/rdf11-concepts/#h3_section-IRIs)
3. IRIs are a generalization of URIs that permits a wider range of Unicode characters. Every absolute URI and URL is an IRI, but not every IRI is an URI. [source](https://www.w3.org/TR/rdf11-concepts/#h3_section-IRIs)

## RDF

1. [Resource Description Framework](https://en.wikipedia.org/wiki/Resource_Description_Framework), basically a set of standards defined around quads
2. An RDF triple consists of three components: 
   1. the subject, which is an IRI or a blank node
   2. the predicate, which is an IRI
   3. the object, which is an IRI, a literal or a blank node [source](https://www.w3.org/TR/rdf11-concepts/#h3_section-triples)   

## RDF store, quad store, named graph, semantic graph database

1. ...persisting RDF — storing it — became a thing, and these stores were called triple stores. Next they were called quad stores and included information about context and named graphs, then RDF stores, and most recently they call themselves “semantic graph database.” [source](https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/)
2. Adding a name to the triple makes a "quad store" or named graph. [source](https://en.wikipedia.org/wiki/Triplestore#Related_database_types)

## Cayley

1. Cayley is a quad store that supports multiple storage backends.  It supports multiple query languages for traversing and filtering the named graphs formed by its quads, and it has associated tooling such as a CLI, HTTP server, and so on.

## Gizmo

1. A [Gremlin/TinkerPop](http://tinkerpop.apache.org/)-inspired query language for Cayley.  Looks a lot like JavaScript, the syntax is documented [here](https://github.com/cayleygraph/cayley/blob/master/docs/GizmoAPI.md#graphv).

## g.V\(\)

1. For Gremlin/TinkerPop, [g.V\(\) returns a list of all the vertices in the graph](http://tinkerpop.apache.org/docs/3.3.3/tutorials/gremlins-anatomy/#_graphtraversalsource)
2. `.v()` is for "Vertex" in Gizmo, and it is used like `pathObject = graph.Vertex([nodeId],[nodeId]...)` \(see \[\[path\|\#path\]\]\)

## inbound/outbound predicate

1. Inbound/outbound refers to the direction of a relation via a predicate. In the case of the triple "A follows B", "follows" is an outbound predicate for `A` and an inbound predicate for `B`.

   In/out predicates can be expressed in a query language, for example using the format `resultSet = subject.out(predicate)` to discover matching `Object`s. In the case of the triple "A follows B", `A.out(“follows”)` would return a set of nodes which contains `B`. An excellent example of this sort of query format is given in the Gremlin/TinkerPop homepage example:

   ```javascript
   What are the names of projects that were created by two friends?
    g.V().match(
      as(“a”).out(“knows”).as(“b”),
      as(“a”).out(“created”).as(“c”),
      as(“b”).out(“created”).as(“c”),
      as(“c”).in(“created”).count().is(2)).
        select(“c”).by(“name”)
   ```

## direction

1. Direction specifies a node's position within a quad. [source](https://godoc.org/github.com/cayleygraph/quad#Direction)

   ```go
   const (
    Any Direction = iota
    Subject
    Predicate
    Object
    Label
   )
   ```

2. Direction is passed to the `Get` method of a quad to access one of its four parts, see [quad.Get\(d Direction\) Value](https://godoc.org/github.com/cayleygraph/quad#Quad.Get)
3. The term "Direction" comes about from the concept of traversing a graph. Take for example the triple `{A, follows, B}` and supposing you "select" the predicate `follows`. Now you want to traverse the graph, so you move in the `Object` direction, and you now have `B` selected. Whereas the high-level [path](glossary.md#path) abstraction for queries uses inbound/outbound predicates to represent movement on the graph, the bottom-level [iterator](glossary.md#iterator) mechanic uses Direction.

## path

1. Paths are just a set of helpers to build a query, but they are not that good for building something more complex. You can try using [Shapes](glossary.md#shape) for this - it will give you a full control of what the query actually does. [source](https://discourse.cayley.io/t/a-variety-of-questions/1183/2)
2. Path represents either a morphism \(a pre-defined path stored for later use\), or a concrete path, consisting of a morphism and an underlying QuadStore. [source](https://godoc.org/github.com/cayleygraph/cayley/query/path#Path)
3. Underlying code:

   ```go
   type Path struct {
      stack       []morphism
      qs          graph.QuadStore
      baseContext pathContext
   }

   type morphism struct {
      IsTag    bool
      Reversal func(*pathContext) (morphism, *pathContext)
      Apply    applyMorphism
      tags     []string
   }

   type applyMorphism func(shape.Shape, *pathContext) (shape.Shape, *pathContext)
   ```

   So, as previously stated, the [path](https://godoc.org/github.com/cayleygraph/cayley/query/path) package is just helper methods on top of the [shape](https://godoc.org/github.com/cayleygraph/cayley/graph/shape) package.

## morphism

1. Morphism is basically a path that is not attached to any particular quadstore or a particular starting point in the graph. Morphisms are meant to be used as a query part that can be applied to other queries to follow a path specified in the Morphism.

   A good example will be a `FollowRecursive` function that will apply a single morphism multiple times to get to all nodes that can be traversed recursively. [source](https://discourse.cayley.io/t/a-variety-of-questions/1183/2)

## iterator

1. So a graph query is roughly represented as a tree of iterators – things

   that implement graph.Iterator. An iterator is \(loosely\) a stand-in for a

   set of things that match a particular portion of the graph. [source](https://discourse.cayley.io/t/7-7-14-question-about-iterator/62)

## subiterator

1. So a graph query is roughly represented as a tree of iterators...Evaluation is merely calling Next\(\) repeatedly on the iterator at the top of the tree. Subiterators, then, are the branches and leaves of the tree. [source](https://discourse.cayley.io/t/7-7-14-question-about-iterator/62)
2. Example of converting the Cayley-Gremlin-Go-API query `g.V(“B”).In(“follows”).All()` into an iterator tree:
   * **HasA** \(subject\) – gets the things in the subject field for:
     * **And** – the intersection of:
       * **LinksTo \(predicate\)** links that have the predicate of…:
         * Fixed iterator containing “follows” – … just the node “follows”.
       * **LinksTo \(object\)** links that have the object field of:
         * Fixed iterator containing “B” – … just the node “B”

## LinkTo iterator

1. A LinksTo takes a subiterator of nodes, and contains an iteration of links which "link to" those nodes in a given direction. ... Can be seen as the dual of the HasA iterator. [source](https://github.com/cayleygraph/cayley/blob/1f53d04893ea9b2736e9b2277bbba3f47b88711a/graph/iterator/linksto.go#L17)
   * Next\(\)ing a LinksTo is straightforward -- iterate through all links to things in the subiterator, and then advance the subiterator, and do it again.
     * To restate in pseudo-code; `results` is what would be returned in successive `Next()` calls:

       ```go
       var results []quad.Quad
       for _, node := range linkTo.subIterator {
         for _, quad := range allQuads {
             if quad.Get(linkTo.direction) == node {
                 results = append(results, quad)
             }
         }
       }
       ```
   * Contains\(\)ing a LinksTo means, given a link, take the direction we care about and check if it's in our subiterator.
     * To restate in pseudo-code:

       ```go
       for _, node := range linkTo.subIterator {
         if theLink.Get(linkTo.direction) == node {
             return true
         }
       }
       return false
       ```

## HasA iterator

1. The HasA takes a subiterator of links, and acts as an iterator of nodes in the given direction. The name comes from the idea that a "link HasA subject" or a "link HasA predicate". [source](https://github.com/cayleygraph/cayley/blob/41bf496d9dfe622b385c1482789480df8b106472/graph/iterator/hasa.go#L17)
   * Next\(\), [We have a subiterator we can get a value from, and we can take that resultant quad, pull our direction out of it, and return that.](https://github.com/cayleygraph/cayley/blob/41bf496d9dfe622b385c1482789480df8b106472/graph/iterator/hasa.go#L206)

     ```go
     var results []quad.Value
     for _, quad := range hasA.subIterator {
       results = append(results, quad.Get(hasA.direction))
     }
     ```

   * Contains\(\)

     ```go
     for _, quad := range hasA.subIterator {
       if quad.Get(hasA.direction) == theNode {
           return true
       }
     }
     return false
     ```

## shape

1. Shape represent a query tree shape. [source](https://godoc.org/github.com/cayleygraph/cayley/graph/shape#Shape)

   ```go
    type Shape interface {
        BuildIterator(qs graph.QuadStore) graph.Iterator
        Optimize(r Optimizer) (Shape, bool)
    }
   ```

2. This is the most interesting part of the query system - it describes how exactly the query looks like. ... This package also describes different query optimizations that are not specific to a backend. ... You can write a query using either Paths, Shapes or raw Iterators... [source](https://discourse.cayley.io/t/a-variety-of-questions/1183/2)
3. A Shape seems to be an abstract representation of a query, a level above Iterators and a level below Paths.  You can perform various operations on it \(traverse inbound/outbound predicates, find unions and intersections, etc.\) and most importantly build a tree of Iterators from it, which will do the mechanical act of processing quads to find results.

## token

1. In the context of a [quad store](https://godoc.org/github.com/cayleygraph/cayley/graph#QuadStore), a [graph.Value](https://godoc.org/github.com/cayleygraph/cayley/graph#Value). However the backend wishes to implement it, a Value is merely a token to a quad or a node that the backing store itself understands, and the base iterators pass around.

   For example, in a very traditional, graphd-style graph, these are int64s \(guids of the primitives\). In a very direct sort of graph, these could be pointers to structs, or merely quads, or whatever works best for the backing store.

## reification

1. “With reification, we create a metagraph on top of our graph that represents the statement that we have here. We create a new node that represents a statement and points at the subject...” [source](https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/)
2. Reifying a relationship means viewing it as an entity. The purpose of reifying a relationship is to make it explicit, when additional information needs to be added to it.

   Viewing a relationship as an entity, one can say that the entity reifies the relationship. This is called reification of a relationship. Like any other entity, it must be an instance of an entity type. [source](https://en.wikipedia.org/wiki/Reification_)



================================================
FILE: docs/getting-involved/locations.md
================================================
# Locations of parts of Cayley

## Community

* Where is the beating heart of this community?  [https://discourse.cayley.io/](https://discourse.cayley.io/)
* Where is the mailing list?  [https://discourse.cayley.io/](https://discourse.cayley.io/) \(enable mailing list mode under options\)
* Where is the chat room? [cayleygraph.slack.com](https://cayleygraph.slack.com) -- Invite [here](https://cayley-slackin.herokuapp.com/)
* Where should I start contributing? [Contributing.md](contributing.md) \(Also: [How to get involved!](https://discourse.cayley.io/t/how-to-get-involved/44)\)
* Where is the site-content? [https://github.com/cayleygraph/site-content](https://github.com/cayleygraph/site-content)
* Where are issues? [https://github.com/cayleygraph/cayley/issues](https://github.com/cayleygraph/cayley/issues)
* Where is the graph source code? [https://github.com/cayleygraph/cayley](https://github.com/cayleygraph/cayley)
* Where are pull requests? [https://github.com/cayleygraph/cayley/pulls](https://github.com/cayleygraph/cayley/pulls)
* Where is the wiki?  It was at [https://github.com/cayleygraph/cayley/wiki](https://github.com/cayleygraph/cayley/wiki), but we are deprecating it.
* Where is the \(old\) mailing list?  It was at [https://groups.google.com/forum/\#!forum/cayley-users](https://groups.google.com/forum/#!forum/cayley-users), but we are deprecating it for this forum \(and its mailing list mode\).



================================================
FILE: docs/getting-involved/todo.md
================================================
# TODOs

The main source of our TODO list is our [Github Issues](https://github.com/cayleygraph/cayley/issues), so we are going to try to avoid duplicating them here.

## Anything marked "TODO" in the code.

Usually something that should be taken care of.



================================================
FILE: docs/getting-started.md
================================================
# Getting Started

This guide will take you through starting a graph based on provided data.

## Prerequisites

This tutorial requires you to be connected to **local Cayley installation**. For more information on installing Cayley locally, see [Install Cayley](installation.md).

## Start Cayley

```bash
cayley http
```

You should see:

```text
Cayley version: 0.7.7 (dev snapshot)
using backend "memstore"
listening on 127.0.0.1:64210, web interface at http://127.0.0.1:64210
```

You can now open the web-interface on: [localhost:64210](http://localhost:64210/).

Cayley is configured by default to run in memory \(That's what `backend memstore` means\). To change the configuration see the documentation for [Configuration File](configuration.md) or run `cayley http --help`.

For more information about the UI see: [UI Overview](usage/ui-overview.md)

## Run with sample data

### Download sample data

[Sample Data](https://github.com/cayleygraph/cayley/raw/master/data/30kmoviedata.nq.gz)

### Run Cayley

```bash
cayley http --load 30kmoviedata.nq.gz
```

## Query Data

Using the 30kmoviedata.nq dataset from above, let's walk through some simple queries:

### Query all vertices in the graph

To select all vertices in the graph call, limit to 5 first results. `g` and `V` are synonyms for `graph` and `Vertex` respectively, as they are quite common.

```javascript
g.V().getLimit(5);
```

### Match a property of a vertex

Find vertex with property "Humphrey Bogart"

```javascript
g.V()
  .has("<name>", "Humphrey Bogart")
  .all();
```

You may start to notice a pattern here: with Gizmo, the query lines tend to:

Start somewhere in the graph \| Follow a path \| Run the query with "all" or "getLimit"

### Match a complex path

Get the list of actors in the film

```javascript
g.V()
  .has("<name>", "Casablanca")
  .out("</film/film/starring>")
  .out("</film/performance/actor>")
  .out("<name>")
  .all();
```

### Match

This is starting to get long. Let's use a Morphism, a pre-defined path stored in a variable, as our linkage

```javascript
var filmToActor = g
  .Morphism()
  .out("</film/film/starring>")
  .out("</film/performance/actor>");

g.V()
  .has("<name>", "Casablanca")
  .follow(filmToActor)
  .out("<name>")
  .all();
```

To learn more about querying see [Gizmo Documentation](query-languages/gizmoapi.md)



================================================
FILE: docs/gizmoapi.md
================================================
# Gizmo API

![Autogenerated file](https://img.shields.io/badge/file-generated-orange.svg)

## The `graph` object

Name: `graph`, Alias: `g`

This is the only special object in the environment, generates the query objects. Under the hood, they're simple objects that get compiled to a Go iterator tree when executed.

### `graph.addDefaultNamespaces()`

AddDefaultNamespaces register all default namespaces for automatic IRI resolution.

### `graph.addNamespace(pref, ns)`

AddNamespace associates prefix with a given IRI namespace.

### `graph.emit(*)`

Emit adds data programmatically to the JSON result list. Can be any JSON type.

```javascript
g.emit({ name: "bob" }); // push {"name":"bob"} as a result
```

### `graph.loadNamespaces()`

LoadNamespaces loads all namespaces saved to graph.

### `graph.M()`

M is a shorthand for Morphism.

### `graph.Morphism()`

Morphism creates a morphism path object. Unqueryable on it's own, defines one end of the path. Saving these to variables with

```javascript
var shorterPath = graph
  .Morphism()
  .out("foo")
  .out("bar");
```

is the common use case. See also: path.follow\(\), path.followR\(\).

### `graph.IRI(s)`

Uri creates an IRI values from a given string.

### `graph.V(*)`

V is a shorthand for Vertex.

### `graph.Vertex([nodeId],[nodeId]...)`

Vertex starts a query path at the given vertex/vertices. No ids means "all vertices".

Arguments:

* `nodeId` \(Optional\): A string or list of strings representing the starting vertices.

Returns: Path object

## Path object

Both `.Morphism()` and `.Vertex()` create path objects, which provide the following traversal methods. Note that `.Vertex()` returns a query object, which is a subclass of path object.

For these examples, suppose we have the following graph:

```text
+-------+                        +------+
| alice |-----                 ->| fred |<--
+-------+     \---->+-------+-/  +------+   \-+-------+
              ----->| #bob# |       |         |*emily*|
+---------+--/  --->+-------+       |         +-------+
| charlie |    /                    v
+---------+   /                  +--------+
  \---    +--------+             |*#greg#*|
      \-->| #dani# |------------>+--------+
          +--------+
```

Where every link is a `<follows>` relationship, and the nodes with an extra `#` in the name have an extra `<status>` link. As in,

```text
<dani> -- <status> --> "cool_person"
```

Perhaps these are the influencers in our community. So too are extra `*`s in the name -- these are our smart people, according to the `<smart_graph>` label, eg, the quad:

```text
<greg> <status> "smart_person" <smart_graph> .
```

### `path.all()`

All executes the query and adds the results, with all tags, as a string-to-string \(tag to node\) map in the output set, one for each path that a traversal could take.

### `path.and(path)`

And is an alias for Intersect.

### `path.as(tags)`

As is an alias for Tag.

### `path.back([tag])`

Back returns current path to a set of nodes on a given tag, preserving all constraints.

If still valid, a path will now consider their vertex to be the same one as the previously tagged one, with the added constraint that it was valid all the way here. Useful for traversing back in queries and taking another route for things that have matched so far.

Arguments:

* `tag`: A previous tag in the query to jump back to.

Example:

```javascript
// Start from all nodes, save them into start, follow any status links,
// jump back to the starting node, and find who follows them. Return the result.
// Results are:
//   {"id": "<alice>", "start": "<bob>"},
//   {"id": "<charlie>", "start": "<bob>"},
//   {"id": "<charlie>", "start": "<dani>"},
//   {"id": "<dani>", "start": "<bob>"},
//   {"id": "<dani>", "start": "<greg>"},
//   {"id": "<dani>", "start": "<greg>"},
//   {"id": "<fred>", "start": "<greg>"},
//   {"id": "<fred>", "start": "<greg>"}
g.V()
  .Tag("start")
  .out("<status>")
  .back("start")
  .in("<follows>")
  .all();
```

### `path.both([predicatePath], [tags])`

Both follow the predicate in either direction. Same as Out or In.

Example:

```javascript
// Find all followers/followees of fred. Returns bob, emily and greg
g.V("<fred>")
  .both("<follows>")
  .all();
```

### `path.count()`

Count returns a number of results and returns it as a value.

Example:

```javascript
// Save count as a variable
var n = g.V().count();
// Send it as a query result
g.emit(n);
```

### `path.difference(path)`

Difference is an alias for Except.

### `path.except(path)`

Except removes all paths which match query from current path.

In a set-theoretic sense, this is \(A - B\). While `g.V().except(path)` to achieve `U - B = !B` is supported, it's often very slow. Example:

```javascript
var cFollows = g.V("<charlie>").out("<follows>");
var dFollows = g.V("<dani>").out("<follows>");
// People followed by both charlie (bob and dani) and dani (bob and greg) -- returns bob.
cFollows.except(dFollows).all(); // The set (dani) -- what charlie follows that dani does not also follow.
// Equivalently, g.V("<charlie>").out("<follows>").except(g.V("<dani>").out("<follows>")).all()
```

### `path.filter(args)`

Filter applies constraints to a set of nodes. Can be used to filter values by range or match strings.

#### `path.filter(regex(expression, includeIRIs))`

Filters by match a regular expression \([syntax](https://github.com/google/re2/wiki/Syntax)\). By default works only on literals unless includeEntities is set to `true`.

### `path.follow(path)`

Follow is the way to use a path prepared with Morphism. Applies the path chain on the morphism object to the current path.

Starts as if at the g.M\(\) and follows through the morphism path.

Example:

```javascript
var friendOfFriend = g
  .Morphism()
  .out("<follows>")
  .out("<follows>");
// Returns the followed people of who charlie follows -- a simplistic "friend of my friend"
// and whether or not they have a "cool" status. Potential for recommending followers abounds.
// Returns bob and greg
g.V("<charlie>")
  .follow(friendOfFriend)
  .has("<status>", "cool_person")
  .all();
```

### `path.followR(path)`

FollowR is the same as Follow but follows the chain in the reverse direction. Flips "In" and "Out" where appropriate, the net result being a virtual predicate followed in the reverse direction.

Starts at the end of the morphism and follows it backwards \(with appropriate flipped directions\) to the g.M\(\) location.

Example:

```javascript
var friendOfFriend = g
  .Morphism()
  .out("<follows>")
  .out("<follows>");
// Returns the third-tier of influencers -- people who follow people who follow the cool people.
// Returns charlie (from bob), charlie (from greg), bob and emily
g.V()
  .has("<status>", "cool_person")
  .followR(friendOfFriend)
  .all();
```

### `path.followRecursive(*)`

FollowRecursive is the same as Follow but follows the chain recursively.

Starts as if at the g.M\(\) and follows through the morphism path multiple times, returning all nodes encountered.

Example:

```javascript
var friend = g.Morphism().out("<follows>");
// Returns all people in Charlie's network.
// Returns bob and dani (from charlie), fred (from bob) and greg (from dani).
g.V("<charlie>")
  .followRecursive(friend)
  .all();
```

### `path.forEach(callback) or (limit, callback)`

ForEach calls callback\(data\) for each result, where data is the tag-to-string map as in All case.

Arguments:

* `limit` \(Optional\): An integer value on the first `limit` paths to process.
* `callback`: A javascript function of the form `function(data)`

Example:

```javascript
// Simulate query.all().all()
graph.V("<alice>").ForEach(function(d) {
  g.emit(d);
});
```

### `path.getLimit(limit)`

GetLimit is the same as All, but limited to the first N unique nodes at the end of the path, and each of their possible traversals.

### `path.has(predicate, object)`

Has filters all paths which are, at this point, on the subject for the given predicate and object, but do not follow the path, merely filter the possible paths.

Usually useful for starting with all nodes, or limiting to a subset depending on some predicate/value pair.

Arguments:

* `predicate`: A string for a predicate node.
* `object`: A string for a object node or a set of filters to find it.

Example:

```javascript
// Start from all nodes that follow bob -- results in alice, charlie and dani
g.V()
  .has("<follows>", "<bob>")
  .all();
// People charlie follows who then follow fred. Results in bob.
g.V("<charlie>")
  .out("<follows>")
  .has("<follows>", "<fred>")
  .all();
// People with friends who have names sorting lower then "f".
g.V()
  .has("<follows>", gt("<f>"))
  .all();
```

### `path.hasR(*)`

HasR is the same as Has, but sets constraint in reverse direction.

### `path.in([predicatePath], [tags])`

In is inverse of Out. Starting with the nodes in `path` on the object, follow the quads with predicates defined by `predicatePath` to their subjects.

Arguments:

* `predicatePath` \(Optional\): One of:
  * null or undefined: All predicates pointing into this node
  * a string: The predicate name to follow into this node
  * a list of strings: The predicates to follow into this node
  * a query path object: The target of which is a set of predicates to follow.
* `tags` \(Optional\): One of:
  * null or undefined: No tags
  * a string: A single tag to add the predicate used to the output set.
  * a list of strings: Multiple tags to use as keys to save the predicate used to the output set.

Example:

```javascript
// Find the cool people, bob, dani and greg
g.V("cool_person")
  .in("<status>")
  .all();
// Find who follows bob, in this case, alice, charlie, and dani
g.V("<bob>")
  .in("<follows>")
  .all();
// Find who follows the people emily follows, namely, bob and emily
g.V("<emily>")
  .out("<follows>")
  .in("<follows>")
  .all();
```

### `path.inPredicates()`

InPredicates gets the list of predicates that are pointing in to a node.

Example:

```javascript
// bob only has "<follows>" predicates pointing inward
// returns "<follows>"
g.V("<bob>")
  .inPredicates()
  .all();
```

### `path.intersect(path)`

Intersect filters all paths by the result of another query path.

This is essentially a join where, at the stage of each path, a node is shared. Example:

```javascript
var cFollows = g.V("<charlie>").out("<follows>");
var dFollows = g.V("<dani>").out("<follows>");
// People followed by both charlie (bob and dani) and dani (bob and greg) -- returns bob.
cFollows.intersect(dFollows).all();
// Equivalently, g.V("<charlie>").out("<follows>").And(g.V("<dani>").out("<follows>")).all()
```

### `path.is(node, [node..])`

Filter all paths to ones which, at this point, are on the given node.

Arguments:

* `node`: A string for a node. Can be repeated or a list of strings.

Example:

```javascript
// Starting from all nodes in the graph, find the paths that follow bob.
// Results in three paths for bob (from alice, charlie and dani).all()
g.V()
  .out("<follows>")
  .is("<bob>")
  .all();
```

### `path.labelContext([labelPath], [tags])`

LabelContext sets \(or removes\) the subgraph context to consider in the following traversals. Affects all In\(\), Out\(\), and Both\(\) calls that follow it. The default LabelContext is null \(all subgraphs\).

Arguments:

* `predicatePath` \(Optional\): One of:
  * null or undefined: In future traversals, consider all edges, regardless of subgraph.
  * a string: The name of the subgraph to restrict traversals to.
  * a list of strings: A set of subgraphs to restrict traversals to.
  * a query path object: The target of which is a set of subgraphs.
* `tags` \(Optional\): One of:
  * null or undefined: No tags
  * a string: A single tag to add the last traversed label to the output set.
  * a list of strings: Multiple tags to use as keys to save the label used to the output set.

Example:

```javascript
// Find the status of people Dani follows
g.V("<dani>")
  .out("<follows>")
  .out("<status>")
  .all();
// Find only the statuses provided by the smart_graph
g.V("<dani>")
  .out("<follows>")
  .labelContext("<smart_graph>")
  .out("<status>")
  .all();
// Find all people followed by people with statuses in the smart_graph.
g.V()
  .labelContext("<smart_graph>")
  .in("<status>")
  .labelContext(null)
  .in("<follows>")
  .all();
```

### `path.labels()`

Labels gets the list of inbound and outbound quad labels

### `path.limit(limit)`

Limit limits a number of nodes for current path.

Arguments:

* `limit`: A number of nodes to limit results to.

Example:

```javascript
// Start from all nodes that follow bob, and limit them to 2 nodes -- results in alice and charlie
g.V()
  .has("<follows>", "<bob>")
  .limit(2)
  .all();
```

### `path.map(*)`

Map is a alias for ForEach.

### `path.or(path)`

Or is an alias for Union.

### `path.out([predicatePath], [tags])`

Out is the work-a-day way to get between nodes, in the forward direction. Starting with the nodes in `path` on the subject, follow the quads with predicates defined by `predicatePath` to their objects.

Arguments:

* `predicatePath` \(Optional\): One of:
  * null or undefined: All predicates pointing out from this node
  * a string: The predicate name to follow out from this node
  * a list of strings: The predicates to follow out from this node
  * a query path object: The target of which is a set of predicates to follow.
* `tags` \(Optional\): One of:
  * null or undefined: No tags
  * a string: A single tag to add the predicate used to the output set.
  * a list of strings: Multiple tags to use as keys to save the predicate used to the output set.

Example:

```javascript
// The working set of this is bob and dani
g.V("<charlie>")
  .out("<follows>")
  .all();
// The working set of this is fred, as alice follows bob and bob follows fred.
g.V("<alice>")
  .out("<follows>")
  .out("<follows>")
  .all();
// Finds all things dani points at. Result is bob, greg and cool_person
g.V("<dani>")
  .out()
  .all();
// Finds all things dani points at on the status linkage.
// Result is bob, greg and cool_person
g.V("<dani>")
  .out(["<follows>", "<status>"])
  .all();
// Finds all things dani points at on the status linkage, given from a separate query path.
// Result is {"id": "cool_person", "pred": "<status>"}
g.V("<dani>")
  .out(g.V("<status>"), "pred")
  .all();
```

### `path.outPredicates()`

OutPredicates gets the list of predicates that are pointing out from a node.

Example:

```javascript
// bob has "<follows>" and "<status>" edges pointing outwards
// returns "<follows>", "<status>"
g.V("<bob>")
  .outPredicates()
  .all();
```

### `path.save(predicate, tag)`

Save saves the object of all quads with predicate into tag, without traversal.

Arguments:

* `predicate`: A string for a predicate node.
* `tag`: A string for a tag key to store the object node.

Example:

```javascript
// Start from dani and bob and save who they follow into "target"
// Returns:
//   {"id" : "<bob>", "target": "<fred>" },
//   {"id" : "<dani>", "target": "<bob>" },
//   {"id" : "<dani>", "target": "<greg>" }
g.V("<dani>", "<bob>")
  .save("<follows>", "target")
  .all();
```

### `path.saveInPredicates(tag)`

SaveInPredicates tags the list of predicates that are pointing in to a node.

Example:

```javascript
// bob only has "<follows>" predicates pointing inward
// returns {"id":"<bob>", "pred":"<follows>"}
g.V("<bob>")
  .saveInPredicates("pred")
  .all();
```

### `path.saveOpt(*)`

SaveOpt is the same as Save, but returns empty tags if predicate does not exists.

### `path.saveOptR(*)`

SaveOptR is the same as SaveOpt, but tags values via reverse predicate.

### `path.saveOutPredicates(tag)`

SaveOutPredicates tags the list of predicates that are pointing out from a node.

Example:

```javascript
// bob has "<follows>" and "<status>" edges pointing outwards
// returns {"id":"<bob>", "pred":"<follows>"}
g.V("<bob>")
  .saveInPredicates("pred")
  .all();
```

### `path.saveR(*)`

SaveR is the same as Save, but tags values via reverse predicate.

### `path.skip(offset)`

Skip skips a number of nodes for current path.

Arguments:

* `offset`: A number of nodes to skip.

Example:

```javascript
// Start from all nodes that follow bob, and skip 2 nodes -- results in dani
g.V()
  .has("<follows>", "<bob>")
  .skip(2)
  .all();
```

### `path.tag(tags)`

Tag saves a list of nodes to a given tag.

In order to save your work or learn more about how a path got to the end, we have tags. The simplest thing to do is to add a tag anywhere you'd like to put each node in the result set.

Arguments:

* `tag`: A string or list of strings to act as a result key. The value for tag was the vertex the path was on at the time it reached "Tag"

  Example:

```javascript
// Start from all nodes, save them into start, follow any status links, and return the result.
// Results are:
//   {"id": "cool_person", "start": "<bob>"},
//   {"id": "cool_person", "start": "<dani>"},
//   {"id": "cool_person", "start": "<greg>"},
//   {"id": "smart_person", "start": "<emily>"},
//   {"id": "smart_person", "start": "<greg>"}
g.V()
  .tag("start")
  .out("<status>")
  .all();
```

### `path.tagArray(*)`

TagArray is the same as ToArray, but instead of a list of top-level nodes, returns an Array of tag-to-string dictionaries, much as All would, except inside the JS environment.

Example:

```javascript
// bobTags contains an Array of followers of bob (alice, charlie, dani).
var bobTags = g
  .V("<bob>")
  .tag("name")
  .in("<follows>")
  .tagArray();
// nameValue should be the string "<bob>"
var nameValue = bobTags[0]["name"];
```

### `path.tagValue()`

TagValue is the same as TagArray, but limited to one result node. Returns a tag-to-string map.

### `path.toArray(*)`

ToArray executes a query and returns the results at the end of the query path as an JS array.

Example:

```javascript
// bobFollowers contains an Array of followers of bob (alice, charlie, dani).
var bobFollowers = g
  .V("<bob>")
  .in("<follows>")
  .toArray();
```

### `path.toValue()`

ToValue is the same as ToArray, but limited to one result node.

### `path.union(path)`

Union returns the combined paths of the two queries.

Notice that it's per-path, not per-node. Once again, if multiple paths reach the same destination, they might have had different ways of getting there \(and different tags\). See also: `path.Tag()`

Example:

```javascript
var cFollows = g.V("<charlie>").out("<follows>");
var dFollows = g.V("<dani>").out("<follows>");
// People followed by both charlie (bob and dani) and dani (bob and greg) -- returns bob (from charlie), dani, bob (from dani), and greg.
cFollows.union(dFollows).all();
```

### `path.unique()`

Unique removes duplicate values from the path.

### `path.order()`

Order returns values from the path in ascending order.


================================================
FILE: docs/glossary.md
================================================
# Glossary of Terms

_Note: this definitions in this glossary are sequenced so that they build on each other, one to the next, rather than alphabetically._

## triple

1. a data entity composed of subject-predicate-object, like "Bob is 35" or "Bob knows Fred". \(A predicate in traditional grammar...is seen as a property that a subject has or is characterized by.\) [source](https://en.wikipedia.org/wiki/Triplestore) and \[source\]\([https://en.wikipedia.org/wiki/Predicate\_\(grammar\)\#Predicates\_in\_traditional\_grammar](https://en.wikipedia.org/wiki/Predicate_%28grammar%29#Predicates_in_traditional_grammar)\)

## triplestore

1. a purpose-built database for the storage and retrieval of triples... [source](https://en.wikipedia.org/wiki/Triplestore)

## quad

1. where triples have the form `{subject, predicate, object}`, quads would have a form along the lines of `{subject, predicate, object, context}` [source](https://en.wikipedia.org/wiki/Named_graph#Named_graphs_and_quads) 
2. You can add context or extra values to triples that identifies them and makes it easy to define subgraphs, or named properties. [source](https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/)
3. From [Cayley godoc](https://godoc.org/github.com/cayleygraph/quad#Quad):

   ```go
   type Quad struct {
    Subject   Value `json:“subject”`
    Predicate Value `json:“predicate”`
    Object    Value `json:“object”`
    Label     Value `json:“label,omitempty”`
   }
   ```

## link

1. Another name for a triple, since it "links" any two nodes.
2. Given the triple `{A, knows, C}` you would say in graph terminology that `A` and `C` are "vertices" while `knows` is an "edge". You would also say that `A`, `knows`, and `C` are all "nodes", and they are "linked" to one another by the triple.

## IRI

1. IRI is an RDF Internationalized Resource Identifier. [source](https://godoc.org/github.com/cayleygraph/quad#IRI)
2. An IRI \(Internationalized Resource Identifier\) within an RDF graph is a Unicode string that conforms to the syntax defined in RFC 3987. [source](https://www.w3.org/TR/rdf11-concepts/#h3_section-IRIs)
3. IRIs are a generalization of URIs that permits a wider range of Unicode characters. Every absolute URI and URL is an IRI, but not every IRI is an URI. [source](https://www.w3.org/TR/rdf11-concepts/#h3_section-IRIs)

## RDF

1. [Resource Description Framework](https://en.wikipedia.org/wiki/Resource_Description_Framework), basically a set of standards defined around quads
2. An RDF triple consists of three components: 
   1. the subject, which is an IRI or a blank node
   2. the predicate, which is an IRI
   3. the object, which is an IRI, a literal or a blank node [source](https://www.w3.org/TR/rdf11-concepts/#h3_section-triples)   

## RDF store, quad store, named graph, semantic graph database

1. ...persisting RDF — storing it — became a thing, and these stores were called triple stores. Next they were called quad stores and included information about context and named graphs, then RDF stores, and most recently they call themselves “semantic graph database.” [source](https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/)
2. Adding a name to the triple makes a "quad store" or named graph. [source](https://en.wikipedia.org/wiki/Triplestore#Related_database_types)

## Cayley

1. Cayley is a quad store that supports multiple storage backends.  It supports multiple query languages for traversing and filtering the named graphs formed by its quads, and it has associated tooling such as a CLI, HTTP server, and so on.

## Gizmo

1. A [Gremlin/TinkerPop](http://tinkerpop.apache.org/)-inspired query language for Cayley.  Looks a lot like JavaScript, the syntax is documented [here](https://github.com/cayleygraph/cayley/blob/master/docs/GizmoAPI.md#graphv).

## g.V\(\)

1. For Gremlin/TinkerPop, [g.V\(\) returns a list of all the vertices in the graph](http://tinkerpop.apache.org/docs/3.3.3/tutorials/gremlins-anatomy/#_graphtraversalsource)
2. `.v()` is for "Vertex" in Gizmo, and it is used like `pathObject = graph.Vertex([nodeId],[nodeId]...)` \(see \[\[path\|\#path\]\]\)

## inbound/outbound predicate

1. Inbound/outbound refers to the direction of a relation via a predicate.  In the case of the triple "A follows B", "follows" is an outbound predicate for `A` and an inbound predicate for `B`.    

   In/out predicates can be expressed in a query language, for example using the format `resultSet = subject.out(predicate)` to discover matching `Object`s.  In the case of the triple "A follows B", `A.out(“follows”)` would return a set of nodes which contains `B`.  An excellent example of this sort of query format is given in the Gremlin/TinkerPop homepage example:

   ```javascript
   What are the names of projects that were created by two friends?
    g.V().match(
      as(“a”).out(“knows”).as(“b”),
      as(“a”).out(“created”).as(“c”),
      as(“b”).out(“created”).as(“c”),
      as(“c”).in(“created”).count().is(2)).
        select(“c”).by(“name”)
   ```

## direction

1. Direction specifies a node's position within a quad. [source](https://godoc.org/github.com/cayleygraph/quad#Direction)

   ```go
   const (
    Any Direction = iota
    Subject
    Predicate
    Object
    Label
   )
   ```

2. Direction is passed to the `Get` method of a quad to access one of its four parts, see [quad.Get\(d Direction\) Value](https://godoc.org/github.com/cayleygraph/quad#Quad.Get)
3. The term "Direction" comes about from the concept of traversing a graph. Take for example the triple `{A, follows, B}` and supposing you "select" the predicate `follows`. Now you want to traverse the graph, so you move in the `Object` direction, and you now have `B` selected. Whereas the high-level [path](glossary.md#path) abstraction for queries uses inbound/outbound predicates to represent movement on the graph, the bottom-level [iterator](glossary.md#iterator) mechanic uses Direction.

## path

1. Paths are just a set of helpers to build a query, but they are not that good for building something more complex. You can try using [Shapes](glossary.md#shape) for this - it will give you a full control of what the query actually does. [source](https://discourse.cayley.io/t/a-variety-of-questions/1183/2)
2. Path represents either a morphism \(a pre-defined path stored for later use\), or a concrete path, consisting of a morphism and an underlying QuadStore. [source](https://godoc.org/github.com/cayleygraph/cayley/query/path#Path)
3. Underlying code:

   ```go
   type Path struct {
      stack       []morphism
      qs          graph.QuadStore
      baseContext pathContext
   }

   type morphism struct {
      IsTag    bool
      Reversal func(*pathContext) (morphism, *pathContext)
      Apply    applyMorphism
      tags     []string
   }

   type applyMorphism func(shape.Shape, *pathContext) (shape.Shape, *pathContext)
   ```

   So, as previously stated, the [path](https://godoc.org/github.com/cayleygraph/cayley/query/path) package is just helper methods on top of the [shape](https://godoc.org/github.com/cayleygraph/cayley/graph/shape) package.

## morphism

1. Morphism is basically a path that is not attached to any particular quadstore or a particular starting point in the graph. Morphisms are meant to be used as a query part that can be applied to other queries to follow a path specified in the Morphism.  

   A good example will be a `FollowRecursive` function that will apply a single morphism multiple times to get to all nodes that can be traversed recursively. [source](https://discourse.cayley.io/t/a-variety-of-questions/1183/2)

## iterator

1. So a graph query is roughly represented as a tree of iterators – things

   that implement graph.Iterator. An iterator is \(loosely\) a stand-in for a

   set of things that match a particular portion of the graph. [source](https://discourse.cayley.io/t/7-7-14-question-about-iterator/62)

## subiterator

1. So a graph query is roughly represented as a tree of iterators...Evaluation is merely calling Next\(\) repeatedly on the iterator at the top of the tree. Subiterators, then, are the branches and leaves of the tree. [source](https://discourse.cayley.io/t/7-7-14-question-about-iterator/62)
2. Example of converting the Cayley-Gremlin-Go-API query `g.V(“B”).In(“follows”).All()` into an iterator tree:
   * **HasA** \(subject\) – gets the things in the subject field for:
     * **And** – the intersection of:
       * **LinksTo \(predicate\)** links that have the predicate of…:
         * Fixed iterator containing “follows” – … just the node “follows”.
       * **LinksTo \(object\)** links that have the object field of:
         * Fixed iterator containing “B” – … just the node “B”

## LinkTo iterator

1. A LinksTo takes a subiterator of nodes, and contains an iteration of links which "link to" those nodes in a given direction. ... Can be seen as the dual of the HasA iterator. [source](https://github.com/cayleygraph/cayley/blob/1f53d04893ea9b2736e9b2277bbba3f47b88711a/graph/iterator/linksto.go#L17)
   * Next\(\)ing a LinksTo is straightforward -- iterate through all links to things in the subiterator, and then advance the subiterator, and do it again.
     * To restate in pseudo-code; `results` is what would be returned in successive `Next()` calls:

       ```go
       var results []quad.Quad
       for _, node := range linkTo.subIterator {
         for _, quad := range allQuads {
             if quad.Get(linkTo.direction) == node {
                 results = append(results, quad)
             }
         }
       }
       ```
   * Contains\(\)ing a LinksTo means, given a link, take the direction we care about and check if it's in our subiterator.
     * To restate in pseudo-code:

       ```go
       for _, node := range linkTo.subIterator {
         if theLink.Get(linkTo.direction) == node {
             return true
         }
       }
       return false
       ```

## HasA iterator

1. The HasA takes a subiterator of links, and acts as an iterator of nodes in the given direction. The name comes from the idea that a "link HasA subject" or a "link HasA predicate". [source](https://github.com/cayleygraph/cayley/blob/41bf496d9dfe622b385c1482789480df8b106472/graph/iterator/hasa.go#L17)
   * Next\(\), [We have a subiterator we can get a value from, and we can take that resultant quad, pull our direction out of it, and return that.](https://github.com/cayleygraph/cayley/blob/41bf496d9dfe622b385c1482789480df8b106472/graph/iterator/hasa.go#L206)

     ```go
     var results []quad.Value
     for _, quad := range hasA.subIterator {
       results = append(results, quad.Get(hasA.direction))
     }
     ```

   * Contains\(\)

     ```go
     for _, quad := range hasA.subIterator {
       if quad.Get(hasA.direction) == theNode {
           return true
       }
     }
     return false
     ```

## shape

1. Shape represent a query tree shape. [source](https://godoc.org/github.com/cayleygraph/cayley/graph/shape#Shape)

   ```go
    type Shape interface {
        BuildIterator(qs graph.QuadStore) graph.Iterator
        Optimize(ctx context.Context, r Optimizer) (Shape, bool)
    }
   ```

2. This is the most interesting part of the query system - it describes how exactly the query looks like. ... This package also describes different query optimizations that are not specific to a backend. ... You can write a query using either Paths, Shapes or raw Iterators... [source](https://discourse.cayley.io/t/a-variety-of-questions/1183/2)
3. A Shape seems to be an abstract representation of a query, a level above Iterators and a level below Paths.  You can perform various operations on it \(traverse inbound/outbound predicates, find unions and intersections, etc.\) and most importantly build a tree of Iterators from it, which will do the mechanical act of processing quads to find results.

## token

1. In the context of a [quad store](https://godoc.org/github.com/cayleygraph/cayley/graph#QuadStore), a [graph.Value](https://godoc.org/github.com/cayleygraph/cayley/graph#Value).  However the backend wishes to implement it, a Value is merely a token to a quad or a node that the backing store itself understands, and the base iterators pass around.    

    For example, in a very traditional, graphd-style graph, these are int64s \(guids of the primitives\). In a very direct sort of graph, these could be pointers to structs, or merely quads, or whatever works best for the backing store.

## reification

1. “With reification, we create a metagraph on top of our graph that represents the statement that we have here. We create a new node that represents a statement and points at the subject...” [source](https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/)
2. Reifying a relationship means viewing it as an entity. The purpose of reifying a relationship is to make it explicit, when additional information needs to be added to it.   

   Viewing a relationship as an entity, one can say that the entity reifies the relationship. This is called reification of a relationship. Like any other entity, it must be an instance of an entity type. [source](https://en.wikipedia.org/wiki/Reification_)



================================================
FILE: docs/graphql.md
================================================
# GraphQL Guide

**Disclaimer:** Cayley's GraphQL implementation is not strictly a GraphQL, but only a query language with the same syntax and mostly the same rules.

We will use [this simple dataset](https://github.com/cayleygraph/cayley/tree/87c9c341848b59924a054ebc2dd0f2bf8c57c6a9/data/testdata.nq) for our examples.

Every query is represented by tree-like structure of nested objects and properties, similar to [MQL](mql.md).

```graphql
{
  nodes{
    id
  }
}
```

This particular query is equivalent to all nodes in the graph, where `id` is the special field name for the value of the node itself.

First root object in traditional GraphQL \(named `nodes` here\) represents a method that will be called on the server to get results. In our current implementation this name serves only as a placeholder and will always execute the object search query.

Our example returns the following result:

```javascript
{
  "data": {
    "nodes": [
      {"id": "bob"},
      {"id": "status"},
      {"id": "cool_person"},
      {"id": "alice"},
      {"id": "greg"},
      {"id": "emily"},
      {"id": "smart_graph"},
      {"id": "predicates"},
      {"id": "dani"},
      {"id": "fred"},
      {"id": "smart_person"},
      {"id": "charlie"},
      {"id": "are"},
      {"id": "follows"}
    ]
  }
}
```

First level of JSON object corresponds to a request itself, thus either `data` field or `errors` will be present.

Any nested objects will correspond to fields defined in query, including top-level name \(`nodes`\).

## Limit and pagination

Maximal number of results can be limited using `first` keyword:

```graphql
{
  nodes(first: 10){
    id
  }
}
```

Pagination can be done with `offset` keyword:

```graphql
{
  nodes(offset: 5, first: 3){
    id
  }
}
```

This query returns objects 5-7.

_Note: Values might be sorted differently, depending on what backend is used._

## Properties

Predicates \(or properties\) are added to the object to specify additional fields to load:

```graphql
{
  nodes{
    id, status
  }
}
```

Results:

```javascript
{
  "data": {
    "nodes": [
      {"id": "bob", "status": "cool_person"},
      {"id": "greg", "status": "cool_person"},
      {"id": "dani", "status": "cool_person"},
      {"id": "greg", "status": "smart_person"},
      {"id": "emily", "status": "smart_person"}
    ]
  }
}
```

All predicates are interpreted as IRIs and can be written in plain text or with angle brackets: `status` and `<status>` are considered equal. Also, well-known namespaces like RDF, RDFS and Schema.org can be written in short form and will be expanded automatically: `schema:name` and `<schema:name>` will be expanded to `<http://schema.org/name>`.

Properties are required to be present by default and can be set to optional with `@opt` or `@optional` directive:

```graphql
{
  nodes{
    id
    status @opt
  }
}
```

Results:

```javascript
{
  "data": {
    "nodes": [
      {"id": "bob", "status": "cool_person"},
      {"id": "status"},
      {"id": "cool_person"},
      {"id": "alice"},
      {"id": "greg", "status": ["cool_person", "smart_person"]},
      {"id": "emily", "status": "smart_person"},
      {"id": "smart_graph"},
      {"id": "predicates"},
      {"id": "dani", "status": "cool_person"},
      {"id": "fred"},
      {"id": "smart_person"},
      {"id": "charlie"},
      {"id": "are"},
      {"id": "follows"}
    ]
  }
}
```

_Note: Since Cayley has no knowledge about property types and schema, it might decide to return a property as a single value for one object and as an array for another object. This behavior will be fixed in future versions._

## Nested objects

Objects and properties can be nested:

```graphql
{
  nodes{
    id
    follows {
      id
    }
  }
}
```

All operations available on root also works for nested object, for example the limit:

```graphql
{
  nodes(first: 10){
    id
    follows(first: 1){
      id
    }
  }
}
```

## Reversed predicates

Any predicate can be reversed with `@rev` or `@reverse` directive \(search for "in" links instead of "out"\):

```graphql
{
  nodes{
    id
    followed: <follows> @rev {
      id
    }
  }
}
```

## Filters

Objects can be filtered by specific values of properties:

```graphql
{
  nodes(id: <bob>, status: "cool_person"){
    id
  }
}
```

Only exact match is supported for now.

GraphQL names are interpreted as IRIs and string literals are interpreted as strings. Boolean, integer and float value are also supported and will be converted to `schema:Boolean`, `schema:Integer` and `schema:Float` accordingly.

## Labels

Any fields and traversals can be filtered by quad label with `@label` directive:

```graphql
{
  nodes{
    id
    follows @label(v: <fb>) {
      id, name
      follows @label {
        id, name
      }
    }
  }
}
```

Label will be inherited by child objects. To reset label filter add `@label` directive without parameters.

## Expanding all properties

To expand all properties of an object, `*` can be used instead of property name:

```graphql
{
  nodes{
    id
    follows {*}
  }
}
```

## Un-nest objects

The following query will return objects with `{id: x, status: {name: y}}` structure:

```graphql
{
  nodes{
    id
    status {
      name
    }
  }
}
```

It is possible to un-nest `status` field object into parent:

```graphql
{
  nodes{
    id
    status @unnest {
      status: name
    }
  }
}
```

Resulted objects will have a flat structure: `{id: x, status: y}`.

Arrays fields cannot be un-nested. You can still un-nest such fields by providing a limit directive \(will select the first value from array\):

```graphql
{
  nodes{
    id
    statuses(first: 1) @unnest {
      status: name
    }
  }
}
```



================================================
FILE: docs/gremlinapi.md
================================================
# GremlinAPI

Cayley Gremlin API was renamed to [Gizmo](gizmoapi.md) to avoid confusion with TinkerPop Gremlin API.



================================================
FILE: docs/hacking.md
================================================
# HACKING

See [Contributing.md](contributing.md)



================================================
FILE: docs/http.md
================================================
# HTTP Methods

This file covers deprecated v1 HTTP API. All the methods of v2 HTTP API is described in OpenAPI/Swagger [spec](https://github.com/cayleygraph/cayley/tree/87c9c341848b59924a054ebc2dd0f2bf8c57c6a9/docs/api/swagger.yml) and can be viewed by importing `https://raw.githubusercontent.com/cayleygraph/cayley/master/docs/api/swagger.yml` URL into [Swagger Editor](https://editor.swagger.io/) or [Swagger UI demo](http://petstore.swagger.io/).

## Gephi

Cayley supports streaming to Gephi via [GraphStream](gephigraphstream.md).

## API v1

Unless otherwise noted, all URIs take a POST command.

### Queries and Results

#### `/api/v1/query/gizmo`

POST Body: Javascript source code of the query

Response: JSON results, depending on the query.

#### `/api/v1/query/graphql`

POST Body: [GraphQL](graphql.md) query

Response: JSON results, depending on the query.

#### `/api/v1/query/mql`

POST Body: JSON MQL query

Response: JSON results, with a query wrapper:

```javascript
{
    "result": <JSON Result set>
}
```

If the JSON is invalid or an error occurs:

```javascript
{
    "error": "Error message"
}
```

### Query Shapes

Result form:

```javascript
{
    "nodes": [{
        "id" : integer,
        "tags": ["list of tags from the query"],
        "values": ["known values from the query"],
        "is_link_node": bool,  // Does the node represent the link or the node (the oval shapes)
        "is_fixed": bool  // Is the node a fixed starting point of the query
    }],

    "links": [{
        "source": integer,  // Node ID
        "target": integer,  // Node ID
        "link_node": integer  // Node ID
    }]
}
```

#### `/api/v1/shape/gizmo`

POST Body: Javascript source code of the query

Response: JSON description of the last query executed.

#### `/api/v1/shape/mql`

POST Body: JSON MQL query

Response: JSON description of the query.

### Write commands

Responses come in the form

200 Success:

```javascript
{
    "result": "Success message."
}
```

400 / 500 Error:

```javascript
{
    "error": "Error message."
}
```

#### `/api/v1/write`

POST Body: JSON quads

```javascript
[{
    "subject": "Subject Node",
    "predicate": "Predicate Node",
    "object": "Object node",
    "label": "Label node"  // Optional
}]   // More than one quad allowed.
```

Response: JSON response message

#### `/api/v1/write/file/nquad`

POST Body: Form-encoded body:

* Key: `NQuadFile`, Value: N-Quad file to write.

Response: JSON response message

Example:

```text
curl http://localhost:64210/api/v1/write/file/nquad -F NQuadFile=@30k.n3
```

#### `/api/v1/delete`

POST Body: JSON quads

```javascript
[{
    "subject": "Subject Node",
    "predicate": "Predicate Node",
    "object": "Object node",
    "label": "Label node"  // Optional
}]   // More than one quad allowed.
```

Response: JSON response message.



================================================
FILE: docs/installation.md
================================================
# Install Cayley

## Install Cayley on Ubuntu

```text
snap install --edge --devmode cayley
```

## Install Cayley on macOS

### Install Homebrew

macOS does not include the Homebrew brew package by default. Install brew using the [official instructions](https://brew.sh/#install)

### Install Cayley

```bash
brew install cayley
```

## Install Cayley with Docker

```bash
docker run -p 64210:64210 cayleygraph/cayley
```

For more information see [Container Documentation](deployment/container.md)

## Build from Source

See instructions in [Contributing](getting-involved/contributing.md)



================================================
FILE: docs/k8s/README.md
================================================
# k8s



================================================
FILE: docs/k8s/cayley-mongo.yml
================================================
kind: Namespace
apiVersion: v1
metadata:
  name: cayley
---
apiVersion: v1
kind: Service
metadata:
  name: mongo
  namespace: cayley
  labels:
    name: mongo
spec:
  ports:
  - name: mgo
    port: 27017
    targetPort: mgo
  clusterIP: None
  selector:
    role: mongo
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: mongo
  namespace: cayley
spec:
  serviceName: "mongo"
  replicas: 3
  template:
    metadata:
      namespace: cayley
      labels:
        role: mongo
        environment: test
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        - name: mongo
          image: mongo:3
          command:
            - mongod
            - "--replSet"
            - rs0
            - "--smallfiles"
            - "--noprealloc"
          ports:
            - name: mgo
              containerPort: 27017
          volumeMounts:
            - name: mongo-pvc
              mountPath: /data/db
        - name: mongo-sidecar
          image: cvallance/mongo-k8s-sidecar
          env:
            - name: MONGO_SIDECAR_POD_LABELS
              value: "role=mongo,environment=test"
  volumeClaimTemplates:
  - metadata:
      name: mongo-pvc
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: standard
      resources:
        requests:
          storage: 20Gi
---
kind: Service
apiVersion: v1
metadata:
  name: cayley
  namespace: cayley
spec:
  selector:
    app: cayley
  ports:
  - protocol: TCP
    port: 80
    targetPort: http
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: cayley
  namespace: cayley
spec:
  replicas: 1
  template:
    metadata:
      namespace: cayley
      labels:
        app: cayley
    spec:
      initContainers:
      - name: cayley-init
        image: ghcr.io/cayleygraph/cayley:v0.7.8
        command:
        - cayley
        - init
        - -d=mongo
        - -a=mongo
      containers:
      - name: cayley
        image: ghcr.io/cayleygraph/cayley:v0.7.8
        command:
        - cayley
        - http
        - --init # TODO: remove once initContainers works properly
        - -d=mongo
        - -a=mongo
        - --host=:64210
        ports:
        - name: http
          containerPort: 64210

================================================
FILE: docs/k8s/cayley-single.yml
================================================
kind: Namespace
apiVersion: v1
metadata:
  name: cayley
---
kind: Service
apiVersion: v1
metadata:
  name: cayley
  namespace: cayley
spec:
  selector:
    app: cayley
  ports:
  - protocol: TCP
    port: 80
    targetPort: http
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: cayley-pvc
  namespace: cayley
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
  storageClassName: standard
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: cayley
  namespace: cayley
spec:
  replicas: 1 # cannot be really scaled because of local backend
  template:
    metadata:
      namespace: cayley
      labels:
        app: cayley
    spec:
      initContainers:
      - name: cayley-init
        image: ghcr.io/cayleygraph/cayley:v0.7.8
        command:
        - cayley
        - init
        - -c=/etc/cayley.json
        volumeMounts:
        - mountPath: /data
          name: database
      containers:
      - name: cayley
        image: ghcr.io/cayleygraph/cayley:v0.7.8
        command:
        - cayley
        - http
        - --init # TODO: remove once initContainers is out of beta
        - -c=/etc/cayley.json
        - --host=:64210
        ports:
        - name: http
          containerPort: 64210
        volumeMounts:
        - mountPath: /data
          name: database
      volumes:
      - name: database
        persistentVolumeClaim:
          claimName: cayley-pvc


================================================
FILE: docs/k8s/k8s.md
================================================
# Running in Kubernetes

Most examples requires Kubernetes 1.5+ and PersistentVolumes are configured.

After running scripts namespace `cayley` will be created and service with the same name will be available in cluster. Service is of type `ClusterIP` by default. If you want to expose it, consider changing type to `LoadBalancer`.

## Single instance \(Bolt\)

This is a simplest possible configuration: single Cayley instance with persistent storage, using Bolt as a backend.

```bash
kubectl create -f ./docs/k8s/cayley-single.yml
```

## Distributed \(MongoDB cluster\)

This example is based on [thesandlord/mongo-k8s-sidecar](https://github.com/thesandlord/mongo-k8s-sidecar) and runs Cayley on top of 3-node Mongo cluster.

```bash
kubectl create -f ./docs/k8s/cayley-mongo.yml
```

## Distributed

_TODO: PostgreSQL, CockroachDB_



================================================
FILE: docs/locations.md
================================================
# Locations of parts of Cayley

## Community

* Where is the beating heart of this community?  [https://discourse.cayley.io/](https://discourse.cayley.io/)
* Where is the mailing list?  [https://discourse.cayley.io/](https://discourse.cayley.io/) \(enable mailing list mode under options\)
* Where is the chat room? [cayleygraph.slack.com](https://cayleygraph.slack.com) -- Invite [here](https://cayley-slackin.herokuapp.com/)
* Where should I start contributing? [Contributing.md](contributing.md) \(Also: [How to get involved!](https://discourse.cayley.io/t/how-to-get-involved/44)\)
* Where is the site-content? [https://github.com/cayleygraph/site-content](https://github.com/cayleygraph/site-content)
* Where are issues? [https://github.com/cayleygraph/cayley/issues](https://github.com/cayleygraph/cayley/issues)
* Where is the graph source code? [https://github.com/cayleygraph/cayley](https://github.com/cayleygraph/cayley)
* Where are pull requests? [https://github.com/cayleygraph/cayley/pulls](https://github.com/cayleygraph/cayley/pulls)
* Where is the wiki?  It was at [https://github.com/cayleygraph/cayley/wiki](https://github.com/cayleygraph/cayley/wiki), but we are deprecating it.
* Where is the \(old\) mailing list?  It was at [https://groups.google.com/forum/\#!forum/cayley-users](https://groups.google.com/forum/#!forum/cayley-users), but we are deprecating it for this forum \(and its mailing list mode\).



================================================
FILE: docs/migration.md
================================================
# Migration

## From Cayley 0.6.1 to 0.7.x

First you need to dump all the data from the database via v0.6.1:

```bash
./cayley-0.6 dump --db <backend> --dbpath <address> --dump_type pquads --dump ./data.pq.gz
```

or using config file:

```bash
./cayley-0.6 dump --config <config> --dump_type pquads --dump ./data.pq.gz
```

And load the data into new database via v0.7.x \(`pq` file extension is important\):

```bash
./cayley load --init -d <new-backend> -a <new-address> -i ./data.pq.gz
```

or using config file:

```bash
./cayley load --init -c <new-config> -i ./data.pq.gz
```

### Dump via text format

An above guide uses Cayley-specific binary format to avoid encoding and parsing overhead and to compress output file better.

As an alternative, a standard nquads file format can be used to dump and load data \(note `nq` extension\):

```bash
./cayley-0.6 dump --config <config> --dump ./data.nq.gz
./cayley load --init -c <new-config> -i ./data.nq.gz
```

### Bolt, LevelDB, MongoDB

Cayley v0.7.0 is still able to read and write databases of these types in old format. It can be accessed by changing backend name from `bolt`/`leveldb`/`mongo` to `bolt1`/`leveldb1`/`mongo1`. Thus, you can use guide for moving data between different backends for v0.7.x \(see below\).

**Note:** support for old versions will be dropped starting from v0.7.1.

### SQL

Data format for SQL between v0.6.1 and v0.7.x has not changed significantly. Database can be upgraded by executing the following SQL statements:

```sql
ALTER TABLE quads DROP id;
ALTER TABLE nodes ADD refs INT DEFAULT 0 NOT NULL;
ALTER TABLE nodes ALTER COLUMN refs DROP DEFAULT;
UPDATE nodes SET refs = 
  (SELECT count(1) FROM quads WHERE subject_hash = nodes.hash) +
  (SELECT count(1) FROM quads WHERE predicate_hash = nodes.hash) +
  (SELECT count(1) FROM quads WHERE object_hash = nodes.hash) +
  (SELECT count(1) FROM quads WHERE label_hash = nodes.hash);
```

## From different backend \(Cayley 0.7+\)

First you need to dump all the data from old backend \(`pq` extension is important\):

```bash
./cayley dump -d <backend> -a <address> -o ./data.pq.gz
```

or using config file:

```bash
./cayley dump -c <config> -o ./data.pq.gz
```

And load the data into a new backend and/or database:

```bash
./cayley load --init -d <new-backend> -a <new-address> -i ./data.pq.gz
```

or using config file:

```bash
./cayley load --init -c <new-config> -i ./data.pq.gz
```

### Dump via text format

An above guide uses Cayley-specific binary format to avoid encoding and parsing overhead and to compress output file better.

As an alternative, a standard nquads file format can be used to dump and load data \(note `nq` extension\):

```bash
./cayley dump -c <config> -o ./data.nq.gz
./cayley load --init -c <new-config> -i ./data.nq.gz
```



================================================
FILE: docs/mql.md
================================================
# MQL Guide

## General

Cayley's MQL implementation is a work-in-progress clone of [Freebase's MQL API](https://developers.google.com/freebase/mql/). At the moment, it supports very basic queries without some of the extended features. It also aims to be database-agnostic, meaning that the schema inference from Freebase does not \(yet\) apply.

Every JSON Object can be thought of as a node in the graph, and wrapping an object in a list means there may be several of these, or it may be repeated. A simple query like:

```javascript
[{
  "id": null
}]
```

Is equivalent to all nodes in the graph, where "id" is the special keyword for the value of the node.

Predicates are added to the object to specify constraints.

```javascript
[{
  "id": null,
  "some_predicate": "some value"
}]
```

Predicates can take as values objects or lists of objects \(subqueries\), strings and numbers \(literal IDs that must match -- equivalent to the object {"id": "value"}\) or null, which indicates that, while the object must have a predicate that matches, the matching values will replace the null. A single null is one such value, an empty list will be filled with all such values, as strings.

## Keywords

* `id`: The value of the node.

## Reverse Predicates

Predicates always assume a forward direction. That is,

```javascript
[{
  "id": "A",
  "some_predicate": "B"
}]
```

will only match if the quad

```text
A some_predicate B .
```

exists. In order to reverse the directions, "!predicates" are used. So that:

```javascript
[{
  "id": "A",
  "!some_predicate": "B"
}]
```

will only match if the quad

```text
B some_predicate A .
```

exists.

## Multiple Predicates

JSON does not specify the behavior of objects with the same key. In order to have separate constraints for the same predicate, the prefix "@name:" can be applied to any predicate. This is slightly different from traditional MQL in that fully-qualified http paths may be common predicates, so we have an "@name:" prefix instead.

```javascript
[{
  "id": "A",
  "@x:some_predicate": "B",
  "@y:some_predicate": "C"

}]
```

Will only match if _both_

```text
A some_predicate B .
A some_predicate C .
```

exist.

This combines with the reversal rule to create paths like `"@a:!some_predicate"`



================================================
FILE: docs/query-languages/gephigraphstream.md
================================================
# Gephi GraphStream

Cayley supports graph visualisation in Gephi using GraphStream API.

Enpoint can be accessed by adding URL `http://localhost:64210/gephi/gs` to Gephi GraphStream client.

## Options

### `limit`

Default: `10000`

Sets a maximal number of object that will be streamed. Depending on stream mode this could be either nodes or quads.

Values less than 0 interpreted as "no limit".

### `mode`

Sets streaming mode. Supported values:

* `raw` \(default\) - all or selected quads
* `nodes` - nodes with properties

#### Raw mode

In this mode Cayley directly streams selected 
Download .txt
gitextract_q4kowbxs/

├── .dockerignore
├── .gitbook.yaml
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   └── workflows/
│       └── build-and-release.yml
├── .gitignore
├── .goreleaser.yml
├── AUTHORS
├── CODEOWNERS
├── CONTRIBUTORS
├── Dockerfile
├── LICENSE
├── README.md
├── cayley_example.yml
├── client/
│   └── client.go
├── clog/
│   ├── clog.go
│   └── glog/
│       └── glog.go
├── cmd/
│   ├── cayley/
│   │   ├── cayley.go
│   │   └── command/
│   │       ├── convert.go
│   │       ├── database.go
│   │       ├── dedup.go
│   │       ├── dump.go
│   │       ├── health.go
│   │       ├── http.go
│   │       ├── repl.go
│   │       └── schema.go
│   ├── cayleyexport/
│   │   ├── cayleyexport.go
│   │   └── cayleyexport_test.go
│   ├── cayleyimport/
│   │   ├── cayleyimport.go
│   │   └── cayleyimport_test.go
│   ├── docgen/
│   │   └── docgen.go
│   └── download_ui/
│       └── download_ui.go
├── configurations/
│   ├── default.json
│   └── persisted.json
├── data/
│   ├── 30kmoviedata_gephi_meta.nq
│   ├── people.jsonld
│   ├── testdata.nq
│   └── testdata_multigraph.nq
├── docs/
│   ├── 3rd-party-apis.md
│   ├── GizmoAPI.md.in
│   ├── README.md
│   ├── SUMMARY.md
│   ├── advanced-use.md
│   ├── api/
│   │   └── swagger.yml
│   ├── cayleyexport.md
│   ├── cayleyimport.md
│   ├── configuration.md
│   ├── container.md
│   ├── contributing.md
│   ├── convert-linked-data-files.md
│   ├── deployment/
│   │   ├── container.md
│   │   └── k8s-1.md
│   ├── docker-compose/
│   │   └── docker-compose.mongo.yml
│   ├── faq.md
│   ├── gephigraphstream.md
│   ├── getting-involved/
│   │   ├── contributing.md
│   │   ├── glossary.md
│   │   ├── locations.md
│   │   └── todo.md
│   ├── getting-started.md
│   ├── gizmoapi.md
│   ├── glossary.md
│   ├── graphql.md
│   ├── gremlinapi.md
│   ├── hacking.md
│   ├── http.md
│   ├── installation.md
│   ├── k8s/
│   │   ├── README.md
│   │   ├── cayley-mongo.yml
│   │   ├── cayley-single.yml
│   │   └── k8s.md
│   ├── locations.md
│   ├── migration.md
│   ├── mql.md
│   ├── query-languages/
│   │   ├── gephigraphstream.md
│   │   ├── gizmoapi.md
│   │   ├── graphql.md
│   │   └── mql.md
│   ├── quickstart-as-application.md
│   ├── quickstart-as-lib.md
│   ├── todo.md
│   ├── tools/
│   │   └── convert-linked-data-files.md
│   ├── ui-overview.md
│   └── usage/
│       ├── 3rd-party-apis.md
│       ├── advanced-use.md
│       ├── http.md
│       ├── migration.md
│       ├── quickstart-as-lib.md
│       └── ui-overview.md
├── examples/
│   ├── README.md
│   ├── hello_bolt/
│   │   └── main.go
│   ├── hello_schema/
│   │   └── main.go
│   ├── hello_world/
│   │   └── main.go
│   └── transaction/
│       └── main.go
├── go.mod
├── go.sum
├── gogen.go
├── graph/
│   ├── all/
│   │   ├── all.go
│   │   └── all_cgo.go
│   ├── gaedatastore/
│   │   ├── config.go
│   │   ├── iterator.go
│   │   ├── quadstore.go
│   │   └── quadstore_test.go
│   ├── graphmock/
│   │   └── graphmock.go
│   ├── graphtest/
│   │   ├── graphtest.go
│   │   ├── integration.go
│   │   └── testutil/
│   │       └── testutil.go
│   ├── hasa.go
│   ├── hasa_test.go
│   ├── http/
│   │   └── httpgraph.go
│   ├── iterator/
│   │   ├── and.go
│   │   ├── and_optimize.go
│   │   ├── and_optimize_test.go
│   │   ├── and_test.go
│   │   ├── count.go
│   │   ├── count_test.go
│   │   ├── fixed.go
│   │   ├── iterate.go
│   │   ├── iterator.go
│   │   ├── iterator_test.go
│   │   ├── limit.go
│   │   ├── limit_test.go
│   │   ├── materialize.go
│   │   ├── materialize_test.go
│   │   ├── misc.go
│   │   ├── not.go
│   │   ├── not_test.go
│   │   ├── or.go
│   │   ├── or_test.go
│   │   ├── recursive.go
│   │   ├── recursive_test.go
│   │   ├── regex.go
│   │   ├── resolver.go
│   │   ├── resolver_test.go
│   │   ├── save.go
│   │   ├── skip.go
│   │   ├── skip_test.go
│   │   ├── sort.go
│   │   ├── unique.go
│   │   ├── unique_test.go
│   │   ├── value_comparison.go
│   │   ├── value_comparison_test.go
│   │   └── value_filter.go
│   ├── kv/
│   │   ├── all/
│   │   │   └── all.go
│   │   ├── all_iterator.go
│   │   ├── badger/
│   │   │   ├── badger.go
│   │   │   └── badger_test.go
│   │   ├── bbolt/
│   │   │   ├── bolt.go
│   │   │   └── bolt_test.go
│   │   ├── bolt/
│   │   │   ├── bolt.go
│   │   │   └── bolt_test.go
│   │   ├── btree/
│   │   │   ├── btree.go
│   │   │   └── btree_test.go
│   │   ├── indexing.go
│   │   ├── indexing_test.go
│   │   ├── iterators.go
│   │   ├── kvtest/
│   │   │   └── kvtest.go
│   │   ├── leveldb/
│   │   │   ├── leveldb.go
│   │   │   └── leveldb_test.go
│   │   ├── metrics.go
│   │   ├── quad_iterator.go
│   │   ├── quadstore.go
│   │   ├── quadstore_test.go
│   │   └── registry.go
│   ├── linksto.go
│   ├── linksto_test.go
│   ├── log/
│   │   └── graphlog.go
│   ├── memstore/
│   │   ├── Makefile
│   │   ├── all_iterator.go
│   │   ├── gen.go
│   │   ├── iterator.go
│   │   ├── keys.go
│   │   ├── keys_test.go
│   │   ├── quadstore.go
│   │   └── quadstore_test.go
│   ├── nosql/
│   │   ├── all/
│   │   │   ├── all.go
│   │   │   └── all_test.go
│   │   ├── elastic/
│   │   │   └── elastic.go
│   │   ├── iterator.go
│   │   ├── mongo/
│   │   │   └── mongo.go
│   │   ├── nosqltest/
│   │   │   └── nosqltest.go
│   │   ├── ouch/
│   │   │   └── ouch.go
│   │   ├── quadstore.go
│   │   ├── shapes.go
│   │   └── value_test.go
│   ├── proto/
│   │   ├── primitive.pb.go
│   │   ├── primitive.proto
│   │   ├── primitive_helpers.go
│   │   ├── serializations.pb.go
│   │   ├── serializations.proto
│   │   └── serializations_helpers.go
│   ├── quadstore.go
│   ├── quadwriter.go
│   ├── quadwriter_test.go
│   ├── refs/
│   │   └── refs.go
│   ├── registry.go
│   ├── sql/
│   │   ├── cockroach/
│   │   │   ├── cockroach.go
│   │   │   └── cockroach_test.go
│   │   ├── database.go
│   │   ├── iterator.go
│   │   ├── mysql/
│   │   │   ├── mysql.go
│   │   │   └── mysql_test.go
│   │   ├── optimizer.go
│   │   ├── postgres/
│   │   │   ├── postgres.go
│   │   │   └── postgres_test.go
│   │   ├── quadstore.go
│   │   ├── shape.go
│   │   ├── shape_test.go
│   │   ├── sqlite/
│   │   │   ├── sqlite.go
│   │   │   └── sqlite_test.go
│   │   └── sqltest/
│   │       └── sqltest.go
│   ├── transaction.go
│   └── transaction_test.go
├── imports.go
├── inference/
│   ├── inference.go
│   └── inference_test.go
├── internal/
│   ├── decompressor/
│   │   ├── decompressor.go
│   │   └── decompressor_test.go
│   ├── dock/
│   │   └── dock.go
│   ├── gephi/
│   │   ├── stream.go
│   │   └── stream_test.go
│   ├── http/
│   │   ├── api_v1.go
│   │   ├── cors.go
│   │   ├── health.go
│   │   ├── http.go
│   │   ├── http_test.go
│   │   ├── logs.go
│   │   ├── query.go
│   │   └── write.go
│   ├── linkedql/
│   │   └── schema/
│   │       ├── schema.go
│   │       └── schema_test.go
│   ├── load.go
│   ├── lru/
│   │   ├── lru.go
│   │   └── lru_test.go
│   └── repl/
│       ├── repl.go
│       └── repl_test.go
├── query/
│   ├── gizmo/
│   │   ├── environ.go
│   │   ├── errors.go
│   │   ├── finals.go
│   │   ├── gizmo.go
│   │   ├── gizmo_test.go
│   │   └── traversals.go
│   ├── graphql/
│   │   ├── graphql.go
│   │   ├── graphql_test.go
│   │   └── http.go
│   ├── linkedql/
│   │   ├── entity_identfier.go
│   │   ├── errors.go
│   │   ├── graph_pattern.go
│   │   ├── iter_docs.go
│   │   ├── iter_tags.go
│   │   ├── iter_tags_test.go
│   │   ├── iter_values.go
│   │   ├── jsonld_util.go
│   │   ├── linkedql.go
│   │   ├── property_path.go
│   │   ├── registry.go
│   │   ├── registry_test.go
│   │   ├── step_types.go
│   │   ├── steps/
│   │   │   ├── as.go
│   │   │   ├── back.go
│   │   │   ├── both.go
│   │   │   ├── collect.go
│   │   │   ├── count.go
│   │   │   ├── difference.go
│   │   │   ├── greater_than.go
│   │   │   ├── greater_than_equals.go
│   │   │   ├── has.go
│   │   │   ├── has_reverse.go
│   │   │   ├── in.go
│   │   │   ├── intersect.go
│   │   │   ├── jsonld_util.go
│   │   │   ├── jsonld_util_test.go
│   │   │   ├── labels.go
│   │   │   ├── less_than.go
│   │   │   ├── less_than_equals.go
│   │   │   ├── like.go
│   │   │   ├── limit.go
│   │   │   ├── match.go
│   │   │   ├── match_test.go
│   │   │   ├── optional.go
│   │   │   ├── order.go
│   │   │   ├── out.go
│   │   │   ├── placeholder.go
│   │   │   ├── properties.go
│   │   │   ├── property_names.go
│   │   │   ├── property_names_as.go
│   │   │   ├── regexp.go
│   │   │   ├── reverse_properties.go
│   │   │   ├── reverse_property_names.go
│   │   │   ├── reverse_property_names_as.go
│   │   │   ├── skip.go
│   │   │   ├── steps_final.go
│   │   │   ├── steps_test.go
│   │   │   ├── test-cases/
│   │   │   │   ├── all-vertices.json
│   │   │   │   ├── back.json
│   │   │   │   ├── both.json
│   │   │   │   ├── collect.json
│   │   │   │   ├── count.json
│   │   │   │   ├── difference.json
│   │   │   │   ├── documents.json
│   │   │   │   ├── greater-than-equals.json
│   │   │   │   ├── greater-than.json
│   │   │   │   ├── has-reverse.json
│   │   │   │   ├── has.json
│   │   │   │   ├── intersect.json
│   │   │   │   ├── less-than-equals.json
│   │   │   │   ├── less-than.json
│   │   │   │   ├── like.json
│   │   │   │   ├── limit.json
│   │   │   │   ├── match-all.json
│   │   │   │   ├── match-exact.json
│   │   │   │   ├── optional.json
│   │   │   │   ├── order.json
│   │   │   │   ├── properties.json
│   │   │   │   ├── property-names-as.json
│   │   │   │   ├── property-names.json
│   │   │   │   ├── reg-exp.json
│   │   │   │   ├── reverse-properties.json
│   │   │   │   ├── reverse-property-names-as.json
│   │   │   │   ├── select-with-tags.json
│   │   │   │   ├── select.json
│   │   │   │   ├── skip.json
│   │   │   │   ├── union.json
│   │   │   │   ├── unique.json
│   │   │   │   ├── view-reverse.json
│   │   │   │   ├── view.json
│   │   │   │   └── where.json
│   │   │   ├── union.go
│   │   │   ├── unique.go
│   │   │   ├── vertex.go
│   │   │   ├── visit.go
│   │   │   ├── visit_reverse.go
│   │   │   └── where.go
│   │   └── voc_util.go
│   ├── mql/
│   │   ├── build_iterator.go
│   │   ├── fill.go
│   │   ├── mql_test.go
│   │   ├── query.go
│   │   └── session.go
│   ├── path/
│   │   ├── morphism_apply_functions.go
│   │   ├── path.go
│   │   ├── path_test.go
│   │   └── pathtest/
│   │       └── pathtest.go
│   ├── session.go
│   ├── sexp/
│   │   ├── parser.go
│   │   ├── parser_test.go
│   │   └── session.go
│   └── shape/
│       ├── path.go
│       ├── shape.go
│       └── shape_test.go
├── schema/
│   ├── loader.go
│   ├── loader_test.go
│   ├── namespaces.go
│   ├── namespaces_test.go
│   ├── schema.go
│   ├── schema_test.go
│   ├── types.go
│   ├── writer.go
│   └── writer_test.go
├── server/
│   └── http/
│       ├── accept.go
│       ├── api_v2.go
│       ├── api_v2_test.go
│       └── common.go
├── ui/
│   ├── embed.go
│   └── web/
│       ├── asset-manifest.json
│       ├── gizmo.d.ts
│       ├── index.html
│       ├── manifest.json
│       ├── precache-manifest.5316e0e4a35813e95b82d4799f1bb55c.js
│       ├── robots.txt
│       ├── service-worker.js
│       └── static/
│           ├── css/
│           │   ├── 2.6b51f286.chunk.css
│           │   └── main.72fe53e6.chunk.css
│           └── js/
│               ├── 2.7d84b3fa.chunk.js
│               ├── main.84d3ab8c.chunk.js
│               └── runtime-main.0686c6e7.js
├── version/
│   └── version.go
├── vet.sh
└── writer/
    └── single.go
Download .txt
Showing preview only (311K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3687 symbols across 249 files)

FILE: client/client.go
  function New (line 13) | func New(addr string) *Client {
  type Client (line 20) | type Client struct
    method SetHTTPClient (line 25) | func (c *Client) SetHTTPClient(cli *http.Client) {
    method url (line 28) | func (c *Client) url(s string, q map[string]string) string {
    method QuadReader (line 48) | func (c *Client) QuadReader() (quad.ReadCloser, error) {
    method QuadWriter (line 76) | func (c *Client) QuadWriter() (quad.WriteCloser, error) {
  type errRequestFailed (line 40) | type errRequestFailed struct
    method Error (line 45) | func (e errRequestFailed) Error() string {
  type funcCloser (line 64) | type funcCloser struct
    method Close (line 69) | func (c funcCloser) Close() error {

FILE: clog/clog.go
  type Logger (line 21) | type Logger interface
  function SetLogger (line 35) | func SetLogger(l Logger) { logger = l }
  function V (line 40) | func V(level int) bool {
  function SetV (line 48) | func SetV(level int) {
  function Infof (line 55) | func Infof(format string, args ...interface{}) {
  function Warningf (line 62) | func Warningf(format string, args ...interface{}) {
  function Errorf (line 69) | func Errorf(format string, args ...interface{}) {
  function Fatalf (line 76) | func Fatalf(format string, args ...interface{}) {
  type stdlog (line 83) | type stdlog struct
    method Infof (line 87) | func (stdlog) Infof(format string, args ...interface{})    { log.Print...
    method Warningf (line 88) | func (stdlog) Warningf(format string, args ...interface{}) { log.Print...
    method Errorf (line 89) | func (stdlog) Errorf(format string, args ...interface{})   { log.Print...
    method Fatalf (line 90) | func (stdlog) Fatalf(format string, args ...interface{})   { log.Fatal...
    method V (line 91) | func (s stdlog) V(level int) bool                          { return s....
    method SetV (line 92) | func (s *stdlog) SetV(level int)                           { s.verbosi...

FILE: clog/glog/glog.go
  function init (line 10) | func init() {
  type Logger (line 14) | type Logger struct
    method Infof (line 16) | func (Logger) Infof(format string, args ...interface{}) {
    method Warningf (line 19) | func (Logger) Warningf(format string, args ...interface{}) {
    method Errorf (line 22) | func (Logger) Errorf(format string, args ...interface{}) {
    method Fatalf (line 25) | func (Logger) Fatalf(format string, args ...interface{}) {
    method V (line 29) | func (Logger) V(level int) bool {
    method SetV (line 33) | func (Logger) SetV(v int) {

FILE: cmd/cayley/cayley.go
  type pFlag (line 117) | type pFlag struct
    method Type (line 121) | func (pFlag) Type() string { return "string" }
  function init (line 123) | func init() {
  function main (line 208) | func main() {

FILE: cmd/cayley/command/convert.go
  function newLazyReader (line 15) | func newLazyReader(open func() (quad.ReadCloser, error)) quad.ReadCloser {
  type lazyReader (line 19) | type lazyReader struct
    method ReadQuad (line 24) | func (r *lazyReader) ReadQuad() (quad.Quad, error) {
    method Close (line 34) | func (r *lazyReader) Close() (err error) {
  type multiReader (line 41) | type multiReader struct
    method ReadQuad (line 46) | func (r *multiReader) ReadQuad() (quad.Quad, error) {
    method Close (line 61) | func (r *multiReader) Close() error {
  function NewConvertCmd (line 73) | func NewConvertCmd() *cobra.Command {

FILE: cmd/cayley/command/database.go
  constant KeyBackend (line 23) | KeyBackend  = "store.backend"
  constant KeyAddress (line 24) | KeyAddress  = "store.address"
  constant KeyPath (line 25) | KeyPath     = "store.path"
  constant KeyReadOnly (line 26) | KeyReadOnly = "store.read_only"
  constant KeyOptions (line 27) | KeyOptions  = "store.options"
  constant KeyLoadBatch (line 29) | KeyLoadBatch = "load.batch"
  constant flagLoad (line 33) | flagLoad       = "load"
  constant flagLoadFormat (line 34) | flagLoadFormat = "load_format"
  constant flagDump (line 35) | flagDump       = "dump"
  constant flagDumpFormat (line 36) | flagDumpFormat = "dump_format"
  function registerLoadFlags (line 41) | func registerLoadFlags(cmd *cobra.Command) {
  function registerDumpFlags (line 54) | func registerDumpFlags(cmd *cobra.Command) {
  function NewInitDatabaseCmd (line 66) | func NewInitDatabaseCmd() *cobra.Command {
  function NewLoadDatabaseCmd (line 86) | func NewLoadDatabaseCmd() *cobra.Command {
  function NewDumpDatabaseCmd (line 141) | func NewDumpDatabaseCmd() *cobra.Command {
  function NewUpgradeCmd (line 168) | func NewUpgradeCmd() *cobra.Command {
  function printBackendInfo (line 187) | func printBackendInfo() {
  function initDatabase (line 196) | func initDatabase() error {
  function openDatabase (line 203) | func openDatabase() (*graph.Handle, error) {
  function openForQueries (line 218) | func openForQueries(cmd *cobra.Command) (*graph.Handle, error) {
  type profileData (line 268) | type profileData struct
  function mustSetupProfile (line 273) | func mustSetupProfile(cmd *cobra.Command) profileData {
  function mustFinishProfile (line 291) | func mustFinishProfile(p profileData) {

FILE: cmd/cayley/command/dedup.go
  function iriFlag (line 23) | func iriFlag(s string, err error) (quad.IRI, error) {
  function NewDedupCommand (line 30) | func NewDedupCommand() *cobra.Command {
  function valueLess (line 56) | func valueLess(a, b graph.Ref) bool {
  type sortVals (line 62) | type sortVals
    method Len (line 64) | func (a sortVals) Len() int           { return len(a) }
    method Less (line 65) | func (a sortVals) Less(i, j int) bool { return valueLess(a[i], a[j]) }
    method Swap (line 66) | func (a sortVals) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
  type sortProp (line 68) | type sortProp
    method Len (line 70) | func (a sortProp) Len() int           { return len(a) }
    method Less (line 71) | func (a sortProp) Less(i, j int) bool { return valueLess(a[i].Pred, a[...
    method Swap (line 72) | func (a sortProp) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
  function hashProperties (line 74) | func hashProperties(h hash.Hash, m map[interface{}]property) string {
  type property (line 97) | type property struct
  function dedupProperties (line 102) | func dedupProperties(ctx context.Context, h *graph.Handle, pred, typ qua...
  function dedupValueTx (line 189) | func dedupValueTx(ctx context.Context, h *graph.Handle, tx *graph.Transa...

FILE: cmd/cayley/command/dump.go
  function writerQuadsTo (line 16) | func writerQuadsTo(path string, typ string, qr quad.Reader) error {
  function dumpDatabase (line 69) | func dumpDatabase(h *graph.Handle, path string, typ string) error {

FILE: cmd/cayley/command/health.go
  constant defaultAddress (line 11) | defaultAddress = "http://localhost:64210/"
  function NewHealthCmd (line 13) | func NewHealthCmd() *cobra.Command {

FILE: cmd/cayley/command/http.go
  function NewHTTPCmd (line 15) | func NewHTTPCmd() *cobra.Command {

FILE: cmd/cayley/command/repl.go
  constant keyQueryTimeout (line 22) | keyQueryTimeout = "query.timeout"
  function getContext (line 25) | func getContext() (context.Context, func()) {
  function registerQueryFlags (line 40) | func registerQueryFlags(cmd *cobra.Command) {
  function NewReplCmd (line 49) | func NewReplCmd() *cobra.Command {
  function NewQueryCmd (line 76) | func NewQueryCmd() *cobra.Command {

FILE: cmd/cayley/command/schema.go
  function NewSchemaCommand (line 13) | func NewSchemaCommand() *cobra.Command {
  function NewLinkedQLSchemaCommand (line 24) | func NewLinkedQLSchemaCommand() *cobra.Command {

FILE: cmd/cayleyexport/cayleyexport.go
  constant defaultFormat (line 19) | defaultFormat = "jsonld"
  function NewCmd (line 22) | func NewCmd() *cobra.Command {
  function main (line 85) | func main() {
  function formatByFileName (line 92) | func formatByFileName(fileName string) *quad.Format {

FILE: cmd/cayleyexport/cayleyexport_test.go
  function serializeTestData (line 28) | func serializeTestData() string {
  function TestCayleyExport (line 36) | func TestCayleyExport(t *testing.T) {

FILE: cmd/cayleyimport/cayleyimport.go
  constant defaultFormat (line 23) | defaultFormat = "jsonld"
  function NewCmd (line 26) | func NewCmd() *cobra.Command {
  function main (line 102) | func main() {
  function hasIn (line 109) | func hasIn(in io.Reader) bool {
  function formatByFileName (line 117) | func formatByFileName(fileName string) *quad.Format {

FILE: cmd/cayleyimport/cayleyimport_test.go
  function allQuads (line 30) | func allQuads(t testing.TB, qs graph.QuadStore) []quad.Quad {
  function TestCayleyImport (line 46) | func TestCayleyImport(t *testing.T) {

FILE: cmd/docgen/docgen.go
  constant placeholder (line 25) | placeholder = `#AUTOGENERATED#`
  function main (line 27) | func main() {
  function writeDocs (line 69) | func writeDocs(w io.Writer, dp *doc.Package) {
  function Signature (line 110) | func Signature(m *doc.Func) string {
  function isExported (line 133) | func isExported(s string) bool {
  function isJsArgs (line 137) | func isJsArgs(f *ast.FieldList) bool {
  function funcDocs (line 154) | func funcDocs(s string) string {

FILE: cmd/download_ui/download_ui.go
  constant version (line 15) | version       = "v0.8.0"
  constant fileURL (line 16) | fileURL       = "https://github.com/cayleygraph/web/releases/download/" ...
  constant fileName (line 17) | fileName      = "web.zip"
  constant directoryName (line 18) | directoryName = "ui/web"
  function main (line 21) | func main() {
  function DownloadFile (line 43) | func DownloadFile(filepath string, url string) error {
  function Unzip (line 70) | func Unzip(src string, dest string) error {

FILE: examples/hello_bolt/main.go
  function main (line 16) | func main() {

FILE: examples/hello_schema/main.go
  type Person (line 22) | type Person struct
  type Coords (line 31) | type Coords struct
  function checkErr (line 38) | func checkErr(err error) {
  function main (line 44) | func main() {

FILE: examples/hello_world/main.go
  function main (line 11) | func main() {

FILE: examples/transaction/main.go
  function main (line 11) | func main() {

FILE: graph/gaedatastore/config.go
  type Config (line 26) | type Config struct
    method UnmarshalJSON (line 52) | func (c *Config) UnmarshalJSON(data []byte) error {
    method MarshalJSON (line 73) | func (c *Config) MarshalJSON() ([]byte, error) {
  type config (line 39) | type config struct
  type duration (line 90) | type duration
    method UnmarshalJSON (line 96) | func (d *duration) UnmarshalJSON(data []byte) error {
    method MarshalJSON (line 119) | func (d *duration) MarshalJSON() ([]byte, error) {
  function LoadConf (line 125) | func LoadConf(file string) (*Config, error) {

FILE: graph/gaedatastore/iterator.go
  constant bufferSize (line 33) | bufferSize = 50
  type Iterator (line 36) | type Iterator struct
    method Iterate (line 45) | func (it *Iterator) Iterate() iterator.Scanner {
    method Lookup (line 52) | func (it *Iterator) Lookup() iterator.Index {
    method SubIterators (line 83) | func (it *Iterator) SubIterators() []iterator.Shape {
    method Sorted (line 87) | func (it *Iterator) Sorted() bool                                     ...
    method Optimize (line 88) | func (it *Iterator) Optimize(ctx context.Context) (iterator.Shape, boo...
    method String (line 89) | func (it *Iterator) String() string {
    method getSize (line 102) | func (it *Iterator) getSize(ctx context.Context) (refs.Size, error) {
    method Stats (line 138) | func (it *Iterator) Stats(ctx context.Context) (iterator.Costs, error) {
  method newIterator (line 59) | func (qs *QuadStore) newIterator(k string, d quad.Direction, val graph.R...
  method newAllIterator (line 73) | func (qs *QuadStore) newAllIterator(kind string) *Iterator {
  type iteratorNext (line 148) | type iteratorNext struct
    method Close (line 213) | func (it *iteratorNext) Close() error {
    method TagResults (line 222) | func (it *iteratorNext) TagResults(dst map[string]graph.Ref) {}
    method NextPath (line 224) | func (it *iteratorNext) NextPath(ctx context.Context) bool {
    method Result (line 228) | func (it *iteratorNext) Result() graph.Ref {
    method Next (line 232) | func (it *iteratorNext) Next(ctx context.Context) bool {
    method Err (line 306) | func (it *iteratorNext) Err() error {
    method Sorted (line 310) | func (it *iteratorNext) Sorted() bool { return false }
    method String (line 311) | func (it *iteratorNext) String() string {
  function newIteratorNext (line 163) | func newIteratorNext(qs *QuadStore, k string, d quad.Direction, t *Token...
  function newAllIteratorNext (line 196) | func newAllIteratorNext(qs *QuadStore, kind string) *iteratorNext {
  type iteratorContains (line 315) | type iteratorContains struct
    method Close (line 377) | func (it *iteratorContains) Close() error {
    method Contains (line 383) | func (it *iteratorContains) Contains(ctx context.Context, v graph.Ref)...
    method TagResults (line 417) | func (it *iteratorContains) TagResults(dst map[string]graph.Ref) {}
    method NextPath (line 419) | func (it *iteratorContains) NextPath(ctx context.Context) bool {
    method Result (line 423) | func (it *iteratorContains) Result() graph.Ref {
    method Err (line 427) | func (it *iteratorContains) Err() error {
    method Sorted (line 431) | func (it *iteratorContains) Sorted() bool { return false }
    method String (line 432) | func (it *iteratorContains) String() string {
  function newIteratorContains (line 327) | func newIteratorContains(qs *QuadStore, k string, d quad.Direction, t *T...
  function newAllIteratorContains (line 360) | func newAllIteratorContains(qs *QuadStore, kind string) *iteratorContains {

FILE: graph/gaedatastore/quadstore.go
  constant QuadStoreType (line 39) | QuadStoreType = "gaedatastore"
  constant quadKind (line 40) | quadKind      = "quad"
  constant nodeKind (line 41) | nodeKind      = "node"
  type QuadStore (line 49) | type QuadStore struct
    method createKeyForQuad (line 105) | func (qs *QuadStore) createKeyForQuad(q quad.Quad) *datastore.Key {
    method createKeyForNode (line 117) | func (qs *QuadStore) createKeyForNode(n quad.Value) *datastore.Key {
    method createKeyForMetadata (line 122) | func (qs *QuadStore) createKeyForMetadata() *datastore.Key {
    method createKeyForLog (line 126) | func (qs *QuadStore) createKeyForLog() *datastore.Key {
    method createKeyFromToken (line 130) | func (qs *QuadStore) createKeyFromToken(t *Token) *datastore.Key {
    method checkValid (line 134) | func (qs *QuadStore) checkValid(k *datastore.Key) (bool, error) {
    method ForRequest (line 164) | func (qs *QuadStore) ForRequest(r *http.Request) (graph.QuadStore, err...
    method NewQuadWriter (line 168) | func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error) {
    method ApplyDeltas (line 208) | func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreOpts graph.Ig...
    method updateNodes (line 281) | func (qs *QuadStore) updateNodes(in []graph.Delta) (int64, error) {
    method updateQuads (line 341) | func (qs *QuadStore) updateQuads(in []graph.Delta, ids []int64) (int64...
    method updateMetadata (line 382) | func (qs *QuadStore) updateMetadata(quadsAdded int64, nodesAdded int64...
    method updateLog (line 402) | func (qs *QuadStore) updateLog(in []graph.Delta) ([]int64, error) {
    method QuadIterator (line 441) | func (qs *QuadStore) QuadIterator(dir quad.Direction, v graph.Ref) ite...
    method NodesAllIterator (line 445) | func (qs *QuadStore) NodesAllIterator() iterator.Shape {
    method QuadsAllIterator (line 449) | func (qs *QuadStore) QuadsAllIterator() iterator.Shape {
    method ValueOf (line 453) | func (qs *QuadStore) ValueOf(s quad.Value) (graph.Ref, error) {
    method NameOf (line 458) | func (qs *QuadStore) NameOf(val graph.Ref) (quad.Value, error) {
    method Quad (line 481) | func (qs *QuadStore) Quad(val graph.Ref) (quad.Quad, error) {
    method Stats (line 512) | func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Sta...
    method QuadIteratorSize (line 534) | func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Dire...
    method Close (line 550) | func (qs *QuadStore) Close() error {
    method QuadDirection (line 555) | func (qs *QuadStore) QuadDirection(val graph.Ref, dir quad.Direction) ...
  type MetadataEntry (line 53) | type MetadataEntry struct
  type Token (line 58) | type Token struct
    method IsNode (line 63) | func (t Token) IsNode() bool     { return t.Kind == nodeKind }
    method Key (line 64) | func (t Token) Key() interface{} { return t }
  type QuadEntry (line 66) | type QuadEntry struct
  type NodeEntry (line 76) | type NodeEntry struct
  type LogEntry (line 81) | type LogEntry struct
  function init (line 87) | func init() {
  function initQuadStore (line 96) | func initQuadStore(_ string, _ graph.Options) error {
  function newQuadStore (line 101) | func newQuadStore(_ string, options graph.Options) (graph.QuadStore, err...
  function hashOf (line 113) | func hashOf(s quad.Value) string {
  function getContext (line 154) | func getContext(opts graph.Options) (context.Context, error) {
  type quadWriter (line 172) | type quadWriter struct
    method WriteQuad (line 177) | func (w *quadWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 182) | func (w *quadWriter) WriteQuads(buf []quad.Quad) (int, error) {
    method Close (line 203) | func (w *quadWriter) Close() error {

FILE: graph/gaedatastore/quadstore_test.go
  type pair (line 54) | type pair struct
  function createInstance (line 59) | func createInstance() (aetest.Instance, *http.Request, error) {
  function makeGAE (line 75) | func makeGAE(t testing.TB) (graph.QuadStore, graph.Options, func()) {
  function TestGAEAll (line 94) | func TestGAEAll(t *testing.T) {
  function TestIterators (line 101) | func TestIterators(t *testing.T) {

FILE: graph/graphmock/graphmock.go
  type IntVal (line 18) | type IntVal
    method Key (line 20) | func (v IntVal) Key() interface{} { return v }
  type StringNode (line 22) | type StringNode
    method Key (line 24) | func (s StringNode) Key() interface{} { return s }
  type Oldstore (line 27) | type Oldstore struct
    method valueAt (line 33) | func (qs *Oldstore) valueAt(i int) quad.Value {
    method ValueOf (line 44) | func (qs *Oldstore) ValueOf(s quad.Value) (graph.Ref, error) {
    method NewQuadWriter (line 56) | func (qs *Oldstore) NewQuadWriter() (quad.WriteCloser, error) {
    method ApplyDeltas (line 74) | func (qs *Oldstore) ApplyDeltas([]graph.Delta, graph.IgnoreOpts) error...
    method Quad (line 76) | func (qs *Oldstore) Quad(graph.Ref) quad.Quad { return quad.Quad{} }
    method QuadIterator (line 78) | func (qs *Oldstore) QuadIterator(d quad.Direction, i graph.Ref) iterat...
    method QuadIteratorSize (line 82) | func (qs *Oldstore) QuadIteratorSize(ctx context.Context, d quad.Direc...
    method NodesAllIterator (line 87) | func (qs *Oldstore) NodesAllIterator() iterator.Shape { return &iterat...
    method QuadsAllIterator (line 89) | func (qs *Oldstore) QuadsAllIterator() iterator.Shape { return &iterat...
    method NameOf (line 91) | func (qs *Oldstore) NameOf(v graph.Ref) (quad.Value, error) {
    method Size (line 109) | func (qs *Oldstore) Size() int64 { return 0 }
    method DebugPrint (line 111) | func (qs *Oldstore) DebugPrint() {}
    method OptimizeIterator (line 113) | func (qs *Oldstore) OptimizeIterator(it iterator.Shape) (iterator.Shap...
    method Close (line 117) | func (qs *Oldstore) Close() error { return nil }
    method QuadDirection (line 119) | func (qs *Oldstore) QuadDirection(graph.Ref, quad.Direction) graph.Ref {
    method RemoveQuad (line 123) | func (qs *Oldstore) RemoveQuad(t quad.Quad) {}
    method Type (line 125) | func (qs *Oldstore) Type() string { return "oldmockstore" }
  type nopWriter (line 60) | type nopWriter struct
    method WriteQuad (line 62) | func (nopWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 66) | func (nopWriter) WriteQuads(buf []quad.Quad) (int, error) {
    method Close (line 70) | func (nopWriter) Close() error {
  type Store (line 127) | type Store struct
    method ValueOf (line 133) | func (qs *Store) ValueOf(s quad.Value) (graph.Ref, error) {
    method ApplyDeltas (line 142) | func (qs *Store) ApplyDeltas([]graph.Delta, graph.IgnoreOpts) error { ...
    method NewQuadWriter (line 144) | func (qs *Store) NewQuadWriter() (quad.WriteCloser, error) {
    method Quad (line 156) | func (qs *Store) Quad(v graph.Ref) (quad.Quad, error) {
    method NameOf (line 160) | func (qs *Store) NameOf(v graph.Ref) (quad.Value, error) {
    method RemoveQuad (line 167) | func (qs *Store) RemoveQuad(t quad.Quad) {}
    method Type (line 169) | func (qs *Store) Type() string { return "mockstore" }
    method QuadDirection (line 171) | func (qs *Store) QuadDirection(v graph.Ref, d quad.Direction) (graph.R...
    method Close (line 179) | func (qs *Store) Close() error { return nil }
    method DebugPrint (line 181) | func (qs *Store) DebugPrint() {}
    method QuadIterator (line 183) | func (qs *Store) QuadIterator(d quad.Direction, i graph.Ref) iterator....
    method QuadIteratorSize (line 194) | func (qs *Store) QuadIteratorSize(ctx context.Context, d quad.Directio...
    method NodesAllIterator (line 205) | func (qs *Store) NodesAllIterator() iterator.Shape {
    method QuadsAllIterator (line 225) | func (qs *Store) QuadsAllIterator() iterator.Shape {
    method Stats (line 233) | func (qs *Store) Stats(ctx context.Context, exact bool) (graph.Stats, ...
  type quadValue (line 148) | type quadValue struct
    method Key (line 152) | func (q quadValue) Key() interface{} {

FILE: graph/graphtest/graphtest.go
  type Config (line 25) | type Config struct
  function TestAll (line 65) | func TestAll(t *testing.T, gen testutil.DatabaseFunc, conf *Config) {
  function BenchmarkAll (line 93) | func BenchmarkAll(b *testing.B, gen testutil.DatabaseFunc, conf *Config) {
  function MakeQuadSet (line 114) | func MakeQuadSet() []quad.Quad {
  function IteratedQuads (line 130) | func IteratedQuads(t testing.TB, qs graph.QuadStore, s iterator.Shape) [...
  function IteratedQuadsNext (line 136) | func IteratedQuadsNext(t testing.TB, qs graph.QuadStore, it iterator.Sca...
  function ExpectIteratedQuads (line 152) | func ExpectIteratedQuads(t testing.TB, qs graph.QuadStore, it iterator.S...
  function ExpectIteratedRawStrings (line 164) | func ExpectIteratedRawStrings(t testing.TB, qs graph.QuadStore, it itera...
  function ExpectIteratedValues (line 171) | func ExpectIteratedValues(t testing.TB, qs graph.QuadStore, it iterator....
  function IteratedStrings (line 190) | func IteratedStrings(t testing.TB, qs graph.QuadStore, s iterator.Shape)...
  function IteratedValues (line 205) | func IteratedValues(t testing.TB, qs graph.QuadStore, s iterator.Shape) ...
  function TestLoadOneQuad (line 219) | func TestLoadOneQuad(t testing.TB, gen testutil.DatabaseFunc, c *Config) {
  function testLoadDup (line 253) | func testLoadDup(t testing.TB, gen testutil.DatabaseFunc, c *Config, sin...
  function TestLoadDup (line 286) | func TestLoadDup(t testing.TB, gen testutil.DatabaseFunc, c *Config) {
  function TestLoadDupSingle (line 290) | func TestLoadDupSingle(t testing.TB, gen testutil.DatabaseFunc, c *Confi...
  function TestLoadDupRaw (line 294) | func TestLoadDupRaw(t testing.TB, gen testutil.DatabaseFunc, c *Config) {
  function TestWriters (line 321) | func TestWriters(t *testing.T, gen testutil.DatabaseFunc, c *Config) {
  function Test1K (line 418) | func Test1K(t *testing.T, gen testutil.DatabaseFunc, c *Config) {
  function Test1KBatch (line 443) | func Test1KBatch(t *testing.T, gen testutil.DatabaseFunc, c *Config) {
  type ValueSizer (line 472) | type ValueSizer interface
  function TestSizes (line 476) | func TestSizes(t testing.TB, gen testutil.DatabaseFunc, conf *Config) {
  function TestIterator (line 539) | func TestIterator(t testing.TB, gen testutil.DatabaseFunc, _ *Config) {
  function TestHasA (line 619) | func TestHasA(t testing.TB, gen testutil.DatabaseFunc, conf *Config) {
  function TestSetIterator (line 640) | func TestSetIterator(t testing.TB, gen testutil.DatabaseFunc, _ *Config) {
  function TestDeleteQuad (line 737) | func TestDeleteQuad(t testing.TB, gen testutil.DatabaseFunc, _ *Config) {
  function TestDeletedFromIterator (line 774) | func TestDeletedFromIterator(t testing.TB, gen testutil.DatabaseFunc, co...
  function TestLoadTypedQuads (line 796) | func TestLoadTypedQuads(t testing.TB, gen testutil.DatabaseFunc, conf *C...
  function TestAddRemove (line 874) | func TestAddRemove(t testing.TB, gen testutil.DatabaseFunc, conf *Config) {
  function TestIteratorsAndNextResultOrderA (line 966) | func TestIteratorsAndNextResultOrderA(t testing.TB, gen testutil.Databas...
  constant lt (line 1027) | lt, lte, gt, gte = iterator.CompareLT, iterator.CompareLTE, iterator.Com...
  function TestCompareTypedValues (line 1093) | func TestCompareTypedValues(t testing.TB, gen testutil.DatabaseFunc, con...
  function TestNodeDelete (line 1150) | func TestNodeDelete(t testing.TB, gen testutil.DatabaseFunc, conf *Confi...
  function TestSchema (line 1186) | func TestSchema(t testing.TB, gen testutil.DatabaseFunc, conf *Config) {
  function TestDeleteReinserted (line 1217) | func TestDeleteReinserted(t testing.TB, gen testutil.DatabaseFunc, _ *Co...
  function TestDeleteReinsertedDup (line 1247) | func TestDeleteReinsertedDup(t testing.TB, gen testutil.DatabaseFunc, _ ...
  function irif (line 1290) | func irif(format string, args ...interface{}) quad.IRI {
  function BenchmarkImport (line 1294) | func BenchmarkImport(b *testing.B, gen testutil.DatabaseFunc) {

FILE: graph/graphtest/integration.go
  constant format (line 38) | format  = "nquads"
  constant timeout (line 39) | timeout = 300 * time.Second
  constant nSpeed (line 43) | nSpeed = "Speed"
  constant nLakeH (line 44) | nLakeH = "The Lake House"
  constant SandraB (line 46) | SandraB = "Sandra Bullock"
  constant KeanuR (line 47) | KeanuR  = "Keanu Reeves"
  function checkIntegration (line 50) | func checkIntegration(t testing.TB, force bool) {
  function TestIntegration (line 59) | func TestIntegration(t *testing.T, gen testutil.DatabaseFunc, force bool) {
  function BenchmarkIntegration (line 66) | func BenchmarkIntegration(t *testing.B, gen testutil.DatabaseFunc, force...
  function costarTag (line 71) | func costarTag(id, c1, c1m, c2, c2m string) map[string]string {
  constant common (line 444) | common = `
  function prepare (line 462) | func prepare(t testing.TB, gen testutil.DatabaseFunc) graph.QuadStore {
  function checkQueries (line 492) | func checkQueries(t *testing.T, qs graph.QuadStore, timeout time.Duratio...
  function unsortedEqual (line 540) | func unsortedEqual(got, expect []interface{}) bool {
  function convertToStringList (line 546) | func convertToStringList(in []interface{}) []string {
  function benchmarkQueries (line 563) | func benchmarkQueries(b *testing.B, gen testutil.DatabaseFunc) {

FILE: graph/graphtest/testutil/testutil.go
  type DatabaseFunc (line 16) | type DatabaseFunc
  function LoadGraph (line 18) | func LoadGraph(t testing.TB, path string) []quad.Quad {
  function MakeWriter (line 43) | func MakeWriter(t testing.TB, qs graph.QuadStore, opts graph.Options, da...

FILE: graph/hasa.go
  type HasA (line 49) | type HasA struct
    method Iterate (line 65) | func (it *HasA) Iterate() iterator.Scanner {
    method Lookup (line 69) | func (it *HasA) Lookup() iterator.Index {
    method SubIterators (line 74) | func (it *HasA) SubIterators() []iterator.Shape {
    method Direction (line 79) | func (it *HasA) Direction() quad.Direction { return it.dir }
    method Optimize (line 83) | func (it *HasA) Optimize(ctx context.Context) (iterator.Shape, bool) {
    method String (line 94) | func (it *HasA) String() string {
    method Stats (line 104) | func (it *HasA) Stats(ctx context.Context) (iterator.Costs, error) {
  function NewHasA (line 57) | func NewHasA(qs QuadIndexer, subIt iterator.Shape, d quad.Direction) *Ha...
  type hasANext (line 125) | type hasANext struct
    method Direction (line 144) | func (it *hasANext) Direction() quad.Direction { return it.dir }
    method TagResults (line 147) | func (it *hasANext) TagResults(dst map[string]refs.Ref) {
    method String (line 151) | func (it *hasANext) String() string {
    method NextPath (line 156) | func (it *hasANext) NextPath(ctx context.Context) bool {
    method Next (line 163) | func (it *hasANext) Next(ctx context.Context) bool {
    method Err (line 176) | func (it *hasANext) Err() error {
    method Result (line 183) | func (it *hasANext) Result() refs.Ref {
    method Close (line 189) | func (it *hasANext) Close() error {
  function newHasANext (line 135) | func newHasANext(qs QuadIndexer, subIt iterator.Scanner, d quad.Directio...
  type hasAContains (line 196) | type hasAContains struct
    method Direction (line 216) | func (it *hasAContains) Direction() quad.Direction { return it.dir }
    method TagResults (line 219) | func (it *hasAContains) TagResults(dst map[string]refs.Ref) {
    method String (line 223) | func (it *hasAContains) String() string {
    method Contains (line 230) | func (it *hasAContains) Contains(ctx context.Context, val refs.Ref) bo...
    method nextContains (line 249) | func (it *hasAContains) nextContains(ctx context.Context) bool {
    method NextPath (line 278) | func (it *hasAContains) NextPath(ctx context.Context) bool {
    method Err (line 306) | func (it *hasAContains) Err() error {
    method Result (line 310) | func (it *hasAContains) Result() refs.Ref {
    method Close (line 316) | func (it *hasAContains) Close() error {
  function newHasAContains (line 207) | func newHasAContains(qs QuadIndexer, subIt iterator.Index, d quad.Direct...

FILE: graph/hasa_test.go
  function TestHasAIteratorErr (line 29) | func TestHasAIteratorErr(t *testing.T) {

FILE: graph/http/httpgraph.go
  type QuadStore (line 9) | type QuadStore interface

FILE: graph/iterator/and.go
  type And (line 26) | type And struct
    method Iterate (line 44) | func (it *And) Iterate() Scanner {
    method Lookup (line 59) | func (it *And) Lookup() Index {
    method SubIterators (line 79) | func (it *And) SubIterators() []Shape {
    method String (line 86) | func (it *And) String() string {
    method AddSubIterator (line 96) | func (it *And) AddSubIterator(sub Shape) {
    method AddOptionalIterator (line 105) | func (it *And) AddOptionalIterator(sub Shape) *And {
  function NewAnd (line 34) | func NewAnd(sub ...Shape) *And {
  type andNext (line 112) | type andNext struct
    method TagResults (line 129) | func (it *andNext) TagResults(dst map[string]refs.Ref) {
    method String (line 134) | func (it *andNext) String() string {
    method Next (line 142) | func (it *andNext) Next(ctx context.Context) bool {
    method Err (line 153) | func (it *andNext) Err() error {
    method Result (line 163) | func (it *andNext) Result() refs.Ref {
    method NextPath (line 170) | func (it *andNext) NextPath(ctx context.Context) bool {
    method Close (line 188) | func (it *andNext) Close() error {
  function newAndNext (line 120) | func newAndNext(pri Scanner, sec Index) Scanner {
  type andContains (line 198) | type andContains struct
    method TagResults (line 219) | func (it *andContains) TagResults(dst map[string]refs.Ref) {
    method String (line 231) | func (it *andContains) String() string {
    method Err (line 235) | func (it *andContains) Err() error {
    method Result (line 252) | func (it *andContains) Result() refs.Ref {
    method Contains (line 257) | func (it *andContains) Contains(ctx context.Context, val refs.Ref) bool {
    method NextPath (line 295) | func (it *andContains) NextPath(ctx context.Context) bool {
    method Close (line 322) | func (it *andContains) Close() error {
  function newAndContains (line 210) | func newAndContains(sub, opt []Index) Index {

FILE: graph/iterator/and_optimize.go
  method Optimize (line 44) | func (it *And) Optimize(ctx context.Context) (Shape, bool) {
  function optimizeReplacement (line 92) | func optimizeReplacement(its []Shape) Shape {
  function optimizeOrder (line 112) | func optimizeOrder(ctx context.Context, its []Shape) []Shape {
  function sortByContainsCost (line 169) | func sortByContainsCost(ctx context.Context, arr []Shape) error {
  type byCost (line 187) | type byCost struct
    method Len (line 192) | func (c byCost) Len() int { return len(c.list) }
    method Less (line 193) | func (c byCost) Less(i, j int) bool {
    method Swap (line 196) | func (c byCost) Swap(i, j int) {
  method optimizeContains (line 203) | func (it *And) optimizeContains(ctx context.Context) error {
  function optimizeSubIterators (line 216) | func optimizeSubIterators(ctx context.Context, its []Shape) []Shape {
  function hasAnyNullIterators (line 226) | func hasAnyNullIterators(its []Shape) bool {
  function materializeIts (line 235) | func materializeIts(ctx context.Context, its []Shape) ([]Shape, error) {
  function getStatsForSlice (line 256) | func getStatsForSlice(ctx context.Context, its, opt []Shape) (Costs, []C...
  method Stats (line 308) | func (it *And) Stats(ctx context.Context) (Costs, error) {

FILE: graph/iterator/and_optimize_test.go
  function TestNullIteratorAnd (line 28) | func TestNullIteratorAnd(t *testing.T) {
  function TestReorderWithTag (line 41) | func TestReorderWithTag(t *testing.T) {
  function TestAndStatistics (line 58) | func TestAndStatistics(t *testing.T) {

FILE: graph/iterator/and_test.go
  function TestAndTag (line 29) | func TestAndTag(t *testing.T) {
  function TestAndAndFixedIterators (line 50) | func TestAndAndFixedIterators(t *testing.T) {
  function TestNonOverlappingFixedIterators (line 85) | func TestNonOverlappingFixedIterators(t *testing.T) {
  function TestAllIterators (line 111) | func TestAllIterators(t *testing.T) {
  function TestAndIteratorErr (line 126) | func TestAndIteratorErr(t *testing.T) {

FILE: graph/iterator/count.go
  type Count (line 11) | type Count struct
    method Iterate (line 24) | func (it *Count) Iterate() Scanner {
    method Lookup (line 28) | func (it *Count) Lookup() Index {
    method SubIterators (line 33) | func (it *Count) SubIterators() []Shape {
    method Optimize (line 37) | func (it *Count) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 43) | func (it *Count) Stats(ctx context.Context) (Costs, error) {
    method String (line 58) | func (it *Count) String() string { return "Count" }
  function NewCount (line 18) | func NewCount(it Shape, qs refs.Namer) *Count {
  type countNext (line 61) | type countNext struct
    method TagResults (line 76) | func (it *countNext) TagResults(dst map[string]refs.Ref) {}
    method Next (line 79) | func (it *countNext) Next(ctx context.Context) bool {
    method Err (line 104) | func (it *countNext) Err() error {
    method Result (line 108) | func (it *countNext) Result() refs.Ref {
    method NextPath (line 115) | func (it *countNext) NextPath(ctx context.Context) bool {
    method Close (line 119) | func (it *countNext) Close() error {
    method String (line 123) | func (it *countNext) String() string { return "CountNext" }
  function newCountNext (line 70) | func newCountNext(it Shape) *countNext {
  type countContains (line 126) | type countContains struct
    method TagResults (line 141) | func (it *countContains) TagResults(dst map[string]refs.Ref) {}
    method Err (line 143) | func (it *countContains) Err() error {
    method Result (line 150) | func (it *countContains) Result() refs.Ref {
    method Contains (line 154) | func (it *countContains) Contains(ctx context.Context, val refs.Ref) b...
    method NextPath (line 172) | func (it *countContains) NextPath(ctx context.Context) bool {
    method Close (line 176) | func (it *countContains) Close() error {
    method String (line 180) | func (it *countContains) String() string { return "CountContains" }
  function newCountContains (line 134) | func newCountContains(it Shape, qs refs.Namer) *countContains {

FILE: graph/iterator/count_test.go
  function TestCount (line 12) | func TestCount(t *testing.T) {

FILE: graph/iterator/fixed.go
  type Fixed (line 34) | type Fixed struct
    method Iterate (line 45) | func (it *Fixed) Iterate() Scanner {
    method Lookup (line 49) | func (it *Fixed) Lookup() Index {
    method Add (line 55) | func (it *Fixed) Add(v refs.Ref) {
    method Values (line 60) | func (it *Fixed) Values() []refs.Ref {
    method String (line 64) | func (it *Fixed) String() string {
    method SubIterators (line 69) | func (it *Fixed) SubIterators() []Shape {
    method Optimize (line 76) | func (it *Fixed) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 86) | func (it *Fixed) Stats(ctx context.Context) (Costs, error) {
  function NewFixed (line 39) | func NewFixed(vals ...refs.Ref) *Fixed {
  type fixedNext (line 99) | type fixedNext struct
    method Close (line 112) | func (it *fixedNext) Close() error {
    method TagResults (line 116) | func (it *fixedNext) TagResults(dst map[string]refs.Ref) {}
    method String (line 118) | func (it *fixedNext) String() string {
    method Next (line 123) | func (it *fixedNext) Next(ctx context.Context) bool {
    method Err (line 133) | func (it *fixedNext) Err() error {
    method Result (line 137) | func (it *fixedNext) Result() refs.Ref {
    method NextPath (line 141) | func (it *fixedNext) NextPath(ctx context.Context) bool {
  function newFixedNext (line 106) | func newFixedNext(vals []refs.Ref) *fixedNext {
  type fixedContains (line 147) | type fixedContains struct
    method Close (line 165) | func (it *fixedContains) Close() error {
    method TagResults (line 169) | func (it *fixedContains) TagResults(dst map[string]refs.Ref) {}
    method String (line 171) | func (it *fixedContains) String() string {
    method Contains (line 176) | func (it *fixedContains) Contains(ctx context.Context, v refs.Ref) bool {
    method Err (line 190) | func (it *fixedContains) Err() error {
    method Result (line 194) | func (it *fixedContains) Result() refs.Ref {
    method NextPath (line 198) | func (it *fixedContains) NextPath(ctx context.Context) bool {
  function newFixedContains (line 154) | func newFixedContains(vals []refs.Ref) *fixedContains {

FILE: graph/iterator/iterate.go
  type Chain (line 12) | type Chain struct
    method next (line 39) | func (c *Chain) next() bool {
    method nextPath (line 51) | func (c *Chain) nextPath() bool {
    method start (line 63) | func (c *Chain) start() {
    method end (line 70) | func (c *Chain) end() {
    method Limit (line 75) | func (c *Chain) Limit(n int) *Chain {
    method Paths (line 82) | func (c *Chain) Paths(enable bool) *Chain {
    method On (line 88) | func (c *Chain) On(qs refs.Namer) *Chain {
    method UnOptimized (line 94) | func (c *Chain) UnOptimized() *Chain {
    method Each (line 100) | func (c *Chain) Each(fnc func(refs.Ref) error) error {
    method Count (line 128) | func (c *Chain) Count() (int64, error) {
    method All (line 166) | func (c *Chain) All() ([]refs.Ref, error) {
    method First (line 192) | func (c *Chain) First() (refs.Ref, error) {
    method Send (line 204) | func (c *Chain) Send(out chan<- refs.Ref) error {
    method TagEach (line 226) | func (c *Chain) TagEach(fnc func(map[string]refs.Ref) error) error {
    method EachValue (line 271) | func (c *Chain) EachValue(qs refs.Namer, fnc func(quad.Value) error) e...
    method EachValuePair (line 290) | func (c *Chain) EachValuePair(qs refs.Namer, fnc func(refs.Ref, quad.V...
    method AllValues (line 309) | func (c *Chain) AllValues(qs refs.Namer) ([]quad.Value, error) {
    method FirstValue (line 319) | func (c *Chain) FirstValue(qs refs.Namer) (quad.Value, error) {
    method SendValues (line 335) | func (c *Chain) SendValues(qs refs.Namer, out chan<- quad.Value) error {
    method TagValues (line 376) | func (c *Chain) TagValues(qs refs.Namer, fnc func(map[string]quad.Valu...
  function Iterate (line 29) | func Iterate(ctx context.Context, it Shape) *Chain {

FILE: graph/iterator/iterator.go
  type TaggerBase (line 32) | type TaggerBase interface
  type Base (line 40) | type Base interface
  type Scanner (line 80) | type Scanner interface
  type Index (line 91) | type Index interface
  type TaggerShape (line 101) | type TaggerShape interface
  type Costs (line 107) | type Costs struct
  type Shape (line 116) | type Shape interface
  type Morphism (line 150) | type Morphism
  function IsNull (line 152) | func IsNull(it Shape) bool {
  function Height (line 160) | func Height(it Shape, filter func(Shape) bool) int {
  type Null (line 178) | type Null struct
    method Iterate (line 187) | func (it *Null) Iterate() Scanner {
    method Lookup (line 192) | func (it *Null) Lookup() Index {
    method TagResults (line 197) | func (it *Null) TagResults(dst map[string]refs.Ref) {}
    method Contains (line 199) | func (it *Null) Contains(ctx context.Context, v refs.Ref) bool {
    method Optimize (line 205) | func (it *Null) Optimize(ctx context.Context) (Shape, bool) { return i...
    method String (line 207) | func (it *Null) String() string {
    method Next (line 211) | func (it *Null) Next(ctx context.Context) bool {
    method Err (line 215) | func (it *Null) Err() error {
    method Result (line 219) | func (it *Null) Result() refs.Ref {
    method SubIterators (line 223) | func (it *Null) SubIterators() []Shape {
    method NextPath (line 227) | func (it *Null) NextPath(ctx context.Context) bool {
    method Reset (line 231) | func (it *Null) Reset() {}
    method Close (line 233) | func (it *Null) Close() error {
    method Stats (line 238) | func (it *Null) Stats(ctx context.Context) (Costs, error) {
  function NewNull (line 182) | func NewNull() *Null {
  type Error (line 243) | type Error struct
    method Iterate (line 251) | func (it *Error) Iterate() Scanner {
    method Lookup (line 255) | func (it *Error) Lookup() Index {
    method TagResults (line 260) | func (it *Error) TagResults(dst map[string]refs.Ref) {}
    method Contains (line 262) | func (it *Error) Contains(ctx context.Context, v refs.Ref) bool {
    method Optimize (line 266) | func (it *Error) Optimize(ctx context.Context) (Shape, bool) { return ...
    method String (line 268) | func (it *Error) String() string {
    method Next (line 272) | func (it *Error) Next(ctx context.Context) bool {
    method Err (line 276) | func (it *Error) Err() error {
    method Result (line 280) | func (it *Error) Result() refs.Ref {
    method SubIterators (line 284) | func (it *Error) SubIterators() []Shape {
    method NextPath (line 288) | func (it *Error) NextPath(ctx context.Context) bool {
    method Reset (line 292) | func (it *Error) Reset() {}
    method Close (line 294) | func (it *Error) Close() error {
    method Stats (line 298) | func (it *Error) Stats(ctx context.Context) (Costs, error) {
  function NewError (line 247) | func NewError(err error) *Error {

FILE: graph/iterator/iterator_test.go
  type testIterator (line 12) | type testIterator struct
    method Iterate (line 27) | func (it *testIterator) Iterate() Scanner {
    method Lookup (line 35) | func (it *testIterator) Lookup() Index {
  function newTestIterator (line 19) | func newTestIterator(next bool, err error) Shape {
  type testIteratorNext (line 44) | type testIteratorNext struct
    method Next (line 51) | func (it *testIteratorNext) Next(ctx context.Context) bool {
    method Err (line 55) | func (it *testIteratorNext) Err() error {
  type testIteratorContains (line 60) | type testIteratorContains struct
    method Contains (line 67) | func (it *testIteratorContains) Contains(ctx context.Context, v refs.R...
    method Err (line 71) | func (it *testIteratorContains) Err() error {
  type Int64Quad (line 75) | type Int64Quad
    method Key (line 77) | func (v Int64Quad) Key() interface{} { return v }
    method IsNode (line 79) | func (Int64Quad) IsNode() bool { return false }
  type Int64 (line 84) | type Int64 struct
    method Iterate (line 89) | func (it *Int64) Iterate() Scanner {
    method Lookup (line 93) | func (it *Int64) Lookup() Index {
    method String (line 106) | func (it *Int64) String() string {
    method SubIterators (line 111) | func (it *Int64) SubIterators() []Shape {
    method Size (line 117) | func (it *Int64) Size() (int64, bool) {
    method Optimize (line 130) | func (it *Int64) Optimize(ctx context.Context) (Shape, bool) { return ...
    method Stats (line 134) | func (it *Int64) Stats(ctx context.Context) (Costs, error) {
  function newInt64 (line 98) | func newInt64(min, max int64, node bool) *Int64 {
  function valToInt64 (line 122) | func valToInt64(v refs.Ref) int64 {
  type int64Next (line 147) | type int64Next struct
    method Close (line 164) | func (it *int64Next) Close() error {
    method TagResults (line 168) | func (it *int64Next) TagResults(dst map[string]refs.Ref) {}
    method String (line 170) | func (it *int64Next) String() string {
    method Next (line 176) | func (it *int64Next) Next(ctx context.Context) bool {
    method Err (line 189) | func (it *int64Next) Err() error {
    method toValue (line 193) | func (it *int64Next) toValue(v int64) refs.Ref {
    method Result (line 200) | func (it *int64Next) Result() refs.Ref {
    method NextPath (line 204) | func (it *int64Next) NextPath(ctx context.Context) bool {
  function newInt64Next (line 155) | func newInt64Next(min, max int64, node bool) *int64Next {
  type int64Contains (line 209) | type int64Contains struct
    method Close (line 226) | func (it *int64Contains) Close() error {
    method TagResults (line 230) | func (it *int64Contains) TagResults(dst map[string]refs.Ref) {}
    method String (line 232) | func (it *int64Contains) String() string {
    method Err (line 236) | func (it *int64Contains) Err() error {
    method toValue (line 240) | func (it *int64Contains) toValue(v int64) refs.Ref {
    method Result (line 247) | func (it *int64Contains) Result() refs.Ref {
    method NextPath (line 251) | func (it *int64Contains) NextPath(ctx context.Context) bool {
    method SubIterators (line 256) | func (it *int64Contains) SubIterators() []Shape {
    method Contains (line 262) | func (it *int64Contains) Contains(ctx context.Context, tsv refs.Ref) b...
  function newInt64Contains (line 217) | func newInt64Contains(min, max int64, node bool) *int64Contains {

FILE: graph/iterator/limit.go
  type Limit (line 12) | type Limit struct
    method Iterate (line 24) | func (it *Limit) Iterate() Scanner {
    method Lookup (line 28) | func (it *Limit) Lookup() Index {
    method SubIterators (line 33) | func (it *Limit) SubIterators() []Shape {
    method Optimize (line 37) | func (it *Limit) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 46) | func (it *Limit) Stats(ctx context.Context) (Costs, error) {
    method String (line 54) | func (it *Limit) String() string {
  function NewLimit (line 17) | func NewLimit(it Shape, max int64) *Limit {
  type limitNext (line 60) | type limitNext struct
    method TagResults (line 73) | func (it *limitNext) TagResults(dst map[string]refs.Ref) {
    method Next (line 78) | func (it *limitNext) Next(ctx context.Context) bool {
    method Err (line 89) | func (it *limitNext) Err() error {
    method Result (line 93) | func (it *limitNext) Result() refs.Ref {
    method NextPath (line 99) | func (it *limitNext) NextPath(ctx context.Context) bool {
    method Close (line 112) | func (it *limitNext) Close() error {
    method String (line 116) | func (it *limitNext) String() string {
  function NewLimitNext (line 66) | func NewLimitNext(it Scanner, limit int64) Scanner {
  type limitContains (line 122) | type limitContains struct
    method TagResults (line 135) | func (it *limitContains) TagResults(dst map[string]refs.Ref) {
    method Err (line 139) | func (it *limitContains) Err() error {
    method Result (line 143) | func (it *limitContains) Result() refs.Ref {
    method Contains (line 147) | func (it *limitContains) Contains(ctx context.Context, val refs.Ref) b...
    method NextPath (line 160) | func (it *limitContains) NextPath(ctx context.Context) bool {
    method Close (line 173) | func (it *limitContains) Close() error {
    method String (line 177) | func (it *limitContains) String() string {
  function newLimitContains (line 128) | func newLimitContains(it Index, limit int64) *limitContains {

FILE: graph/iterator/limit_test.go
  function TestLimitIteratorBasics (line 12) | func TestLimitIteratorBasics(t *testing.T) {

FILE: graph/iterator/materialize.go
  constant MaterializeLimit (line 26) | MaterializeLimit = 1000
  type result (line 28) | type result struct
  type Materialize (line 33) | type Materialize struct
    method Iterate (line 49) | func (it *Materialize) Iterate() Scanner {
    method Lookup (line 53) | func (it *Materialize) Lookup() Index {
    method String (line 57) | func (it *Materialize) String() string {
    method SubIterators (line 61) | func (it *Materialize) SubIterators() []Shape {
    method Optimize (line 65) | func (it *Materialize) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 78) | func (it *Materialize) Stats(ctx context.Context) (Costs, error) {
  function NewMaterialize (line 38) | func NewMaterialize(sub Shape) *Materialize {
  function NewMaterializeWithSize (line 42) | func NewMaterializeWithSize(sub Shape, size int64) *Materialize {
  type materializeNext (line 94) | type materializeNext struct
    method Close (line 116) | func (it *materializeNext) Close() error {
    method TagResults (line 123) | func (it *materializeNext) TagResults(dst map[string]refs.Ref) {
    method String (line 139) | func (it *materializeNext) String() string {
    method Result (line 143) | func (it *materializeNext) Result() refs.Ref {
    method Next (line 159) | func (it *materializeNext) Next(ctx context.Context) bool {
    method Err (line 180) | func (it *materializeNext) Err() error {
    method NextPath (line 184) | func (it *materializeNext) NextPath(ctx context.Context) bool {
    method materializeSet (line 204) | func (it *materializeNext) materializeSet(ctx context.Context) {
  function newMaterializeNext (line 107) | func newMaterializeNext(sub Shape) *materializeNext {
  type materializeContains (line 253) | type materializeContains struct
    method Close (line 264) | func (it *materializeContains) Close() error {
    method TagResults (line 274) | func (it *materializeContains) TagResults(dst map[string]refs.Ref) {
    method String (line 282) | func (it *materializeContains) String() string {
    method Result (line 286) | func (it *materializeContains) Result() refs.Ref {
    method Err (line 293) | func (it *materializeContains) Err() error {
    method run (line 302) | func (it *materializeContains) run(ctx context.Context) {
    method Contains (line 309) | func (it *materializeContains) Contains(ctx context.Context, v refs.Re...
    method NextPath (line 328) | func (it *materializeContains) NextPath(ctx context.Context) bool {
  function newMaterializeContains (line 258) | func newMaterializeContains(sub Shape) *materializeContains {

FILE: graph/iterator/materialize_test.go
  function TestMaterializeIteratorError (line 27) | func TestMaterializeIteratorError(t *testing.T) {
  function TestMaterializeIteratorErrorAbort (line 40) | func TestMaterializeIteratorErrorAbort(t *testing.T) {

FILE: graph/iterator/misc.go
  type Int64Node (line 25) | type Int64Node
    method Key (line 27) | func (v Int64Node) Key() interface{} { return v }
    method IsNode (line 29) | func (Int64Node) IsNode() bool { return true }

FILE: graph/iterator/not.go
  type Not (line 11) | type Not struct
    method Iterate (line 23) | func (it *Not) Iterate() Scanner {
    method Lookup (line 27) | func (it *Not) Lookup() Index {
    method SubIterators (line 34) | func (it *Not) SubIterators() []Shape {
    method Optimize (line 38) | func (it *Not) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 48) | func (it *Not) Stats(ctx context.Context) (Costs, error) {
    method String (line 64) | func (it *Not) String() string {
  function NewNot (line 16) | func NewNot(primaryIt, allIt Shape) *Not {
  type notNext (line 70) | type notNext struct
    method TagResults (line 83) | func (it *notNext) TagResults(dst map[string]refs.Ref) {
    method Next (line 92) | func (it *notNext) Next(ctx context.Context) bool {
    method Err (line 102) | func (it *notNext) Err() error {
    method Result (line 112) | func (it *notNext) Result() refs.Ref {
    method NextPath (line 118) | func (it *notNext) NextPath(ctx context.Context) bool {
    method Close (line 124) | func (it *notNext) Close() error {
    method String (line 132) | func (it *notNext) String() string {
  function newNotNext (line 76) | func newNotNext(primaryIt Index, allIt Scanner) *notNext {
  type notContains (line 138) | type notContains struct
    method TagResults (line 150) | func (it *notContains) TagResults(dst map[string]refs.Ref) {
    method Err (line 156) | func (it *notContains) Err() error {
    method Result (line 160) | func (it *notContains) Result() refs.Ref {
    method Contains (line 167) | func (it *notContains) Contains(ctx context.Context, val refs.Ref) bool {
    method NextPath (line 182) | func (it *notContains) NextPath(ctx context.Context) bool {
    method Close (line 188) | func (it *notContains) Close() error {
    method String (line 192) | func (it *notContains) String() string {
  function newNotContains (line 144) | func newNotContains(primaryIt Index) *notContains {

FILE: graph/iterator/not_test.go
  function TestNotIteratorBasics (line 13) | func TestNotIteratorBasics(t *testing.T) {
  function TestNotIteratorErr (line 47) | func TestNotIteratorErr(t *testing.T) {

FILE: graph/iterator/or.go
  type Or (line 30) | type Or struct
    method Iterate (line 61) | func (it *Or) Iterate() Scanner {
    method Lookup (line 69) | func (it *Or) Lookup() Index {
    method SubIterators (line 78) | func (it *Or) SubIterators() []Shape {
    method String (line 82) | func (it *Or) String() string {
    method AddSubIterator (line 87) | func (it *Or) AddSubIterator(sub Shape) {
    method Optimize (line 91) | func (it *Or) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 107) | func (it *Or) Stats(ctx context.Context) (Costs, error) {
  function NewOr (line 38) | func NewOr(sub ...Shape) *Or {
  function NewShortCircuitOr (line 49) | func NewShortCircuitOr(sub ...Shape) *Or {
  type orNext (line 138) | type orNext struct
    method TagResults (line 156) | func (it *orNext) TagResults(dst map[string]refs.Ref) {
    method String (line 160) | func (it *orNext) String() string {
    method Next (line 167) | func (it *orNext) Next(ctx context.Context) bool {
    method Err (line 201) | func (it *orNext) Err() error {
    method Result (line 205) | func (it *orNext) Result() refs.Ref {
    method NextPath (line 213) | func (it *orNext) NextPath(ctx context.Context) bool {
    method Close (line 229) | func (it *orNext) Close() error {
  function newOrNext (line 146) | func newOrNext(sub []Scanner, shortCircuit bool) *orNext {
  type orContains (line 240) | type orContains struct
    method TagResults (line 258) | func (it *orContains) TagResults(dst map[string]refs.Ref) {
    method String (line 262) | func (it *orContains) String() string {
    method Err (line 266) | func (it *orContains) Err() error {
    method Result (line 270) | func (it *orContains) Result() refs.Ref {
    method subItsContain (line 275) | func (it *orContains) subItsContain(ctx context.Context, val refs.Ref)...
    method Contains (line 293) | func (it *orContains) Contains(ctx context.Context, val refs.Ref) bool {
    method NextPath (line 309) | func (it *orContains) NextPath(ctx context.Context) bool {
    method Close (line 326) | func (it *orContains) Close() error {
  function newOrContains (line 248) | func newOrContains(sub []Index, shortCircuit bool) *orContains {

FILE: graph/iterator/or_test.go
  function iterated (line 28) | func iterated(s Shape) []int {
  function TestOrIteratorBasics (line 39) | func TestOrIteratorBasics(t *testing.T) {
  function TestShortCircuitingOrBasics (line 78) | func TestShortCircuitingOrBasics(t *testing.T) {
  function TestOrIteratorErr (line 143) | func TestOrIteratorErr(t *testing.T) {
  function TestShortCircuitOrIteratorErr (line 163) | func TestShortCircuitOrIteratorErr(t *testing.T) {

FILE: graph/iterator/recursive.go
  constant recursiveBaseTag (line 11) | recursiveBaseTag = "__base_recursive"
  type seenAt (line 13) | type seenAt struct
  type Recursive (line 22) | type Recursive struct
    method Iterate (line 40) | func (it *Recursive) Iterate() Scanner {
    method Lookup (line 44) | func (it *Recursive) Lookup() Index {
    method AddDepthTag (line 48) | func (it *Recursive) AddDepthTag(s string) {
    method SubIterators (line 52) | func (it *Recursive) SubIterators() []Shape {
    method Optimize (line 56) | func (it *Recursive) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 64) | func (it *Recursive) Stats(ctx context.Context) (Costs, error) {
    method String (line 84) | func (it *Recursive) String() string {
  function NewRecursive (line 29) | func NewRecursive(it Shape, morphism Morphism, maxDepth int) *Recursive {
  type recursiveNext (line 89) | type recursiveNext struct
    method TagResults (line 121) | func (it *recursiveNext) TagResults(dst map[string]refs.Ref) {
    method Next (line 140) | func (it *recursiveNext) Next(ctx context.Context) bool {
    method Err (line 195) | func (it *recursiveNext) Err() error {
    method Result (line 199) | func (it *recursiveNext) Result() refs.Ref {
    method getBaseValue (line 203) | func (it *recursiveNext) getBaseValue(val refs.Ref) refs.Ref {
    method NextPath (line 218) | func (it *recursiveNext) NextPath(ctx context.Context) bool {
    method Close (line 226) | func (it *recursiveNext) Close() error {
    method String (line 239) | func (it *recursiveNext) String() string {
  function newRecursiveNext (line 107) | func newRecursiveNext(it Scanner, morphism Morphism, maxDepth int, depth...
  type recursiveContains (line 244) | type recursiveContains struct
    method TagResults (line 255) | func (it *recursiveContains) TagResults(dst map[string]refs.Ref) {
    method Err (line 262) | func (it *recursiveContains) Err() error {
    method Result (line 266) | func (it *recursiveContains) Result() refs.Ref {
    method Contains (line 270) | func (it *recursiveContains) Contains(ctx context.Context, val refs.Re...
    method NextPath (line 288) | func (it *recursiveContains) NextPath(ctx context.Context) bool {
    method Close (line 292) | func (it *recursiveContains) Close() error {
    method String (line 296) | func (it *recursiveContains) String() string {
  function newRecursiveContains (line 249) | func newRecursiveContains(next *recursiveNext) *recursiveContains {

FILE: graph/iterator/recursive_test.go
  function singleHop (line 31) | func singleHop(qs graph.QuadIndexer, pred string) Morphism {
  function TestRecursiveNext (line 56) | func TestRecursiveNext(t *testing.T) {
  function TestRecursiveContains (line 75) | func TestRecursiveContains(t *testing.T) {
  function TestRecursiveNextPath (line 92) | func TestRecursiveNextPath(t *testing.T) {

FILE: graph/iterator/regex.go
  function newRegex (line 24) | func newRegex(qs refs.Namer, sub Shape, re *regexp.Regexp, refs bool) Sh...
  function NewRegex (line 51) | func NewRegex(sub Shape, re *regexp.Regexp, qs refs.Namer) Shape {
  function NewRegexWithRefs (line 68) | func NewRegexWithRefs(sub Shape, re *regexp.Regexp, qs refs.Namer) Shape {

FILE: graph/iterator/resolver.go
  type Resolver (line 27) | type Resolver struct
    method Iterate (line 42) | func (it *Resolver) Iterate() Scanner {
    method Lookup (line 46) | func (it *Resolver) Lookup() Index {
    method String (line 50) | func (it *Resolver) String() string {
    method SubIterators (line 54) | func (it *Resolver) SubIterators() []Shape {
    method Optimize (line 60) | func (it *Resolver) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 67) | func (it *Resolver) Stats(ctx context.Context) (Costs, error) {
  function NewResolver (line 33) | func NewResolver(qs refs.Namer, nodes ...quad.Value) *Resolver {
  type resolverNext (line 81) | type resolverNext struct
    method Close (line 101) | func (it *resolverNext) Close() error {
    method TagResults (line 105) | func (it *resolverNext) TagResults(dst map[string]refs.Ref) {}
    method String (line 107) | func (it *resolverNext) String() string {
    method resolve (line 112) | func (it *resolverNext) resolve(ctx context.Context) error {
    method Next (line 125) | func (it *resolverNext) Next(ctx context.Context) bool {
    method Err (line 141) | func (it *resolverNext) Err() error {
    method Result (line 145) | func (it *resolverNext) Result() refs.Ref {
    method NextPath (line 149) | func (it *resolverNext) NextPath(ctx context.Context) bool {
  function newResolverNext (line 92) | func newResolverNext(qs refs.Namer, nodes []quad.Value) *resolverNext {
  type resolverContains (line 155) | type resolverContains struct
    method Close (line 174) | func (it *resolverContains) Close() error {
    method TagResults (line 178) | func (it *resolverContains) TagResults(dst map[string]refs.Ref) {}
    method String (line 180) | func (it *resolverContains) String() string {
    method resolve (line 185) | func (it *resolverContains) resolve(ctx context.Context) error {
    method Contains (line 203) | func (it *resolverContains) Contains(ctx context.Context, value refs.R...
    method Err (line 217) | func (it *resolverContains) Err() error {
    method Result (line 221) | func (it *resolverContains) Result() refs.Ref {
    method NextPath (line 225) | func (it *resolverContains) NextPath(ctx context.Context) bool {
  function newResolverContains (line 165) | func newResolverContains(qs refs.Namer, nodes []quad.Value) *resolverCon...

FILE: graph/iterator/resolver_test.go
  function TestResolverIteratorIterate (line 15) | func TestResolverIteratorIterate(t *testing.T) {
  function TestResolverIteratorNotFoundError (line 48) | func TestResolverIteratorNotFoundError(t *testing.T) {
  function TestResolverIteratorContains (line 79) | func TestResolverIteratorContains(t *testing.T) {

FILE: graph/iterator/save.go
  function Tag (line 14) | func Tag(it Shape, tag string) Shape {
  function NewSave (line 30) | func NewSave(on Shape, tags ...string) *Save {
  type Save (line 36) | type Save struct
    method Iterate (line 42) | func (it *Save) Iterate() Scanner {
    method Lookup (line 46) | func (it *Save) Lookup() Index {
    method String (line 50) | func (it *Save) String() string {
    method AddTags (line 55) | func (it *Save) AddTags(tag ...string) {
    method AddFixedTag (line 59) | func (it *Save) AddFixedTag(tag string, value refs.Ref) {
    method Tags (line 67) | func (it *Save) Tags() []string {
    method FixedTags (line 72) | func (it *Save) FixedTags() map[string]refs.Ref {
    method CopyFromTagger (line 76) | func (it *Save) CopyFromTagger(st TaggerBase) {
    method Stats (line 91) | func (it *Save) Stats(ctx context.Context) (Costs, error) {
    method Optimize (line 95) | func (it *Save) Optimize(ctx context.Context) (nit Shape, no bool) {
    method SubIterators (line 112) | func (it *Save) SubIterators() []Shape {
  function newSaveNext (line 116) | func newSaveNext(it Scanner, tags []string, fixed map[string]refs.Ref) *...
  type saveNext (line 120) | type saveNext struct
    method String (line 126) | func (it *saveNext) String() string {
    method TagResults (line 130) | func (it *saveNext) TagResults(dst map[string]refs.Ref) {
    method Result (line 143) | func (it *saveNext) Result() refs.Ref {
    method Next (line 147) | func (it *saveNext) Next(ctx context.Context) bool {
    method NextPath (line 151) | func (it *saveNext) NextPath(ctx context.Context) bool {
    method Err (line 155) | func (it *saveNext) Err() error {
    method Close (line 159) | func (it *saveNext) Close() error {
  function newSaveContains (line 163) | func newSaveContains(it Index, tags []string, fixed map[string]refs.Ref)...
  type saveContains (line 167) | type saveContains struct
    method String (line 173) | func (it *saveContains) String() string {
    method TagResults (line 177) | func (it *saveContains) TagResults(dst map[string]refs.Ref) {
    method Result (line 190) | func (it *saveContains) Result() refs.Ref {
    method NextPath (line 194) | func (it *saveContains) NextPath(ctx context.Context) bool {
    method Contains (line 198) | func (it *saveContains) Contains(ctx context.Context, v refs.Ref) bool {
    method Err (line 202) | func (it *saveContains) Err() error {
    method Close (line 206) | func (it *saveContains) Close() error {

FILE: graph/iterator/skip.go
  type Skip (line 11) | type Skip struct
    method Iterate (line 23) | func (it *Skip) Iterate() Scanner {
    method Lookup (line 27) | func (it *Skip) Lookup() Index {
    method SubIterators (line 32) | func (it *Skip) SubIterators() []Shape {
    method Optimize (line 36) | func (it *Skip) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 45) | func (it *Skip) Stats(ctx context.Context) (Costs, error) {
    method String (line 56) | func (it *Skip) String() string {
  function NewSkip (line 16) | func NewSkip(primaryIt Shape, off int64) *Skip {
  type skipNext (line 61) | type skipNext struct
    method TagResults (line 74) | func (it *skipNext) TagResults(dst map[string]refs.Ref) {
    method Next (line 80) | func (it *skipNext) Next(ctx context.Context) bool {
    method Err (line 92) | func (it *skipNext) Err() error {
    method Result (line 96) | func (it *skipNext) Result() refs.Ref {
    method NextPath (line 102) | func (it *skipNext) NextPath(ctx context.Context) bool {
    method Close (line 113) | func (it *skipNext) Close() error {
    method String (line 117) | func (it *skipNext) String() string {
  function newSkipNext (line 67) | func newSkipNext(primaryIt Scanner, skip int64) *skipNext {
  type skipContains (line 122) | type skipContains struct
    method TagResults (line 135) | func (it *skipContains) TagResults(dst map[string]refs.Ref) {
    method Err (line 139) | func (it *skipContains) Err() error {
    method Result (line 143) | func (it *skipContains) Result() refs.Ref {
    method Contains (line 147) | func (it *skipContains) Contains(ctx context.Context, val refs.Ref) bo...
    method NextPath (line 186) | func (it *skipContains) NextPath(ctx context.Context) bool {
    method Close (line 197) | func (it *skipContains) Close() error {
    method String (line 201) | func (it *skipContains) String() string {
  function newSkipContains (line 128) | func newSkipContains(primaryIt Index, skip int64) *skipContains {

FILE: graph/iterator/skip_test.go
  function TestSkipIteratorBasics (line 12) | func TestSkipIteratorBasics(t *testing.T) {

FILE: graph/iterator/sort.go
  type Sort (line 11) | type Sort struct
    method Iterate (line 23) | func (it *Sort) Iterate() Scanner {
    method Lookup (line 27) | func (it *Sort) Lookup() Index {
    method Optimize (line 34) | func (it *Sort) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 42) | func (it *Sort) Stats(ctx context.Context) (Costs, error) {
    method String (line 55) | func (it *Sort) String() string {
    method SubIterators (line 60) | func (it *Sort) SubIterators() []Shape {
  function NewSort (line 19) | func NewSort(namer refs.Namer, subIt Shape) *Sort {
  type sortValue (line 64) | type sortValue struct
  type sortByString (line 69) | type sortByString
    method Len (line 71) | func (v sortByString) Len() int { return len(v) }
    method Less (line 72) | func (v sortByString) Less(i, j int) bool {
    method Swap (line 75) | func (v sortByString) Swap(i, j int) { v[i], v[j] = v[j], v[i] }
  type sortNext (line 77) | type sortNext struct
    method TagResults (line 95) | func (it *sortNext) TagResults(dst map[string]refs.Ref) {
    method Err (line 101) | func (it *sortNext) Err() error {
    method Result (line 105) | func (it *sortNext) Result() refs.Ref {
    method Next (line 109) | func (it *sortNext) Next(ctx context.Context) bool {
    method NextPath (line 130) | func (it *sortNext) NextPath(ctx context.Context) bool {
    method Close (line 143) | func (it *sortNext) Close() error {
    method String (line 148) | func (it *sortNext) String() string {
  function newSortNext (line 87) | func newSortNext(namer refs.Namer, subIt Scanner) *sortNext {
  function getSortedValues (line 152) | func getSortedValues(ctx context.Context, namer refs.Namer, it Scanner) ...

FILE: graph/iterator/unique.go
  type Unique (line 10) | type Unique struct
    method Iterate (line 20) | func (it *Unique) Iterate() Scanner {
    method Lookup (line 24) | func (it *Unique) Lookup() Index {
    method SubIterators (line 30) | func (it *Unique) SubIterators() []Shape {
    method Optimize (line 34) | func (it *Unique) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 44) | func (it *Unique) Stats(ctx context.Context) (Costs, error) {
    method String (line 56) | func (it *Unique) String() string {
  function NewUnique (line 14) | func NewUnique(subIt Shape) *Unique {
  constant uniquenessFactor (line 42) | uniquenessFactor = 2
  type uniqueNext (line 61) | type uniqueNext struct
    method TagResults (line 75) | func (it *uniqueNext) TagResults(dst map[string]refs.Ref) {
    method Next (line 83) | func (it *uniqueNext) Next(ctx context.Context) bool {
    method Err (line 97) | func (it *uniqueNext) Err() error {
    method Result (line 101) | func (it *uniqueNext) Result() refs.Ref {
    method NextPath (line 108) | func (it *uniqueNext) NextPath(ctx context.Context) bool {
    method Close (line 113) | func (it *uniqueNext) Close() error {
    method String (line 118) | func (it *uniqueNext) String() string {
  function newUniqueNext (line 68) | func newUniqueNext(subIt Scanner) *uniqueNext {
  type uniqueContains (line 123) | type uniqueContains struct
    method TagResults (line 133) | func (it *uniqueContains) TagResults(dst map[string]refs.Ref) {
    method Err (line 139) | func (it *uniqueContains) Err() error {
    method Result (line 143) | func (it *uniqueContains) Result() refs.Ref {
    method Contains (line 149) | func (it *uniqueContains) Contains(ctx context.Context, val refs.Ref) ...
    method NextPath (line 156) | func (it *uniqueContains) NextPath(ctx context.Context) bool {
    method Close (line 161) | func (it *uniqueContains) Close() error {
    method String (line 165) | func (it *uniqueContains) String() string {
  function newUniqueContains (line 127) | func newUniqueContains(subIt Index) *uniqueContains {

FILE: graph/iterator/unique_test.go
  function TestUniqueIteratorBasics (line 12) | func TestUniqueIteratorBasics(t *testing.T) {

FILE: graph/iterator/value_comparison.go
  type Operator (line 37) | type Operator
    method String (line 39) | func (op Operator) String() string {
  constant CompareLT (line 55) | CompareLT Operator = iota
  constant CompareLTE (line 56) | CompareLTE
  constant CompareGT (line 57) | CompareGT
  constant CompareGTE (line 58) | CompareGTE
  function NewComparison (line 62) | func NewComparison(sub Shape, op Operator, val quad.Value, qs refs.Namer...
  function RunIntOp (line 101) | func RunIntOp(a quad.Int, op Operator, b quad.Int) bool {
  function RunFloatOp (line 116) | func RunFloatOp(a quad.Float, op Operator, b quad.Float) bool {
  function RunStrOp (line 131) | func RunStrOp(a string, op Operator, b string) bool {
  function RunTimeOp (line 146) | func RunTimeOp(a time.Time, op Operator, b time.Time) bool {

FILE: graph/iterator/value_comparison_test.go
  function simpleFixedIterator (line 37) | func simpleFixedIterator() *Fixed {
  function stringFixedIterator (line 45) | func stringFixedIterator() *Fixed {
  function mixedFixedIterator (line 53) | func mixedFixedIterator() *Fixed {
  function TestValueComparison (line 143) | func TestValueComparison(t *testing.T) {
  function TestVCIContains (line 235) | func TestVCIContains(t *testing.T) {
  function TestComparisonIteratorErr (line 262) | func TestComparisonIteratorErr(t *testing.T) {

FILE: graph/iterator/value_filter.go
  type ValueFilterFunc (line 24) | type ValueFilterFunc
  type ValueFilter (line 26) | type ValueFilter struct
    method Iterate (line 40) | func (it *ValueFilter) Iterate() Scanner {
    method Lookup (line 44) | func (it *ValueFilter) Lookup() Index {
    method SubIterators (line 48) | func (it *ValueFilter) SubIterators() []Shape {
    method String (line 52) | func (it *ValueFilter) String() string {
    method Optimize (line 59) | func (it *ValueFilter) Optimize(ctx context.Context) (Shape, bool) {
    method Stats (line 69) | func (it *ValueFilter) Stats(ctx context.Context) (Costs, error) {
  function NewValueFilter (line 32) | func NewValueFilter(qs refs.Namer, sub Shape, filter ValueFilterFunc) *V...
  type valueFilterNext (line 76) | type valueFilterNext struct
    method doFilter (line 92) | func (it *valueFilterNext) doFilter(val refs.Ref) bool {
    method Close (line 105) | func (it *valueFilterNext) Close() error {
    method Next (line 109) | func (it *valueFilterNext) Next(ctx context.Context) bool {
    method Err (line 121) | func (it *valueFilterNext) Err() error {
    method Result (line 125) | func (it *valueFilterNext) Result() refs.Ref {
    method NextPath (line 129) | func (it *valueFilterNext) NextPath(ctx context.Context) bool {
    method TagResults (line 135) | func (it *valueFilterNext) TagResults(dst map[string]refs.Ref) {
    method String (line 139) | func (it *valueFilterNext) String() string {
  function newValueFilterNext (line 84) | func newValueFilterNext(qs refs.Namer, sub Scanner, filter ValueFilterFu...
  type valueFilterContains (line 143) | type valueFilterContains struct
    method doFilter (line 159) | func (it *valueFilterContains) doFilter(val refs.Ref) bool {
    method Close (line 172) | func (it *valueFilterContains) Close() error {
    method Err (line 176) | func (it *valueFilterContains) Err() error {
    method Result (line 180) | func (it *valueFilterContains) Result() refs.Ref {
    method NextPath (line 184) | func (it *valueFilterContains) NextPath(ctx context.Context) bool {
    method Contains (line 188) | func (it *valueFilterContains) Contains(ctx context.Context, val refs....
    method TagResults (line 201) | func (it *valueFilterContains) TagResults(dst map[string]refs.Ref) {
    method String (line 205) | func (it *valueFilterContains) String() string {
  function newValueFilterContains (line 151) | func newValueFilterContains(qs refs.Namer, sub Index, filter ValueFilter...

FILE: graph/kv/all_iterator.go
  type constraint (line 27) | type constraint struct
  type allIterator (line 32) | type allIterator struct
    method Iterate (line 49) | func (it *allIterator) Iterate() iterator.Scanner {
    method Lookup (line 53) | func (it *allIterator) Lookup() iterator.Index {
    method SubIterators (line 58) | func (it *allIterator) SubIterators() []iterator.Shape {
    method String (line 62) | func (it *allIterator) String() string {
    method Sorted (line 66) | func (it *allIterator) Sorted() bool { return false }
    method Optimize (line 68) | func (it *allIterator) Optimize(ctx context.Context) (iterator.Shape, ...
    method Stats (line 72) | func (it *allIterator) Stats(ctx context.Context) (iterator.Costs, err...
  method newAllIterator (line 38) | func (qs *QuadStore) newAllIterator(nodes bool, cons *constraint) *allIt...
  type allIteratorNext (line 83) | type allIteratorNext struct
    method TagResults (line 106) | func (it *allIteratorNext) TagResults(dst map[string]graph.Ref) {}
    method Close (line 108) | func (it *allIteratorNext) Close() error {
    method Err (line 112) | func (it *allIteratorNext) Err() error {
    method Result (line 116) | func (it *allIteratorNext) Result() graph.Ref {
    method Next (line 131) | func (it *allIteratorNext) Next(ctx context.Context) bool {
    method NextPath (line 180) | func (it *allIteratorNext) NextPath(ctx context.Context) bool {
    method String (line 184) | func (it *allIteratorNext) String() string {
    method Sorted (line 188) | func (it *allIteratorNext) Sorted() bool { return false }
  method newAllIteratorNext (line 94) | func (qs *QuadStore) newAllIteratorNext(nodes bool, cons *constraint) *a...
  constant nextBatch (line 129) | nextBatch = 100
  type allIteratorContains (line 190) | type allIteratorContains struct
    method TagResults (line 212) | func (it *allIteratorContains) TagResults(dst map[string]graph.Ref) {}
    method Close (line 214) | func (it *allIteratorContains) Close() error {
    method Err (line 218) | func (it *allIteratorContains) Err() error {
    method Result (line 222) | func (it *allIteratorContains) Result() graph.Ref {
    method NextPath (line 235) | func (it *allIteratorContains) NextPath(ctx context.Context) bool {
    method Contains (line 239) | func (it *allIteratorContains) Contains(ctx context.Context, v graph.R...
    method String (line 267) | func (it *allIteratorContains) String() string {
    method Sorted (line 271) | func (it *allIteratorContains) Sorted() bool { return false }
  method newAllIteratorContains (line 200) | func (qs *QuadStore) newAllIteratorContains(nodes bool, cons *constraint...

FILE: graph/kv/badger/badger.go
  constant Type (line 28) | Type = badger.Name
  function Create (line 31) | func Create(path string, m graph.Options) (hkv.KV, error) {

FILE: graph/kv/badger/badger_test.go
  function makeBadgerkv (line 27) | func makeBadgerkv(t testing.TB) (hkv.KV, graph.Options, func()) {
  function TestBadgerkv (line 43) | func TestBadgerkv(t *testing.T) {
  function BenchmarkBadgerkv (line 47) | func BenchmarkBadgerkv(b *testing.B) {

FILE: graph/kv/bbolt/bolt.go
  function init (line 29) | func init() {
  constant Type (line 40) | Type = bolt.Name
  function getBoltFile (line 43) | func getBoltFile(cfgpath string) string {
  function Create (line 47) | func Create(path string, _ graph.Options) (hkv.KV, error) {
  function Open (line 63) | func Open(path string, opt graph.Options) (hkv.KV, error) {

FILE: graph/kv/bbolt/bolt_test.go
  function makeBolt (line 27) | func makeBolt(t testing.TB) (hkv.KV, graph.Options, func()) {
  function TestBolt (line 43) | func TestBolt(t *testing.T) {
  function BenchmarkBolt (line 47) | func BenchmarkBolt(b *testing.B) {

FILE: graph/kv/bolt/bolt.go
  function init (line 28) | func init() {
  constant Type (line 39) | Type = bolt.Name
  function getBoltFile (line 42) | func getBoltFile(cfgpath string) string {
  function Create (line 46) | func Create(path string, _ graph.Options) (hkv.KV, error) {
  function Open (line 62) | func Open(path string, opt graph.Options) (hkv.KV, error) {

FILE: graph/kv/bolt/bolt_test.go
  function makeBolt (line 27) | func makeBolt(t testing.TB) (hkv.KV, graph.Options, func()) {
  function TestBolt (line 43) | func TestBolt(t *testing.T) {
  function BenchmarkBolt (line 47) | func BenchmarkBolt(b *testing.B) {

FILE: graph/kv/btree/btree.go
  constant Type (line 25) | Type = btree.Name
  function Create (line 28) | func Create(path string, _ graph.Options) (hkv.KV, error) {
  function New (line 32) | func New() hkv.KV {

FILE: graph/kv/btree/btree_test.go
  constant debug (line 26) | debug = false
  function makeBtree (line 28) | func makeBtree(t testing.TB) (hkv.KV, graph.Options, func()) {
  function makeBtreeDebug (line 35) | func makeBtreeDebug(t testing.TB) (hkv.KV, graph.Options, func()) {
  function TestBtree (line 49) | func TestBtree(t *testing.T) {
  function BenchmarkBtree (line 53) | func BenchmarkBtree(b *testing.B) {

FILE: graph/kv/indexing.go
  type QuadIndex (line 75) | type QuadIndex struct
    method Key (line 80) | func (ind QuadIndex) Key(vals []uint64) kv.Key {
    method KeyFor (line 90) | func (ind QuadIndex) KeyFor(p *cproto.Primitive) kv.Key {
    method bucket (line 100) | func (ind QuadIndex) bucket() kv.Key {
  function bucketForVal (line 110) | func bucketForVal(i, j byte) kv.Key {
  function bucketForValRefs (line 114) | func bucketForValRefs(i, j byte) kv.Key {
  method createBuckets (line 118) | func (qs *QuadStore) createBuckets(ctx context.Context, upfront bool) er...
  method incSize (line 149) | func (qs *QuadStore) incSize(ctx context.Context, tx kv.Tx, size int64) ...
  method writeIndexesMeta (line 156) | func (qs *QuadStore) writeIndexesMeta(ctx context.Context) error {
  method readIndexesMeta (line 169) | func (qs *QuadStore) readIndexesMeta(ctx context.Context) ([]QuadIndex, ...
  method resolveValDeltas (line 191) | func (qs *QuadStore) resolveValDeltas(ctx context.Context, tx kv.Tx, del...
  method getMetaIntTx (line 235) | func (qs *QuadStore) getMetaIntTx(ctx context.Context, tx kv.Tx, key str...
  method incMetaInt (line 245) | func (qs *QuadStore) incMetaInt(ctx context.Context, tx kv.Tx, key strin...
  method genIDs (line 266) | func (qs *QuadStore) genIDs(ctx context.Context, tx kv.Tx, n int) (uint6...
  type nodeUpdate (line 277) | type nodeUpdate struct
  method incNodesCnt (line 283) | func (qs *QuadStore) incNodesCnt(ctx context.Context, tx kv.Tx, deltas, ...
  type resolvedNode (line 331) | type resolvedNode struct
  method incNodes (line 336) | func (qs *QuadStore) incNodes(ctx context.Context, tx kv.Tx, deltas []gr...
  method decNodes (line 380) | func (qs *QuadStore) decNodes(ctx context.Context, tx kv.Tx, deltas []gr...
  method NewQuadWriter (line 409) | func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error) {
  type quadWriter (line 413) | type quadWriter struct
    method WriteQuad (line 420) | func (w *quadWriter) WriteQuad(q quad.Quad) error {
    method flush (line 425) | func (w *quadWriter) flush(ctx context.Context) error {
    method WriteQuads (line 447) | func (w *quadWriter) WriteQuads(buf []quad.Quad) (int, error) {
    method Close (line 476) | func (w *quadWriter) Close() error {
  method applyAddDeltas (line 501) | func (qs *QuadStore) applyAddDeltas(ctx context.Context, tx kv.Tx, in []...
  method ApplyDeltas (line 563) | func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreOpts graph.Igno...
  method indexNode (line 673) | func (qs *QuadStore) indexNode(ctx context.Context, tx kv.Tx, p *cproto....
  method indexLinks (line 695) | func (qs *QuadStore) indexLinks(ctx context.Context, tx kv.Tx, links []*...
  method indexLink (line 703) | func (qs *QuadStore) indexLink(ctx context.Context, tx kv.Tx, p *cproto....
  method markAsDead (line 722) | func (qs *QuadStore) markAsDead(ctx context.Context, tx kv.Tx, p *cproto...
  method delLog (line 729) | func (qs *QuadStore) delLog(ctx context.Context, tx kv.Tx, id uint64) er...
  method markLinksDead (line 733) | func (qs *QuadStore) markLinksDead(ctx context.Context, tx kv.Tx, links ...
  method getBucketIndexes (line 742) | func (qs *QuadStore) getBucketIndexes(ctx context.Context, tx kv.Tx, key...
  function countIndex (line 761) | func countIndex(b []byte) (int64, error) {
  function decodeIndex (line 776) | func decodeIndex(b []byte) ([]uint64, error) {
  function appendIndex (line 791) | func appendIndex(bytelist []byte, l []uint64) []byte {
  method bestUnique (line 802) | func (qs *QuadStore) bestUnique() ([]QuadIndex, error) {
  function hasDir (line 835) | func hasDir(dirs []quad.Direction, d quad.Direction) bool {
  method bestIndexes (line 844) | func (qs *QuadStore) bestIndexes(dirs []quad.Direction) []QuadIndex {
  method hasPrimitive (line 879) | func (qs *QuadStore) hasPrimitive(ctx context.Context, tx kv.Tx, p *cpro...
  function intersectSortedUint64 (line 928) | func intersectSortedUint64(a, b []uint64) []uint64 {
  method addToMapBucket (line 954) | func (qs *QuadStore) addToMapBucket(tx kv.Tx, key kv.Key, value uint64) ...
  method flushMapBucket (line 976) | func (qs *QuadStore) flushMapBucket(ctx context.Context, tx kv.Tx) error {
  method indexSchema (line 1044) | func (qs *QuadStore) indexSchema(tx kv.Tx, p *cproto.Primitive) error {
  method addToLog (line 1048) | func (qs *QuadStore) addToLog(ctx context.Context, tx kv.Tx, p *cproto.P...
  function createNodePrimitive (line 1060) | func createNodePrimitive(v quad.Value) (*cproto.Primitive, error) {
  method resolveQuadValue (line 1071) | func (qs *QuadStore) resolveQuadValue(ctx context.Context, tx kv.Tx, v q...
  function bucketKeyForVal (line 1079) | func bucketKeyForVal(v quad.Value) kv.Key {
  function bucketKeyForHash (line 1084) | func bucketKeyForHash(h refs.ValueHash) kv.Key {
  function bucketKeyForHashRefs (line 1088) | func bucketKeyForHashRefs(h refs.ValueHash) kv.Key {
  method resolveQuadValues (line 1092) | func (qs *QuadStore) resolveQuadValues(ctx context.Context, tx kv.Tx, va...
  function uint64toBytes (line 1128) | func uint64toBytes(x uint64) []byte {
  function uint64toBytesAt (line 1133) | func uint64toBytesAt(x uint64, bytes []byte) []byte {
  function uint64KeyBytes (line 1138) | func uint64KeyBytes(x uint64) kv.Key {
  method getPrimitivesFromLog (line 1144) | func (qs *QuadStore) getPrimitivesFromLog(ctx context.Context, tx kv.Tx,...
  method getPrimitiveFromLog (line 1171) | func (qs *QuadStore) getPrimitiveFromLog(ctx context.Context, tx kv.Tx, ...
  method initBloomFilter (line 1181) | func (qs *QuadStore) initBloomFilter(ctx context.Context) error {
  method testBloom (line 1210) | func (qs *QuadStore) testBloom(p *cproto.Primitive) bool {
  method bloomRemove (line 1220) | func (qs *QuadStore) bloomRemove(p *cproto.Primitive) {
  method bloomAdd (line 1230) | func (qs *QuadStore) bloomAdd(p *cproto.Primitive) {
  function writePrimToBuf (line 1240) | func writePrimToBuf(p *cproto.Primitive, buf []byte) {
  type Int64Set (line 1246) | type Int64Set
    method Len (line 1248) | func (a Int64Set) Len() int           { return len(a) }
    method Swap (line 1249) | func (a Int64Set) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
    method Less (line 1250) | func (a Int64Set) Less(i, j int) bool { return a[i] < a[j] }

FILE: graph/kv/indexing_test.go
  function TestIntersectSorted (line 5) | func TestIntersectSorted(t *testing.T) {
  function TestIndexlist (line 36) | func TestIndexlist(t *testing.T) {

FILE: graph/kv/iterators.go
  method NodesAllIterator (line 17) | func (qs *QuadStore) NodesAllIterator() iterator.Shape {
  method QuadsAllIterator (line 21) | func (qs *QuadStore) QuadsAllIterator() iterator.Shape {
  method indexSize (line 25) | func (qs *QuadStore) indexSize(ctx context.Context, ind QuadIndex, vals ...
  method QuadIteratorSize (line 53) | func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Direct...
  method QuadIterator (line 76) | func (qs *QuadStore) QuadIterator(dir quad.Direction, v graph.Ref) itera...
  method OptimizeShape (line 96) | func (qs *QuadStore) OptimizeShape(ctx context.Context, s shape.Shape) (...
  method optimizeQuadsAction (line 104) | func (qs *QuadStore) optimizeQuadsAction(s shape.QuadsAction) (shape.Sha...
  type IndexScan (line 127) | type IndexScan struct
    method BuildIterator (line 132) | func (s IndexScan) BuildIterator(qs graph.QuadStore) iterator.Shape {
    method Optimize (line 140) | func (s IndexScan) Optimize(ctx context.Context, r shape.Optimizer) (s...

FILE: graph/kv/kvtest/kvtest.go
  type DatabaseFunc (line 19) | type DatabaseFunc
  type Config (line 21) | type Config struct
    method quadStore (line 25) | func (c Config) quadStore() *graphtest.Config {
  function newQuadStoreFunc (line 32) | func newQuadStoreFunc(gen DatabaseFunc, bloom bool) testutil.DatabaseFunc {
  function NewQuadStoreFunc (line 38) | func NewQuadStoreFunc(gen DatabaseFunc) testutil.DatabaseFunc {
  function newQuadStore (line 42) | func newQuadStore(t testing.TB, gen DatabaseFunc, bloom bool) (graph.Qua...
  function NewQuadStore (line 68) | func NewQuadStore(t testing.TB, gen DatabaseFunc) (graph.QuadStore, grap...
  function TestAll (line 72) | func TestAll(t *testing.T, gen DatabaseFunc, conf *Config) {
  function testOptimize (line 89) | func testOptimize(t *testing.T, gen DatabaseFunc, _ *Config) {
  function BenchmarkAll (line 131) | func BenchmarkAll(t *testing.B, gen DatabaseFunc, conf *Config) {

FILE: graph/kv/leveldb/leveldb.go
  constant Type (line 28) | Type = leveldb.Name
  function Create (line 31) | func Create(path string, m graph.Options) (hkv.KV, error) {
  function Open (line 51) | func Open(path string, m graph.Options) (hkv.KV, error) {

FILE: graph/kv/leveldb/leveldb_test.go
  function makeLeveldb (line 27) | func makeLeveldb(t testing.TB) (hkv.KV, graph.Options, func()) {
  function TestLeveldb (line 43) | func TestLeveldb(t *testing.T) {
  function BenchmarkLeveldb (line 47) | func BenchmarkLeveldb(b *testing.B) {

FILE: graph/kv/metrics.go
  function wrapTx (line 111) | func wrapTx(tx kv.Tx) kv.Tx {
  type mTx (line 115) | type mTx struct
    method Commit (line 120) | func (tx *mTx) Commit(ctx context.Context) error {
    method Close (line 129) | func (tx *mTx) Close() error {
    method Get (line 137) | func (tx *mTx) Get(ctx context.Context, key kv.Key) (kv.Value, error) {
    method GetBatch (line 148) | func (tx *mTx) GetBatch(ctx context.Context, keys []kv.Key) ([]kv.Valu...
    method Put (line 161) | func (tx *mTx) Put(ctx context.Context, k kv.Key, v kv.Value) error {
    method Del (line 167) | func (tx *mTx) Del(ctx context.Context, k kv.Key) error {
    method Scan (line 172) | func (tx *mTx) Scan(ctx context.Context, opts ...kv.IteratorOption) kv...

FILE: graph/kv/quad_iterator.go
  type QuadIterator (line 30) | type QuadIterator struct
    method Iterate (line 48) | func (it *QuadIterator) Iterate() iterator.Scanner {
    method Lookup (line 52) | func (it *QuadIterator) Lookup() iterator.Index {
    method SubIterators (line 56) | func (it *QuadIterator) SubIterators() []iterator.Shape {
    method getSize (line 60) | func (it *QuadIterator) getSize(ctx context.Context) (refs.Size, error) {
    method String (line 80) | func (it *QuadIterator) String() string {
    method Sorted (line 84) | func (it *QuadIterator) Sorted() bool { return true }
    method Optimize (line 86) | func (it *QuadIterator) Optimize(ctx context.Context) (iterator.Shape,...
    method Stats (line 90) | func (it *QuadIterator) Stats(ctx context.Context) (iterator.Costs, er...
  method newQuadIterator (line 39) | func (qs *QuadStore) newQuadIterator(ind QuadIndex, vals []uint64) *Quad...
  type quadIteratorNext (line 99) | type quadIteratorNext struct
    method TagResults (line 123) | func (it *quadIteratorNext) TagResults(dst map[string]graph.Ref) {}
    method Close (line 125) | func (it *quadIteratorNext) Close() error {
    method Err (line 139) | func (it *quadIteratorNext) Err() error {
    method Result (line 143) | func (it *quadIteratorNext) Result() graph.Ref {
    method ensureTx (line 150) | func (it *quadIteratorNext) ensureTx(ctx context.Context) bool {
    method Next (line 162) | func (it *quadIteratorNext) Next(ctx context.Context) bool {
    method NextPath (line 216) | func (it *quadIteratorNext) NextPath(ctx context.Context) bool {
    method String (line 220) | func (it *quadIteratorNext) String() string {
    method Sorted (line 224) | func (it *quadIteratorNext) Sorted() bool { return true }
  method newQuadIteratorNext (line 115) | func (qs *QuadStore) newQuadIteratorNext(ind QuadIndex, vals []uint64) *...
  type quadIteratorContains (line 226) | type quadIteratorContains struct
    method TagResults (line 243) | func (it *quadIteratorContains) TagResults(dst map[string]graph.Ref) {}
    method Close (line 245) | func (it *quadIteratorContains) Close() error {
    method Err (line 249) | func (it *quadIteratorContains) Err() error {
    method Result (line 253) | func (it *quadIteratorContains) Result() graph.Ref {
    method NextPath (line 260) | func (it *quadIteratorContains) NextPath(ctx context.Context) bool {
    method Contains (line 264) | func (it *quadIteratorContains) Contains(ctx context.Context, v graph....
    method String (line 280) | func (it *quadIteratorContains) String() string {
    method Sorted (line 284) | func (it *quadIteratorContains) Sorted() bool { return true }
  method newQuadIteratorContains (line 235) | func (qs *QuadStore) newQuadIteratorContains(ind QuadIndex, vals []uint6...

FILE: graph/kv/quadstore.go
  type Registration (line 43) | type Registration struct
  type InitFunc (line 49) | type InitFunc
  type NewFunc (line 50) | type NewFunc
  function Register (line 52) | func Register(name string, r Registration) {
  constant latestDataVersion (line 86) | latestDataVersion   = 2
  constant envKVDefaultIndexes (line 87) | envKVDefaultIndexes = "CAYLEY_KV_INDEXES"
  type QuadStore (line 95) | type QuadStore struct
    method getMetaInt (line 203) | func (qs *QuadStore) getMetaInt(ctx context.Context, key string) (int6...
    method getSize (line 221) | func (qs *QuadStore) getSize() (int64, error) {
    method Size (line 229) | func (qs *QuadStore) Size() int64 {
    method Stats (line 234) | func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Sta...
    method Close (line 265) | func (qs *QuadStore) Close() error {
    method getMetadata (line 269) | func (qs *QuadStore) getMetadata(ctx context.Context) (int64, error) {
    method horizon (line 297) | func (qs *QuadStore) horizon(ctx context.Context) int64 {
    method ValuesOf (line 302) | func (qs *QuadStore) ValuesOf(ctx context.Context, vals []graph.Ref) (...
    method RefsOf (line 348) | func (qs *QuadStore) RefsOf(ctx context.Context, nodes []quad.Value) (...
    method NameOf (line 366) | func (qs *QuadStore) NameOf(v graph.Ref) (quad.Value, error) {
    method Quad (line 375) | func (qs *QuadStore) Quad(k graph.Ref) (quad.Quad, error) {
    method primitiveToQuad (line 396) | func (qs *QuadStore) primitiveToQuad(ctx context.Context, tx kv.Tx, p ...
    method getValFromLog (line 409) | func (qs *QuadStore) getValFromLog(ctx context.Context, tx kv.Tx, k ui...
    method ValueOf (line 420) | func (qs *QuadStore) ValueOf(s quad.Value) (graph.Ref, error) {
    method QuadDirection (line 437) | func (qs *QuadStore) QuadDirection(val graph.Ref, d quad.Direction) (g...
    method getPrimitives (line 458) | func (qs *QuadStore) getPrimitives(ctx context.Context, vals []uint64)...
  function newQuadStore (line 120) | func newQuadStore(kv kv.KV) *QuadStore {
  function Init (line 124) | func Init(kv kv.KV, opt graph.Options) error {
  constant OptNoBloom (line 158) | OptNoBloom = "no_bloom"
  function New (line 161) | func New(kv kv.KV, opt graph.Options) (graph.QuadStore, error) {
  function setVersion (line 192) | func setVersion(ctx context.Context, db kv.KV, version int64) error {
  function asInt64 (line 287) | func asInt64(b []byte, empty int64) (int64, error) {
  type Int64Value (line 468) | type Int64Value
    method Key (line 470) | func (v Int64Value) Key() interface{} { return v }

FILE: graph/kv/quadstore_test.go
  function hex (line 25) | func hex(s string) []byte {
  function irih (line 33) | func irih(s string) []byte {
  function irib (line 38) | func irib(s string) string {
  function iric (line 43) | func iric(s string) string {
  function key (line 48) | func key(b string, k []byte) hkv.Key {
  function be (line 52) | func be(v ...uint64) []byte {
  function le (line 59) | func le(v uint64) []byte {
  constant bMeta (line 66) | bMeta = "meta"
  constant bLog (line 67) | bLog  = "log"
  type Ops (line 79) | type Ops
    method Len (line 81) | func (s Ops) Len() int {
    method Less (line 85) | func (s Ops) Less(i, j int) bool {
    method Swap (line 90) | func (s Ops) Swap(i, j int) {
    method String (line 94) | func (s Ops) String() string {
  function TestApplyDeltas (line 106) | func TestApplyDeltas(t *testing.T) {
  function clone (line 229) | func clone(b []byte) []byte {
  function sortByOp (line 236) | func sortByOp(exp, got Ops) {
  constant opGet (line 262) | opGet = iota
  constant opPut (line 263) | opPut
  constant opDel (line 264) | opDel
  type kvOp (line 267) | type kvOp struct
  type kvHook (line 276) | type kvHook struct
    method log (line 283) | func (h *kvHook) log() Ops {
    method addOp (line 291) | func (h *kvHook) addOp(op kvOp) {
    method Close (line 297) | func (h *kvHook) Close() error {
    method Tx (line 301) | func (h *kvHook) Tx(ctx context.Context, rw bool) (hkv.Tx, error) {
    method View (line 309) | func (h *kvHook) View(ctx context.Context, fn func(tx hkv.Tx) error) e...
    method Update (line 315) | func (h *kvHook) Update(ctx context.Context, fn func(tx hkv.Tx) error)...
  type txHook (line 321) | type txHook struct
    method Commit (line 326) | func (h txHook) Commit(ctx context.Context) error {
    method Close (line 330) | func (h txHook) Close() error {
    method GetBatch (line 334) | func (h txHook) GetBatch(ctx context.Context, keys []hkv.Key) ([]hkv.V...
    method Get (line 348) | func (h txHook) Get(ctx context.Context, k hkv.Key) (hkv.Value, error) {
    method Put (line 358) | func (h txHook) Put(ctx context.Context, k hkv.Key, v hkv.Value) error {
    method Del (line 369) | func (h txHook) Del(ctx context.Context, k hkv.Key) error {
    method Scan (line 379) | func (h txHook) Scan(ctx context.Context, opts ...hkv.IteratorOption) ...

FILE: graph/kv/registry.go
  function init (line 11) | func init() {

FILE: graph/linksto.go
  type LinksTo (line 44) | type LinksTo struct
    method Direction (line 62) | func (it *LinksTo) Direction() quad.Direction { return it.dir }
    method Iterate (line 64) | func (it *LinksTo) Iterate() iterator.Scanner {
    method Lookup (line 68) | func (it *LinksTo) Lookup() iterator.Index {
    method String (line 72) | func (it *LinksTo) String() string {
    method SubIterators (line 77) | func (it *LinksTo) SubIterators() []iterator.Shape {
    method Optimize (line 82) | func (it *LinksTo) Optimize(ctx context.Context) (iterator.Shape, bool) {
    method Stats (line 94) | func (it *LinksTo) Stats(ctx context.Context) (iterator.Costs, error) {
    method getSize (line 106) | func (it *LinksTo) getSize(ctx context.Context) refs.Size {
  function NewLinksTo (line 53) | func NewLinksTo(qs QuadIndexer, it iterator.Shape, d quad.Direction) *Li...
  type linksToNext (line 141) | type linksToNext struct
    method Direction (line 162) | func (it *linksToNext) Direction() quad.Direction { return it.dir }
    method TagResults (line 165) | func (it *linksToNext) TagResults(dst map[string]refs.Ref) {
    method String (line 169) | func (it *linksToNext) String() string {
    method Next (line 174) | func (it *linksToNext) Next(ctx context.Context) bool {
    method Err (line 202) | func (it *linksToNext) Err() error {
    method Result (line 206) | func (it *linksToNext) Result() refs.Ref {
    method Close (line 212) | func (it *linksToNext) Close() error {
    method NextPath (line 224) | func (it *linksToNext) NextPath(ctx context.Context) bool {
  function newLinksToNext (line 152) | func newLinksToNext(qs QuadIndexer, it iterator.Scanner, d quad.Directio...
  type linksToContains (line 235) | type linksToContains struct
    method Direction (line 254) | func (it *linksToContains) Direction() quad.Direction { return it.dir }
    method TagResults (line 257) | func (it *linksToContains) TagResults(dst map[string]refs.Ref) {
    method String (line 261) | func (it *linksToContains) String() string {
    method Contains (line 267) | func (it *linksToContains) Contains(ctx context.Context, val refs.Ref)...
    method Err (line 280) | func (it *linksToContains) Err() error {
    method Result (line 287) | func (it *linksToContains) Result() refs.Ref {
    method Close (line 293) | func (it *linksToContains) Close() error {
    method NextPath (line 298) | func (it *linksToContains) NextPath(ctx context.Context) bool {
  function newLinksToContains (line 245) | func newLinksToContains(qs QuadIndexer, it iterator.Index, d quad.Direct...

FILE: graph/linksto_test.go
  function TestLinksTo (line 29) | func TestLinksTo(t *testing.T) {

FILE: graph/log/graphlog.go
  type Op (line 12) | type Op interface
  type NodeUpdate (line 21) | type NodeUpdate struct
    method isOp (line 27) | func (NodeUpdate) isOp() {}
  type QuadUpdate (line 29) | type QuadUpdate struct
    method isOp (line 35) | func (QuadUpdate) isOp() {}
  type Deltas (line 37) | type Deltas struct
  function InsertQuads (line 44) | func InsertQuads(in []quad.Quad) *Deltas {
  function SplitDeltas (line 79) | func SplitDeltas(in []graph.Delta) *Deltas {

FILE: graph/memstore/all_iterator.go
  type allIterator (line 27) | type allIterator struct
    method Iterate (line 41) | func (it *allIterator) Iterate() iterator.Scanner {
    method Lookup (line 45) | func (it *allIterator) Lookup() iterator.Index {
    method SubIterators (line 49) | func (it *allIterator) SubIterators() []iterator.Shape { return nil }
    method Optimize (line 50) | func (it *allIterator) Optimize(ctx context.Context) (iterator.Shape, ...
    method String (line 54) | func (it *allIterator) String() string {
    method Stats (line 58) | func (it *allIterator) Stats(ctx context.Context) (iterator.Costs, err...
  method newAllIterator (line 34) | func (qs *QuadStore) newAllIterator(nodes bool, maxid int64) *allIterator {
  method filter (line 70) | func (p *Primitive) filter(isNode bool, maxid int64) bool {
  type allIteratorNext (line 81) | type allIteratorNext struct
    method ok (line 99) | func (it *allIteratorNext) ok(p *Primitive) bool {
    method Next (line 103) | func (it *allIteratorNext) Next(ctx context.Context) bool {
    method Result (line 128) | func (it *allIteratorNext) Result() graph.Ref {
    method Err (line 138) | func (it *allIteratorNext) Err() error { return nil }
    method Close (line 139) | func (it *allIteratorNext) Close() error {
    method TagResults (line 145) | func (it *allIteratorNext) TagResults(dst map[string]graph.Ref) {}
    method String (line 147) | func (it *allIteratorNext) String() string {
    method NextPath (line 150) | func (it *allIteratorNext) NextPath(ctx context.Context) bool { return...
  method newAllIteratorNext (line 92) | func (qs *QuadStore) newAllIteratorNext(nodes bool, maxid int64, all []*...
  type allIteratorContains (line 152) | type allIteratorContains struct
    method ok (line 168) | func (it *allIteratorContains) ok(p *Primitive) bool {
    method Contains (line 172) | func (it *allIteratorContains) Contains(ctx context.Context, v graph.R...
    method Result (line 191) | func (it *allIteratorContains) Result() graph.Ref {
    method Err (line 201) | func (it *allIteratorContains) Err() error { return nil }
    method Close (line 202) | func (it *allIteratorContains) Close() error {
    method TagResults (line 207) | func (it *allIteratorContains) TagResults(dst map[string]graph.Ref) {}
    method String (line 209) | func (it *allIteratorContains) String() string {
    method NextPath (line 212) | func (it *allIteratorContains) NextPath(ctx context.Context) bool { re...
  method newAllIteratorContains (line 161) | func (qs *QuadStore) newAllIteratorContains(nodes bool, maxid int64) *al...

FILE: graph/memstore/iterator.go
  type Iterator (line 29) | type Iterator struct
    method Iterate (line 45) | func (it *Iterator) Iterate() iterator.Scanner {
    method Lookup (line 50) | func (it *Iterator) Lookup() iterator.Index {
    method SubIterators (line 54) | func (it *Iterator) SubIterators() []iterator.Shape {
    method String (line 58) | func (it *Iterator) String() string {
    method Sorted (line 62) | func (it *Iterator) Sorted() bool { return true }
    method Optimize (line 64) | func (it *Iterator) Optimize(ctx context.Context) (iterator.Shape, boo...
    method Stats (line 68) | func (it *Iterator) Stats(ctx context.Context) (iterator.Costs, error) {
  method newIterator (line 36) | func (qs *QuadStore) newIterator(tree *Tree, d quad.Direction, value int...
  type iteratorNext (line 79) | type iteratorNext struct
    method TagResults (line 99) | func (it *iteratorNext) TagResults(dst map[string]graph.Ref) {}
    method Close (line 101) | func (it *iteratorNext) Close() error {
    method Next (line 105) | func (it *iteratorNext) Next(ctx context.Context) bool {
    method Err (line 128) | func (it *iteratorNext) Err() error {
    method Result (line 132) | func (it *iteratorNext) Result() graph.Ref {
    method NextPath (line 139) | func (it *iteratorNext) NextPath(ctx context.Context) bool {
    method String (line 143) | func (it *iteratorNext) String() string {
    method Sorted (line 147) | func (it *iteratorNext) Sorted() bool { return true }
  method newIteratorNext (line 90) | func (qs *QuadStore) newIteratorNext(tree *Tree, d quad.Direction) *iter...
  type iteratorContains (line 149) | type iteratorContains struct
    method TagResults (line 170) | func (it *iteratorContains) TagResults(dst map[string]graph.Ref) {}
    method Close (line 172) | func (it *iteratorContains) Close() error {
    method Err (line 176) | func (it *iteratorContains) Err() error {
    method Result (line 180) | func (it *iteratorContains) Result() graph.Ref {
    method NextPath (line 187) | func (it *iteratorContains) NextPath(ctx context.Context) bool {
    method Contains (line 191) | func (it *iteratorContains) Contains(ctx context.Context, v graph.Ref)...
    method String (line 210) | func (it *iteratorContains) String() string {
    method Sorted (line 214) | func (it *iteratorContains) Sorted() bool { return true }
  method newIteratorContains (line 160) | func (qs *QuadStore) newIteratorContains(tree *Tree, d quad.Direction, v...

FILE: graph/memstore/keys.go
  constant kx (line 66) | kx = 32
  constant kd (line 67) | kd = 32
  function init (line 70) | func init() {
  type btTpool (line 87) | type btTpool struct
    method get (line 89) | func (p *btTpool) get(cmp Cmp) *Tree {
  type btEpool (line 95) | type btEpool struct
    method get (line 97) | func (p *btEpool) get(err error, hit bool, i int, k int64, q *d, t *Tr...
  type Cmp (line 110) | type Cmp
  type d (line 112) | type d struct
    method mvL (line 233) | func (l *d) mvL(r *d, c int) {
    method mvR (line 240) | func (l *d) mvR(r *d, c int) {
  type de (line 119) | type de struct
  type Enumerator (line 132) | type Enumerator struct
    method Close (line 858) | func (e *Enumerator) Close() {
    method Next (line 866) | func (e *Enumerator) Next() (k int64, v *Primitive, err error) {
    method next (line 900) | func (e *Enumerator) next() error {
    method Prev (line 920) | func (e *Enumerator) Prev() (k int64, v *Primitive, err error) {
    method prev (line 954) | func (e *Enumerator) prev() error {
  type Tree (line 143) | type Tree struct
    method Clear (line 256) | func (t *Tree) Clear() {
    method Close (line 268) | func (t *Tree) Close() {
    method cat (line 274) | func (t *Tree) cat(p *x, q, r *d, pi int) {
    method catX (line 301) | func (t *Tree) catX(p, q, r *x, pi int) {
    method Delete (line 335) | func (t *Tree) Delete(k int64) (ok bool) {
    method extract (line 386) | func (t *Tree) extract(q *d, i int) { // (r *primitive) {
    method find (line 398) | func (t *Tree) find(q interface{}, k int64) (i int, ok bool) {
    method First (line 436) | func (t *Tree) First() (k int64, v *Primitive) {
    method Get (line 446) | func (t *Tree) Get(k int64) (v *Primitive, ok bool) {
    method insert (line 472) | func (t *Tree) insert(q *d, i int, k int64, v *Primitive) *d {
    method Last (line 487) | func (t *Tree) Last() (k int64, v *Primitive) {
    method Len (line 496) | func (t *Tree) Len() int {
    method overflow (line 500) | func (t *Tree) overflow(p *x, q *d, pi, i int, k int64, v *Primitive) {
    method Seek (line 529) | func (t *Tree) Seek(k int64) (e *Enumerator, ok bool) {
    method SeekFirst (line 559) | func (t *Tree) SeekFirst() (e *Enumerator, err error) {
    method SeekLast (line 570) | func (t *Tree) SeekLast() (e *Enumerator, err error) {
    method Set (line 580) | func (t *Tree) Set(k int64, v *Primitive) {
    method Put (line 645) | func (t *Tree) Put(k int64, upd func(oldV *Primitive, exists bool) (ne...
    method split (line 711) | func (t *Tree) split(p *x, q *d, pi, i int, k int64, v *Primitive) {
    method splitX (line 746) | func (t *Tree) splitX(p *x, q *x, pi int, i int) (*x, int) {
    method underflow (line 786) | func (t *Tree) underflow(p *x, q *d, pi int) {
    method underflowX (line 804) | func (t *Tree) underflowX(p *x, q *x, pi int, i int) (*x, int) {
  type xe (line 152) | type xe struct
  type x (line 157) | type x struct
    method extract (line 195) | func (q *x) extract(i int) {
    method insert (line 205) | func (q *x) insert(i int, k int64, ch interface{}) *x {
    method siblings (line 219) | func (q *x) siblings(i int) (l, r *d) {
  function clr (line 173) | func clr(q interface{}) {
  function newX (line 189) | func newX(ch0 interface{}) *x {
  function TreeNew (line 251) | func TreeNew(cmp Cmp) *Tree {

FILE: graph/memstore/keys_test.go
  function rng (line 15) | func rng() *mathutil.FC32 {
  function BenchmarkSetSeq1e3 (line 24) | func BenchmarkSetSeq1e3(b *testing.B) {
  function BenchmarkSetSeq1e4 (line 28) | func BenchmarkSetSeq1e4(b *testing.B) {
  function BenchmarkSetSeq1e5 (line 32) | func BenchmarkSetSeq1e5(b *testing.B) {
  function BenchmarkSetSeq1e6 (line 36) | func BenchmarkSetSeq1e6(b *testing.B) {
  function benchmarkSetSeq (line 40) | func benchmarkSetSeq(b *testing.B, n int) {
  function BenchmarkGetSeq1e3 (line 56) | func BenchmarkGetSeq1e3(b *testing.B) {
  function BenchmarkGetSeq1e4 (line 60) | func BenchmarkGetSeq1e4(b *testing.B) {
  function BenchmarkGetSeq1e5 (line 64) | func BenchmarkGetSeq1e5(b *testing.B) {
  function BenchmarkGetSeq1e6 (line 68) | func BenchmarkGetSeq1e6(b *testing.B) {
  function benchmarkGetSeq (line 72) | func benchmarkGetSeq(b *testing.B, n int) {
  function BenchmarkSetRnd1e3 (line 88) | func BenchmarkSetRnd1e3(b *testing.B) {
  function BenchmarkSetRnd1e4 (line 92) | func BenchmarkSetRnd1e4(b *testing.B) {
  function BenchmarkSetRnd1e5 (line 96) | func BenchmarkSetRnd1e5(b *testing.B) {
  function BenchmarkSetRnd1e6 (line 100) | func BenchmarkSetRnd1e6(b *testing.B) {
  function benchmarkSetRnd (line 104) | func benchmarkSetRnd(b *testing.B, n int) {
  function BenchmarkGetRnd1e3 (line 125) | func BenchmarkGetRnd1e3(b *testing.B) {
  function BenchmarkGetRnd1e4 (line 129) | func BenchmarkGetRnd1e4(b *testing.B) {
  function BenchmarkGetRnd1e5 (line 133) | func BenchmarkGetRnd1e5(b *testing.B) {
  function BenchmarkGetRnd1e6 (line 137) | func BenchmarkGetRnd1e6(b *testing.B) {
  function benchmarkGetRnd (line 141) | func benchmarkGetRnd(b *testing.B, n int) {
  function BenchmarkDelSeq1e3 (line 162) | func BenchmarkDelSeq1e3(b *testing.B) {
  function BenchmarkDelSeq1e4 (line 166) | func BenchmarkDelSeq1e4(b *testing.B) {
  function BenchmarkDelSeq1e5 (line 170) | func BenchmarkDelSeq1e5(b *testing.B) {
  function BenchmarkDelSeq1e6 (line 174) | func BenchmarkDelSeq1e6(b *testing.B) {
  function benchmarkDelSeq (line 178) | func benchmarkDelSeq(b *testing.B, n int) {
  function BenchmarkDelRnd1e3 (line 195) | func BenchmarkDelRnd1e3(b *testing.B) {
  function BenchmarkDelRnd1e4 (line 199) | func BenchmarkDelRnd1e4(b *testing.B) {
  function BenchmarkDelRnd1e5 (line 203) | func BenchmarkDelRnd1e5(b *testing.B) {
  function BenchmarkDelRnd1e6 (line 207) | func BenchmarkDelRnd1e6(b *testing.B) {
  function benchmarkDelRnd (line 211) | func benchmarkDelRnd(b *testing.B, n int) {
  function BenchmarkSeekSeq1e3 (line 235) | func BenchmarkSeekSeq1e3(b *testing.B) {
  function BenchmarkSeekSeq1e4 (line 239) | func BenchmarkSeekSeq1e4(b *testing.B) {
  function BenchmarkSeekSeq1e5 (line 243) | func BenchmarkSeekSeq1e5(b *testing.B) {
  function BenchmarkSeekSeq1e6 (line 247) | func BenchmarkSeekSeq1e6(b *testing.B) {
  function benchmarkSeekSeq (line 251) | func benchmarkSeekSeq(b *testing.B, n int) {
  function BenchmarkSeekRnd1e3 (line 270) | func BenchmarkSeekRnd1e3(b *testing.B) {
  function BenchmarkSeekRnd1e4 (line 274) | func BenchmarkSeekRnd1e4(b *testing.B) {
  function BenchmarkSeekRnd1e5 (line 278) | func BenchmarkSeekRnd1e5(b *testing.B) {
  function BenchmarkSeekRnd1e6 (line 282) | func BenchmarkSeekRnd1e6(b *testing.B) {
  function benchmarkSeekRnd (line 286) | func benchmarkSeekRnd(b *testing.B, n int) {
  function BenchmarkNext1e3 (line 308) | func BenchmarkNext1e3(b *testing.B) {
  function BenchmarkNext1e4 (line 312) | func BenchmarkNext1e4(b *testing.B) {
  function BenchmarkNext1e5 (line 316) | func BenchmarkNext1e5(b *testing.B) {
  function BenchmarkNext1e6 (line 320) | func BenchmarkNext1e6(b *testing.B) {
  function benchmarkNext (line 324) | func benchmarkNext(b *testing.B, n int) {
  function BenchmarkPrev1e3 (line 352) | func BenchmarkPrev1e3(b *testing.B) {
  function BenchmarkPrev1e4 (line 356) | func BenchmarkPrev1e4(b *testing.B) {
  function BenchmarkPrev1e5 (line 360) | func BenchmarkPrev1e5(b *testing.B) {
  function BenchmarkPrev1e6 (line 364) | func BenchmarkPrev1e6(b *testing.B) {
  function benchmarkPrev (line 368) | func benchmarkPrev(b *testing.B, n int) {

FILE: graph/memstore/quadstore.go
  constant QuadStoreType (line 29) | QuadStoreType = "memstore"
  function init (line 31) | func init() {
  type bnode (line 42) | type bnode
    method Key (line 44) | func (n bnode) Key() interface{} { return n }
  type qprim (line 46) | type qprim struct
    method Key (line 50) | func (n qprim) Key() interface{} { return n.p.ID }
  function cmp (line 54) | func cmp(a, b int64) int {
  type QuadDirectionIndex (line 58) | type QuadDirectionIndex struct
    method Tree (line 71) | func (qdi QuadDirectionIndex) Tree(d quad.Direction, id int64) *Tree {
    method Get (line 83) | func (qdi QuadDirectionIndex) Get(d quad.Direction, id int64) (*Tree, ...
  function NewQuadDirectionIndex (line 62) | func NewQuadDirectionIndex() QuadDirectionIndex {
  type Primitive (line 91) | type Primitive struct
  type internalQuad (line 98) | type internalQuad struct
    method Zero (line 102) | func (q internalQuad) Zero() bool {
    method SetDir (line 106) | func (q *internalQuad) SetDir(d quad.Direction, n int64) {
    method Dir (line 120) | func (q internalQuad) Dir(d quad.Direction) int64 {
  type QuadStore (line 135) | type QuadStore struct
    method cloneAll (line 166) | func (qs *QuadStore) cloneAll() []*Primitive {
    method addPrimitive (line 171) | func (qs *QuadStore) addPrimitive(p *Primitive) int64 {
    method appendPrimitive (line 180) | func (qs *QuadStore) appendPrimitive(p *Primitive) {
    method resolveVal (line 193) | func (qs *QuadStore) resolveVal(v quad.Value, add bool) (int64, bool) {
    method resolveQuad (line 223) | func (qs *QuadStore) resolveQuad(q quad.Quad, add bool) (internalQuad,...
    method lookupVal (line 239) | func (qs *QuadStore) lookupVal(id int64) quad.Value {
    method lookupQuadDirs (line 247) | func (qs *QuadStore) lookupQuadDirs(p internalQuad) quad.Quad {
    method AddBNode (line 261) | func (qs *QuadStore) AddBNode() int64 {
    method AddValue (line 267) | func (qs *QuadStore) AddValue(v quad.Value) (int64, bool) {
    method indexesForQuad (line 272) | func (qs *QuadStore) indexesForQuad(q internalQuad) []*Tree {
    method AddQuad (line 286) | func (qs *QuadStore) AddQuad(q quad.Quad) (int64, bool) {
    method WriteQuad (line 305) | func (qs *QuadStore) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 311) | func (qs *QuadStore) WriteQuads(buf []quad.Quad) (int, error) {
    method NewQuadWriter (line 318) | func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error) {
    method deleteQuadNodes (line 342) | func (qs *QuadStore) deleteQuadNodes(q internalQuad) {
    method Delete (line 358) | func (qs *QuadStore) Delete(id int64) bool {
    method findQuad (line 396) | func (qs *QuadStore) findQuad(q quad.Quad) (int64, internalQuad, bool) {
    method ApplyDeltas (line 405) | func (qs *QuadStore) ApplyDeltas(deltas []graph.Delta, ignoreOpts grap...
    method quad (line 456) | func (qs *QuadStore) quad(v graph.Ref) (q internalQuad, ok bool) {
    method Quad (line 472) | func (qs *QuadStore) Quad(index graph.Ref) (quad.Quad, error) {
    method QuadIterator (line 480) | func (qs *QuadStore) QuadIterator(d quad.Direction, value graph.Ref) i...
    method QuadIteratorSize (line 492) | func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Dire...
    method Stats (line 504) | func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Sta...
    method ValueOf (line 517) | func (qs *QuadStore) ValueOf(name quad.Value) (graph.Ref, error) {
    method NameOf (line 528) | func (qs *QuadStore) NameOf(v graph.Ref) (quad.Value, error) {
    method QuadsAllIterator (line 544) | func (qs *QuadStore) QuadsAllIterator() iterator.Shape {
    method QuadDirection (line 548) | func (qs *QuadStore) QuadDirection(val graph.Ref, d quad.Direction) (g...
    method NodesAllIterator (line 560) | func (qs *QuadStore) NodesAllIterator() iterator.Shape {
    method Close (line 564) | func (qs *QuadStore) Close() error { return nil }
  function New (line 149) | func New(quads ...quad.Quad) *QuadStore {
  function newQuadStore (line 157) | func newQuadStore() *QuadStore {
  constant internalBNodePrefix (line 191) | internalBNodePrefix = "memnode"
  type quadWriter (line 322) | type quadWriter struct
    method WriteQuad (line 326) | func (w *quadWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 331) | func (w *quadWriter) WriteQuads(buf []quad.Quad) (int, error) {
    method Close (line 338) | func (w *quadWriter) Close() error {
  function asID (line 445) | func asID(v graph.Ref) (int64, bool) {

FILE: graph/memstore/quadstore_test.go
  function makeTestStore (line 61) | func makeTestStore(data []quad.Quad) (*QuadStore, graph.QuadWriter, []pa...
  function TestMemstore (line 85) | func TestMemstore(t *testing.T) {
  function BenchmarkMemstore (line 93) | func BenchmarkMemstore(b *testing.B) {
  type pair (line 101) | type pair struct
  function TestMemstoreValueOf (line 106) | func TestMemstoreValueOf(t *testing.T) {
  function TestIteratorsAndNextResultOrderA (line 128) | func TestIteratorsAndNextResultOrderA(t *testing.T) {
  function TestLinksToOptimization (line 188) | func TestLinksToOptimization(t *testing.T) {
  function TestRemoveQuad (line 204) | func TestRemoveQuad(t *testing.T) {
  function TestTransaction (line 242) | func TestTransaction(t *testing.T) {

FILE: graph/nosql/all/all_test.go
  function TestNoSQL (line 14) | func TestNoSQL(t *testing.T) {
  function BenchmarkNoSQL (line 18) | func BenchmarkNoSQL(t *testing.B) {

FILE: graph/nosql/elastic/elastic.go
  constant Type (line 15) | Type = elastic.Name
  function Create (line 17) | func Create(addr string, opt graph.Options) (nosql.Database, error) {
  function Open (line 21) | func Open(addr string, opt graph.Options) (nosql.Database, error) {

FILE: graph/nosql/iterator.go
  type Linkage (line 31) | type Linkage struct
  function linkageToFilters (line 36) | func linkageToFilters(links []Linkage) []nosql.FieldFilter {
  type Iterator (line 48) | type Iterator struct
    method Iterate (line 75) | func (it *Iterator) Iterate() iterator.Scanner {
    method Lookup (line 79) | func (it *Iterator) Lookup() iterator.Index {
    method SubIterators (line 83) | func (it *Iterator) SubIterators() []iterator.Shape {
    method getSize (line 87) | func (it *Iterator) getSize(ctx context.Context) (refs.Size, error) {
    method Sorted (line 110) | func (it *Iterator) Sorted() bool                                     ...
    method Optimize (line 111) | func (it *Iterator) Optimize(ctx context.Context) (iterator.Shape, boo...
    method String (line 113) | func (it *Iterator) String() string {
    method Stats (line 117) | func (it *Iterator) Stats(ctx context.Context) (iterator.Costs, error) {
  method newLinksToIterator (line 59) | func (qs *QuadStore) newLinksToIterator(collection string, links []Linka...
  method newIterator (line 66) | func (qs *QuadStore) newIterator(collection string, constraints ...nosql...
  type iteratorNext (line 126) | type iteratorNext struct
    method makeIterator (line 146) | func (it *iteratorNext) makeIterator(ctx context.Context) nosql.DocIte...
    method Close (line 157) | func (it *iteratorNext) Close() error {
    method TagResults (line 164) | func (it *iteratorNext) TagResults(dst map[string]graph.Ref) {}
    method Next (line 166) | func (it *iteratorNext) Next(ctx context.Context) bool {
    method Err (line 200) | func (it *iteratorNext) Err() error {
    method Result (line 204) | func (it *iteratorNext) Result() graph.Ref {
    method NextPath (line 208) | func (it *iteratorNext) NextPath(ctx context.Context) bool {
    method Sorted (line 212) | func (it *iteratorNext) Sorted() bool { return true }
    method String (line 214) | func (it *iteratorNext) String() string {
  method newIteratorNext (line 137) | func (qs *QuadStore) newIteratorNext(collection string, constraints []no...
  type iteratorContains (line 218) | type iteratorContains struct
    method makeIterator (line 240) | func (it *iteratorContains) makeIterator(ctx context.Context) nosql.Do...
    method Close (line 251) | func (it *iteratorContains) Close() error {
    method TagResults (line 258) | func (it *iteratorContains) TagResults(dst map[string]graph.Ref) {}
    method Err (line 260) | func (it *iteratorContains) Err() error {
    method Result (line 264) | func (it *iteratorContains) Result() graph.Ref {
    method NextPath (line 268) | func (it *iteratorContains) NextPath(ctx context.Context) bool {
    method Contains (line 272) | func (it *iteratorContains) Contains(ctx context.Context, v graph.Ref)...
    method Sorted (line 305) | func (it *iteratorContains) Sorted() bool { return true }
    method String (line 307) | func (it *iteratorContains) String() string {
  method newIteratorContains (line 230) | func (qs *QuadStore) newIteratorContains(collection string, constraints ...

FILE: graph/nosql/mongo/mongo.go
  constant Type (line 15) | Type = mongo.Name
  function Create (line 17) | func Create(addr string, opt graph.Options) (nosql.Database, error) {
  function Open (line 21) | func Open(addr string, opt graph.Options) (nosql.Database, error) {

FILE: graph/nosql/nosqltest/nosqltest.go
  function toConfig (line 16) | func toConfig(c nosql.Traits) graphtest.Config {
  function NewQuadStore (line 26) | func NewQuadStore(t testing.TB, gen nosqltest.Database) (graph.QuadStore...
  function TestAll (line 45) | func TestAll(t *testing.T, gen nosqltest.Database) {
  function BenchmarkAll (line 52) | func BenchmarkAll(t *testing.B, gen nosqltest.Database) {

FILE: graph/nosql/quadstore.go
  constant DefaultDBName (line 36) | DefaultDBName = "cayley"
  type Registration (line 38) | type Registration struct
  function init (line 47) | func init() {
  type InitFunc (line 61) | type InitFunc
  type NewFunc (line 62) | type NewFunc
  function Register (line 64) | func Register(name string, r Registration) {
  function Init (line 102) | func Init(db nosql.Database, opt graph.Options) error {
  function NewQuadStore (line 106) | func NewQuadStore(db nosql.Database, nopt *Traits, opt graph.Options) (*...
  type NodeHash (line 121) | type NodeHash
    method IsNode (line 123) | func (NodeHash) IsNode() bool       { return false }
    method Key (line 124) | func (v NodeHash) Key() interface{} { return v }
    method key (line 125) | func (v NodeHash) key() nosql.Key   { return nosql.Key{string(v)} }
  type QuadHash (line 127) | type QuadHash
    method IsNode (line 129) | func (QuadHash) IsNode() bool       { return false }
    method Key (line 130) | func (v QuadHash) Key() interface{} { return v }
    method Get (line 132) | func (v QuadHash) Get(d quad.Direction) string {
  constant colLog (line 148) | colLog   = "log"
  constant colNodes (line 149) | colNodes = "nodes"
  constant colQuads (line 150) | colQuads = "quads"
  constant fldLogID (line 152) | fldLogID = "id"
  constant fldSubject (line 154) | fldSubject     = "subject"
  constant fldPredicate (line 155) | fldPredicate   = "predicate"
  constant fldObject (line 156) | fldObject      = "object"
  constant fldLabel (line 157) | fldLabel       = "label"
  constant fldQuadAdded (line 158) | fldQuadAdded   = "added"
  constant fldQuadDeleted (line 159) | fldQuadDeleted = "deleted"
  constant fldHash (line 161) | fldHash  = "hash"
  constant fldValue (line 162) | fldValue = "value"
  constant fldSize (line 163) | fldSize  = "refs"
  constant fldValData (line 165) | fldValData   = "str"
  constant fldIRI (line 166) | fldIRI       = "iri"
  constant fldBNode (line 167) | fldBNode     = "bnode"
  constant fldType (line 168) | fldType      = "type"
  constant fldLang (line 169) | fldLang      = "lang"
  constant fldValInt (line 170) | fldValInt    = "int"
  constant fldValStrInt (line 171) | fldValStrInt = "int_str"
  constant fldValFloat (line 172) | fldValFloat  = "float"
  constant fldValBool (line 173) | fldValBool   = "bool"
  constant fldValTime (line 174) | fldValTime   = "ts"
  constant fldValPb (line 175) | fldValPb     = "pb"
  type QuadStore (line 178) | type QuadStore struct
    method nameToKey (line 237) | func (qs *QuadStore) nameToKey(name quad.Value) nosql.Key {
    method updateNodeBy (line 242) | func (qs *QuadStore) updateNodeBy(ctx context.Context, key nosql.Key, ...
    method cleanupNodes (line 254) | func (qs *QuadStore) cleanupNodes(ctx context.Context, keys []nosql.Ke...
    method updateQuad (line 266) | func (qs *QuadStore) updateQuad(ctx context.Context, q quad.Quad, proc...
    method checkValidQuad (line 295) | func (qs *QuadStore) checkValidQuad(ctx context.Context, key nosql.Key...
    method batchInsert (line 307) | func (qs *QuadStore) batchInsert(col string) nosql.DocWriter {
    method appendLog (line 311) | func (qs *QuadStore) appendLog(ctx context.Context, deltas []graph.Del...
    method NewQuadWriter (line 338) | func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error) {
    method ApplyDeltas (line 378) | func (qs *QuadStore) ApplyDeltas(deltas []graph.Delta, ignoreOpts grap...
    method Quad (line 615) | func (qs *QuadStore) Quad(val graph.Ref) (quad.Quad, error) {
    method QuadIterator (line 635) | func (qs *QuadStore) QuadIterator(d quad.Direction, val graph.Ref) ite...
    method QuadIteratorSize (line 643) | func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Dire...
    method NodesAllIterator (line 658) | func (qs *QuadStore) NodesAllIterator() iterator.Shape {
    method QuadsAllIterator (line 662) | func (qs *QuadStore) QuadsAllIterator() iterator.Shape {
    method hashOf (line 666) | func (qs *QuadStore) hashOf(s quad.Value) NodeHash {
    method ValueOf (line 670) | func (qs *QuadStore) ValueOf(s quad.Value) (graph.Ref, error) {
    method NameOf (line 677) | func (qs *QuadStore) NameOf(v graph.Ref) (quad.Value, error) {
    method Stats (line 709) | func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Sta...
    method Size (line 731) | func (qs *QuadStore) Size() int64 {
    method Close (line 740) | func (qs *QuadStore) Close() error {
    method QuadDirection (line 744) | func (qs *QuadStore) QuadDirection(in graph.Ref, d quad.Direction) (gr...
    method getSize (line 748) | func (qs *QuadStore) getSize(col string, constraints []nosql.FieldFilt...
  function ensureIndexes (line 185) | func ensureIndexes(ctx context.Context, db nosql.Database) error {
  function getKeyForQuad (line 220) | func getKeyForQuad(t quad.Quad) nosql.Key {
  function hashOf (line 229) | func hashOf(s quad.Value) string {
  function checkQuadValid (line 289) | func checkQuadValid(q nosql.Document) bool {
  type quadWriter (line 342) | type quadWriter struct
    method WriteQuad (line 347) | func (w *quadWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 352) | func (w *quadWriter) WriteQuads(buf []quad.Quad) (int, error) {
    method Close (line 373) | func (w *quadWriter) Close() error {
  function toDocumentValue (line 464) | func toDocumentValue(opt *Traits, v quad.Value) nosql.Document {
  function asInt (line 510) | func asInt(v nosql.Value) (nosql.Int, error) {
  function toQuadValue (line 523) | func toQuadValue(opt *Traits, d nosql.Document) (quad.Value, error) {

FILE: graph/nosql/shapes.go
  method OptimizeShape (line 19) | func (qs *QuadStore) OptimizeShape(ctx context.Context, s shape.Shape) (...
  type Shape (line 36) | type Shape struct
    method BuildIterator (line 42) | func (s Shape) BuildIterator(qs graph.QuadStore) iterator.Shape {
    method Optimize (line 50) | func (s Shape) Optimize(ctx context.Context, r shape.Optimizer) (shape...
  type Quads (line 55) | type Quads struct
    method BuildIterator (line 60) | func (s Quads) BuildIterator(qs graph.QuadStore) iterator.Shape {
    method Optimize (line 68) | func (s Quads) Optimize(ctx context.Context, r shape.Optimizer) (shape...
  constant int64Adjust (line 72) | int64Adjust = 1 << 63
  function itos (line 75) | func itos(i int64) string {
  function stoi (line 82) | func stoi(s string) int64 {
  function toFieldFilter (line 91) | func toFieldFilter(opt *Traits, c shape.Comparison) ([]nosql.FieldFilter...
  method optimizeFilter (line 152) | func (qs *QuadStore) optimizeFilter(s shape.Filter) (shape.Shape, bool) {
  method optimizeQuads (line 199) | func (qs *QuadStore) optimizeQuads(s shape.Quads) (shape.Shape, bool) {
  method optimizePage (line 223) | func (qs *QuadStore) optimizePage(s shape.Page) (shape.Shape, bool) {

FILE: graph/nosql/value_test.go
  function TestIntStr (line 9) | func TestIntStr(t *testing.T) {

FILE: graph/proto/primitive.pb.go
  constant _ (line 32) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  constant _ (line 34) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  type PrimitiveType (line 37) | type PrimitiveType
    method Enum (line 80) | func (x PrimitiveType) Enum() *PrimitiveType {
    method String (line 86) | func (x PrimitiveType) String() string {
    method Descriptor (line 90) | func (PrimitiveType) Descriptor() protoreflect.EnumDescriptor {
    method Type (line 94) | func (PrimitiveType) Type() protoreflect.EnumType {
    method Number (line 98) | func (x PrimitiveType) Number() protoreflect.EnumNumber {
    method EnumDescriptor (line 103) | func (PrimitiveType) EnumDescriptor() ([]byte, []int) {
  constant PrimitiveType_LINK (line 40) | PrimitiveType_LINK      PrimitiveType = 0
  constant PrimitiveType_IRI (line 41) | PrimitiveType_IRI       PrimitiveType = 1
  constant PrimitiveType_STRING (line 42) | PrimitiveType_STRING    PrimitiveType = 2
  constant PrimitiveType_BNODE (line 43) | PrimitiveType_BNODE     PrimitiveType = 3
  constant PrimitiveType_TYPED_STR (line 44) | PrimitiveType_TYPED_STR PrimitiveType = 4
  constant PrimitiveType_LANG_STR (line 45) | PrimitiveType_LANG_STR  PrimitiveType = 5
  constant PrimitiveType_INT (line 46) | PrimitiveType_INT       PrimitiveType = 6
  constant PrimitiveType_FLOAT (line 47) | PrimitiveType_FLOAT     PrimitiveType = 7
  constant PrimitiveType_BOOL (line 48) | PrimitiveType_BOOL      PrimitiveType = 8
  constant PrimitiveType_TIMESTAMP (line 49) | PrimitiveType_TIMESTAMP PrimitiveType = 9
  type Primitive (line 107) | type Primitive struct
    method Reset (line 123) | func (x *Primitive) Reset() {
    method String (line 132) | func (x *Primitive) String() string {
    method ProtoMessage (line 136) | func (*Primitive) ProtoMessage() {}
    method ProtoReflect (line 138) | func (x *Primitive) ProtoReflect() protoreflect.Message {
    method Descriptor (line 151) | func (*Primitive) Descriptor() ([]byte, []int) {
    method GetID (line 155) | func (x *Primitive) GetID() uint64 {
    method GetSubject (line 162) | func (x *Primitive) GetSubject() uint64 {
    method GetPredicate (line 169) | func (x *Primitive) GetPredicate() uint64 {
    method GetObject (line 176) | func (x *Primitive) GetObject() uint64 {
    method GetLabel (line 183) | func (x *Primitive) GetLabel() uint64 {
    method GetReplaces (line 190) | func (x *Primitive) GetReplaces() uint64 {
    method GetTimestamp (line 197) | func (x *Primitive) GetTimestamp() int64 {
    method GetValue (line 204) | func (x *Primitive) GetValue() []byte {
    method GetDeleted (line 211) | func (x *Primitive) GetDeleted() bool {
  function file_primitive_proto_rawDescGZIP (line 257) | func file_primitive_proto_rawDescGZIP() []byte {
  function init (line 278) | func init() { file_primitive_proto_init() }
  function file_primitive_proto_init (line 279) | func file_primitive_proto_init() {

FILE: graph/proto/primitive_helpers.go
  method GetDirection (line 7) | func (p *Primitive) GetDirection(d quad.Direction) uint64 {
  method SetDirection (line 21) | func (p *Primitive) SetDirection(d quad.Direction, v uint64) {
  method IsNode (line 34) | func (p *Primitive) IsNode() bool {
  method Key (line 38) | func (p *Primitive) Key() interface{} {
  method IsSameLink (line 42) | func (p *Primitive) IsSameLink(q *Primitive) bool {

FILE: graph/proto/serializations.pb.go
  constant _ (line 33) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  constant _ (line 35) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  type LogDelta (line 38) | type LogDelta struct
    method Reset (line 49) | func (x *LogDelta) Reset() {
    method String (line 58) | func (x *LogDelta) String() string {
    method ProtoMessage (line 62) | func (*LogDelta) ProtoMessage() {}
    method ProtoReflect (line 64) | func (x *LogDelta) ProtoReflect() protoreflect.Message {
    method Descriptor (line 77) | func (*LogDelta) Descriptor() ([]byte, []int) {
    method GetID (line 81) | func (x *LogDelta) GetID() uint64 {
    method GetQuad (line 88) | func (x *LogDelta) GetQuad() *pquads.Quad {
    method GetAction (line 95) | func (x *LogDelta) GetAction() int32 {
    method GetTimestamp (line 102) | func (x *LogDelta) GetTimestamp() int64 {
  type HistoryEntry (line 109) | type HistoryEntry struct
    method Reset (line 117) | func (x *HistoryEntry) Reset() {
    method String (line 126) | func (x *HistoryEntry) String() string {
    method ProtoMessage (line 130) | func (*HistoryEntry) ProtoMessage() {}
    method ProtoReflect (line 132) | func (x *HistoryEntry) ProtoReflect() protoreflect.Message {
    method Descriptor (line 145) | func (*HistoryEntry) Descriptor() ([]byte, []int) {
    method GetHistory (line 149) | func (x *HistoryEntry) GetHistory() []uint64 {
  type NodeData (line 156) | type NodeData struct
    method Reset (line 166) | func (x *NodeData) Reset() {
    method String (line 175) | func (x *NodeData) String() string {
    method ProtoMessage (line 179) | func (*NodeData) ProtoMessage() {}
    method ProtoReflect (line 181) | func (x *NodeData) ProtoReflect() protoreflect.Message {
    method Descriptor (line 194) | func (*NodeData) Descriptor() ([]byte, []int) {
    method GetName (line 198) | func (x *NodeData) GetName() string {
    method GetSize (line 205) | func (x *NodeData) GetSize() int64 {
    method GetValue (line 212) | func (x *NodeData) GetValue() *pquads.Value {
  function file_serializations_proto_rawDescGZIP (line 251) | func file_serializations_proto_rawDescGZIP() []byte {
  function init (line 276) | func init() { file_serializations_proto_init() }
  function file_serializations_proto_init (line 277) | func file_serializations_proto_init() {

FILE: graph/proto/serializations_helpers.go
  method GetNativeValue (line 12) | func (m *NodeData) GetNativeValue() quad.Value {
  method Upgrade (line 24) | func (m *NodeData) Upgrade() {

FILE: graph/quadstore.go
  function ValuesOf (line 47) | func ValuesOf(ctx context.Context, qs refs.Namer, vals []Ref) ([]quad.Va...
  function RefsOf (line 51) | func RefsOf(ctx context.Context, qs refs.Namer, nodes []quad.Value) ([]R...
  type QuadIndexer (line 55) | type QuadIndexer interface
  type Stats (line 85) | type Stats struct
  type QuadStore (line 90) | type QuadStore interface
  type Options (line 113) | type Options
    method IntKey (line 119) | func (d Options) IntKey(key string, def int) (int, error) {
    method StringKey (line 131) | func (d Options) StringKey(key string, def string) (string, error) {
    method BoolKey (line 143) | func (d Options) BoolKey(key string, def bool) (bool, error) {

FILE: graph/quadwriter.go
  type Procedure (line 34) | type Procedure
    method String (line 36) | func (p Procedure) String() string {
  constant Add (line 49) | Add    Procedure = +1
  constant Delete (line 50) | Delete Procedure = -1
  type Delta (line 53) | type Delta struct
  function Unwrap (line 60) | func Unwrap(qs QuadStore) QuadStore {
  type Handle (line 67) | type Handle struct
    method Close (line 76) | func (h *Handle) Close() error {
  type IgnoreOpts (line 72) | type IgnoreOpts struct
  type DeltaError (line 90) | type DeltaError struct
    method Error (line 95) | func (e *DeltaError) Error() string {
    method Unwrap (line 102) | func (e *DeltaError) Unwrap() error {
  function IsQuadExist (line 108) | func IsQuadExist(err error) bool {
  function IsQuadNotExist (line 114) | func IsQuadNotExist(err error) bool {
  function IsInvalidAction (line 120) | func IsInvalidAction(err error) bool {
  type QuadWriter (line 134) | type QuadWriter interface
  type NewQuadWriterFunc (line 158) | type NewQuadWriterFunc
  function RegisterWriter (line 162) | func RegisterWriter(name string, newFunc NewQuadWriterFunc) {
  function NewQuadWriter (line 169) | func NewQuadWriter(name string, qs QuadStore, opts Options) (QuadWriter,...
  function WriterMethods (line 177) | func WriterMethods() []string {
  type BatchWriter (line 185) | type BatchWriter interface
  function NewWriter (line 193) | func NewWriter(qs QuadWriter) BatchWriter {
  type batchWriter (line 197) | type batchWriter struct
    method flushBuffer (line 202) | func (w *batchWriter) flushBuffer(force bool) error {
    method WriteQuad (line 211) | func (w *batchWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 218) | func (w *batchWriter) WriteQuads(quads []quad.Quad) (int, error) {
    method Flush (line 224) | func (w *batchWriter) Flush() error {
    method Close (line 227) | func (w *batchWriter) Close() error {
  function NewTxWriter (line 233) | func NewTxWriter(tx *Transaction, p Procedure) quad.Writer {
  type txWriter (line 240) | type txWriter struct
    method WriteQuad (line 245) | func (w *txWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 257) | func (w *txWriter) WriteQuads(buf []quad.Quad) (int, error) {
  function NewRemover (line 267) | func NewRemover(qs QuadWriter) BatchWriter {
  type removeWriter (line 271) | type removeWriter struct
    method WriteQuad (line 275) | func (w *removeWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 278) | func (w *removeWriter) WriteQuads(quads []quad.Quad) (int, error) {
    method Flush (line 288) | func (w *removeWriter) Flush() error {
    method Close (line 291) | func (w *removeWriter) Close() error { return nil }
  function NewQuadStoreReader (line 294) | func NewQuadStoreReader(qs QuadStore) quad.ReadSkipCloser {
  function NewResultReader (line 304) | func NewResultReader(qs QuadStore, it iterator.Scanner) quad.ReadSkipClo...
  type quadReader (line 311) | type quadReader struct
    method ReadQuad (line 316) | func (r *quadReader) ReadQuad() (quad.Quad, error) {
    method SkipQuad (line 326) | func (r *quadReader) SkipQuad() error {
    method Close (line 335) | func (r *quadReader) Close() error { return r.it.Close() }

FILE: graph/quadwriter_test.go
  function TestIsQuadExist (line 8) | func TestIsQuadExist(t *testing.T) {
  function TestIsQuadNotExist (line 27) | func TestIsQuadNotExist(t *testing.T) {
  function TestIsInvalidAction (line 46) | func TestIsInvalidAction(t *testing.T) {

FILE: graph/refs/refs.go
  type Size (line 12) | type Size struct
  type Ref (line 27) | type Ref interface
  type Namer (line 33) | type Namer interface
  type BatchNamer (line 42) | type BatchNamer interface
  function HashOf (line 47) | func HashOf(s quad.Value) (out ValueHash) {
  type ValueHash (line 58) | type ValueHash
    method Valid (line 60) | func (h ValueHash) Valid() bool {
    method Key (line 63) | func (h ValueHash) Key() interface{} { return h }
    method String (line 64) | func (h ValueHash) String() string {
  type PreFetchedValue (line 73) | type PreFetchedValue interface
  function PreFetched (line 78) | func PreFetched(v quad.Value) PreFetchedValue {
  type fetchedValue (line 82) | type fetchedValue struct
    method IsNode (line 86) | func (v fetchedValue) IsNode() bool       { return true }
    method NameOf (line 87) | func (v fetchedValue) NameOf() quad.Value { return v.Val }
    method Key (line 88) | func (v fetchedValue) Key() interface{}   { return v.Val }
  function ToKey (line 91) | func ToKey(v Ref) interface{} {
  type QuadHash (line 100) | type QuadHash struct
    method Dirs (line 107) | func (q QuadHash) Dirs() [4]ValueHash {
    method Key (line 115) | func (q QuadHash) Key() interface{} { return q }
    method Get (line 116) | func (q QuadHash) Get(d quad.Direction) ValueHash {
    method Set (line 129) | func (q *QuadHash) Set(d quad.Direction, h ValueHash) {
  function ValuesOf (line 144) | func ValuesOf(ctx context.Context, qs Namer, vals []Ref) ([]quad.Value, ...
  function RefsOf (line 159) | func RefsOf(ctx context.Context, qs Namer, nodes []quad.Value) ([]Ref, e...

FILE: graph/registry.go
  type NewStoreFunc (line 30) | type NewStoreFunc
  type InitStoreFunc (line 31) | type InitStoreFunc
  type UpgradeStoreFunc (line 32) | type UpgradeStoreFunc
  type QuadStoreRegistration (line 34) | type QuadStoreRegistration struct
  function RegisterQuadStore (line 41) | func RegisterQuadStore(name string, register QuadStoreRegistration) {
  function NewQuadStore (line 53) | func NewQuadStore(name string, dbpath string, opts Options) (QuadStore, ...
  function InitQuadStore (line 63) | func InitQuadStore(name string, dbpath string, opts Options) error {
  function UpgradeQuadStore (line 73) | func UpgradeQuadStore(name string, dbpath string, opts Options) error {
  function IsRegistered (line 84) | func IsRegistered(name string) bool {
  function IsPersistent (line 89) | func IsPersistent(name string) bool {
  function QuadStores (line 93) | func QuadStores() []string {

FILE: graph/sql/cockroach/cockroach.go
  constant Type (line 20) | Type = "cockroach"
  function init (line 22) | func init() {
  type AmbiguousCommitError (line 57) | type AmbiguousCommitError struct
    method Error (line 61) | func (e *AmbiguousCommitError) Error() string {
    method Unwrap (line 65) | func (e *AmbiguousCommitError) Unwrap() error {
  function retryTxCockroach (line 71) | func retryTxCockroach(tx *sql.Tx, stmts func() error) error {
  function convError (line 111) | func convError(err error) error {
  function convInsertError (line 123) | func convInsertError(err error) error {
  function runTxCockroach (line 140) | func runTxCockroach(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []gra...

FILE: graph/sql/cockroach/cockroach_test.go
  function makeCockroach (line 22) | func makeCockroach(t testing.TB) (string, graph.Options) {
  function TestCockroach (line 74) | func TestCockroach(t *testing.T) {
  function BenchmarkCockroach (line 78) | func BenchmarkCockroach(t *testing.B) {

FILE: graph/sql/database.go
  function Register (line 16) | func Register(name string, f Registration) {
  type Registration (line 25) | type Registration struct
    method nodesTable (line 47) | func (r Registration) nodesTable() string {
    method quadsTable (line 80) | func (r Registration) quadsTable() string {
    method quadIndexes (line 99) | func (r Registration) quadIndexes(options graph.Options) []string {

FILE: graph/sql/iterator.go
  method OptimizeShape (line 32) | func (qs *QuadStore) OptimizeShape(ctx context.Context, s shape.Shape) (...
  method prepareQuery (line 36) | func (qs *QuadStore) prepareQuery(s Shape) (string, []interface{}) {
  method QueryRow (line 47) | func (qs *QuadStore) QueryRow(ctx context.Context, s Shape) *sql.Row {
  method Query (line 52) | func (qs *QuadStore) Query(ctx context.Context, s Shape) (*sql.Rows, err...
  method newIterator (line 61) | func (qs *QuadStore) newIterator(s Select) *Iterator {
  type Iterator (line 68) | type Iterator struct
    method Iterate (line 74) | func (it *Iterator) Iterate() iterator.Scanner {
    method Lookup (line 78) | func (it *Iterator) Lookup() iterator.Index {
    method Stats (line 82) | func (it *Iterator) Stats(ctx context.Context) (iterator.Costs, error) {
    method estimateSize (line 91) | func (it *Iterator) estimateSize(ctx context.Context) int64 {
    method getSize (line 102) | func (it *Iterator) getSize(ctx context.Context) (refs.Size, error) {
    method Optimize (line 111) | func (it *Iterator) Optimize(ctx context.Context) (iterator.Shape, boo...
    method SubIterators (line 115) | func (it *Iterator) SubIterators() []iterator.Shape {
    method String (line 119) | func (it *Iterator) String() string {
  function newIteratorBase (line 123) | func newIteratorBase(qs *QuadStore, s Select) iteratorBase {
  type iteratorBase (line 130) | type iteratorBase struct
    method TagResults (line 142) | func (it *iteratorBase) TagResults(m map[string]graph.Ref) {
    method Result (line 148) | func (it *iteratorBase) Result() graph.Ref {
    method ensureColumns (line 152) | func (it *iteratorBase) ensureColumns() {
    method scanValue (line 176) | func (it *iteratorBase) scanValue(r *sql.Rows) bool {
    method Err (line 215) | func (it *iteratorBase) Err() error {
    method String (line 219) | func (it *iteratorBase) String() string {
  method newIteratorNext (line 223) | func (qs *QuadStore) newIteratorNext(s Select) *iteratorNext {
  type iteratorNext (line 229) | type iteratorNext struct
    method Next (line 237) | func (it *iteratorNext) Next(ctx context.Context) bool {
    method NextPath (line 277) | func (it *iteratorNext) NextPath(ctx context.Context) bool {
    method Close (line 304) | func (it *iteratorNext) Close() error {
  method newIteratorContains (line 312) | func (qs *QuadStore) newIteratorContains(s Select) *iteratorContains {
  type iteratorContains (line 318) | type iteratorContains struct
    method Contains (line 324) | func (it *iteratorContains) Contains(ctx context.Context, v graph.Ref)...
    method NextPath (line 373) | func (it *iteratorContains) NextPath(ctx context.Context) bool {
    method Close (line 387) | func (it *iteratorContains) Close() error {

FILE: graph/sql/mysql/mysql.go
  constant Type (line 17) | Type = "mysql"
  function init (line 27) | func init() {
  function runTxMysql (line 45) | func runTxMysql(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []graphlo...
  function convInsertError (line 132) | func convInsertError(err error) error {

FILE: graph/sql/mysql/mysql_test.go
  function makeMysqlVersion (line 14) | func makeMysqlVersion(image string) sqltest.DatabaseFunc {
  constant mysqlImage (line 32) | mysqlImage   = "mysql:8"
  constant mariadbImage (line 33) | mariadbImage = "mariadb:11"
  function TestMysql (line 36) | func TestMysql(t *testing.T) {
  function TestMariaDB (line 40) | func TestMariaDB(t *testing.T) {
  function BenchmarkMysql (line 44) | func BenchmarkMysql(t *testing.B) {
  function BenchmarkMariadb (line 48) | func BenchmarkMariadb(t *testing.B) {

FILE: graph/sql/optimizer.go
  function NewOptimizer (line 28) | func NewOptimizer() *Optimizer {
  type Optimizer (line 32) | type Optimizer struct
    method SetRegexpOp (line 39) | func (opt *Optimizer) SetRegexpOp(op CmpOp) {
    method NoOffsetWithoutLimit (line 43) | func (opt *Optimizer) NoOffsetWithoutLimit() {
    method nextTable (line 47) | func (opt *Optimizer) nextTable() string {
    method ensureAliases (line 52) | func (opt *Optimizer) ensureAliases(s *Select) {
    method OptimizeShape (line 80) | func (opt *Optimizer) OptimizeShape(ctx context.Context, s shape.Shape...
    method optimizeLookup (line 207) | func (opt *Optimizer) optimizeLookup(s shape.Lookup) (shape.Shape, boo...
    method optimizeFilter (line 223) | func (opt *Optimizer) optimizeFilter(from shape.Shape, f shape.ValueFi...
    method optimizeFilters (line 269) | func (opt *Optimizer) optimizeFilters(s shape.Filter) (shape.Shape, bo...
    method optimizeQuads (line 309) | func (opt *Optimizer) optimizeQuads(s shape.Quads) (shape.Shape, bool) {
    method optimizeNodesFrom (line 380) | func (opt *Optimizer) optimizeNodesFrom(s shape.NodesFrom) (shape.Shap...
    method optimizeQuadsAction (line 408) | func (opt *Optimizer) optimizeQuadsAction(s shape.QuadsAction) (shape....
    method optimizeSave (line 443) | func (opt *Optimizer) optimizeSave(s shape.Save) (shape.Shape, bool) {
    method optimizePage (line 472) | func (opt *Optimizer) optimizePage(s shape.Page) (shape.Shape, bool) {
    method optimizeIntersect (line 495) | func (opt *Optimizer) optimizeIntersect(s shape.Intersect) (shape.Shap...
  function sortDirs (line 74) | func sortDirs(dirs []quad.Direction) {
  function selectValueQuery (line 105) | func selectValueQuery(v quad.Value, op CmpOp) ([]Where, []Value, bool) {
  function SelectValue (line 198) | func SelectValue(v quad.Value, op CmpOp) *Select {
  function convRegexp (line 219) | func convRegexp(re string) string {

FILE: graph/sql/postgres/postgres.go
  constant Type (line 17) | Type = "postgres"
  function init (line 27) | func init() {
  function ConvError (line 45) | func ConvError(err error) error {
  function convInsertError (line 57) | func convInsertError(err error) error {
  function RunTxPostgres (line 110) | func RunTxPostgres(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []grap...
  function RunTx (line 114) | func RunTx(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []graphlog.Qua...

FILE: graph/sql/postgres/postgres_test.go
  function makePostgres (line 16) | func makePostgres(t testing.TB) (string, graph.Options) {
  function TestPostgres (line 41) | func TestPostgres(t *testing.T) {
  function BenchmarkPostgres (line 45) | func BenchmarkPostgres(t *testing.B) {

FILE: graph/sql/quadstore.go
  function registerQuadStore (line 23) | func registerQuadStore(name, typ string) {
  type StringVal (line 38) | type StringVal
    method SQLValue (line 40) | func (v StringVal) SQLValue() interface{} {
  type IntVal (line 44) | type IntVal
    method SQLValue (line 46) | func (v IntVal) SQLValue() interface{} {
  type FloatVal (line 50) | type FloatVal
    method SQLValue (line 52) | func (v FloatVal) SQLValue() interface{} {
  type BoolVal (line 56) | type BoolVal
    method SQLValue (line 58) | func (v BoolVal) SQLValue() interface{} {
  type TimeVal (line 62) | type TimeVal
    method SQLValue (line 64) | func (v TimeVal) SQLValue() interface{} {
  type NodeHash (line 68) | type NodeHash struct
    method SQLValue (line 72) | func (h NodeHash) SQLValue() interface{} {
    method Scan (line 78) | func (h *NodeHash) Scan(src interface{}) error {
  function HashOf (line 97) | func HashOf(s quad.Value) NodeHash {
  type QuadHashes (line 101) | type QuadHashes struct
  type QuadStore (line 105) | type QuadStore struct
    method NewQuadWriter (line 358) | func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error) {
    method ApplyDeltas (line 398) | func (qs *QuadStore) ApplyDeltas(in []graph.Delta, opts graph.IgnoreOp...
    method Quad (line 513) | func (qs *QuadStore) Quad(val graph.Ref) (quad.Quad, error) {
    method QuadIterator (line 533) | func (qs *QuadStore) QuadIterator(d quad.Direction, val graph.Ref) ite...
    method querySize (line 543) | func (qs *QuadStore) querySize(ctx context.Context, sel Select) (refs....
    method QuadIteratorSize (line 558) | func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Dire...
    method NodesAllIterator (line 568) | func (qs *QuadStore) NodesAllIterator() iterator.Shape {
    method QuadsAllIterator (line 572) | func (qs *QuadStore) QuadsAllIterator() iterator.Shape {
    method ValueOf (line 576) | func (qs *QuadStore) ValueOf(s quad.Value) (graph.Ref, error) {
    method NameOf (line 617) | func (qs *QuadStore) NameOf(v graph.Ref) (quad.Value, error) {
    method Stats (line 736) | func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Sta...
    method Close (line 773) | func (qs *QuadStore) Close() error {
    method QuadDirection (line 777) | func (qs *QuadStore) QuadDirection(in graph.Ref, d quad.Direction) (gr...
    method sizeForIterator (line 781) | func (qs *QuadStore) sizeForIterator(dir quad.Direction, hash NodeHash...
  function connect (line 118) | func connect(addr string, flavor string, opts graph.Options) (*sql.DB, e...
  function Init (line 201) | func Init(typ string, addr string, options graph.Options) error {
  function New (line 268) | func New(typ string, addr string, options graph.Options) (graph.QuadStor...
  function escapeNullByte (line 300) | func escapeNullByte(s string) string {
  function unescapeNullByte (line 303) | func unescapeNullByte(s string) string {
  type ValueType (line 307) | type ValueType
    method Columns (line 309) | func (t ValueType) Columns() []string {
  function NodeValues (line 313) | func NodeValues(h NodeHash, v quad.Value) (ValueType, []interface{}, err...
  type quadWriter (line 362) | type quadWriter struct
    method WriteQuad (line 367) | func (w *quadWriter) WriteQuad(q quad.Quad) error {
    method WriteQuads (line 372) | func (w *quadWriter) WriteQuads(buf []quad.Quad) (int, error) {
    method Close (line 393) | func (w *quadWriter) Close() error {
  type NullTime (line 583) | type NullTime struct
    method Scan (line 589) | func (nt *NullTime) Scan(value interface{}) error {
    method Value (line 610) | func (nt NullTime) Value() (driver.Value, error) {

FILE: graph/sql/shape.go
  type QueryDialect (line 38) | type QueryDialect struct
  function NewBuilder (line 44) | func NewBuilder(d QueryDialect) *Builder {
  type Builder (line 48) | type Builder struct
    method EscapeField (line 61) | func (b *Builder) EscapeField(s string) string {
    method Placeholder (line 67) | func (b *Builder) Placeholder() string {
  function needQuotes (line 53) | func needQuotes(s string) bool {
  constant tagPref (line 73) | tagPref = "__"
  constant tagNode (line 74) | tagNode = tagPref + "node"
  function dirField (line 77) | func dirField(d quad.Direction) string {
  function dirTag (line 81) | func dirTag(d quad.Direction) string {
  type Value (line 85) | type Value interface
  type Shape (line 89) | type Shape interface
  function AllNodes (line 95) | func AllNodes() Select {
  function Nodes (line 99) | func Nodes(where []Where, params []Value) Select {
  function AllQuads (line 112) | func AllQuads(alias string) Select {
  type FieldName (line 128) | type FieldName struct
    method isExpr (line 133) | func (FieldName) isExpr() {}
    method SQL (line 134) | func (f FieldName) SQL(b *Builder) string {
  type Field (line 142) | type Field struct
    method SQL (line 149) | func (f Field) SQL(b *Builder) string {
    method NameOrAlias (line 162) | func (f Field) NameOrAlias() string {
  type Source (line 169) | type Source interface
  type Table (line 175) | type Table struct
    method isSource (line 180) | func (Table) isSource() {}
    method SQL (line 199) | func (f Table) SQL(b *Builder) string {
    method Args (line 206) | func (f Table) Args() []Value {
    method NameSQL (line 209) | func (f Table) NameSQL() string {
  type Subquery (line 182) | type Subquery struct
    method isSource (line 187) | func (Subquery) isSource() {}
    method SQL (line 188) | func (s Subquery) SQL(b *Builder) string {
    method Args (line 195) | func (s Subquery) Args() []Value {
  type CmpOp (line 216) | type CmpOp
  constant OpEqual (line 219) | OpEqual  = CmpOp("=")
  constant OpGT (line 220) | OpGT     = CmpOp(">")
  constant OpGTE (line 221) | OpGTE    = CmpOp(">=")
  constant OpLT (line 222) | OpLT     = CmpOp("<")
  constant OpLTE (line 223) | OpLTE    = CmpOp("<=")
  constant OpIsNull (line 224) | OpIsNull = CmpOp("IS NULL")
  constant OpIsTrue (line 225) | OpIsTrue = CmpOp("IS true")
  type Expr (line 228) | type Expr interface
  type Placeholder (line 233) | type Placeholder struct
    method isExpr (line 235) | func (Placeholder) isExpr() {}
    method SQL (line 237) | func (Placeholder) SQL(b *Builder) string {
  type Where (line 241) | type Where struct
    method SQL (line 248) | func (w Where) SQL(b *Builder) string {
  type Select (line 263) | type Select struct
    method Clone (line 276) | func (s Select) Clone() Select {
    method isAll (line 284) | func (s Select) isAll() bool {
    method onlyAsSubquery (line 290) | func (s Select) onlyAsSubquery() bool {
    method Columns (line 294) | func (s Select) Columns() []string {
    method BuildIterator (line 306) | func (s Select) BuildIterator(qs graph.QuadStore) iterator.Shape {
    method Optimize (line 314) | func (s Select) Optimize(ctx context.Context, r shape.Optimizer) (shap...
    method AppendParam (line 319) | func (s *Select) AppendParam(o Value) Expr {
    method WhereEq (line 324) | func (s *Select) WhereEq(tbl, field string, v Value) {
    method SQL (line 333) | func (s Select) SQL(b *Builder) string {
    method Args (line 367) | func (s Select) Args() []Value {

FILE: graph/sql/shape_test.go
  type stringVal (line 15) | type stringVal
    method Key (line 17) | func (s stringVal) Key() interface{} {
    method SQLValue (line 21) | func (s stringVal) SQLValue() interface{} {
  function sVal (line 25) | func sVal(s string) stringVal {
  function sVals (line 29) | func sVals(arr ...string) []Value {
  function TestSQLShapes (line 360) | func TestSQLShapes(t *testing.T) {

FILE: graph/sql/sqlite/sqlite.go
  constant Type (line 20) | Type = "sqlite"
  function init (line 30) | func init() {
  function runTxSqlite (line 57) | func runTxSqlite(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []graphl...
  function convInsertError (line 144) | func convInsertError(err error) error {

FILE: graph/sql/sqlite/sqlite_test.go
  function makeSqlite (line 14) | func makeSqlite(t testing.TB) (string, graph.Options) {
  function TestSqlite (line 30) | func TestSqlite(t *testing.T) {
  function BenchmarkSqlite (line 34) | func BenchmarkSqlite(t *testing.B) {

FILE: graph/sql/sqltest/sqltest.go
  type Config (line 16) | type Config struct
    method quadStore (line 21) | func (c Config) quadStore() *graphtest.Config {
  function TestAll (line 30) | func TestAll(t *testing.T, typ string, fnc DatabaseFunc, c *Config) {
  function BenchmarkAll (line 45) | func BenchmarkAll(t *testing.B, typ string, fnc DatabaseFunc, c *Config) {
  type DatabaseFunc (line 55) | type DatabaseFunc
  function makeDatabaseFunc (line 57) | func makeDatabaseFunc(typ string, create DatabaseFunc) testutil.Database...
  function testZeroRune (line 74) | func testZeroRune(t testing.TB, create testutil.DatabaseFunc) {

FILE: graph/transaction.go
  type Transaction (line 20) | type Transaction struct
    method AddQuad (line 40) | func (t *Transaction) AddQuad(q quad.Quad) {
    method RemoveQuad (line 55) | func (t *Transaction) RemoveQuad(q quad.Quad) {
    method addDelta (line 79) | func (t *Transaction) addDelta(d Delta) {
    method deleteDelta (line 84) | func (t *Transaction) deleteDelta(d Delta) {
  function NewTransaction (line 28) | func NewTransaction() *Transaction {
  function NewTransactionN (line 33) | func NewTransactionN(n int) *Transaction {
  function createDeltas (line 67) | func createDeltas(q quad.Quad) (ad, rd Delta) {

FILE: graph/transaction_test.go
  function TestTransaction (line 9) | func TestTransaction(t *testing.T) {

FILE: imports.go
  type Handle (line 25) | type Handle struct
    method Close (line 30) | func (h *Handle) Close() error {
  function Triple (line 36) | func Triple(subject, predicate, object interface{}) quad.Quad {
  function Quad (line 40) | func Quad(subject, predicate, object, label interface{}) quad.Quad {
  function NewGraph (line 44) | func NewGraph(name, dbpath string, opts graph.Options) (*Handle, error) {
  function NewMemoryGraph (line 56) | func NewMemoryGraph() (*Handle, error) {

FILE: inference/inference.go
  type classSet (line 32) | type classSet
  type propertySet (line 35) | type propertySet
  type Class (line 38) | type Class struct
    method Name (line 64) | func (c *Class) Name() quad.Value {
    method IsSubClassOf (line 69) | func (c *Class) IsSubClassOf(super *Class) bool {
    method isReferenced (line 87) | func (c *Class) isReferenced() bool {
    method deleteIfUnreferenced (line 95) | func (c *Class) deleteIfUnreferenced() {
  type Property (line 102) | type Property struct
    method Name (line 124) | func (p *Property) Name() quad.Value {
    method Domain (line 129) | func (p *Property) Domain() *Class {
    method Range (line 134) | func (p *Property) Range() *Class {
    method IsSubPropertyOf (line 139) | func (p *Property) IsSubPropertyOf(super *Property) bool {
    method isReferenced (line 154) | func (p *Property) isReferenced() bool {
    method deleteIfUnreferenced (line 162) | func (p *Property) deleteIfUnreferenced() {
  function newProperty (line 113) | func newProperty(name quad.Value, explicit bool, store *Store) *Property {
  type Store (line 169) | type Store struct
    method newClass (line 49) | func (s *Store) newClass(name quad.Value, explicit bool) *Class {
    method GetClass (line 185) | func (s *Store) GetClass(name quad.Value) *Class {
    method GetProperty (line 190) | func (s *Store) GetProperty(name quad.Value) *Property {
    method ensureClass (line 194) | func (s *Store) ensureClass(name quad.Value) {
    method getOrCreateImplicitClass (line 202) | func (s *Store) getOrCreateImplicitClass(name quad.Value) *Class {
    method createProperty (line 210) | func (s *Store) createProperty(name quad.Value) {
    method getOrCreateImplicitProperty (line 218) | func (s *Store) getOrCreateImplicitProperty(name quad.Value) *Property {
    method addClassRelationship (line 227) | func (s *Store) addClassRelationship(child quad.Value, parent quad.Val...
    method addPropertyRelationship (line 236) | func (s *Store) addPropertyRelationship(child quad.Value, parent quad....
    method setPropertyDomain (line 245) | func (s *Store) setPropertyDomain(property quad.Value, domain quad.Val...
    method setPropertyRange (line 253) | func (s *Store) setPropertyRange(property quad.Value, prange quad.Valu...
    method addClassInstance (line 261) | func (s *Store) addClassInstance(name quad.Value) {
    method addPropertyInstance (line 269) | func (s *Store) addPropertyInstance(name quad.Value) *Property {
    method ProcessQuads (line 279) | func (s *Store) ProcessQuads(quads ...quad.Quad) {
    method processQuad (line 286) | func (s *Store) processQuad(q quad.Quad) {
    method deleteClass (line 328) | func (s *Store) deleteClass(name quad.Value) {
    method deleteProperty (line 342) | func (s *Store) deleteProperty(name quad.Value) {
    method deleteClassRel (line 356) | func (s *Store) deleteClassRel(child quad.Value, parent quad.Value) {
    method deletePropertyRel (line 367) | func (s *Store) deletePropertyRel(child quad.Value, parent quad.Value) {
    method unsetPropertyDomain (line 378) | func (s *Store) unsetPropertyDomain(property quad.Value, domain quad.V...
    method unsetPropertyRange (line 388) | func (s *Store) unsetPropertyRange(property quad.Value, prange quad.Va...
    method deleteClassInstance (line 398) | func (s *Store) deleteClassInstance(name quad.Value) {
    method deletePropertyInstance (line 407) | func (s *Store) deletePropertyInstance(name quad.Value) *Property {
    method UnprocessQuads (line 418) | func (s *Store) UnprocessQuads(quads ...quad.Quad) {
    method unprocessQuad (line 425) | func (s *Store) unprocessQuad(q quad.Quad) {
  function NewStore (line 175) | func NewStore() Store {

FILE: inference/inference_test.go
  function triple (line 12) | func triple(subject quad.Value, predicate quad.IRI, object quad.Value) q...
  function TestClassName (line 62) | func TestClassName(t *testing.T) {
  function TestPropertyName (line 68) | func TestPropertyName(t *testing.T) {
  function TestReferencedType (line 74) | func TestReferencedType(t *testing.T) {
  function TestReferencedBNodeType (line 82) | func TestReferencedBNodeType(t *testing.T) {
  function TestReferencedProperty (line 91) | func TestReferencedProperty(t *testing.T) {
  function TestNewClass (line 99) | func TestNewClass(t *testing.T) {
  function TestNewBNodeClass (line 107) | func TestNewBNodeClass(t *testing.T) {
  function TestInvalidNewClass (line 116) | func TestInvalidNewClass(t *testing.T) {
  function TestNewProperty (line 125) | func TestNewProperty(t *testing.T) {
  function TestInvalidNewProperty (line 133) | func TestInvalidNewProperty(t *testing.T) {
  function TestSubClass (line 142) | func TestSubClass(t *testing.T) {
  function TestSubProperty (line 158) | func TestSubProperty(t *testing.T) {
  function TestPropertyDomain (line 174) | func TestPropertyDomain(t *testing.T) {
  function TestPropertyRange (line 190) | func TestPropertyRange(t *testing.T) {
  function TestIsSubClassOf (line 206) | func TestIsSubClassOf(t *testing.T) {
  function TestIsSubClassOfRecursive (line 215) | func TestIsSubClassOfRecursive(t *testing.T) {
  function TestIsSubClassOfItself (line 224) | func TestIsSubClassOfItself(t *testing.T) {
  function TestIsSubClassOfResource (line 233) | func TestIsSubClassOfResource(t *testing.T) {
  function TestIsSubPropertyOf (line 242) | func TestIsSubPropertyOf(t *testing.T) {
  function TestIsSubPropertyOfRecursive (line 251) | func TestIsSubPropertyOfRecursive(t *testing.T) {
  function TestIsSubPropertyOfItself (line 263) | func TestIsSubPropertyOfItself(t *testing.T) {
  function TestUnprocessInvalidQuad (line 272) | func TestUnprocessInvalidQuad(t *testing.T) {
  function TestUnprocessInvalidTypeQuad (line 277) | func TestUnprocessInvalidTypeQuad(t *testing.T) {
  function TestDeleteReferencedType (line 282) | func TestDeleteReferencedType(t *testing.T) {
  function TestDeleteClassWithSubClass (line 291) | func TestDeleteClassWithSubClass(t *testing.T) {
  function TestDeleteClassWithSuperClass (line 306) | func TestDeleteClassWithSuperClass(t *testing.T) {
  function TestDeleteNewClass (line 321) | func TestDeleteNewClass(t *testing.T) {
  function TestDeleteNewProperty (line 330) | func TestDeleteNewProperty(t *testing.T) {
  function TestDeletePropertyWithSubProperty (line 339) | func TestDeletePropertyWithSubProperty(t *testing.T) {
  function TestDeletePropertyWithSuperProperty (line 354) | func TestDeletePropertyWithSuperProperty(t *testing.T) {
  function TestDeleteSubClass (line 369) | func TestDeleteSubClass(t *testing.T) {
  function TestDeleteSubProperty (line 386) | func TestDeleteSubProperty(t *testing.T) {
  function TestDeletePropertyDomain (line 406) | func TestDeletePropertyDomain(t *testing.T) {
  function TestDeletePropertyRange (line 426) | func TestDeletePropertyRange(t *testing.T) {
  function TestDeleteIsSubClassOf (line 446) | func TestDeleteIsSubClassOf(t *testing.T) {
  function TestDeleteIsSubClassOfRecursive (line 457) | func TestDeleteIsSubClassOfRecursive(t *testing.T) {
  function TestDeleteIsSubPropertyOf (line 472) | func TestDeleteIsSubPropertyOf(t *testing.T) {
  function TestDeleteIsSubPropertyOfRecursive (line 486) | func TestDeleteIsSubPropertyOfRecursive(t *testing.T) {
  function TestClassIsReference (line 504) | func TestClassIsReference(t *testing.T) {
  function TestPropertyIsReference (line 514) | func TestPropertyIsReference(t *testing.T) {
  function TestClassUnreference (line 524) | func TestClassUnreference(t *testing.T) {
  function TestPropertyUnreference (line 532) | func TestPropertyUnreference(t *testing.T) {
  function TestDomainClassInstance (line 540) | func TestDomainClassInstance(t *testing.T) {
  function TestRangeClassInstance (line 559) | func TestRangeClassInstance(t *testing.T) {
  function TestDeleteNonExistingClass (line 578) | func TestDeleteNonExistingClass(t *testing.T) {
  function TestDeleteNonExistingProperty (line 583) | func TestDeleteNonExistingProperty(t *testing.T) {
  function TestDeleteNonExistingClassInstance (line 588) | func TestDeleteNonExistingClassInstance(t *testing.T) {
  function TestDeleteNonExistingUsedProperty (line 593) | func TestDeleteNonExistingUsedProperty(t *testing.T) {

FILE: internal/decompressor/decompressor.go
  constant gzipMagic (line 26) | gzipMagic  = "\x1f\x8b"
  constant b2zipMagic (line 27) | b2zipMagic = "BZh"
  function New (line 32) | func New(r io.Reader) (io.Reader, error) {

FILE: internal/decompressor/decompressor_test.go
  function TestDecompressor (line 78) | func TestDecompressor(t *testing.T) {

FILE: internal/dock/dock.go
  type Config (line 22) | type Config struct
  type fullConfig (line 26) | type fullConfig struct
  function run (line 31) | func run(t testing.TB, conf fullConfig) (addr string) {
  function randPort (line 77) | func randPort() int {
  constant localhost (line 95) | localhost = "127.0.0.1"
  function RunAndWait (line 97) | func RunAndWait(t testing.TB, conf Config, port string, check func(strin...
  constant wait (line 133) | wait = time.Second * 5
  function waitPort (line 135) | func waitPort(addr string) bool {

FILE: internal/gephi/stream.go
  constant defaultLimit (line 28) | defaultLimit = 10000
  constant defaultSize (line 29) | defaultSize  = 20
  constant limitCoord (line 30) | limitCoord   = 500
  constant iriInlinePred (line 34) | iriInlinePred = quad.IRI("gephi:inline")
  constant iriPosX (line 35) | iriPosX       = quad.IRI("gephi:x")
  constant iriPosY (line 36) | iriPosY       = quad.IRI("gephi:y")
  type GraphStreamHandler (line 48) | type GraphStreamHandler struct
    method serveRawQuads (line 216) | func (s *GraphStreamHandler) serveRawQuads(ctx context.Context, gs *Gr...
    method serveNodesWithProps (line 253) | func (s *GraphStreamHandler) serveNodesWithProps(ctx context.Context, ...
    method ServeHTTP (line 353) | func (s *GraphStreamHandler) ServeHTTP(w http.ResponseWriter, r *http....
  type valHash (line 52) | type valHash
  type GraphStream (line 54) | type GraphStream struct
    method makeOneNode (line 97) | func (gs *GraphStream) makeOneNode(id string, v quad.Value, props map[...
    method AddNode (line 147) | func (gs *GraphStream) AddNode(v quad.Value, props map[quad.Value]quad...
    method encode (line 152) | func (gs *GraphStream) encode(o interface{}) {
    method addNode (line 158) | func (gs *GraphStream) addNode(v quad.Value, h valHash, props map[quad...
    method ChangeNode (line 173) | func (gs *GraphStream) ChangeNode(v quad.Value, sid string, props map[...
    method AddEdge (line 177) | func (gs *GraphStream) AddEdge(i int, s, o string, p quad.Value) {
    method Flush (line 188) | func (gs *GraphStream) Flush() error {
  function printNodeID (line 60) | func printNodeID(id int) string {
  function NewGraphStream (line 64) | func NewGraphStream(w io.Writer) *GraphStream {
  function toNodeLabel (line 71) | func toNodeLabel(v quad.Value) string {
  function randCoord (line 78) | func randCoord() float64 {
  function randPos (line 81) | func randPos() (x float64, y float64) {
  function setStringProp (line 89) | func setStringProp(v *string, props map[quad.Value]quad.Value, name quad...
  type streamNode (line 199) | type streamNode
  type streamEdge (line 200) | type streamEdge struct
  type graphStreamEvent (line 206) | type graphStreamEvent struct
  function shouldInline (line 245) | func shouldInline(v quad.Value) bool {
  function valuesFromString (line 341) | func valuesFromString(s string) []quad.Value {

FILE: internal/gephi/stream_test.go
  function TestStreamEncoder (line 11) | func TestStreamEncoder(t *testing.T) {

FILE: internal/http/api_v1.go
  type API (line 11) | type API struct
    method GetHandleForRequest (line 16) | func (api *API) GetHandleForRequest(r *http.Request) (*graph.Handle, e...
    method RWOnly (line 20) | func (api *API) RWOnly(handler httprouter.Handle) httprouter.Handle {
    method APIv1 (line 29) | func (api *API) APIv1(r *httprouter.Router) {

FILE: internal/http/cors.go
  function CORS (line 8) | func CORS(h http.Handler) http.Handler {
  function HandlePreflight (line 21) | func HandlePreflight(w http.ResponseWriter, r *http.Request) {

FILE: internal/http/health.go
  function HandleHealth (line 6) | func HandleHealth(w http.ResponseWriter, r *http.Request) {

FILE: internal/http/http.go
  function jsonResponse (line 32) | func jsonResponse(w http.ResponseWriter, code int, err interface{}) {
  type Config (line 42) | type Config struct
  function SetupRoutes (line 48) | func SetupRoutes(handle *graph.Handle, cfg *Config) error {

FILE: internal/http/http_test.go
  function TestParseJSON (line 63) | func TestParseJSON(t *testing.T) {

FILE: internal/http/logs.go
  type statusWriter (line 11) | type statusWriter struct
    method WriteHeader (line 22) | func (w *statusWriter) WriteHeader(code int) {
  function newStatusWriter (line 17) | func newStatusWriter(w http.ResponseWriter) *statusWriter {
  function getAddress (line 28) | func getAddress(req *http.Request) string {
  function LogRequest (line 40) | func LogRequest(handler http.Handler) http.Handler {

FILE: internal/http/query.go
  type SuccessQueryWrapper (line 32) | type SuccessQueryWrapper struct
  type ErrorQueryWrapper (line 36) | type ErrorQueryWrapper struct
  function WriteError (line 40) | func WriteError(w io.Writer, err error) error {
  function WriteResult (line 46) | func WriteResult(w io.Writer, result interface{}) error {
  method contextForRequest (line 52) | func (api *API) contextForRequest(r *http.Request) (context.Context, fun...
  function defaultErrorFunc (line 61) | func defaultErrorFunc(w query.ResponseWriter, err error) {
  method ServeV1Query (line 72) | func (api *API) ServeV1Query(w http.ResponseWriter, r *http.Request, par...
  method ServeV1Shape (line 138) | func (api *API) ServeV1Shape(w http.ResponseWriter, r *http.Request, par...

FILE: internal/http/write.go
  function ParseJSONToQuadList (line 35) | func ParseJSONToQuadList(jsonBody []byte) (out []quad.Quad, _ error) {
  constant maxQuerySize (line 62) | maxQuerySize = 1024 * 1024
  function readLimit (line 63) | func readLimit(r io.Reader) ([]byte, error) {
  method ServeV1Write (line 72) | func (api *API) ServeV1Write(w http.ResponseWriter, r *http.Request, _ h...
  method ServeV1WriteNQuad (line 100) | func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request...
  method ServeV1Delete (line 142) | func (api *API) ServeV1Delete(w http.ResponseWriter, r *http.Request, pa...

FILE: internal/linkedql/schema/schema.go
  constant rdfgNamespace (line 20) | rdfgNamespace = "http://www.w3.org/2004/03/trix/rdfg-1/"
  constant rdfgPrefix (line 21) | rdfgPrefix    = "rdfg:"
  constant rdfgGraph (line 22) | rdfgGraph     = rdfgPrefix + "Graph"
  function typeToRange (line 35) | func typeToRange(t reflect.Type) string {
  type identified (line 70) | type identified struct
  function newIdentified (line 75) | func newIdentified(id string) identified {
  type cardinalityRestriction (line 80) | type cardinalityRestriction struct
  function newBlankNodeID (line 87) | func newBlankNodeID() string {
  function newSingleCardinalityRestriction (line 92) | func newSingleCardinalityRestriction(prop string) cardinalityRestriction {
  type owlPropertyRestriction (line 101) | type owlPropertyRestriction struct
  function newOWLPropertyRestriction (line 107) | func newOWLPropertyRestriction(prop string) owlPropertyRestriction {
  type minCardinalityRestriction (line 116) | type minCardinalityRestriction struct
  type maxCardinalityRestriction (line 122) | type maxCardinalityRestriction struct
  function newMinCardinalityRestriction (line 127) | func newMinCardinalityRestriction(prop string, minCardinality int) minCa...
  function newSingleMaxCardinalityRestriction (line 134) | func newSingleMaxCardinalityRestriction(prop string) maxCardinalityRestr...
  function getOWLPropertyType (line 142) | func getOWLPropertyType(kind reflect.Kind) string {
  type property (line 150) | type property struct
  type class (line 158) | type class struct
  function newClass (line 166) | func newClass(id string, superClasses []interface{}, comment string) cla...
  function getStepTypeClasses (line 176) | func getStepTypeClasses(t reflect.Type) []string {
  type list (line 187) | type list struct
  function newList (line 191) | func newList(members []interface{}) list {
  type unionOf (line 197) | type unionOf struct
  function newUnionOf (line 203) | func newUnionOf(classes []string) unionOf {
  function newGenerator (line 215) | func newGenerator() *generator {
  type generator (line 223) | type generator struct
    method addTypeFields (line 231) | func (g *generator) addTypeFields(name string, t reflect.Type, indirec...
    method AddType (line 280) | func (g *generator) AddType(name string, t reflect.Type) {
    method Generate (line 294) | func (g *generator) Generate() []byte {
  function Generate (line 366) | func Generate() []byte {

FILE: internal/linkedql/schema/schema_test.go
  function TestMarshalSchema (line 8) | func TestMarshalSchema(t *testing.T) {

FILE: internal/load.go
  function Load (line 20) | func Load(qw quad.WriteCloser, batch int, path, typ string) error {
  type readCloser (line 24) | type readCloser struct
    method Close (line 29) | func (r readCloser) Close() error {
  type nopCloser (line 37) | type nopCloser struct
    method Close (line 41) | func (r nopCloser) Close() error { return nil }
  function QuadReaderFor (line 43) | func QuadReaderFor(path, typ string) (quad.ReadCloser, error) {
  function DecompressAndLoad (line 123) | func DecompressAndLoad(qw quad.WriteCloser, batch int, path, typ string)...
  type batchLogger (line 140) | type batchLogger struct
    method WriteQuads (line 145) | func (w *batchLogger) WriteQuads(quads []quad.Quad) (int, error) {

FILE: internal/lru/lru.go
  type Cache (line 25) | type Cache struct
    method Put (line 45) | func (lru *Cache) Put(key string, value interface{}) {
    method Del (line 60) | func (lru *Cache) Del(key string) {
    method Get (line 71) | func (lru *Cache) Get(key string) (interface{}, bool) {
  type kv (line 32) | type kv struct
  function New (line 37) | func New(size int) *Cache {

FILE: internal/lru/lru_test.go
  function TestPanicLRUCache (line 24) | func TestPanicLRUCache(t *testing.T) {

FILE: internal/repl/repl.go
  function trace (line 37) | func trace(s string) (string, time.Time) {
  function un (line 41) | func un(s string, startTime time.Time) {
  function Run (line 47) | func Run(ctx context.Context, qu string, ses query.REPLSession) error {
  constant defaultLanguage (line 82) | defaultLanguage = "gizmo"
  constant ps1 (line 84) | ps1 = "cayley> "
  constant ps2 (line 85) | ps2 = "...     "
  constant history (line 87) | history = ".cayley_history"
  function Repl (line 90) | func Repl(ctx context.Context, h *graph.Handle, queryLanguage string, ti...
  function splitLine (line 228) | func splitLine(line string) (string, string) {
  function terminal (line 246) | func terminal(path string) (*liner.State, error) {
  function persist (line 272) | func persist(term *liner.State, path string) error {

FILE: internal/repl/repl_test.go
  function TestSplitLines (line 54) | func TestSplitLines(t *testing.T) {

FILE: query/gizmo/environ.go
  type graphObject (line 40) | type graphObject struct
    method NewIRI (line 45) | func (g *graphObject) NewIRI(s string) quad.IRI {
    method AddNamespace (line 50) | func (g *graphObject) AddNamespace(pref, ns string) {
    method AddDefaultNamespaces (line 55) | func (g *graphObject) AddDefaultNamespaces() {
    method LoadNamespaces (line 60) | func (g *graphObject) LoadNamespaces() error {
    method NewV (line 65) | func (g *graphObject) NewV(call goja.FunctionCall) goja.Value {
    method NewVertex (line 77) | func (g *graphObject) NewVertex(call goja.FunctionCall) goja.Value {
    method NewM (line 90) | func (g *graphObject) NewM() *pathObject {
    method NewMorphism (line 101) | func (g *graphObject) NewMorphism() *pathObject {
    method Emit (line 112) | func (g *graphObject) Emit(call goja.FunctionCall) goja.Value {
    method CapitalizedUri (line 124) | func (g *graphObject) CapitalizedUri(s string) quad.IRI {
    method CapitalizedAddNamespace (line 127) | func (g *graphObject) CapitalizedAddNamespace(pref, ns string) {
    method CapitalizedAddDefaultNamespaces (line 130) | func (g *graphObject) CapitalizedAddDefaultNamespaces() {
    method CapitalizedLoadNamespaces (line 133) | func (g *graphObject) CapitalizedLoadNamespaces() error {
    method CapitalizedEmit (line 136) | func (g *graphObject) CapitalizedEmit(call goja.FunctionCall) goja.Val...
  function oneStringType (line 140) | func oneStringType(fnc func(s string) quad.Value) func(vm *goja.Runtime,...
  function twoStringType (line 150) | func twoStringType(fnc func(s1, s2 string) quad.Value) func(vm *goja.Run...
  function cmpOpType (line 160) | func cmpOpType(op iterator.Operator) func(vm *goja.Runtime, call goja.Fu...
  function cmpWildcard (line 174) | func cmpWildcard(vm *goja.Runtime, call goja.FunctionCall) goja.Value {
  function cmpRegexp (line 186) | func cmpRegexp(vm *goja.Runtime, call goja.FunctionCall) goja.Value {
  type valFilter (line 240) | type valFilter struct
  function unwrap (line 265) | func unwrap(o interface{}) interface{} {
  function exportArgs (line 281) | func exportArgs(args []goja.Value) []interface{} {
  function toInt (line 293) | func toInt(o interface{}) (int, bool) {
  function toQuadValue (line 306) | func toQuadValue(o interface{}) (quad.Value, error) {
  function toQuadValues (line 333) | func toQuadValues(objs []interface{}) ([]quad.Value, error) {
  function toStrings (line 348) | func toStrings(objs []interface{}) []string {
  function toVia (line 370) | func toVia(via []interface{}) []interface{} {
  function toViaData (line 400) | func toViaData(objs []interface{}) (predicates []interface{}, tags []str...
  function toViaDepthData (line 411) | func toViaDepthData(objs []interface{}) (predicates []interface{}, maxDe...
  function throwErr (line 429) | func throwErr(vm *goja.Runtime, err error) goja.Value {

FILE: query/gizmo/errors.go
  type errArgCount2 (line 24) | type errArgCount2 struct
    method Error (line 29) | func (e errArgCount2) Error() string {
  type errArgCount (line 33) | type errArgCount struct
    method Error (line 37) | func (e errArgCount) Error() string {
  type errNotQuadValue (line 41) | type errNotQuadValue struct
    method Error (line 45) | func (e errNotQuadValue) Error() string {

FILE: query/gizmo/finals.go
  constant TopResultTag (line 24) | TopResultTag = "id"
  method GetLimit (line 27) | func (p *pathObject) GetLimit(limit int) error {
  method All (line 36) | func (p *pathObject) All() error {
  method toArray (line 40) | func (p *pathObject) toArray(call goja.FunctionCall, withTags bool) goja...
  method ToArray (line 72) | func (p *pathObject) ToArray(call goja.FunctionCall) goja.Value {
  method TagArray (line 84) | func (p *pathObject) TagArray(call goja.FunctionCall) goja.Value {
  method toValue (line 87) | func (p *pathObject) toValue(withTags bool) (interface{}, error) {
  method ToValue (line 112) | func (p *pathObject) ToValue() (interface{}, error) {
  method TagValue (line 117) | func (p *pathObject) TagValue() (interface{}, error) {
  method Map (line 122) | func (p *pathObject) Map(call goja.FunctionCall) goja.Value {
  method ForEach (line 138) | func (p *pathObject) ForEach(call goja.FunctionCall) goja.Value {
  method Count (line 165) | func (p *pathObject) Count() (int64, error) {
  method CapitalizedGetLimit (line 171) | func (p *pathObject) CapitalizedGetLimit(limit int) error {
  method CapitalizedAll (line 174) | func (p *pathObject) CapitalizedAll() error {
  method CapitalizedtoArray (line 177) | func (p *pathObject) CapitalizedtoArray(call goja.FunctionCall, withTags...
  method CapitalizedToArray (line 180) | func (p *pathObject) CapitalizedToArray(call goja.FunctionCall) goja.Val...
  method CapitalizedTagArray (line 183) | func (p *pathObject) CapitalizedTagArray(call goja.FunctionCall) goja.Va...
  method CapitalizedtoValue (line 186) | func (p *pathObject) CapitalizedtoValue(withTags bool) (interface{}, err...
  method CapitalizedToValue (line 189) | func (p *pathObject) CapitalizedToValue() (interface{}, error) {
  method CapitalizedTagValue (line 192) | func (p *pathObject) CapitalizedTagValue() (interface{}, error) {
  method CapitalizedMap (line 195) | func (p *pathObject) CapitalizedMap(call goja.FunctionCall) goja.Value {
  method CapitalizedForEach (line 198) | func (p *pathObject) CapitalizedForEach(call goja.FunctionCall) goja.Val...
  method CapitalizedCount (line 201) | func (p *pathObject) CapitalizedCount() (int64, error) {
  function quadValueToString (line 205) | func quadValueToString(v quad.Value) string {

FILE: query/gizmo/gizmo.go
  constant Name (line 38) | Name = "gizmo"
  function init (line 40) | func init() {
  function NewSession (line 49) | func NewSession(qs graph.QuadStore) *Session {
  function lcFirst (line 61) | func lcFirst(str string) string {
  type fieldNameMapper (line 66) | type fieldNameMapper struct
    method FieldName (line 68) | func (fieldNameMapper) FieldName(t reflect.Type, f reflect.StructField...
    method MethodName (line 75) | func (fieldNameMapper) MethodName(t reflect.Type, m reflect.Method) st...
  constant constructMethodPrefix (line 72) | constructMethodPrefix = "New"
  constant backwardsCompatibilityPrefix (line 73) | backwardsCompatibilityPrefix = "Capitalized"
  type Session (line 85) | type Session struct
    method context (line 103) | func (s *Session) context() context.Context {
    method buildEnv (line 107) | func (s *Session) buildEnv() error {
    method quadValueToNative (line 124) | func (s *Session) quadValueToNative(v quad.Value) interface{} {
    method tagsToValueMap (line 138) | func (s *Session) tagsToValueMap(m map[string]graph.Ref) (map[string]i...
    method runIteratorToArray (line 154) | func (s *Session) runIteratorToArray(it iterator.Shape, limit int) ([]...
    method runIteratorToArrayNoTags (line 174) | func (s *Session) runIteratorToArrayNoTags(it iterator.Shape, limit in...
    method runIteratorWithCallback (line 190) | func (s *Session) runIteratorWithCallback(it iterator.Shape, callback ...
    method send (line 210) | func (s *Session) send(ctx context.Context, r *Result) bool {
    method runIterator (line 229) | func (s *Session) runIterator(it iterator.Shape) error {
    method countResults (line 246) | func (s *Session) countResults(it iterator.Shape) (int64, error) {
    method compile (line 263) | func (s *Session) compile(qu string) error {
    method run (line 278) | func (s *Session) run() (goja.Value, error) {
    method Execute (line 287) | func (s *Session) Execute(ctx context.Context, qu string, opt query.Op...
  type Result (line 250) | type Result struct
    method Result (line 256) | func (r *Result) Result() interface{} {
  type results (line 308) | type results struct
    method stop (line 321) | func (it *results) stop(err error) {
    method Next (line 330) | func (it *results) Next(ctx context.Context) bool {
    method Result (line 363) | func (it *results) Result() interface{} {
    method jsonResult (line 378) | func (it *results) jsonResult() interface{} {
    method replResult (line 408) | func (it *results) replResult() interface{} {
    method Err (line 460) | func (it *results) Err() error {
    method Close (line 464) | func (it *results) Close() error {

FILE: query/gizmo/gizmo_test.go
  function makeTestSession (line 49) | func makeTestSession(data []quad.Quad) *Session {
  function intVal (line 58) | func intVal(v int) string {
  constant multiGraphTestFile (line 62) | multiGraphTestFile = "../../data/testdata_multigraph.nq"
  function runQueryGetTag (line 695) | func runQueryGetTag(rec func(), g []quad.Quad, qu string, tag string, li...
  function TestGizmo (line 734) | func TestGizmo(t *testing.T) {
  function TestIssue160 (line 791) | func TestIssue160(t *testing.T) {
  constant issue718Limit (line 828) | issue718Limit = 5
  function issue718Graph (line 830) | func issue718Graph() []quad.Quad {
  function issue718Nodes (line 839) | func issue718Nodes() []string {

FILE: query/gizmo/traversals.go
  type pathObject (line 58) | type pathObject struct
    method new (line 64) | func (p *pathObject) new(np *path.Path) *pathObject {
    method newVal (line 72) | func (p *pathObject) newVal(np *path.Path) goja.Value {
    method clonePath (line 75) | func (p *pathObject) clonePath() *path.Path {
    method buildIteratorTree (line 82) | func (p *pathObject) buildIteratorTree() iterator.Shape {
    method Is (line 101) | func (p *pathObject) Is(call goja.FunctionCall) goja.Value {
    method inout (line 109) | func (p *pathObject) inout(call goja.FunctionCall, in bool) goja.Value {
    method In (line 148) | func (p *pathObject) In(call goja.FunctionCall) goja.Value {
    method Out (line 183) | func (p *pathObject) Out(call goja.FunctionCall) goja.Value {
    method Both (line 194) | func (p *pathObject) Both(call goja.FunctionCall) goja.Value {
    method follow (line 202) | func (p *pathObject) follow(ep *pathObject, rev bool) *pathObject {
    method Follow (line 226) | func (p *pathObject) Follow(path *pathObject) *pathObject {
    method FollowR (line 241) | func (p *pathObject) FollowR(path *pathObject) *pathObject {
    method FollowRecursive (line 255) | func (p *pathObject) FollowRecursive(call goja.FunctionCall) goja.Value {
    method And (line 268) | func (p *pathObject) And(path *pathObject) *pathObject {
    method Intersect (line 282) | func (p *pathObject) Intersect(path *pathObject) *pathObject {
    method Union (line 302) | func (p *pathObject) Union(path *pathObject) *pathObject {
    method Or (line 311) | func (p *pathObject) Or(path *pathObject) *pathObject {
    method Back (line 339) | func (p *pathObject) Back(tag string) *pathObject {
    method Tag (line 362) | func (p *pathObject) Tag(tags ...string) *pathObject {
    method As (line 368) | func (p *pathObject) As(tags ...string) *pathObject {
    method Has (line 392) | func (p *pathObject) Has(call goja.FunctionCall) goja.Value {
    method HasR (line 397) | func (p *pathObject) HasR(call goja.FunctionCall) goja.Value {
    method has (line 400) | func (p *pathObject) has(call goja.FunctionCall, rev bool) goja.Value {
    method save (line 451) | func (p *pathObject) save(call goja.FunctionCall, rev, opt bool) goja....
    method Save (line 524) | func (p *pathObject) Save(call goja.FunctionCall) goja.Value {
    method SaveR (line 529) | func (p *pathObject) SaveR(call goja.FunctionCall) goja.Value {
    method SaveOpt (line 534) | func (p *pathObject) SaveOpt(call goja.FunctionCall) goja.Value {
    method SaveOptR (line 539) | func (p *pathObject) SaveOptR(call goja.FunctionCall) goja.Value {
    method Except (line 553) | func (p *pathObject) Except(path *pathObject) *pathObject {
    method Unique (line 562) | func (p *pathObject) Unique() *pathObject {
    method Difference (line 568) | func (p *pathObject) Difference(path *pathObject) *pathObject {
    method Labels (line 573) | func (p *pathObject) Labels() *pathObject {
    method InPredicates (line 585) | func (p *pathObject) InPredicates() *pathObject {
    method OutPredicates (line 597) | func (p *pathObject) OutPredicates() *pathObject {
    method SaveInPredicates (line 609) | func (p *pathObject) SaveInPredicates(tag string) *pathObject {
    method SaveOutPredicates (line 621) | func (p *pathObject) SaveOutPredicates(tag string) *pathObject {
    method LabelContext (line 650) | func (p *pathObject) LabelContext(call goja.FunctionCall) goja.Value {
    method Filter (line 660) | func (p *pathObject) Filter(args ...valFilter) (*pathObject, error) {
    method Limit (line 685) | func (p *pathObject) Limit(limit int) *pathObject {
    method Skip (line 700) | func (p *pathObject) Skip(offset int) *pathObject {
    method Order (line 705) | func (p *pathObject) Order() *pathObject {
    method CapitalizedIs (line 711) | func (p *pathObject) CapitalizedIs(call goja.FunctionCall) goja.Value {
    method CapitalizedIn (line 714) | func (p *pathObject) CapitalizedIn(call goja.FunctionCall) goja.Value {
    method CapitalizedOut (line 717) | func (p *pathObject) CapitalizedOut(call goja.FunctionCall) goja.Value {
    method CapitalizedBoth (line 720) | func (p *pathObject) CapitalizedBoth(call goja.FunctionCall) goja.Value {
    method CapitalizedFollow (line 723) | func (p *pathObject) CapitalizedFollow(path *pathObject) *pathObject {
    method CapitalizedFollowR (line 726) | func (p *pathObject) CapitalizedFollowR(path *pathObject) *pathObject {
    method CapitalizedFollowRecursive (line 729) | func (p *pathObject) CapitalizedFollowRecursive(call goja.FunctionCall...
    method CapitalizedAnd (line 732) | func (p *pathObject) CapitalizedAnd(path *pathObject) *pathObject {
    method CapitalizedIntersect (line 735) | func (p *pathObject) CapitalizedIntersect(path *pathObject) *pathObject {
    method CapitalizedUnion (line 738) | func (p *pathObject) CapitalizedUnion(path *pathObject) *pathObject {
    method CapitalizedOr (line 741) | func (p *pathObject) CapitalizedOr(path *pathObject) *pathObject {
    method CapitalizedBack (line 744) | func (p *pathObject) CapitalizedBack(tag string) *pathObject {
    method CapitalizedTag (line 747) | func (p *pathObject) CapitalizedTag(tags ...string) *pathObject {
    method CapitalizedAs (line 750) | func (p *pathObject) CapitalizedAs(tags ...string) *pathObject {
    method CapitalizedHas (line 753) | func (p *pathObject) CapitalizedHas(call goja.FunctionCall) goja.Value {
    method CapitalizedHasR (line 756) | func (p *pathObject) CapitalizedHasR(call goja.FunctionCall) goja.Value {
    method CapitalizedSave (line 759) | func (p *pathObject) CapitalizedSave(call goja.FunctionCall) goja.Value {
    method CapitalizedSaveR (line 762) | func (p *pathObject) CapitalizedSaveR(call goja.FunctionCall) goja.Val...
    method CapitalizedSaveOpt (line 765) | func (p *pathObject) CapitalizedSaveOpt(call goja.FunctionCall) goja.V...
    method CapitalizedSaveOptR (line 768) | func (p *pathObject) CapitalizedSaveOptR(call goja.FunctionCall) goja....
    method CapitalizedExcept (line 771) | func (p *pathObject) CapitalizedExcept(path *pathObject) *pathObject {
    method CapitalizedUnique (line 774) | func (p *pathObject) CapitalizedUnique() *pathObject {
    method CapitalizedDifference (line 777) | func (p *pathObject) CapitalizedDifference(path *pathObject) *pathObje...
    method CapitalizedLabels (line 780) | func (p *pathObject) CapitalizedLabels() *pathObject {
    method CapitalizedInPredicates (line 783) | func (p *pathObject) CapitalizedInPredicates() *pathObject {
    method CapitalizedOutPredicates (line 786) | func (p *pathObject) CapitalizedOutPredicates() *pathObject {
    method CapitalizedSaveInPredicates (line 789) | func (p *pathObject) CapitalizedSaveInPredicates(tag string) *pathObje...
    method CapitalizedSaveOutPredicates (line 792) | func (p *pathObject) CapitalizedSaveOutPredicates(tag string) *pathObj...
    method CapitalizedLabelContext (line 795) | func (p *pathObject) CapitalizedLabelContext(call goja.FunctionCall) g...
    method CapitalizedFilter (line 798) | func (p *pathObject) CapitalizedFilter(args ...valFilter) (*pathObject...
    method CapitalizedLimit (line 801) | func (p *pathObject) CapitalizedLimit(limit int) *pathObject {
    method CapitalizedSkip (line 804) | func (p *pathObject) CapitalizedSkip(offset int) *pathObject {

FILE: query/graphql/graphql.go
  constant Name (line 25) | Name = "graphql"
  function allowedNameRune (line 33) | func allowedNameRune(r rune) bool {
  function init (line 38) | func init() {
  function NewSession (line 51) | func NewSession(qs graph.QuadStore) *Session {
  type Session (line 55) | type Session struct
    method Execute (line 59) | func (s *Session) Execute(ctx context.Context, qu string, opt query.Op...
  type results (line 76) | type results struct
    method Next (line 84) | func (it *results) Next(ctx context.Context) bool {
    method Result (line 93) | func (it *results) Result() interface{} {
    method Err (line 104) | func (it *results) Err() error {
    method Close (line 108) | func (it *results) Close() error {
  type Query (line 121) | type Query struct
    method Execute (line 398) | func (q *Query) Execute(ctx context.Context, qs graph.QuadStore) (map[...
  type has (line 125) | type has struct
  type field (line 132) | type field struct
    method isSave (line 144) | func (f field) isSave() bool { return len(f.Has)+len(f.Fields) == 0 &&...
  type object (line 146) | type object struct
  function buildIterator (line 151) | func buildIterator(ctx context.Context, qs graph.QuadStore, p *path.Path...
  function iterateObject (line 156) | func iterateObject(ctx context.Context, qs graph.QuadStore, f *field, p ...
  function Parse (line 416) | func Parse(r io.Reader) (*Query, error) {
  function setToFields (line 443) | func setToFields(set *ast.SelectionSet, labels []quad.Value) (out []fiel...
  function stringToVia (line 470) | func stringToVia(s string) (_ quad.IRI, rev bool) {
  function argsToHas (line 481) | func argsToHas(dst []has, args []*ast.Argument, rev bool, labels []quad....
  function convField (line 497) | func convField(fld *ast.Field, labels []quad.Value) (out field, err erro...
  function convValue (line 563) | func convValue(v ast.Value) (out []quad.Value, _ error) {

FILE: query/graphql/graphql_test.go
  function iris (line 19) | func iris(arr ...string) (out []quad.Value) {
  function TestParse (line 87) | func TestParse(t *testing.T) {
  function toJSON (line 302) | func toJSON(o interface{}) string {
  function TestExecute (line 310) | func TestExecute(t *testing.T) {

FILE: query/graphql/http.go
  type httpResult (line 14) | type httpResult struct
  function httpError (line 19) | func httpError(w query.ResponseWriter, err error) {
  function httpQuery (line 27) | func httpQuery(ctx context.Context, qs graph.QuadStore, w query.Response...

Condensed preview — 378 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,010K chars).
[
  {
    "path": ".dockerignore",
    "chars": 14,
    "preview": ".idea/\nvendor/"
  },
  {
    "path": ".gitbook.yaml",
    "chars": 13,
    "preview": "root: ./docs/"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "chars": 834,
    "preview": "<!--\nThe GitHub issue tracker is for bug reports and feature requests.\nGeneral support can be found at the following loc"
  },
  {
    "path": ".github/workflows/build-and-release.yml",
    "chars": 2579,
    "preview": "name: Test and release\n\non:\n  push:\n    branches:\n      - master\n      - ci_tests\n    tags:\n      - '*'\n  pull_request:\n"
  },
  {
    "path": ".gitignore",
    "chars": 157,
    "preview": ".idea/\ndb/\ndist/\nvendor/\n\n*.swp\nmain\n*.test\n*.peg.go\ncayley.cfg\ncayley.yml\ncayley.json\n.cayley_history\n.DS_Store\n\npackrd"
  },
  {
    "path": ".goreleaser.yml",
    "chars": 1790,
    "preview": "builds:\n  - main: ./cmd/cayley\n    binary: cayley\n    env:\n      - CGO_ENABLED=0\n    goos:\n      - linux\n      - darwin\n"
  },
  {
    "path": "AUTHORS",
    "chars": 1062,
    "preview": "# This is the official list of Cayley authors for copyright purposes.\n# This file is distinct from the CONTRIBUTORS file"
  },
  {
    "path": "CODEOWNERS",
    "chars": 22,
    "preview": "*   @dennwc @eraserhd\n"
  },
  {
    "path": "CONTRIBUTORS",
    "chars": 1190,
    "preview": "# The AUTHORS file lists the copyright holders; this file\n# lists people.  For example, Google employees are listed here"
  },
  {
    "path": "Dockerfile",
    "chars": 1694,
    "preview": "FROM golang:1.22 AS builder\n\nARG VERSION=v0.8.x-dev\n\n# Create filesystem for minimal image\nWORKDIR /fs\n\nRUN mkdir -p etc"
  },
  {
    "path": "LICENSE",
    "chars": 10142,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "README.md",
    "chars": 2009,
    "preview": "<div align=\"center\">\n  <a href=\"https://github.com/cayleygraph/cayley\">\n    <img width=\"200\" src=\"https://github.com/cay"
  },
  {
    "path": "cayley_example.yml",
    "chars": 310,
    "preview": "store:\n  # backend to use\n  backend: bolt\n  # address or path for the database\n  address: \"./cayley.db\"\n  # open databas"
  },
  {
    "path": "client/client.go",
    "chars": 2303,
    "preview": "package client\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/cayleygraph/quad\"\n\t\"github.com/cayleygraph/qu"
  },
  {
    "path": "clog/clog.go",
    "chars": 2688,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "clog/glog/glog.go",
    "chars": 805,
    "preview": "package glog\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cayleygraph/cayley/clog\"\n\t\"github.com/golang/glog\"\n)\n\nfunc init() {\n\tclog.Se"
  },
  {
    "path": "cmd/cayley/cayley.go",
    "chars": 7376,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "cmd/cayley/command/convert.go",
    "chars": 2414,
    "preview": "package command\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/cayleygraph/cayley/clog\"\n\t\"git"
  },
  {
    "path": "cmd/cayley/command/database.go",
    "chars": 7652,
    "preview": "package command\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"runtime/pprof\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/sp"
  },
  {
    "path": "cmd/cayley/command/dedup.go",
    "chars": 4898,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"crypto/sha1\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"sort\"\n\t\"time\"\n\n\t\"github.com/spf13/cobra\"\n"
  },
  {
    "path": "cmd/cayley/command/dump.go",
    "chars": 1581,
    "preview": "package command\n\nimport (\n\t\"compress/gzip\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/cayleygraph/cayl"
  },
  {
    "path": "cmd/cayley/command/health.go",
    "chars": 845,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nconst defaultAddress = \"http://localho"
  },
  {
    "path": "cmd/cayley/command/http.go",
    "chars": 1426,
    "preview": "package command\n\nimport (\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/viper\"\n\n\t\"github.com/"
  },
  {
    "path": "cmd/cayley/command/repl.go",
    "chars": 3317,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strings\"\n\t\"time\"\n\n\t\"githu"
  },
  {
    "path": "cmd/cayley/command/schema.go",
    "chars": 821,
    "preview": "package command\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/cayleygraph/cayley/i"
  },
  {
    "path": "cmd/cayleyexport/cayleyexport.go",
    "chars": 2236,
    "preview": "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/cayleygraph/cayley/clog\"\n\n\t// Load all sup"
  },
  {
    "path": "cmd/cayleyexport/cayleyexport_test.go",
    "chars": 1404,
    "preview": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/cayleygraph/quad\"\n\t\"github.com/cayley"
  },
  {
    "path": "cmd/cayleyimport/cayleyimport.go",
    "chars": 2831,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github"
  },
  {
    "path": "cmd/cayleyimport/cayleyimport_test.go",
    "chars": 2314,
    "preview": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"path\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"github.com/cayleygrap"
  },
  {
    "path": "cmd/docgen/docgen.go",
    "chars": 3783,
    "preview": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/doc\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"io\"\n\t\"os\"\n\t\"path/"
  },
  {
    "path": "cmd/download_ui/download_ui.go",
    "chars": 2644,
    "preview": "package main\n\nimport (\n\t\"archive/zip\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nconst (\n\tvers"
  },
  {
    "path": "configurations/default.json",
    "chars": 47,
    "preview": "{\n  \"store\": {\n    \"backend\": \"memstore\"\n  }\n}\n"
  },
  {
    "path": "configurations/persisted.json",
    "chars": 76,
    "preview": "{\n  \"store\": {\n    \"backend\": \"bolt\",\n    \"address\": \"data/cayley.db\"\n  }\n}\n"
  },
  {
    "path": "data/30kmoviedata_gephi_meta.nq",
    "chars": 170,
    "preview": "</film/performance/character> <gephi:inline> \"true\"^^<schema:Boolean> .\n<type> <gephi:inline> \"true\"^^<schema:Boolean> ."
  },
  {
    "path": "data/people.jsonld",
    "chars": 386,
    "preview": "{\n  \"@context\": {\n    \"ex\": \"http://example.com/\",\n    \"@vocab\": \"http://xmlns.com/foaf/0.1/\"\n  },\n  \"@graph\": [\n    {\n "
  },
  {
    "path": "data/testdata.nq",
    "chars": 463,
    "preview": "<alice> <follows> <bob> .\n<bob> <follows> <fred> .\n<bob> <status> \"cool_person\" .\n<dani> <follows> <bob> .\n<charlie> <fo"
  },
  {
    "path": "data/testdata_multigraph.nq",
    "chars": 510,
    "preview": "<alice> <follows> <bob> .\n<bob> <follows> <fred> .\n<bob> <status> \"cool_person\" .\n<charlie> <follows> <bob> .\n<charlie> "
  },
  {
    "path": "docs/3rd-party-apis.md",
    "chars": 904,
    "preview": "# 3rd-Party-APIs\n\nVarious 3rd party APIs\n\n* **Clojure**: [https://github.com/wgb/cayley-clj](https://github.com/wgb/cayl"
  },
  {
    "path": "docs/GizmoAPI.md.in",
    "chars": 106,
    "preview": "# Gizmo API\n![Autogenerated file](https://img.shields.io/badge/file-generated-orange.svg)\n\n#AUTOGENERATED#"
  },
  {
    "path": "docs/README.md",
    "chars": 1172,
    "preview": "# Cayley Documentation\n\nWelcome to the Cayley Manual! Cayley is an open-source graph database designed for ease of use a"
  },
  {
    "path": "docs/SUMMARY.md",
    "chars": 1042,
    "preview": "# Table of contents\n\n* [Cayley Documentation](README.md)\n* [Getting Started](getting-started.md)\n* [Install Cayley](inst"
  },
  {
    "path": "docs/advanced-use.md",
    "chars": 3381,
    "preview": "# Advanced Use\n\n## Initialize A Graph\n\nNow that Cayley is downloaded \\(or built\\), let's create our database. `init` is "
  },
  {
    "path": "docs/api/swagger.yml",
    "chars": 16684,
    "preview": "openapi: \"3.0.0\"\ninfo:\n  description: \"\"\n  version: \"2.1.0\"\n  title: \"Cayley API\"\n  license:\n    name: \"Apache 2.0\"\n    "
  },
  {
    "path": "docs/cayleyexport.md",
    "chars": 1036,
    "preview": "# `cayleyexport`\n\n```\ncayleyexport <file>\n```\n\n## Synopsis\n\nThe `cayleyexport` tool exports content from a Cayley deploy"
  },
  {
    "path": "docs/cayleyimport.md",
    "chars": 1088,
    "preview": "# `cayleyimport`\n\n```\ncayleyimport <file>\n```\n\n## Synopsis\n\nThe `cayleyimport` tool imports content created by [`cayleye"
  },
  {
    "path": "docs/configuration.md",
    "chars": 7294,
    "preview": "# Configuration\n\nCayley can be configured using configuration file written in YAML / JSON or by passing flags to the com"
  },
  {
    "path": "docs/container.md",
    "chars": 1251,
    "preview": "# Container\n\n## Running in Kubernetes\n\nTo run Cayley in K8S check [this docs section](k8s/k8s.md).\n\n## Running in a cont"
  },
  {
    "path": "docs/contributing.md",
    "chars": 2400,
    "preview": "# Contributing\n\n## Community Involvement\n\nJoin our community on [discourse.cayley.io](https://discourse.cayley.io) or ot"
  },
  {
    "path": "docs/convert-linked-data-files.md",
    "chars": 971,
    "preview": "---\ndescription: >-\n  Linked Data has multiple representations. The Cayley CLI includes a utility to\n  convert Linked Da"
  },
  {
    "path": "docs/deployment/container.md",
    "chars": 1257,
    "preview": "# Running in Docker\n\n## Running in Kubernetes\n\nTo run Cayley in K8S check [this docs section](k8s-1.md).\n\n## Running in "
  },
  {
    "path": "docs/deployment/k8s-1.md",
    "chars": 839,
    "preview": "# Running in Kubernetes\n\nMost examples requires Kubernetes 1.5+ and PersistentVolumes are configured.\n\nAfter running scr"
  },
  {
    "path": "docs/docker-compose/docker-compose.mongo.yml",
    "chars": 213,
    "preview": "version: \"2.2\"\nservices:\n  cayley:\n    image: cayleygraph/cayley\n    command: http --db mongo --dbpath mongodb://mongo:2"
  },
  {
    "path": "docs/faq.md",
    "chars": 199,
    "preview": "# Frequently Asked Questiones\n\nComing Soon! Building the list at [https://discourse.cayley.io/t/faq-frequently-asked-que"
  },
  {
    "path": "docs/gephigraphstream.md",
    "chars": 2410,
    "preview": "# Gephi GraphStream\n\nCayley supports graph visualisation in Gephi using GraphStream API.\n\nEnpoint can be accessed by add"
  },
  {
    "path": "docs/getting-involved/contributing.md",
    "chars": 3077,
    "preview": "# Contributing\n\n## Contributing\n\n### Community Involvement\n\nJoin our community on [discourse.cayley.io](https://discours"
  },
  {
    "path": "docs/getting-involved/glossary.md",
    "chars": 13210,
    "preview": "# Glossary of Terms\n\n_Note: this definitions in this glossary are sequenced so that they build on each other, one to the"
  },
  {
    "path": "docs/getting-involved/locations.md",
    "chars": 1431,
    "preview": "# Locations of parts of Cayley\n\n## Community\n\n* Where is the beating heart of this community?  [https://discourse.cayley"
  },
  {
    "path": "docs/getting-involved/todo.md",
    "chars": 257,
    "preview": "# TODOs\n\nThe main source of our TODO list is our [Github Issues](https://github.com/cayleygraph/cayley/issues), so we ar"
  },
  {
    "path": "docs/getting-started.md",
    "chars": 2346,
    "preview": "# Getting Started\n\nThis guide will take you through starting a graph based on provided data.\n\n## Prerequisites\n\nThis tut"
  },
  {
    "path": "docs/gizmoapi.md",
    "chars": 18909,
    "preview": "# Gizmo API\n\n![Autogenerated file](https://img.shields.io/badge/file-generated-orange.svg)\n\n## The `graph` object\n\nName:"
  },
  {
    "path": "docs/glossary.md",
    "chars": 13249,
    "preview": "# Glossary of Terms\n\n_Note: this definitions in this glossary are sequenced so that they build on each other, one to the"
  },
  {
    "path": "docs/graphql.md",
    "chars": 5706,
    "preview": "# GraphQL Guide\n\n**Disclaimer:** Cayley's GraphQL implementation is not strictly a GraphQL, but only a query language wi"
  },
  {
    "path": "docs/gremlinapi.md",
    "chars": 117,
    "preview": "# GremlinAPI\n\nCayley Gremlin API was renamed to [Gizmo](gizmoapi.md) to avoid confusion with TinkerPop Gremlin API.\n\n"
  },
  {
    "path": "docs/hacking.md",
    "chars": 51,
    "preview": "# HACKING\n\nSee [Contributing.md](contributing.md)\n\n"
  },
  {
    "path": "docs/http.md",
    "chars": 2846,
    "preview": "# HTTP Methods\n\nThis file covers deprecated v1 HTTP API. All the methods of v2 HTTP API is described in OpenAPI/Swagger "
  },
  {
    "path": "docs/installation.md",
    "chars": 593,
    "preview": "# Install Cayley\n\n## Install Cayley on Ubuntu\n\n```text\nsnap install --edge --devmode cayley\n```\n\n## Install Cayley on ma"
  },
  {
    "path": "docs/k8s/README.md",
    "chars": 7,
    "preview": "# k8s\n\n"
  },
  {
    "path": "docs/k8s/cayley-mongo.yml",
    "chars": 2222,
    "preview": "kind: Namespace\napiVersion: v1\nmetadata:\n  name: cayley\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: mongo\n  names"
  },
  {
    "path": "docs/k8s/cayley-single.yml",
    "chars": 1452,
    "preview": "kind: Namespace\napiVersion: v1\nmetadata:\n  name: cayley\n---\nkind: Service\napiVersion: v1\nmetadata:\n  name: cayley\n  name"
  },
  {
    "path": "docs/k8s/k8s.md",
    "chars": 839,
    "preview": "# Running in Kubernetes\n\nMost examples requires Kubernetes 1.5+ and PersistentVolumes are configured.\n\nAfter running scr"
  },
  {
    "path": "docs/locations.md",
    "chars": 1431,
    "preview": "# Locations of parts of Cayley\n\n## Community\n\n* Where is the beating heart of this community?  [https://discourse.cayley"
  },
  {
    "path": "docs/migration.md",
    "chars": 2808,
    "preview": "# Migration\n\n## From Cayley 0.6.1 to 0.7.x\n\nFirst you need to dump all the data from the database via v0.6.1:\n\n```bash\n."
  },
  {
    "path": "docs/mql.md",
    "chars": 2270,
    "preview": "# MQL Guide\n\n## General\n\nCayley's MQL implementation is a work-in-progress clone of [Freebase's MQL API](https://develop"
  },
  {
    "path": "docs/query-languages/gephigraphstream.md",
    "chars": 2410,
    "preview": "# Gephi GraphStream\n\nCayley supports graph visualisation in Gephi using GraphStream API.\n\nEnpoint can be accessed by add"
  },
  {
    "path": "docs/query-languages/gizmoapi.md",
    "chars": 18910,
    "preview": "# Gizmo API\n\n![Autogenerated file](https://img.shields.io/badge/file-generated-orange.svg)\n\n## The `graph` object\n\nName:"
  },
  {
    "path": "docs/query-languages/graphql.md",
    "chars": 5706,
    "preview": "# GraphQL Guide\n\n**Disclaimer:** Cayley's GraphQL implementation is not strictly a GraphQL, but only a query language wi"
  },
  {
    "path": "docs/query-languages/mql.md",
    "chars": 2270,
    "preview": "# MQL Guide\n\n## General\n\nCayley's MQL implementation is a work-in-progress clone of [Freebase's MQL API](https://develop"
  },
  {
    "path": "docs/quickstart-as-application.md",
    "chars": 218,
    "preview": "# Quickstart-As-Application\n\nSee [Getting Started](https://github.com/cayleygraph/cayley/blob/master/docs/getting-starte"
  },
  {
    "path": "docs/quickstart-as-lib.md",
    "chars": 1664,
    "preview": "# Quickstart as Library\n\nCurrently, Cayley supports being used as a Go library for other projects. To use it in such a w"
  },
  {
    "path": "docs/todo.md",
    "chars": 257,
    "preview": "# TODOs\n\nThe main source of our TODO list is our [Github Issues](https://github.com/cayleygraph/cayley/issues), so we ar"
  },
  {
    "path": "docs/tools/convert-linked-data-files.md",
    "chars": 971,
    "preview": "---\ndescription: >-\n  Linked Data has multiple representations. The Cayley CLI includes a utility to\n  convert Linked Da"
  },
  {
    "path": "docs/ui-overview.md",
    "chars": 1653,
    "preview": "# UI Overview\n\n## Sidebar\n\nAlong the side are the various actions or views you can take. From the top, these are:\n\n* Run"
  },
  {
    "path": "docs/usage/3rd-party-apis.md",
    "chars": 904,
    "preview": "# 3rd-Party-APIs\n\nVarious 3rd party APIs\n\n* **Clojure**: [https://github.com/wgb/cayley-clj](https://github.com/wgb/cayl"
  },
  {
    "path": "docs/usage/advanced-use.md",
    "chars": 3387,
    "preview": "# Advanced Use\n\n## Initialize A Graph\n\nNow that Cayley is downloaded \\(or built\\), let's create our database. `init` is "
  },
  {
    "path": "docs/usage/http.md",
    "chars": 2884,
    "preview": "# HTTP Methods\n\nThis file covers deprecated v1 HTTP API. All the methods of v2 HTTP API is described in OpenAPI/Swagger "
  },
  {
    "path": "docs/usage/migration.md",
    "chars": 2808,
    "preview": "# Migration\n\n## From Cayley 0.6.1 to 0.7.x\n\nFirst you need to dump all the data from the database via v0.6.1:\n\n```bash\n."
  },
  {
    "path": "docs/usage/quickstart-as-lib.md",
    "chars": 1664,
    "preview": "# Quickstart as Library\n\nCurrently, Cayley supports being used as a Go library for other projects. To use it in such a w"
  },
  {
    "path": "docs/usage/ui-overview.md",
    "chars": 1691,
    "preview": "# UI Overview\n\n## Sidebar\n\nAlong the side are the various actions or views you can take. From the top, these are:\n\n* Run"
  },
  {
    "path": "examples/README.md",
    "chars": 191,
    "preview": "# Examples\n\nEach of the examples can be run with \n\n```go run hello_world/main.go```\n\nobviously changing **hello_world** "
  },
  {
    "path": "examples/hello_bolt/main.go",
    "chars": 1727,
    "preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/cayleygraph/cayley\"\n\t\"github.com/cayley"
  },
  {
    "path": "examples/hello_schema/main.go",
    "chars": 3411,
    "preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"math/rand\"\n\t\"os\"\n\n\t\"github.com/cayleygraph/cayley\"\n\t\"gith"
  },
  {
    "path": "examples/hello_world/main.go",
    "chars": 868,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/cayleygraph/cayley\"\n\t\"github.com/cayleygraph/quad\"\n)\n\nfunc main() {\n\t"
  },
  {
    "path": "examples/transaction/main.go",
    "chars": 1080,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/cayleygraph/cayley\"\n\t\"github.com/cayleygraph/quad\"\n)\n\nfunc main() {\n\t"
  },
  {
    "path": "go.mod",
    "chars": 6609,
    "preview": "module github.com/cayleygraph/cayley\n\ngo 1.22\n\ntoolchain go1.22.5\n\nrequire (\n\tgithub.com/badgerodon/peg v0.0.0-201307291"
  },
  {
    "path": "go.sum",
    "chars": 70748,
    "preview": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ndmitri.shuralyov.com/gpu/mtl v0.0.0-2"
  },
  {
    "path": "gogen.go",
    "chars": 107,
    "preview": "package cayley\n\n//go:generate go run ./cmd/docgen/docgen.go -i ./docs/GizmoAPI.md.in -o ./docs/GizmoAPI.md\n"
  },
  {
    "path": "graph/all/all.go",
    "chars": 356,
    "preview": "package all\n\nimport (\n\t// supported backends\n\t_ \"github.com/cayleygraph/cayley/graph/kv/all\"\n\t_ \"github.com/cayleygraph/"
  },
  {
    "path": "graph/all/all_cgo.go",
    "chars": 119,
    "preview": "//go:build cgo\n\npackage all\n\nimport (\n\t// backends requiring cgo\n\t_ \"github.com/cayleygraph/cayley/graph/sql/sqlite\"\n)\n"
  },
  {
    "path": "graph/gaedatastore/config.go",
    "chars": 4351,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/gaedatastore/iterator.go",
    "chars": 10007,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/gaedatastore/quadstore.go",
    "chars": 14988,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/gaedatastore/quadstore_test.go",
    "chars": 3474,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.  //\n// Licensed under the Apache License, Version 2.0 (the \"L"
  },
  {
    "path": "graph/graphmock/graphmock.go",
    "chars": 5501,
    "preview": "package graphmock\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\n\t\"github.com/cayleygraph/cayley/graph\"\n\t\"github.com/cayleygraph/cayle"
  },
  {
    "path": "graph/graphtest/graphtest.go",
    "chars": 34088,
    "preview": "package graphtest\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/cayleygraph/quad\"\n\t\"githu"
  },
  {
    "path": "graph/graphtest/integration.go",
    "chars": 25146,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/graphtest/testutil/testutil.go",
    "chars": 1105,
    "preview": "package testutil\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/cayleygraph/quad\"\n\t\"github.com/cayleygraph/qu"
  },
  {
    "path": "graph/hasa.go",
    "chars": 10020,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/hasa_test.go",
    "chars": 1263,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/http/httpgraph.go",
    "chars": 183,
    "preview": "package httpgraph\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/cayleygraph/cayley/graph\"\n)\n\ntype QuadStore interface {\n\tgraph.Qua"
  },
  {
    "path": "graph/iterator/and.go",
    "chars": 9051,
    "preview": "// Defines the And iterator, one of the base iterators. And requires no\n// knowledge of the constituent QuadStore; its s"
  },
  {
    "path": "graph/iterator/and_optimize.go",
    "chars": 9385,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/and_optimize_test.go",
    "chars": 2048,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/and_test.go",
    "chars": 3291,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/count.go",
    "chars": 3983,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n\t\"github.com/cayleygraph/quad\"\n)\n\n// "
  },
  {
    "path": "graph/iterator/count_test.go",
    "chars": 1211,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n\t\"github.com/cayleygraph/q"
  },
  {
    "path": "graph/iterator/fixed.go",
    "chars": 5040,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/iterate.go",
    "chars": 7863,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n\t\"github.com/cayleygraph/quad\""
  },
  {
    "path": "graph/iterator/iterator.go",
    "chars": 7869,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/iterator_test.go",
    "chars": 5320,
    "preview": "package iterator_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t. \"github.com/cayleygraph/cayley/graph/iterator\"\n\t\"github.com/cayley"
  },
  {
    "path": "graph/iterator/limit.go",
    "chars": 3859,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n)\n\n// Limit iterator will stop"
  },
  {
    "path": "graph/iterator/limit_test.go",
    "chars": 962,
    "preview": "package iterator_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\n\t. \"github.com/cayleygrap"
  },
  {
    "path": "graph/iterator/materialize.go",
    "chars": 6959,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/materialize_test.go",
    "chars": 1851,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/misc.go",
    "chars": 1184,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/not.go",
    "chars": 4619,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n)\n\n// Not iterator acts like a comple"
  },
  {
    "path": "graph/iterator/not_test.go",
    "chars": 1069,
    "preview": "package iterator_test\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\n\t. \"github.com/"
  },
  {
    "path": "graph/iterator/or.go",
    "chars": 8181,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/or_test.go",
    "chars": 3881,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/recursive.go",
    "chars": 6784,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"math\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n\t\"github.com/cayleygraph/quad"
  },
  {
    "path": "graph/iterator/recursive_test.go",
    "chars": 3605,
    "preview": "// Copyright 2015 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/regex.go",
    "chars": 2369,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/resolver.go",
    "chars": 5330,
    "preview": "// Copyright 2018 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/resolver_test.go",
    "chars": 2671,
    "preview": "package iterator_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/cayleygraph/"
  },
  {
    "path": "graph/iterator/save.go",
    "chars": 4111,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n)\n\nvar (\n\t_ TaggerBase = (*Sav"
  },
  {
    "path": "graph/iterator/skip.go",
    "chars": 4726,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n)\n\n// Skip iterator will skip "
  },
  {
    "path": "graph/iterator/skip_test.go",
    "chars": 1183,
    "preview": "package iterator_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\n\t. \"github.com/cayleygrap"
  },
  {
    "path": "graph/iterator/sort.go",
    "chars": 3941,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\t\"sort\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n)\n\n// Sort iterator orders va"
  },
  {
    "path": "graph/iterator/unique.go",
    "chars": 3772,
    "preview": "package iterator\n\nimport (\n\t\"context\"\n\n\t\"github.com/cayleygraph/cayley/graph/refs\"\n)\n\n// Unique iterator removes duplica"
  },
  {
    "path": "graph/iterator/unique_test.go",
    "chars": 550,
    "preview": "package iterator_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\n\t. \"github.com/cayleygrap"
  },
  {
    "path": "graph/iterator/value_comparison.go",
    "chars": 3780,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/value_comparison_test.go",
    "chars": 6931,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/iterator/value_filter.go",
    "chars": 4649,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/all/all.go",
    "chars": 360,
    "preview": "package all\n\nimport (\n\t// import all implementations that hidalgo supports\n\t_ \"github.com/hidal-go/hidalgo/kv/all\"\n\n\t// "
  },
  {
    "path": "graph/kv/all_iterator.go",
    "chars": 5903,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/badger/badger.go",
    "chars": 1173,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/badger/badger_test.go",
    "chars": 1367,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/bbolt/bolt.go",
    "chars": 2072,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/bbolt/bolt_test.go",
    "chars": 1344,
    "preview": "// Copyright 2015 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/bolt/bolt.go",
    "chars": 2064,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/bolt/bolt_test.go",
    "chars": 1343,
    "preview": "// Copyright 2015 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/btree/btree.go",
    "chars": 974,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/btree/btree_test.go",
    "chars": 1388,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/indexing.go",
    "chars": 29763,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/indexing_test.go",
    "chars": 1147,
    "preview": "package kv\n\nimport \"testing\"\n\nfunc TestIntersectSorted(t *testing.T) {\n\ttt := []struct {\n\t\ta      []uint64\n\t\tb      []ui"
  },
  {
    "path": "graph/kv/iterators.go",
    "chars": 3355,
    "preview": "package kv\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/hidal-go/hidalgo/kv\"\n\n\t\"github.com/cayleygraph/quad\"\n\n\t\"github.com/"
  },
  {
    "path": "graph/kv/kvtest/kvtest.go",
    "chars": 3537,
    "preview": "package kvtest\n\nimport (\n\t\"context\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/cayleygraph/quad\"\n\thkv \"github.com/hidal-go/hida"
  },
  {
    "path": "graph/kv/leveldb/leveldb.go",
    "chars": 1634,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/leveldb/leveldb_test.go",
    "chars": 1361,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/metrics.go",
    "chars": 5037,
    "preview": "package kv\n\nimport (\n\t\"context\"\n\n\t\"github.com/hidal-go/hidalgo/kv\"\n\t\"github.com/prometheus/client_golang/prometheus\"\n\t\"g"
  },
  {
    "path": "graph/kv/quad_iterator.go",
    "chars": 6035,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/quadstore.go",
    "chars": 10725,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/kv/quadstore_test.go",
    "chars": 8605,
    "preview": "package kv_test\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/binary\"\n\thenc \"encoding/hex\"\n\t\"fmt\"\n\t\"sort\"\n\t\"sync\"\n\t\"testing\"\n"
  },
  {
    "path": "graph/kv/registry.go",
    "chars": 779,
    "preview": "package kv\n\nimport (\n\t\"strings\"\n\n\t\"github.com/hidal-go/hidalgo/kv\"\n\n\t\"github.com/cayleygraph/cayley/graph\"\n)\n\nfunc init("
  },
  {
    "path": "graph/linksto.go",
    "chars": 8533,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/linksto_test.go",
    "chars": 1397,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/log/graphlog.go",
    "chars": 2769,
    "preview": "package graphlog\n\nimport (\n\t\"bytes\"\n\t\"sort\"\n\n\t\"github.com/cayleygraph/cayley/graph\"\n\t\"github.com/cayleygraph/cayley/grap"
  },
  {
    "path": "graph/memstore/Makefile",
    "chars": 1046,
    "preview": "# Copyright 2014 The Cayley Authors. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Licen"
  },
  {
    "path": "graph/memstore/all_iterator.go",
    "chars": 4677,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/memstore/gen.go",
    "chars": 659,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/memstore/iterator.go",
    "chars": 4387,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/memstore/keys.go",
    "chars": 18191,
    "preview": "// Copyright 2014 The b Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license t"
  },
  {
    "path": "graph/memstore/keys_test.go",
    "chars": 6490,
    "preview": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "graph/memstore/quadstore.go",
    "chars": 12482,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/memstore/quadstore_test.go",
    "chars": 6613,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/nosql/all/all.go",
    "chars": 122,
    "preview": "package all\n\nimport (\n\t_ \"github.com/hidal-go/hidalgo/legacy/nosql/all\"\n\n\t_ \"github.com/cayleygraph/cayley/graph/nosql\"\n"
  },
  {
    "path": "graph/nosql/all/all_test.go",
    "chars": 402,
    "preview": "// +build docker\n\npackage all\n\nimport (\n\t\"testing\"\n\n\t_ \"github.com/hidal-go/hidalgo/legacy/nosql/nosqltest/all\"\n\n\t\"githu"
  },
  {
    "path": "graph/nosql/elastic/elastic.go",
    "chars": 686,
    "preview": "package elastic\n\nimport (\n\t\"context\"\n\n\t\"github.com/cayleygraph/cayley/graph\"\n\n\t\"github.com/hidal-go/hidalgo/legacy/nosql"
  },
  {
    "path": "graph/nosql/iterator.go",
    "chars": 7067,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/nosql/mongo/mongo.go",
    "chars": 676,
    "preview": "package mongo\n\nimport (\n\t\"context\"\n\n\t\"github.com/cayleygraph/cayley/graph\"\n\n\t\"github.com/hidal-go/hidalgo/legacy/nosql\"\n"
  },
  {
    "path": "graph/nosql/nosqltest/nosqltest.go",
    "chars": 1399,
    "preview": "package nosqltest\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/hidal-go/hidalgo/legacy/nos"
  },
  {
    "path": "graph/nosql/ouch/ouch.go",
    "chars": 77,
    "preview": "package ouch\n\nimport (\n\t_ \"github.com/hidal-go/hidalgo/legacy/nosql/couch\"\n)\n"
  },
  {
    "path": "graph/nosql/quadstore.go",
    "chars": 18770,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/nosql/shapes.go",
    "chars": 6324,
    "preview": "package nosql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\n\t\"github.com/hidal-go/hidalgo/legacy/nosql\"\n\n\t\"github.com/"
  },
  {
    "path": "graph/nosql/value_test.go",
    "chars": 536,
    "preview": "package nosql\n\nimport (\n\t\"math\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestIntStr(t *testing.T) {\n\tvar testS []string\n\ttestI := []in"
  },
  {
    "path": "graph/proto/primitive.pb.go",
    "chars": 10150,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/proto/primitive.proto",
    "chars": 1091,
    "preview": "// Copyright 2016 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/proto/primitive_helpers.go",
    "chars": 913,
    "preview": "package proto\n\nimport \"github.com/cayleygraph/quad\"\n\n//go:generate protoc --go_opt=paths=source_relative --proto_path=. "
  },
  {
    "path": "graph/proto/serializations.pb.go",
    "chars": 10440,
    "preview": "// Copyright 2015 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/proto/serializations.proto",
    "chars": 990,
    "preview": "// Copyright 2015 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/proto/serializations_helpers.go",
    "chars": 657,
    "preview": "package proto\n\nimport (\n\t\"github.com/cayleygraph/quad\"\n\t\"github.com/cayleygraph/quad/pquads\"\n)\n\n//go:generate curl -LO h"
  },
  {
    "path": "graph/quadstore.go",
    "chars": 5115,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/quadwriter.go",
    "chars": 8088,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/quadwriter_test.go",
    "chars": 1511,
    "preview": "package graph\n\nimport (\n\t\"errors\"\n\t\"testing\"\n)\n\nfunc TestIsQuadExist(t *testing.T) {\n\ttests := []struct {\n\t\tErr     erro"
  },
  {
    "path": "graph/refs/refs.go",
    "chars": 4052,
    "preview": "package refs\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\n\t\"github.com/cayleygraph/quad\"\n)\n\n// Size of a graph (either i"
  },
  {
    "path": "graph/registry.go",
    "chars": 2771,
    "preview": "// Copyright 2014 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/sql/cockroach/cockroach.go",
    "chars": 7156,
    "preview": "package cockroach\n\nimport (\n\t\"bytes\"\n\t\"database/sql\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/jackc/pgx/v5\"\n\t\"github.co"
  },
  {
    "path": "graph/sql/cockroach/cockroach_test.go",
    "chars": 1673,
    "preview": "//go:build docker\n// +build docker\n\npackage cockroach\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"net\"\n\t\"strconv\"\n\t\"testing\"\n"
  },
  {
    "path": "graph/sql/database.go",
    "chars": 4360,
    "preview": "package sql\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/cayleygraph/quad\"\n\n\t\"github.com/cayleygraph/cayley"
  },
  {
    "path": "graph/sql/iterator.go",
    "chars": 8501,
    "preview": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"Li"
  },
  {
    "path": "graph/sql/mysql/mysql.go",
    "chars": 3502,
    "preview": "package mysql\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/cayleygraph/quad\"\n\t\"github.com/go-sql-driver/mys"
  }
]

// ... and 178 more files (download for full content)

About this extraction

This page contains the full source code of the cayleygraph/cayley GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 378 files (1.8 MB), approximately 574.5k tokens, and a symbol index with 3687 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!