<commit_before>Spring Data - Graph
=======================

The primary goal of the [Spring Data](http://www.springsource.org/spring-data) project is to make it easier to
build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce
frameworks, and cloud based data services. As the name implies, the **Graph** project provides integration with
graph value stores.  The only supported Graph Database now is [Neo4j](http://neo4j.org/).

The Spring Data Graph project provides a simplified POJO based programming model that reduces that amount of
boilerplate code needed to create neo4j applications.  it also provides a 'cross store' persistence solution that
can extend existing JPA data models with new parts (properties, entities, relationships) that are stored exclusively
in the graph while being transparently integrated with the JPA entities.  This enables for easy and seamless
addition of new features that were not available before to JPA-based applications.

# Quick Start

## Maven configuration:

*  Add the maven repository and dependency

<pre><![CDATA[
       <dependency>
         <groupId>org.springframework.data</groupId>
         <artifactId>spring-data-neo4j</artifactId>
         <version>1.0.0.RELEASE</version>
       </dependency>

       <repository>
         <id>spring-maven-snapshot</id>
         <snapshots><enabled>true</enabled></snapshots>
         <name>Springframework Maven MILESTONE Repository</name>
         <url>http://maven.springframework.org/milestone</url>
       </repository>
]]></pre>

*  Configure AspectJ: Add the following plugin XML to your project's <plugins> config in pom.xml to
   hook AspectJ into the build process:

<pre><![CDATA[
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.0</version>
        <configuration>
          <outxml>true</outxml>
          <aspectLibraries>
            <aspectLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-aspects</artifactId>
            </aspectLibrary>
            <aspectLibrary>
              <groupId>org.springframework.data</groupId>
              <artifactId>spring-data-neo4j</artifactId>
            </aspectLibrary>
          </aspectLibraries>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.11.RELEASE</version>
          </dependency>
          <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>1.6.11.RELEASE</version>
          </dependency>
        </dependencies>
      </plugin>
	]]></pre>

## Spring configuration:

* Configure Spring Data Graph for Neo4j in your application using the provided xml namespace.

<pre><![CDATA[
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:datagraph="http://www.springframework.org/schema/data/graph"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
            http://www.springframework.org/schema/data/graph http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd
            ">

        <context:annotation-config/>
        <datagraph:config storeDirectory="target/config-test"/>

    </beans>
	]]></pre>

## Graph entities

* Annotate your entity class.  In this case it is a 'World' class that has a relationship to other worlds that are reachable by rocket travel:

        @NodeEntity
        public class World {

          @Indexed
          private String name;

          @Indexed( indexName = "moons" )
		  private int moons;

          @RelatedTo( type = "REACHABLE_BY_ROCKET", direction = Direction.BOTH, elementClass = World.class )
          private Set<World> reachableByRocket;

          public World(String name, int moons) {
              this.name = name;
              this.moons = moons;
          }
<commit_msg>xml not showing in readme - update<commit_after>Spring Data - Graph
=======================

The primary goal of the [Spring Data](http://www.springsource.org/spring-data) project is to make it easier to
build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce
frameworks, and cloud based data services. As the name implies, the **Graph** project provides integration with
graph value stores.  The only supported Graph Database now is [Neo4j](http://neo4j.org/).

The Spring Data Graph project provides a simplified POJO based programming model that reduces that amount of
boilerplate code needed to create neo4j applications.  it also provides a 'cross store' persistence solution that
can extend existing JPA data models with new parts (properties, entities, relationships) that are stored exclusively
in the graph while being transparently integrated with the JPA entities.  This enables for easy and seamless
addition of new features that were not available before to JPA-based applications.

# Quick Start

## Maven configuration:

*  Add the maven repository and dependency

<pre>
       <dependency>
         <groupId>org.springframework.data</groupId>
         <artifactId>spring-data-neo4j</artifactId>
         <version>1.0.0.RELEASE</version>
       </dependency>

       <repository>
         <id>spring-maven-snapshot</id>
         <snapshots><enabled>true</enabled></snapshots>
         <name>Springframework Maven MILESTONE Repository</name>
         <url>http://maven.springframework.org/milestone</url>
       </repository>
</pre>

*  Configure AspectJ: Add the following plugin XML to your project's <plugins> config in pom.xml to
   hook AspectJ into the build process:

<pre>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.0</version>
        <configuration>
          <outxml>true</outxml>
          <aspectLibraries>
            <aspectLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-aspects</artifactId>
            </aspectLibrary>
            <aspectLibrary>
              <groupId>org.springframework.data</groupId>
              <artifactId>spring-data-neo4j</artifactId>
            </aspectLibrary>
          </aspectLibraries>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.11.RELEASE</version>
          </dependency>
          <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>1.6.11.RELEASE</version>
          </dependency>
        </dependencies>
      </plugin>
</pre>

## Spring configuration:

* Configure Spring Data Graph for Neo4j in your application using the provided xml namespace.

<pre>
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:datagraph="http://www.springframework.org/schema/data/graph"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
            http://www.springframework.org/schema/data/graph http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd
            ">

        <context:annotation-config/>
        <datagraph:config storeDirectory="target/config-test"/>

    </beans>
</pre>

## Graph entities

* Annotate your entity class.  In this case it is a 'World' class that has a relationship to other worlds that are reachable by rocket travel:

        @NodeEntity
        public class World {

          @Indexed
          private String name;

          @Indexed( indexName = "moons" )
		  private int moons;

          @RelatedTo( type = "REACHABLE_BY_ROCKET", direction = Direction.BOTH, elementClass = World.class )
          private Set<World> reachableByRocket;

          public World(String name, int moons) {
              this.name = name;
              this.moons = moons;
          }

{'fraction_non_alphanumeric': 0.11263415152481139, 'fraction_numerical': 0.007863138880034003, 'mean_word_length': 2.5896262395118232, 'pattern_counts': {'":': 0, '<': 188, '<?xml version=': 2, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 22, 'xml': 19}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1931382', 'n_tokens_mistral': 2681, 'n_tokens_neox': 2499, 'n_words': 651}