Ejemplo n.º 1
0
def get_schema(query_params):
    context = MemorizeContext(normalize_uri=query_params['expand_uri'])
    class_schema = query_class_schema(query_params)
    if not class_schema["results"]["bindings"]:
        return
    superclasses = query_superclasses(query_params)
    predicates_and_cardinalities = get_predicates_and_cardinalities(context, query_params, superclasses)
    response_dict = assemble_schema_dict(query_params,
                                         get_one_value(class_schema, "title"),
                                         predicates_and_cardinalities,
                                         context,
                                         comment=get_one_value(class_schema, "comment"))
    return response_dict
Ejemplo n.º 2
0
def get_schema(query_params):
    context = MemorizeContext(normalize_uri=query_params['expand_uri'])
    class_schema = query_class_schema(query_params)
    if not class_schema["results"]["bindings"]:
        return
    superclasses = query_superclasses(query_params)
    predicates_and_cardinalities = get_predicates_and_cardinalities(
        context, query_params, superclasses)
    response_dict = assemble_schema_dict(query_params,
                                         get_one_value(class_schema, "title"),
                                         predicates_and_cardinalities,
                                         context,
                                         comment=get_one_value(
                                             class_schema, "comment"))
    return response_dict
Ejemplo n.º 3
0
 def calculate_total_items():
     count_query_result_dict = query_count_classes(query_params)
     total_items = int(get_one_value(count_query_result_dict, "total_items"))
     return total_items
Ejemplo n.º 4
0
 def calculate_total_items():
     result_dict = query_count_filter_instances(query_params)
     total_items = int(get_one_value(result_dict, 'total'))
     return total_items