     }
     
     /**
+     Extracts the keyPath string from a `CoreStoreObject.Relationship` property.
+     ```
+     let keyPath: String = Person.keyPath { $0.pets }
+     ```
+     */
+    public static func keyPath<O: CoreStoreObject, D: CoreStoreObject>(_ relationship: (Self) -> RelationshipContainer<O>.ToOne<D>) -> String  {
+        
+        return relationship(self.meta).keyPath
+    }
+    
+    /**
+     Extracts the keyPath string from a `CoreStoreObject.Relationship` property.
+     ```
+     let keyPath: String = Person.keyPath { $0.pets }
+     ```
+     */
+    public static func keyPath<O: CoreStoreObject, D: CoreStoreObject>(_ relationship: (Self) -> RelationshipContainer<O>.ToManyOrdered<D>) -> String  {
+        
+        return relationship(self.meta).keyPath
+    }
+    
+    /**
+     Extracts the keyPath string from a `CoreStoreObject.Relationship` property.
+     ```
+     let keyPath: String = Person.keyPath { $0.pets }
+     ```
+     */
+    public static func keyPath<O: CoreStoreObject, D: CoreStoreObject>(_ relationship: (Self) -> RelationshipContainer<O>.ToManyUnordered<D>) -> String  {
+        
+        return relationship(self.meta).keyPath
+    }
+    
+    /**
      Creates a `Where` clause from a `CoreStoreObject.Value` property.
      ```
      let person = CoreStore.fetchOne(From<Person>(), Person.where { $0.nickname == "John" })

    /**
     Creates an `OrderBy` clause from a `CoreStoreObject.Value` property.
     ```
     let person = CoreStore.fetchAll(From<Person>(), Person.ascending { $0.age })
     ```
     */
    public static func ascending<O: CoreStoreObject, V: ImportableAttributeType>(_ attribute: (Self) -> ValueContainer<O>.Optional<V>) -> OrderBy  {
        
        return OrderBy(.ascending(attribute(self.meta).keyPath))
    }
    
    /**
     Creates an `OrderBy` clause from a `CoreStoreObject.Value` property.
     ```
     let person = CoreStore.fetchAll(From<Person>(), Person.descending { $0.age })
     ```
     */
    public static func descending<O: CoreStoreObject, V: ImportableAttributeType>(_ attribute: (Self) -> ValueContainer<O>.Optional<V>) -> OrderBy  {
        
        return OrderBy(.descending(attribute(self.meta).keyPath))

        return !Where(attribute.keyPath, isEqualTo: value)
    }
}


// MARK: - RelationshipContainer.ToOne

public extension RelationshipContainer.ToOne {
    
    /**
     Creates a `Where` clause from a `CoreStoreObject.Relationship` property.
     ```
     let dog = CoreStore.fetchOne(From<Dog>(), Dog.where { $0.master == me })
     ```
     */
    @inline(__always)
    public static func == (_ relationship: RelationshipContainer<O>.ToOne<D>, _ object: D?) -> Where {
        
        return Where(relationship.keyPath, isEqualTo: object)
    }
    
    /**
     Creates a `Where` clause from a `CoreStoreObject.Relationship` property.
     ```
     let dog = CoreStore.fetchOne(From<Dog>(), Dog.where { $0.master != me })
     ```
     */
    @inline(__always)
    public static func != (_ relationship: RelationshipContainer<O>.ToOne<D>, _ object: D?) -> Where {
        
        return !Where(relationship.keyPath, isEqualTo: object)
    }
    
    /**
     Creates a `Where` clause from a `CoreStoreObject.Relationship` property.
     ```
     let dog = CoreStore.fetchOne(From<Dog>(), Dog.where { $0.master ~= me })
     ```
     */
    @inline(__always)
    public static func ~= (_ relationship: RelationshipContainer<O>.ToOne<D>, _ object: D?) -> Where {
        
        return Where(relationship.keyPath, isEqualTo: object)
    }
    
    /**
     Creates a `Where` clause from a `CoreStoreObject.Relationship` property.
     ```
     let dog = CoreStore.fetchOne(From<Dog>(), Dog.where { [john, joe, bob] ~= $0.master })
     ```
     */
    @inline(__always)
    public static func ~= <S: Sequence>(_ sequence: S, _ relationship: RelationshipContainer<O>.ToOne<D>) -> Where where S.Iterator.Element == D {
        
        return Where(relationship.keyPath, isMemberOf: sequence)
    }
}
