         return remoteProperties.flatMap { $0 as? NSRelationshipDescription }
     }
     
-    /// An index of remote property names and the corresponding
-    /// relationship description
+    /// An index of remote property names and the corresponding relationship 
+    /// description.
     public func remoteRelationshipsByName(_ useLocalNames: Bool = false) -> [String: NSRelationshipDescription] {
         return remoteRelationships
             .reduce([String: NSRelationshipDescription]()) { remoteRelationshipsByName, relationshipDescription in

        return remoteProperties.flatMap { $0 as? NSAttributeDescription }
    }
    
    public func remoteAttributesByName(_ useLocalNames: Bool = false) -> [String: NSAttributeDescription] {
        return remoteAttributes
            .reduce([String: NSAttributeDescription]()) { remoteAttributesByName, attributeDescription in

            }
    }
}

/// MARK: - Query Helpers
/// MARK: Predicates
extension NSEntityDescription {
    /// Returns a predicate matching the value of key `localPrimaryKeyName`
    /// against `keyValue`.
    public func matchingPrimaryKey<Value: CVarArg>(keyValue: Value) -> NSPredicate {
        return NSPredicate(format: "%K == %@", localPrimaryKeyName, keyValue)
    }
    
    /// Returns a predicate matching the value of key `localPrimaryKeyName` 
    /// in `keyValues`.
    public func matchingPrimaryKeys<Value: CVarArg>(keyValues: [Value]) -> NSPredicate {
        return NSPredicate(format: "%K in %@", localPrimaryKeyName, keyValues)
    }
    
    /// Returns a predicate matching the value of key `localPrimaryKeyName`
    /// in the set `keyValues`.
    public func matchingPrimaryKeys<Value: CVarArg & Hashable>(keyValues: Set<Value>) -> NSPredicate {
        return NSPredicate(format: "%K in %@", localPrimaryKeyName, keyValues)
    }
}
