<commit_before>//
//  SOGrapheDB.swift
//  SOGraphDB
//
//  Created by <NAME> on 13.11.17.
//  Copyright © 2017 <NAME>. All rights reserved.
//
//  Feature List:
//  - Auto Register (TODO)
//
//



import Foundation

open class SOGrapheDB {
    
    private let graphDBStore : SOGraphDBStore
    
    //MARK:  -
    
    public init(store aStore: SOGraphDBStore) {
        self.graphDBStore = aStore
    }
    
    
    /**
     No create -> later feature: auto register
     // create (and register) a new Node
     open func createNode() -> Node {
     let result = Node()
     register(node: result)
     return result;
     }
     */
    
    // register a (new created) Node to DB
    open func register(node aNode : Node) {
        aNode.graphStore = self.graphDBStore
        graphDBStore.register(aNode)
    }
    
    // delete/remove a (registered) Node from the DB
    open func delete(node aNode: Node) {
        graphDBStore.delete(aNode)
        aNode.graphStore = nil;
    }
    
}
<commit_msg>added new access methods<commit_after>//
//  SOGrapheDB.swift
//  SOGraphDB
//
//  Created by <NAME> on 13.11.17.
//  Copyright © 2017 <NAME>. All rights reserved.
//
//  Feature List:
//  - Auto Register (TODO)
//
//



import Foundation

open class SOGrapheDB {
    
    private let graphDBStore : SOGraphDBStore
    
    //MARK:  -
    
    public init(store aStore: SOGraphDBStore) {
        self.graphDBStore = aStore
    }
    
    
    /**
     No create -> later feature: auto register
     // create (and register) a new Node
     open func createNode() -> Node {
     let result = Node()
     register(node: result)
     return result;
     }
     */
    
    // register a (new created) Node to DB
    open func register(node aNode : Node) {
        aNode.graphStore = self.graphDBStore
        graphDBStore.register(aNode)
    }
    
    // delete/remove a (registered) Node from the DB
    open func delete(node aNode: Node) {
        graphDBStore.delete(aNode)
        aNode.graphStore = nil;
    }
    
    //MARK: data access
    
    public subscript(uid: UID) -> Node? {
        get {
            //assert(context != nil, "No GraphContext available")
            return graphDBStore.findNodeBy(uid: uid)
        }
    }
    
}

{'fraction_non_alphanumeric': 0.10913930789707187, 'fraction_numerical': 0.008873114463176575, 'mean_word_length': 1.8544303797468353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7128576', 'n_tokens_mistral': 734, 'n_tokens_neox': 709, 'n_words': 197}