def build_class_schema_query(params): """ Note: if params["lang"] is not False (e.g. "pt"), the following variables are filtered according to the lang provided: - rdfs:label - rdfs:comment (optional) """ template_params = dict(**params) (params, language_tag) = add_language_support(template_params, "title") (params, language_tag) = add_language_support(template_params, "comment") return QUERY_CLASS_SCHEMA % template_params
def list_classes(query_params): params = dict(**query_params) (params, language_tag) = add_language_support(query_params, "label") if not graph_exists(params): raise HTTPError(404, log_message=u"Graph {0} does not exist".format(query_params["graph_uri"])) query_result_dict = query_classes_list(params) if not query_result_dict or not query_result_dict['results']['bindings']: json = { "items": [], "warning": u"No classes found for graph {0} in page {1:d}".format( params["graph_uri"], int(params["page"]) + 1) } return json return assemble_list_json(params, query_result_dict)
def _build_predicate_ranges_query(query_params, search_params): params = add_language_support(query_params, "range_label")[0] params.update(search_params) return QUERY_PREDICATE_RANGES % params