Пример #1
0
def create_condition(condition):
    print("create_condition")
    # TaskManager -> StorageManager
    db.store('conditions', condition)
def verify(collection, obj_id):
    return db.get(collection, obj_id) != None
def create(collection, obj):
    if not verify(collection, obj["@id"]):
        graph.parse(json.dumps(obj))
        db.store(collection, obj)
    else:
        print("Already have " + str(obj["@id"]) + " in database.")
def update_graph(graph):
    db.update('graph','graph',
              {'id':'graph','graph':graph.serialize(format='pretty-xml')})
def get_graph():
    _graph = Graph(store)
    stored_graph = db.get('graph','graph','id')
    if stored_graph != None:
        _graph.parse(data=stored_graph['graph'].decode(),format='xml')
    return _graph
Пример #6
0
def get_graph():
    _graph = Graph(store)
    stored_graph = db.get('graph', 'graph', 'id')
    if stored_graph != None:
        _graph.parse(data=stored_graph['graph'].decode(), format='xml')
    return _graph
Пример #7
0
def update_graph(graph):
    db.update('graph', 'graph', {
        'id': 'graph',
        'graph': graph.serialize(format='pretty-xml')
    })
def create_condition(condition):
    print("create_condition")
    # TaskManager -> StorageManager
    db.store('conditions', condition)
def create(collection, obj):
    if not verify(collection, obj['@id']):
        graph.parse(json.dumps(obj))
        db.store(collection, obj)
    else:
        print("Already have " + str(obj['@id']) + " in database.")
def verify(collection, obj_id):
    return (db.get(collection, obj_id) != None)