Esempio n. 1
0
def rdf_catalog_format(format):
    params = multi_to_dict(request.args)
    page = int(params.get('page', 1))
    page_size = int(params.get('page_size', 100))
    datasets = Dataset.objects.visible().paginate(page, page_size)
    catalog = build_catalog(current_site, datasets, format=format)
    return graph_response(catalog, format)
Esempio n. 2
0
def rdf_catalog_format(format):
    params = multi_to_dict(request.args)
    page = int(params.get('page', 1))
    page_size = int(params.get('page_size', 100))
    datasets = Dataset.objects.visible().paginate(page, page_size)
    catalog = build_catalog(current_site, datasets, format=format)
    return graph_response(catalog, format)
Esempio n. 3
0
def rdf_format(dataset, format):
    if not DatasetEditPermission(dataset).can():
        if dataset.private:
            abort(404)
        elif dataset.deleted:
            abort(410)

    resource = dataset_to_rdf(dataset)
    return graph_response(resource, format)
Esempio n. 4
0
def rdf_format(dataset, format):
    if not DatasetEditPermission(dataset).can():
        if dataset.private:
            abort(404)
        elif dataset.deleted:
            abort(410)

    resource = dataset_to_rdf(dataset)
    return graph_response(resource, format)
Esempio n. 5
0
 def get(self, format):
     params = multi_to_dict(request.args)
     page = int(params.get('page', 1))
     page_size = int(params.get('page_size', 100))
     datasets = Dataset.objects.visible().paginate(page, page_size)
     catalog = build_catalog(current_site, datasets, format=format)
     # bypass flask-restplus make_response, since graph_response
     # is handling the content negociation directly
     return make_response(*graph_response(catalog, format))
Esempio n. 6
0
def rdf_catalog_format(org, format):
    if org.deleted:
        abort(410)
    params = multi_to_dict(request.args)
    page = int(params.get('page', 1))
    page_size = int(params.get('page_size', 100))
    datasets = Dataset.objects(organization=org).visible().paginate(
        page, page_size)
    catalog = build_org_catalog(org, datasets, format=format)
    return graph_response(catalog, format)
Esempio n. 7
0
    def get(self, dataset, format):
        if not DatasetEditPermission(dataset).can():
            if dataset.private:
                api.abort(404)
            elif dataset.deleted:
                api.abort(410)

        resource = dataset_to_rdf(dataset)
        # bypass flask-restplus make_response, since graph_response
        # is handling the content negociation directly
        return make_response(*graph_response(resource, format))
Esempio n. 8
0
 def get(self, org, format):
     if org.deleted:
         api.abort(410)
     params = multi_to_dict(request.args)
     page = int(params.get('page', 1))
     page_size = int(params.get('page_size', 100))
     datasets = Dataset.objects(organization=org).visible().paginate(page, page_size)
     catalog = build_org_catalog(org, datasets, format=format)
     # bypass flask-restplus make_response, since graph_response
     # is handling the content negociation directly
     return make_response(*graph_response(catalog, format))