     }
 
     // MARK: OUT
-    var outRelationshipCount: Int? {
-    get {
-        return 0;
-    }
-    }
-    
+    
+    // only available for testing, not public
+    var outRelationshipID : UID {
+        get {
+            return data.nextOutRelationshipID
+        }
+        set {
+            if newValue != data.nextOutRelationshipID {
+                data.nextOutRelationshipID = newValue
+                dirty = true
+            }
+        }
+    }
+    
+    var _outRelationships:[Relationship]! = nil
+    
+    public var outRelationships: [Relationship] {
+        get {
+            if (_outRelationships == nil) {
+                _outRelationships = [Relationship]()
+                
+                // read data
+                var relationship:Relationship! = nil;
+                var nextRelationshipID = data.nextOutRelationshipID;
+                
+                while (nextRelationshipID > 0) {
+                    
+                    relationship = context.readRelationship(nextRelationshipID)
+                    
+                    _outRelationships.append(relationship)
+                    
+                    nextRelationshipID = relationship.startNodeNextRelationID
+                }
+            }
+            
+            return _outRelationships;
+        }
+    }
+    
+    var outRelationshipCount: Int {
+        get {
+            return outRelationships.count
+        }
+    }
+
     var firstOutNode: Node? {
     get {
         return nil;

        
    }
    
    //func inNodeEnumerator() -> NSEnumerator
    

    // MARK: ??
    
    func update() {

    
    
    // MARK: IN
    
    // only available for testing, not public
    var inRelationshipID : UID {
        get {
            return data.nextInRelationshipID
        }
        set {
            if newValue != data.nextInRelationshipID {
                data.nextInRelationshipID = newValue
                dirty = true
            }
        }
    }
    
    var _inRelationships:[Relationship]! = nil
    
    public var inRelationships: [Relationship] {
        get {
            if (_inRelationships == nil) {
                _inRelationships = [Relationship]()
                
// TODO
            }
            
            return _inRelationships;
        }
    }

    
    var inRelationshipCount: Int? {
        get {
            return 0;
        }
    }
    
    var firstInNode: Node? {
        get {
            return nil;
        }
    }
    
    var lastInNode: Node? {
        get {
            return nil;
        }
    }
    
    func inRelationshipFrom(node: Node) -> Relationship? {
