Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

map

About the files in this folder

This folder contains the AsciiDoc source files used to produce the HTML, XML (DOCBOOK), EPUB, MOBI, and PDF output.

The Practical-Gremlin.adoc file contains links to the different sections of the book. The names of the other AsciiDoc format files follow the naming convention: Section-*.adoc. You can browse Practical-Gremlin.adoc and the various 'Section-*.adoc' files directly from within GitHub, but you will not get the full color coding, chapter numbering, and other niceties that are present in the HTML and PDF versions; as they have been run through an AsciiDoc processor and had various style sheets and code pretty printers applied. Your mileage may vary, but I find the HTML and PDF versions to be the most pleasing to read. The PDF version includes page numbers, the HTML version is one continuous document.

The '.adoc' files in this folder represent the most recent updates and may not have been published elsewhere yet, even in preview form. The other formats (HTML, DocBook, PDF, ePub, and MOBI) will be generated once there are enough updates to make it worthwhile creating a full release.

Building the book

If you want to build the output format files yourself, they can be generated by running the make-book.sh script. The script assumes you have Asciidoctor installed (which is a Ruby Gem) as well as Pygments.rb (another Ruby Gem). The tools can be installed using various package managers and are available on most, commonly used, desktop operating system platforms.

To do the conversion to MOBI and EPUB, the script assumes that Calibre and Pandoc are installed. I have successfully built the book on several Linux distros, including Ubuntu, CentOS, and Red Hat. I have successfully used Asciidoctor on macOS as well, but I always use Linux to produce the EPUB and MOBI versions.

Building the HTML version

asciidoctor Practical-Gremlin.adoc

Building the PDF version

asciidoctor-pdf Practical-Gremlin.adoc

Building additional versions

The XML (DOCBOOK) file is generated using Asciidoctor and can be viewed on Linux using the Yelp tool among many others or used to produce other formats. The EPUB and MOBI files can be viewed using most popular e-book readers and some browsers.

Please note that the DOCBOOK, EPUB, and MOBI format files currently do not have all the nice source code highlighting and colors that the HTML and PDF versions have.

# Docbook / XML
asciidoctor -n -b docbook -d book Practical-Gremlin.adoc -o krltemp.xml
sed -e s/language=\"groovy\"/language=\"java\"/ krltemp.xml > Practical-Gremlin.xml
rm krltemp.xml

# EPUB
pandoc -f docbook -t epub -N --number-sections --top-level-division=chapter --toc --toc-depth=4 Practical-Gremlin.xml -o Practical-Gremlin.epub

# MOBI
ebook-convert Practical-Gremlin.epub Practical-Gremlin.mobi

Preview releases

Preview versions of the book in HTML are automatically published here as changes arrive to the main branch of the repository.

How the book is organized

This is the current layout of the second edition. As work progresses, additional chapters may be added and the layout further refined.

Chapter 1 – INTRODUCTION

  • We start our journey with a brief introduction to Apache Tinkerpop and a quick look at why Graph databases are of interest to us. We also discuss how the book is organized and where to find additional materials, such as sample code and data sets.

Chapter 2 – GETTING STARTED

  • Many of the examples throughout the book use the Gremlin Console and TinkerGraph, and both are introduced in this chapter. We also introduce the air-routes example graph - air-routes.graphml - used throughout the book.

Chapter 3 - WRITING GREMLIN QUERIES

  • Now that the basics have been covered, things start to get a lot more interesting! It's time to start writing Gremlin queries. We briefly explore how we could have built the 'air-routes' graph using a relational database, and then look at how SQL and Gremlin are both similar in some ways and very different in others. We then introduce several of the key Gremlin query language '"steps"'. We focus on
    exploring the graph rather than changing it in this chapter.

Chapter 4 - BEYOND BASIC QUERIES

  • Having now introduced Gremlin in some detail, we introduce the Gremlin steps that can be used to create, modify, and delete, data. We present a selection of best practices and start to explore some more advanced query writing.

Chapter 5 – MISCELLANEOUS QUERIES AND THE RESULTS THEY GENERATE

  • Using the Gremlin steps introduced in Chapters 3 and 4, we are now ready to use what we have learned so far and write queries that analyze the air-routes graph in more depth and answer more complicated questions. The material presented includes a discussion of analyzing distances, route distribution, and writing geospatial queries.

Chapter 6 – MOVING BEYOND THE GREMLIN CONSOLE

  • The next step in our journey is to move beyond the Gremlin console and take a look at interacting with a TinkerGraph using Java and Groovy applications.

Chapter 7 - INTRODUCING GREMLIN SERVER

  • Our journey so far has focussed on working with graphs in a "directly attached" fashion. We now introduce Gremlin Server as a way to deploy and interact with remotely hosted graphs.

Chapter 8 - COMMON GRAPH SERIALIZATION FORMATS

  • Having introduced Gremlin Server, we take a look at some common Graph serialization file formats along with coverage of how to use them in the context of TinkerPop enabled graphs. We take a close look at the TinkerPop GraphSON (JSON) format which is used extensively when using Gremlin queries in conjunction with a Gremlin Server.

Chapter 9 – FURTHER READING

  • Our journey to explore Apache TinkerPop and Gremlin concludes with a look at useful sources of further reading. We present l links to useful websites where you can find tools and documentation for many of the topics and technologies covered in this book.