Exemplo n.º 1
0
def query(ctx, input, output, context, query_file):
    """ Run an MQL query and store the results. """
    graph = ctx.obj['GRAPH']
    for uri in input:
        load_dump(graph, ensure_uri(uri))

    if query_file is not None:
        query = read_yaml_uri(ensure_uri(query_file))
    else:
        query = yaml.loads(sys.stdin)
    save_query_json(graph, query, output, context_id=context)
Exemplo n.º 2
0
def query(ctx, input, output, context, query_file):
    """ Run an MQL query and store the results. """
    graph = ctx.obj['GRAPH']
    for uri in input:
        load_dump(graph, ensure_uri(uri))

    if query_file is not None:
        query = read_yaml_uri(ensure_uri(query_file))
    else:
        query = yaml.loads(sys.stdin)
    save_query_json(graph, query, output, context_id=context)
Exemplo n.º 3
0
def merge(ctx, input, output):
    """ Combine multiple graph files. """
    graph = ctx.obj['GRAPH']
    for uri in input:
        load_dump(graph, ensure_uri(uri))
    save_dump(graph, output)
Exemplo n.º 4
0
def dump_json(ctx, input, types, output, depth):
    """ Generate JSON of registered schemas. """
    graph = ctx.obj['GRAPH']
    for uri in input:
        load_dump(graph, ensure_uri(uri))
    save_json_dump(graph, output, types, depth=depth)
Exemplo n.º 5
0
def dump_json(ctx, input, types, output, depth):
    """ Generate JSON of registered schemas. """
    graph = ctx.obj['GRAPH']
    for uri in input:
        load_dump(graph, ensure_uri(uri))
    save_json_dump(graph, output, types, depth=depth)
Exemplo n.º 6
0
def merge(ctx, input, output):
    """ Combine multiple graph files. """
    graph = ctx.obj['GRAPH']
    for uri in input:
        load_dump(graph, ensure_uri(uri))
    save_dump(graph, output)