Apache TinkerPop Documentation

repository·master·Indexed 24 days ago

https://github.com/apache/tinkerpop

A graph computing framework providing the Gremlin traversal language and drivers for property graphs across OLTP databases and OLAP analytic systems. Includes documentation for Gremlator (a query translation SPA), Gremlint (a code formatting library), the Tinkeradoc AsciidoctorJ extension, and the gql-gremlin module implementing a subset of ISO GQL MATCH syntax.

Tokens
164.6K
Snippets
355
Records
789
Agent score
80%

What's inside Apache TinkerPop

  1. Overview of TinkerPop IO serialization formats

    master

    Apache TinkerPop supports several graph serialization formats for producing and consuming graphs. These formats allow for the exchange of graph data between different systems and implementations. The primary formats include:

    • GraphML: An XML-based format for representing graphs.
    • GraphSON: A JSON-based format for representing graphs.
    • Gryo: A binary format designed for efficient serialization.
    • GraphBinary: A high-performance binary format.

    Detailed implementation notes, samples, and usage instructions for each specific format are available in their respective documentation sections.

  2. What is Gremlint

    master
    Gremlint is a code formatting library designed to parse Gremlin queries and rewrite them according to specific styling rules. It provides a way to enforce consistent Gremlin query syntax and style. The project also hosts gremlint.com, an online platform that serves as a living style guide for Gremlin queries and showcases Gremlint's features.
  3. What is Gremlator?

    master

    Gremlator is a client-side single-page application designed to translate Gremlin queries between different language variants. It allows you to input a Gremlin query and instantly view its equivalent form in several variants, including:

    • Canonical
    • JavaScript
    • Python
    • Go
    • .NET
    • Java
    • Groovy
    • Anonymized

    All translations are powered by the Gremlin JavaScript GLV and run entirely within the browser.

  4. Understand the Tinkeradoc Extension

    master

    The Tinkeradoc Extension is an AsciidoctorJ extension used to render executable Gremlin code blocks within TinkerPop documentation. It is a build-time tool used to produce documentation from source files in docs/src and is not part of the standard TinkerPop distribution.

    It performs two main processing tasks:

    • GremlinTreeprocessor: Finds [gremlin-groovy] blocks, executes them against a Gremlin Console subprocess, and replaces the blocks with the captured console session. It also aggregates adjacent [source,<lang>] blocks (supporting groovy, java, csharp, javascript, python, and go) into tabbed widgets.
    • GremlinPostprocessor: Cleans up HTML output by removing empty CodeRay comment spans and replacing version placeholders (e.g., x.y.z) with the actual TinkerPop version.

    Additionally, the project includes tools for generating agent-friendly documentation (based on llms.txt):

    • MarkdownSplitter: Splits Markdown output into pages based on the llms-summary attribute.
    • LlmsTxtGenerator: Creates an llms.txt discovery index.

    Note: This is a standalone Maven project and must be installed in your local repository before the root TinkerPop documentation can be generated.

  5. Explore Gremlin Traversal Recipes

    master

    Gremlin Recipes provide a collection of practical traversal patterns and solutions to common graph problems. These recipes serve as building blocks for various graph domains and assume familiarity with Gremlin and the Apache TinkerPop stack.

    Available recipe categories include:

    • Between-vertices patterns
    • Centrality
    • Collections
    • Connected components
    • Cycle detection
    • Duplicate edge/vertex detection
    • Edge movement
    • Element existence
    • If-then-based grouping
    • Looping
    • Operating on dropped elements
    • Pagination
    • Recommendation
    • Shortest path
    • Trees
    • OLAP Spark/YARN
  6. Navigate Apache TinkerPop documentation

    master

    Apache TinkerPop provides several types of documentation depending on your role (user, developer, or provider). Use the following categories to find what you need:

    • Reference Documentation: The primary guide for all TinkerPop usage.
    • Tutorials: Detailed explanations of specific technologies, patterns, use cases, or best practices.
    • Publications: Technical papers, blog posts, and presentation materials.
    • Developer Documentation: For contributors to TinkerPop or those implementing TinkerPop interfaces.
    • API Documentation:
      • Java: Full Javadoc for all modules (including an abridged version for core interfaces).
      • .NET: API documentation for Gremlin.Net.
      • JavaScript: API documentation for Gremlin-JavaScript.
    • Upgrade Documentation: Notes on breaking changes and major new features when moving between versions.
  7. TinkerPop 4.x Roadmap and Major Changes

    master

    TinkerPop 4.x marks a transition to semantic versioning. The most significant architectural change is the replacement of WebSockets with HTTP/1.1 for Gremlin Server transport. This change affects all Gremlin Language Variants (GLVs) including gremlin-java, gremlin-python, gremlin-javascript, gremlin-dotnet, and gremlin-go.

    Key features planned for the 4.0 release include:

    • HTTP Support: Transitioning the underlying transport to HTTP/1.1.
    • Transaction Redesign: A new API designed to work over HTTP, aligning remote and embedded transaction usage.
    • Bytecode Removal: Moving from bytecode-based to string-based traversal construction using the gremlin-lang parser.
    • Groovy Removal: Moving away from GremlinGroovyScriptEngine toward GremlinLangScriptEngine to reduce dependency on Groovy and improve security.
    • Other updates: IO serialization updates, console reworks, and support for multi-labels.
  8. TinkerPop 5.x Future Directions

    master

    The 5.x release line is expected to focus on high-level architectural improvements, including:

    • Type System: Defining a formal type system for TinkerPop to improve GLV consistency.
    • Schema Support: Implementing robust schema support.
    • Pluggable Explain: Moving to a pluggable architecture for explain() and profile() steps.
    • Telemetry: Improved metrics collection and debugging support (e.g., OpenTelemetry).
    • Other features: io-olap, documentation reorganization, and meta-properties on edges.
  9. Ways to contribute to Apache TinkerPop

    master

    Contributions to Apache TinkerPop extend beyond code. You can contribute by:

    • Mailing List Participation: Join gremlin-users to help users with problems, or dev@tinkerpop.apache.org to participate in design discussions, feature announcements, and release voting.
    • Testing Releases: Review release artifacts on the dev mailing list and provide a vote (+1, +0, or -1).
    • Reviewing Changes: Review GitHub pull requests and provide feedback or votes.
    • Writing Documentation: Propose changes to project documentation (Asciidoc in docs/src) or the TinkerPop website (HTML in docs/site).
    • Reporting Bugs: Document issues in JIRA with clear reproduction steps.
    • Developing Libraries: Create independent libraries that implement TinkerPop interfaces. If they meet the listing policy, they can be promoted on the TinkerPop website.
  10. What is GraphSON and how does it differ by version?

    master

    GraphSON is a JSON-based serialization format designed for human-readable output.

    • Versions 1 to 3: Acted as both a "graph" format (for full graph serialization) and a generalized object serialization format (useful for Gremlin Server to return arbitrary result types).
    • Version 4 (Current): Specifically intended as a network serialization format for the TinkerPop HTTP API. It is restricted to serializing specific types defined by the format and is not intended for general object serialization.

    For details on GraphSON 1, 2, or 3, refer to the TinkerPop 3.x IO Documentation.

  11. Overview of Gremlin MCP

    master

    Gremlin MCP (Model Context Protocol) integrates Apache TinkerPop with MCP-capable assistants. It allows assistants to discover graph schemas, inspect health, execute traversals, and format/translate queries through a set of standardized tools.

    Available Tools:

    • get_graph_status: Returns health and connectivity info.
    • get_graph_schema: Discovers labels, properties, and relationship patterns.
    • run_gremlin_query: Executes a traversal and returns JSON.
    • refresh_schema_cache: Forces a schema re-discovery.
    • translate_gremlin_query: Translates queries between language variants.
    • format_gremlin_query: Formats queries using gremlint.

    Security Warning: Gremlin MCP can modify the graph. It is recommended to use it against a read-only instance (e.g., using withStrategies(ReadOnlyStrategy) in Gremlin Server).