gpt4 book ai didi

ckan - 没有为 demo.ckan.org 上的资源创建 View

转载 作者:行者123 更新时间:2023-12-03 12:46:06 28 4
gpt4 key购买 nike

曾经是我的resource creation problem has been solved , 我还有 demo.ckan.org 的另一个问题。

创建资源后,我创建了一个数据存储并更新了一些数据:

POST http://demo.ckan.org:80/api/3/action/resource_create HTTP/1.1
{"help": "http://demo.ckan.org/api/3/action/help_show?name=resource_create", "success": true, "result": {"cache_last_updated": null, "cache_url": null, "mimetype_inner": null, "hash": "", "description": "", "format": "", "url": "http://none", "created": "2015-10-01T06:18:25.471301", "state": "active", "webstore_last_updated": null, "webstore_url": null, "package_id": "51b379eb-a2a4-49d8-89b3-188dafdd0279", "last_modified": null, "mimetype": null, "url_type": null, "position": 0, "revision_id": "75c80743-66a8-49d2-a01f-ad67734386f5", "size": null, "id": "12eab044-7853-4907-9879-872550f1376b", "resource_type": null, "name": "room1_room"}}

POST http://demo.ckan.org:80/api/3/action/datastore_create HTTP/1.1
{"help": "http://demo.ckan.org/api/3/action/help_show?name=datastore_create", "success": true, "result": {"fields": [{"type": "int", "id": "recvTimeTs"}, {"type": "timestamp", "id": "recvTime"}, {"type": "text", "id": "entityId"}, {"type": "text", "id": "entityType"}, {"type": "text", "id": "attrName"}, {"type": "text", "id": "attrType"}, {"type": "json", "id": "attrValue"}, {"type": "json", "id": "attrMd"}], "method": "insert", "resource_id": "12eab044-7853-4907-9879-872550f1376b"}}

POST http://demo.ckan.org:80/api/3/action/datastore_upsert HTTP/1.1
{"help": "http://demo.ckan.org/api/3/action/help_show?name=datastore_upsert", "success": true, "result": {"records": [{"attrType": "centigrade", "recvTime": "2015-10-01T06:18:24.72Z", "recvTimeTs": "1443680304", "attrValue": "26.5", "entityType": "Room", "attrName": "temperature", "entityId": "Room1"}], "method": "insert", "resource_id": "12eab044-7853-4907-9879-872550f1376b"}}

数据在那里,可以通过datastore_search检索:

curl -s -S -H "Authorization: b4f6cd71-b592-49a3-bb85-9cd5a0f2eb68" "http://demo.ckan.org/api/3/action/datastore_search?resource_id=12eab044-7853-4907-9879-872550f1376b"
{"help": "http://demo.ckan.org/api/3/action/help_show?name=datastore_search", "success": true, "result": {"resource_id": "12eab044-7853-4907-9879-872550f1376b", "fields": [{"type": "int4", "id": "_id"}, {"type": "int4", "id": "recvTimeTs"}, {"type": "timestamp", "id": "recvTime"}, {"type": "text", "id": "entityId"}, {"type": "text", "id": "entityType"}, {"type": "text", "id": "attrName"}, {"type": "text", "id": "attrType"}, {"type": "json", "id": "attrValue"}, {"type": "json", "id": "attrMd"}], "records": [{"attrType": "centigrade", "recvTime": "2015-10-01T06:18:24.720000", "recvTimeTs": 1443680304, "attrMd": null, "attrValue": "26.5", "entityType": "Room", "attrName": "temperature", "entityId": "Room1", "_id": 1}], "_links": {"start": "/api/3/action/datastore_search?resource_id=12eab044-7853-4907-9879-872550f1376b", "next": "/api/3/action/datastore_search?offset=100&resource_id=12eab044-7853-4907-9879-872550f1376b"}, "total": 1}}

尽管如此,demo.ckan.org 说:

There are no views created for this resource yet.

Not seeing the views you were expecting? Click here for more information.

Here are some reasons you may not be seeing expected views:

  • No view has been created that is suitable for this resource
  • The site administrators may not have enabled the relevant view plugins
  • If a view requires the DataStore, the DataStore plugin may not be enabled, or the data may not have been pushed to the DataStore, or the DataStore hasn't finished processing the data yet

我一直在使用 2.2 API,无需创建 View 。现在,我似乎必须使用 2.4 API 创建这样的 View 。它是否正确,我必须使用 http://docs.ckan.org/en/ckan-2.4.0/api/index.html#ckan.logic.action.create.resource_view_create 方法?还是仅仅是门户的问题?

最佳答案

这很可能是演示服务器的设置方式,我建议使用 API 调用自己创建 resource_view(除非您可以控制服务器并对其进行不同的配置)是可行的方法。

关于ckan - 没有为 demo.ckan.org 上的资源创建 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32881002/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com