diff --git a/src/docbkx/reference/aspectj-details.xml b/src/docbkx/reference/aspectj-details.xml
index a88e35d1c..d435967b6 100644
--- a/src/docbkx/reference/aspectj-details.xml
+++ b/src/docbkx/reference/aspectj-details.xml
@@ -37,7 +37,7 @@
database instead. Under the hood, properties and relationships will be created.
- So how is an aspect applied to a concrete class? At compile time , the AspectJ Java compiler (ajc) takes
+ So how is an aspect applied to a concrete class? At compile time, the AspectJ Java compiler (ajc) takes
source files and aspect definitions, and compiles the source files while adding all the necessary
interception code for the aspects to hook in where they're declared to. This is known as compile-time
weaving. At runtime only a small AspectJ runtime is needed, as the byte code of the
diff --git a/src/docbkx/reference/performance.xml b/src/docbkx/reference/performance.xml
index 48d53c65f..09ceb369e 100644
--- a/src/docbkx/reference/performance.xml
+++ b/src/docbkx/reference/performance.xml
@@ -24,7 +24,7 @@
- Spring Data Graph was however not designed with a major focus on performance. It does add some overhead
+ Spring Data Graph, however, was not designed with a major focus on performance. It does add some overhead
to pure graph operations. Something to keep in mind is that any access of properties and relationships
will in general read through down to the database. To avoid multiple reads, it is sensible to store the
result in a local variable in suitable scope (e.g. method, class or jsp).
diff --git a/src/docbkx/reference/preface.xml b/src/docbkx/reference/preface.xml
index 188083350..409bc027d 100644
--- a/src/docbkx/reference/preface.xml
+++ b/src/docbkx/reference/preface.xml
@@ -10,7 +10,7 @@
to nodes, relationships, and properties in the graph database.
- Spring Data Graph allows anytime to drop down to the Neo4j-API level to execute functionality with
+ Spring Data Graph allows, at anytime, to drop down to the Neo4j-API level to execute functionality with
the highest performance possible. For Integration of Neo4j and Grails/GORM please refer to the Neo4j
grails plugin.
diff --git a/src/docbkx/reference/programming-model/aspectj.xml b/src/docbkx/reference/programming-model/aspectj.xml
index 4b18c21ea..6a3b0f9ee 100644
--- a/src/docbkx/reference/programming-model/aspectj.xml
+++ b/src/docbkx/reference/programming-model/aspectj.xml
@@ -30,7 +30,7 @@
AspectJ IDE support
As Spring Data Graph uses some advanced features of AspectJ, users may experience issues with
- their IDE reporting errors where there in fact are none. Features that might be reported wrongfully
+ their IDE reporting errors where in fact there are none. Features that might be reported wrongfully
include: introduction of methods to interfaces, declaration of additional interfaces for annotated
classes, and generified introduced methods.
diff --git a/src/docbkx/reference/setup.xml b/src/docbkx/reference/setup.xml
index fbcbfc005..d74e2dc15 100644
--- a/src/docbkx/reference/setup.xml
+++ b/src/docbkx/reference/setup.xml
@@ -28,7 +28,8 @@ springVersion = "3.0.5.RELEASE"
springDataGraphVersion = "1.1.0.M2"
aspectjVersion = "1.6.12.M1
-apply from:'https://github.com/SpringSource/spring-data-graph/raw/master/build/gradle/springdatagraph.gradle'
+apply from:'https://github.com/SpringSource/spring-data-graph/raw/master/build/
+gradle/springdatagraph.gradle'
configurations {
runtime
diff --git a/src/docbkx/tutorial/annotations.xml b/src/docbkx/tutorial/annotations.xml
index 68d651837..34f548582 100644
--- a/src/docbkx/tutorial/annotations.xml
+++ b/src/docbkx/tutorial/annotations.xml
@@ -12,7 +12,7 @@
Property fields were taken care of automatically.
- It was time to put our entities to a test. How could we now be assured that a attribute really was persisted to
+ It was time to put our entities to a test. How could we now be assured that an attribute really was persisted to
the graph store? We wanted to load the entity and check the attribute.
Either we could have a GraphDatabaseContext injected and use its getById(entityId)
@@ -48,12 +48,11 @@
need external transactions, but not for this simple test.
- Our domain model had now evolved.
- Movie class
+ Movie class with annotation
cast;
diff --git a/src/docbkx/tutorial/domain.xml b/src/docbkx/tutorial/domain.xml
index 6f18c4412..b87faabd5 100644
--- a/src/docbkx/tutorial/domain.xml
+++ b/src/docbkx/tutorial/domain.xml
@@ -64,6 +64,7 @@ class Rating {
- Then we wrote some tests to show how the basic plumbing works.
+ Then we wrote some simple tests to show that the basic design of the domain is good enough so far. Just creating
+ a movie populating it with actors and having it rated by a user and its friends.
diff --git a/src/docbkx/tutorial/import.xml b/src/docbkx/tutorial/import.xml
index 8c44705d7..f3c7f6aba 100644
--- a/src/docbkx/tutorial/import.xml
+++ b/src/docbkx/tutorial/import.xml
@@ -21,8 +21,10 @@
"status":"Released",
"tagline":"One Witness. One Camera",
"certification":"R",
-"overview":"\"REC\" turns on a young TV reporter and her cameraman who cover the night shift at the local fire station...
-"keywords":["terror", "lebende leichen", "obsession", "camcorder", "firemen", "reality tv ", "bite", "cinematographer",
+"overview":"\"REC\" turns on a young TV reporter and her cameraman who cover the night shift
+ at the local fire station...
+"keywords":["terror", "lebende leichen", "obsession", "camcorder", "firemen", "reality tv ",
+ "bite", "cinematographer",
"attempt to escape", "virus", "lodger", "live-reportage", "schwerverletzt"],
"released":"2007-08-29",
"runtime":78,
@@ -39,14 +41,15 @@
"countries":[{"code":"ES", "name":"Spain", "url":"http://www.themoviedb.org/country/es"}],
"posters":[{"image":{"type":"poster",
"size":"original", "height":1000, "width":706,
-"url":"http://cf1.imgobject.com/posters/3a0/4cc8df415e73d650240003a0/rec-original.jpg", "id":"4cc8df415e73d650240003a0"}},
+"url":"http://cf1.imgobject.com/posters/3a0/4cc8df415e73d650240003a0/rec-original.jpg",
+"id":"4cc8df415e73d650240003a0"}},
....
"cast":[{"name":"Manuela Velasco",
"job":"Actor", "department":"Actors",
"character":"Angela Vidal",
"id":34793, "order":0, "cast_id":1,
"url":"http://www.themoviedb.org/person/34793",
-"profile":"http://cf1.imgobject.com/profiles/390/4c0157fa017a3c702d001390/manuela-velasco-thumb.jpg"},
+"profile":"http://cf1.imgobject.com/profiles/390/.../manuela-velasco-thumb.jpg"},
...
{"name":"Gl\u00f2ria Viguer",
"job":"Costume Design", "department":"Costume \u0026 Make-Up",
@@ -73,7 +76,7 @@
"character":"The Frankenstein Monster",
"cast_id":23,
"url":"http://www.themoviedb.org/movie/3073",
-"poster":"http://cf1.imgobject.com/posters/4ca/4bc9185d017a3c57fe0094ca/bud-abbott-lou-costello-meet-frankenstein-cover.jpg",
+"poster":"http://cf1.imgobject.com/posters/4ca/.../bud-abbott-lou-costello-meet-frankenstein-cover.jpg",
"adult":false, "release":"1948-06-15"},
...],
"profile":[],
@@ -102,7 +105,8 @@ public Movie importMovie(String movieId) {
}
Map data = loadMovieData(movieId);
- if (data.containsKey("not_found")) throw new RuntimeException("Data for Movie "+movieId+" not found.");
+ if (data.containsKey("not_found"))
+ throw new RuntimeException("Data for Movie "+movieId+" not found.");
movieDbJsonMapper.mapToMovie(data, movie);
movie.persist();
relatePersonsToMovie(movie, data);
diff --git a/src/docbkx/tutorial/indexing.xml b/src/docbkx/tutorial/indexing.xml
index 1176843fa..59a8349da 100644
--- a/src/docbkx/tutorial/indexing.xml
+++ b/src/docbkx/tutorial/indexing.xml
@@ -23,7 +23,8 @@
@Test public void persistedMovieShouldBeRetrievableFromGraphDb() {
int id = 1;
Movie forrestGump = new Movie(id, "Forrest Gump", 1994).persist();
- GraphRepository movieRepository = graphRepositoryFactory.createGraphRepository(Movie.class);
+ GraphRepository movieRepository =
+ graphRepositoryFactory.createGraphRepository(Movie.class);
Movie retrievedMovie = movieRepository.findByPropertyValue("id", id);
assertEqual("retrieved movie matches persisted one", forrestGump, retrievedMovie);
assertEqual("retrieved movie title matches", "Forrest Gump", retrievedMovie.getTitle());
diff --git a/src/docbkx/tutorial/neo4j.xml b/src/docbkx/tutorial/neo4j.xml
index c71e2cae1..60154e0b6 100644
--- a/src/docbkx/tutorial/neo4j.xml
+++ b/src/docbkx/tutorial/neo4j.xml
@@ -16,7 +16,7 @@
Traversal Description.
- We also learned that Neo4j is fully transactional and therefore upholds ACID guarantees for our data.
+ We also learned that Neo4j is fully transactional and therefore upholds ACID guarantees for our data.
This is unusual for NOSQL databases, but easier for us to get our head around than non-transactional
eventual consistency. It also made us feel safe, though it also meant that we had to manage transactions.
Something to keep in mind for later.
diff --git a/src/docbkx/tutorial/recommendations.xml b/src/docbkx/tutorial/recommendations.xml
index c02cd99ff..7de2fd35d 100644
--- a/src/docbkx/tutorial/recommendations.xml
+++ b/src/docbkx/tutorial/recommendations.xml
@@ -24,21 +24,26 @@
final DynamicRelationshipType RATED = withName(User.RATED);
final Map ratings=new HashMap();
TraversalDescription traversal= Traversal.description().breadthFirst()
- .relationships(withName(User.FRIEND)).relationships(RATED, OUTGOING).evaluator(new Evaluator() {
+ .relationships(withName(User.FRIEND)).relationships(RATED, OUTGOING)
+ .evaluator(new Evaluator() {
public Evaluation evaluate(Path path) {
final int length = path.length() - 1;
- if (length > ratingDistance) return Evaluation.EXCLUDE_AND_PRUNE; // only as far as requested
+ // only as far as requested
+ if (length > ratingDistance) return Evaluation.EXCLUDE_AND_PRUNE;
Relationship rating = path.lastRelationship();
- if (rating != null && rating.getType().equals(RATED)) { // process RATED relationships, not FRIEND
- if (length == 0) return Evaluation.EXCLUDE_AND_PRUNE; // my rated movies
+ // process RATED relationships, not FRIEND
+ if (rating != null && rating.getType().equals(RATED)) {
+ // my rated movies
+ if (length == 0) return Evaluation.EXCLUDE_AND_PRUNE;
final long movieId = rating.getEndNode().getId();
int[] stars = ratings.get(movieId);
if (stars == null) {
stars = new int[2];
ratings.put(movieId, stars);
}
- int weight = ratingDistance - length; // aggregate for averaging, inverse to distance
+ // aggregate for averaging, inverse to distance
+ int weight = ratingDistance - length;
stars[0] += weight * (Integer) rating.getProperty("stars", 0);
stars[1] += weight;
return Evaluation.INCLUDE_AND_PRUNE;
@@ -48,7 +53,8 @@
});
Map result=new HashMap();
- final Iterable movies = movieRepository.findAllByTraversal(user, traversal); // lazy traversal results
+ // lazy traversal results
+ final Iterable movies = movieRepository.findAllByTraversal(user, traversal);
for (Movie movie : movies) { // assign movie to averaged rating
final int[] stars = ratings.get(movie.getNodeId());
result.put(movie, stars[0]/stars[1]);
diff --git a/src/docbkx/tutorial/relationships.xml b/src/docbkx/tutorial/relationships.xml
index 5e5d2d187..c9fa4c8f4 100644
--- a/src/docbkx/tutorial/relationships.xml
+++ b/src/docbkx/tutorial/relationships.xml
@@ -4,8 +4,8 @@
Relationships
A convincing act
- Our application was not yet very much fun, just storing movies and actors. After all,
- the power is in the relationships between them. Fortunately Neo4j treats relationships as first class citizens
+ Our application was not yet very much fun yet, just storing movies and actors. After all,
+ the power is in the relationships between them. Fortunately, Neo4j treats relationships as first class citizens,
allowing them to be addressed individually and assigned properties. That allows for representing them as entities
if needed.
@@ -64,7 +64,7 @@ class Role {
Accessing related entities
Now we wanted to find connected entities.
- We already had fields for the relationships in both classes. Now it was time to annotate them
+ We already had fields for the relationships in both classes. It was time to annotate them
correctly. It turned out that we needed to provide the target type of the fields again, due to
Java's type erasure. The Neo4j relationship type and direction were easy to figure out.
The direction even defaulted to outgoing, so we only had to specify it for the movie.
@@ -112,9 +112,9 @@ class Actor {
Accessing the relationship entities
But we still couldn't access the Role relationships. It turned out that there was a separate
- annotation @RelatedToVia for accessing the actual relationship entities . And we had
+ annotation @RelatedToVia for accessing the actual relationship entities. And we had
to declare the field as an Iterable<Role>, with read-only semantics. This appeared to mean
- that we were not able to add new roles though the field. Adding relationship entities seemed like
+ that we were not able to add new roles through the field. Adding relationship entities seemed like
it had to be done by using entity.relateTo(). The annotation attributes were similar to
those used for @RelatedTo. So off we went, creating our first real relationship (just kidding).
diff --git a/src/docbkx/tutorial/running.xml b/src/docbkx/tutorial/running.xml
index c88de3199..c2f8b69be 100644
--- a/src/docbkx/tutorial/running.xml
+++ b/src/docbkx/tutorial/running.xml
@@ -11,7 +11,7 @@
Before we opened the gates we needed to add some movie data. So we wrote a small class for
populating the database which could be called from our controller. To make it safe to call
- several times we added index lookups to check for existing entries. A simple /populate endpoint
+ several times we added index lookups to check for existing entries. A simple /populate endpoint
for the controller that called it would be enough for now.
@@ -64,7 +64,8 @@ public class MovieController {
@@ -82,7 +83,7 @@ public class MovieController {
Pardon the misused GET parameter for that (don't try this at home, the
- REST guys will be hunt you down). This is only for
+ REST guys will hunt you down). This is only for
running it from the browser address line. The next iteration of this website would use a button
with POST.
diff --git a/src/docbkx/tutorial/security.xml b/src/docbkx/tutorial/security.xml
index 98ab8b54f..dc8be35e9 100644
--- a/src/docbkx/tutorial/security.xml
+++ b/src/docbkx/tutorial/security.xml
@@ -92,7 +92,8 @@ public class CineastsUserDetailsService implements UserDetailsService, Initializ
@Autowired private UserRepository userRepository;
@Override
- public UserDetails loadUserByUsername(String login) throws UsernameNotFoundException, DataAccessException {
+ public UserDetails loadUserByUsername(String login)
+ throws UsernameNotFoundException, DataAccessException {
final User user = findUser(login);
if (user==null) throw new UsernameNotFoundException("Username not found",login);
return new CineastsUserDetails(user);
diff --git a/src/docbkx/tutorial/spring-data-graph.xml b/src/docbkx/tutorial/spring-data-graph.xml
index c8b7384f0..410cb17d9 100644
--- a/src/docbkx/tutorial/spring-data-graph.xml
+++ b/src/docbkx/tutorial/spring-data-graph.xml
@@ -6,11 +6,11 @@
So far it had all been pure Spring Framework and Neo4j. However, using the Neo4j code in our domain
classes polluted them with graph database details. For this application, we wanted to keep the domain
- classes clean. Spring Data Graph promised to do the heavy lifting for us, so we continued with
- investigating it.
+ classes clean. Spring Data Graph promised to do the heavy lifting for us, so we continued investigating it.
- Spring Data Graph depends heavily on AspectJ weaving. Some parts of our classes would get new behavior,
+ Spring Data Graph depends heavily on AspectJ features.
+ Some parts of our classes would get new behavior,
but it would not be visible in our code. The upside of this is that you get rid of a lot of boilerplate
code.
diff --git a/src/docbkx/tutorial/webapp.xml b/src/docbkx/tutorial/webapp.xml
index 1c0a7cee5..8ebc307fb 100644
--- a/src/docbkx/tutorial/webapp.xml
+++ b/src/docbkx/tutorial/webapp.xml
@@ -12,7 +12,8 @@
Controller for showing movies
- Searching
The next thing was to allow users to search for movies, so we needed some fulltext search
- capabilities. As the index provider implementation of Neo4j is based on Apache Lucene,
+ capabilities. As the index provider implementation of Neo4j is based on Apache Lucene,
we were delighted to see that fulltext indexes were supported out of the box.
@@ -77,7 +78,8 @@ public String singleMovieView(final Model model, @PathVariable String movieId) {
Search controller
- movies = repository.findMovies(query, 20);
model.addAttribute("movies", movies);