title: RestKit importing JSON doesn't set relationships
body: <p>As mentioned in the question header for some reason the relationships aren't set properly when I inspect the sqlite database.</p>
  
  <p>I am importing two resources (books and chapters), each in one JSON file with a one-to-many structure. This is an example JSON:</p>
  
  <pre><code>books.json:      [ { "id": 1, "number": 12345, "name": "Book 1" } ]
  chapters.json:   [ { "id": 1, "bookId": 1, "name": "Chapter 1" } ]
  </code></pre>
  
  <p>I've set the following mappings:</p>
  
  <pre><code>RKEntityMapping *bookMapping = [RKEntityMapping mappingForEntityForName:@"Book"
      inManagedObjectStore:managedObjectStore];
  bookMapping.identificationAttributes = @[ @"id" ];
  [bookMapping addAttributeMappingsFromArray:[Book attributesArray]]; // [@"id", @"number", @"name"]
  
  RKEntityMapping *chapterMapping = [RKEntityMapping mappingForEntityForName:@"Chapter"
      inManagedObjectStore:managedObjectStore];
  chapterMapping.identificationAttributes = @[ @"id" ];
  [chapterMapping addAttributeMappingsFromArray:[Chapter attributesArray]]; // [@"id", @"bookId", @"name"]
  </code></pre>
  
  <p>And of course the connection:</p>
  
  <pre><code>[chapterMapping addConnectionForRelationship:@"book" connectedBy:@{ @"bookId": @"id" }];
  </code></pre>
  
  <p>Here is the part that imports the two JSON files:</p>
  
  <pre><code>RKManagedObjectImporter *importer = [[RKManagedObjectImporter alloc] initWithManagedObjectModel:managedObjectStore.managedObjectModel storePath:path];
  
  NSString *bookJsonPath = [NSString stringWithFormat:@"%@/%@/books.json", [self getDocumentsPath], @"seeds"];
  [importer importObjectsFromItemAtPath:bookJsonPath
                            withMapping:bookMapping
                                keyPath:nil
                                  error:&amp;error];
  
  // [[importer managedObjectContext] saveToPersistentStore:&amp;error];
  
  NSString *chapterJsonPath = [NSString stringWithFormat:@"%@/%@/chapters.json", [self getDocumentsPath], @"seeds"];
  [importer importObjectsFromItemAtPath:chapterJsonPath
                            withMapping:chapterMapping
                                keyPath:nil
                                  error:&amp;error];
  
  success = [importer finishImporting:&amp;error];
  
  if (success) {
      [importer logSeedingInfo];
  
      NSLog(@"Finished seeding!");
  }
  </code></pre>
  
  <p>The import process works perfectly fine, but the chapters have all NULL in the book foreign key column. The logs also show:</p>
  
  <pre><code>Caching instances of Entity 'Book' by attributes 'guid'
  Imported 551 objects from file at path ... (books)
  Caching instances of Entity 'Chapter' by attributes 'guid'
  Imported 1908 objects from file at path ... (chapters)
  Starting 1908 connection operations ...
  A seed database has been generated 
  </code></pre>
  
  <p>which sort of indicates that it started to create connections but nothing happened.</p>
  
  <pre><code> 
  </code></pre>
  
  <p><strong>Update 15.12.14:</strong>
  The two main errors were:</p>
  
  <ol>
  <li>That I used the reserved keyword <code>id</code> as a property (instead of say <code>guid</code>) and </li>
  <li>I had a stupid mistake in my foreign-key mapping! The foreign-key that came in the chapters json was <code>book</code> and my mapping expected <code>bookId</code>. Embarrassing! I changed the server to properly return <code>bookId</code> as the foreign-key and now it works.</li>
  </ol>
  
  <p>This way only the connection was sufficient! No need to add RKRelationShipMappings.</p>