Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)