Exemple #1
0
def entity_type_selection_total(job, id):
    sql_only = request.values.get('sql', default=False) == 'true'
    result = job.get_entity_type_selection_sample_total(id, sql_only=sql_only)

    if sql_only:
        return Response(get_string_from_sql(result), mimetype='text/plain')

    return jsonify(result)
Exemple #2
0
def clusters_totals(job, type, id):
    params = get_data_retrieval_params([
        'sql', 'with_view_filters', 'uris', 'cluster_ids', 'min_strength',
        'max_strength', 'min_size', 'max_size', 'min_count', 'max_count'
    ])
    result = job.get_clusters_totals(id, type, **params)

    if params['sql_only']:
        return Response(get_string_from_sql(result), mimetype='text/plain')

    return jsonify(result)
Exemple #3
0
def clusters(job, type, id):
    params = get_data_retrieval_params([
        'sql', 'with_view_filters', 'with_view_properties', 'include_nodes',
        'uris', 'cluster_ids', 'min_strength', 'max_strength', 'min_size',
        'max_size', 'min_count', 'max_count', 'sort'
    ])
    result = job.get_clusters(id, type, **params, **get_paging_params())

    if params['sql_only']:
        return Response(get_string_from_sql(result), mimetype='text/plain')

    return jsonify(list(result))
Exemple #4
0
def entity_type_selection_sample(job, id):
    invert = request.values.get('invert', default=False) == 'true'
    sql_only = request.values.get('sql', default=False) == 'true'
    result = job.get_entity_type_selection_sample(id,
                                                  invert=invert,
                                                  sql_only=sql_only,
                                                  **get_paging_params())

    if sql_only:
        return Response(get_string_from_sql(result), mimetype='text/plain')

    return jsonify(result)
Exemple #5
0
    def sql_string(self):
        sql_str = get_string_from_sql(self.generate_schema_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(
            self.generate_entity_type_selection_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(self.generate_match_source_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(self.generate_match_target_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(
            self.generate_match_index_and_sequence_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(self.generate_match_linkset_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(
            self.generate_match_linkset_finish_sql())

        return sql_str
Exemple #6
0
    def sql_string(self):
        sql_str = get_string_from_sql(self.generate_lens_sql())
        sql_str += '\n'
        sql_str += get_string_from_sql(self.generate_lens_finish_sql())

        return sql_str