@@ -6,15 +6,15 @@ The focus of this book so far has been to teach the Gremlin query language, usin
66Gremlin Console and TinkerGraph as our learning environment. This is indeed a great
77way to learn, and that environment can be setup quickly, as we have seen, on a single
88laptop, or desktop, computer. Even as you move towards more sophisticated
9- environments, keeping the Gremlin Console nearby is recommended as an easy way to
10- experiment with new ideas.
9+ environments, keeping the console nearby is recommended as an easy way to experiment
10+ with new ideas.
1111
1212As we start to think about using graphs to solve problems in a production
1313environment, we need some additional tools. We have to consider things such as
1414programming language interfaces, persistent storage, making graphs available using
1515servers and more advanced indexing. Those topics are the focus of this chapter, and
1616the two that follow. Hopefully this will whet your appetite for moving beyond the
17- Gremlin Console , and into the world of graph application programming and graph system
17+ console , and into the world of graph application programming and graph system
1818deployment!
1919
2020In this chapter we start the journey by introducing ways to access TinkerGraph
@@ -28,11 +28,11 @@ databases. First, let's take a look at the Apache TinkerPop Java API.
2828
2929So far in this book we have looked at many ways of working with a TinkerGraph from
3030within the Gremlin Console. As you start to create more sophisticated applications,
31- you will find that the Gremlin Console is just one of the tools to keep in your
32- toolbox. It is very likely, if not certain, that you will want to write standalone
33- applications that can work with graph data. There are a number of different
34- programming language bindings currently available for TinkerPop. One of the most
35- widely used is the Java API. Apache TinkerPop itself is coded mostly in Java.
31+ you will find that the console is just one of the tools to keep in your toolbox. It
32+ is very likely, if not certain, that you will want to write standalone applications
33+ that can work with graph data. There are a number of different programming language
34+ bindings currently available for TinkerPop. One of the most widely used is the Java
35+ API. Apache TinkerPop itself is coded mostly in Java.
3636
3737NOTE: You will find several Java samples at the GitHub repository associated with
3838this book. https://github.com/krlawrence/graph
@@ -65,7 +65,7 @@ When using the Gremlin Console, your environment is pre-configured for you so, f
6565the most pat, you do not have to import any classes or interfaces. However, as soon
6666as you move to the domain of the standalone Java application you will need to start
6767importing the classes that your application needs. You will probably discover a few
68- other things that the Gremlin Console was doing on your behalf.
68+ other things that the console was doing on your behalf.
6969
7070By way of a reasonable start, some of the most common imports needed by a Java
7171application working with Gremlin are listed below. As you add more capabilities
@@ -211,7 +211,7 @@ System.out.println("The AUS airport is in " + city.get(0));
211211
212212So when we compile and run again we should now see this additional line of output.
213213
214- [source,console ]
214+ [source,text ]
215215----
216216The AUS airport is in Austin
217217----
@@ -253,7 +253,7 @@ Long n = g.V().has("code","DFW").out().count().next();
253253System.out.println("There are " + n + " routes from Dallas");
254254----
255255
256- [source,console ]
256+ [source,text ]
257257----
258258There are 221 routes from Dallas
259259----
@@ -361,7 +361,7 @@ eng.forEach( (p) -> System.out.print(p + " "));
361361
362362The code we just added should generate output that looks like this.
363363
364- [source,console ]
364+ [source,text ]
365365----
366366Places in England I can get to with one stop from AUS.
367367
@@ -575,10 +575,10 @@ The 'DT' Enum provides constants representing units of time for the 'dateAdd' st
575575 |==============================================================================
576576
577577As discussed earlier, you can always use the 'getClass' method or simply '.class'
578- while using the Gremlin Console to, in many cases, find out where something is
579- defined. As we saw in the examples earlier in this section, lot of the keywords such
580- as 'values', ' id' and 'local' are defined as Enums so you can use 'getClass' on them
581- directly. A few examples are shown below.
578+ while using the console to, in many cases, find out where something is defined. As
579+ we saw in the examples earlier in this section, lot of the keywords such as 'values',
580+ ' id' and 'local' are defined as Enums so you can use 'getClass' on them directly. A
581+ few examples are shown below.
582582
583583[source,groovy]
584584----
@@ -619,7 +619,7 @@ a String representing a three-character airport IATA code as input. The method t
619619uses a Gremlin query to figure out which geographical region the specified airport is
620620in and then returns all airports also in that region. Note the use of 'P.eq' as part
621621of the 'where' step. This is another case of where, because we are not running inside
622- the Gremlin console , we have to more precisely specify things.
622+ the Gremlin Console , we have to more precisely specify things.
623623
624624[source,java]
625625----
@@ -642,7 +642,7 @@ public void findByRegion(String iata) {
642642If we were to call the 'findByRegion' method, passing in a parameter of 'DEN',
643643representing the airport in Denver Colorado, the following output should be returned.
644644
645- [source,console ]
645+ [source,text ]
646646----
647647Region code lookup for DEN
648648[DEN,Denver,US-CO]
@@ -800,7 +800,7 @@ because while most of property keys are Strings, IDs and labels are a special ca
800800If you look at the TinkerPop documentation you will see that T is a Java Enum that
801801contains definitions for 'T.id', 'T.label', 'T.value' and 'T.key'. When working with
802802Gremlin in Java it is important to remember that we need to use the '"T."' prefix in
803- cases where when using the Gremlin Console we would not have to.
803+ cases where when using the console we would not have to.
804804
805805[source,java]
806806----
0 commit comments