Board logo

标题: 用 Exhibit 真正链接开放数据(1)一切都与数据有关 [打印本页]

作者: look_w    时间: 2018-8-9 10:21     标题: 用 Exhibit 真正链接开放数据(1)一切都与数据有关

一切都与数据有关首先,我将重点放在那些需要用 Exhibit 发布的数据上面。Exhibit 在处理 JSON 输入时遵守一组简单约定。是一个基本概览,可作为大多数 Exhibit 冒险历程的起点。
清单 1. JSON 骨架结构
1
2
3
4
5
6
7
8
9
10
11
12
13
   {
items: [
   {
     "label": ...,
     ...
   },
   {
     "label": ...,
     ...
   },
   ...
]
}




上述是一个 JSON 对象的概览,该对象具有一个单一属性,名为 items,其值为一个对象数组。每个这样的条目对象可以具有任何一组属性,而 Exhibit 用这些属性来构造用户界面。
一个很好的数据源我愿意从人们对 Open       Clip Art Library 所做的最新贡献的 Web 提要创建一个 Exhibit,该库内有一组经授权可以使用的艺术剪图。Web 提要是 Exhibit 的一个很好的展示示例,因为它所包括的链接数据具有标题、日期和类别(也称标记),这对于想要寻找信息的用户非常有用。Open Clip Art Library 在其 Atom 1.0 提要中包括了图片,这也是 Exhibit 的一个很好的展示示例。Atom 1.0 格式的 Web 提要非常有用,因为它是用坚实的、与 LOD 兼容的原则创建的。(clipart.feed.xml)节选自该提要最近的快照,是一个很具代表性的示例。   
清单 2 (clipart.feed.xml). 对 Open Clip Art Library 所做最新贡献的 Atom 1.0 提要
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Open Clip Art Library (clip_art)</title>
  <link rel="self" href="http://openclipart.org/media/feed/atom/clip_art"></link>
  <link rel="alternate" href="http://openclipart.org/media/feed/atom/clip_art"></link>
  <updated>2008-03-11T20:06:06+00:00</updated>
  <id>http://openclipart.org/media/feed/atom/clip_art&lt;/id>
  <entry>
      <id>http://openclipart.org/media/files/adriano/8006&lt;/id>
      <title>Hard Hat</title>
      <author>
        <name>Adriano Ribeiro</name>
      </author>
      <logo></logo>
      <link rel="alternate" href="http://openclipart.org/media/files/adriano/8006"
type="text/html"></link>
      <link rel="enclosure"
href="http://openclipart.org/people/adriano/adriano_Hard_Hat.svg"
length="9353" type="image/svg+xml"></link>
         <category term="unchecked"></category>
         <category term="public_domain"></category>
         <category term="image"></category>
         <category term="tool"></category>
         <category term="man"></category>
         <category term="hat"></category>
         <category term="hard"></category>
         <category term="work"></category>
         <category term="wrench"></category>
      <updated>2008-03-11T20:06:06+00:00</updated>
      <content type="text/plain">A yellow hard hat and a wrench</content>
      <link rel="license" href="http://creativecommons.org/licenses/publicdomain"
type="text/html"></link>
  </entry><entry>
      <id>http://openclipart.org/media/files/Caggles/8005&lt;/id>
      <title>Ship's Badge</title>
      <author>
        <name>Caggles</name>
      </author>
      <logo></logo>
      <link rel="alternate" href="http://openclipart.org/media/files/Caggles/8005"
type="text/html"></link>
      <link rel="enclosure"
href="http://openclipart.org/people/Caggles/Caggles_Ship_s_Badge.svg"
length="99224" type="image/svg+xml"></link>
         <category term="unchecked"></category>
         <category term="public_domain"></category>
         <category term="image"></category>
         <category term="svg"></category>
         <category term="png"></category>
         <category term="badge"></category>
         <category term="heraldry"></category>
         <category term="crest"></category>
         <category term="navy"></category>
         <category term="ship"></category>
         <category term="insignia"></category>
      <updated>2008-03-11T16:45:01+00:00</updated>
      <content type="text/plain">Blank outline for a Royal Navy ship's crest.
      </content>
      <link rel="license" href="http://creativecommons.org/licenses/publicdomain"
type="text/html"></link>
  </entry>
</feed>






欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0