Project

General

Profile

1
<!--
2
  * packages.html
3
  *
4
  *      Authors: Chad Berkley
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *      Created: 2001 January 23
9
  *      Version: 
10
  *    File Info: '$ '
11
  * 
12
  * 
13
-->
14
<HTML>
15
<HEAD>
16
<TITLE>Metacat</TITLE>
17
<link rel="stylesheet" type="text/css" href="./default.css">
18
</HEAD> 
19
<BODY>
20
  <table width="100%">
21
    <tr>
22
      <td class="tablehead" colspan="2"><p class="label">Packages and Relationships</p></td>
23
      <td class="tablehead" colspan="2" align="right">
24
        <a href="./metacatapi.html">Back</a> | <a href="./metacattour.html">Home</a> | 
25
        <a href="./replication.html">Next</a>
26
      </td>
27
    </tr>
28
  </table>
29
  <p>Metacat allows a user to create a virtual link between XML documents within
30
  the system.  These links are called <i>Relationships</i> and are defined by triples
31
  in <i>eml-dataset</i>, <i>eml-literature</i> or <i>eml-software</i> files.  A relationship can be defined between two
32
  XML or <a href="./datafiles.html">non-XML</a> files. 
33
  The following is an example of an eml-dataset-2.0 file holding triples at the end:</p>
34
  
35
  <pre>
36
&lt;?xml version="1.0"?&gt;
37
&lt;!DOCTYPE dataset PUBLIC "-//NCEAS//eml-dataset-2.0//EN" "eml-dataset-2.0.dtd"&gt;
38
&lt;dataset&gt;
39
  &lt;identifier system="null"&gt;berkley.5.3&lt;/identifier&gt;
40
  &lt;shortName&gt;allsp&lt;/shortName&gt;
41
  &lt;title&gt;MARINE sampling data collected between spring 1992 and fall 1996&lt;/title&gt;
42
  &lt;originator&gt;
43
    &lt;individualName&gt;
44
      &lt;salutation&gt;Dr.&lt;/salutation&gt;
45
      &lt;givenName&gt;Peter&lt;/givenName&gt;
46
      &lt;surName&gt;Raimondi&lt;/surName&gt;
47
    &lt;/individualName&gt;
48
    &lt;organizationName&gt;UCSC&lt;/organizationName&gt;
49
    &lt;positionName&gt; &lt;/positionName&gt;
50
    &lt;address&gt;
51
      &lt;deliveryPoint&gt;Biology Dept.&lt;/deliveryPoint&gt;
52
      &lt;deliveryPoint&gt;A309 Earth and Marine Science Building&lt;/deliveryPoint&gt;
53
      &lt;city&gt;Santa Cruz&lt;/city&gt;
54
      &lt;administrativeArea&gt;CA&lt;/administrativeArea&gt;
55
      &lt;postalCode&gt;95060&lt;/postalCode&gt;
56
      &lt;country&gt;USA&lt;/country&gt;
57
    &lt;/address&gt;
58
    &lt;phone phonetype="voice"&gt;831-459-1234 x5674&lt;/phone&gt;
59
    &lt;electronicMailAddress&gt;raimondi@biology.ucsc.edu&lt;/electronicMailAddress&gt;
60
    &lt;onlineLink&gt; &lt;/onlineLink&gt;
61
    &lt;role&gt;Originator&lt;/role&gt;
62
  &lt;/originator&gt;
63
  &lt;pubdate&gt; &lt;/pubdate&gt;
64
  &lt;pubplace&gt; &lt;/pubplace&gt;
65
  &lt;series&gt; &lt;/series&gt;
66
  &lt;abstract&gt;
67
    &lt;paragraph&gt; &lt;/paragraph&gt;
68
  &lt;/abstract&gt;
69
  &lt;keywordSet&gt;
70
    &lt;keyword keywordType="null"&gt;intertidal&lt;/keyword&gt;
71
    &lt;keyword keywordType="null"&gt;santa barbara&lt;/keyword&gt;
72
    &lt;keyword keywordType="null"&gt;photoplot&lt;/keyword&gt;
73
    &lt;keyword keywordType="null"&gt;quadrat&lt;/keyword&gt;
74
    &lt;keywordThesaurus&gt; &lt;/keywordThesaurus&gt;
75
  &lt;/keywordSet&gt;
76
  &lt;additionalInfo&gt;
77
    &lt;paragraph&gt; &lt;/paragraph&gt;
78
  &lt;/additionalInfo&gt; <font color="red">
79
  &lt;triple&gt;
80
    &lt;subject&gt;berkley.6.1&lt;/subject&gt;
81
    &lt;relationship&gt;isRelatedTo&lt;/relationship&gt;
82
    &lt;object&gt;berkley.5.3&lt;/object&gt;
83
  &lt;/triple&gt;
84
  &lt;triple&gt;
85
    &lt;subject&gt;berkley.7.1&lt;/subject&gt;
86
    &lt;relationship&gt;isRelatedTo&lt;/relationship&gt;
87
    &lt;object&gt;berkley.6.1&lt;/object&gt;
88
  &lt;/triple&gt;
89
  &lt;triple&gt;
90
    &lt;subject&gt;berkley.8.1&lt;/subject&gt;
91
    &lt;relationship&gt;isRelatedTo&lt;/relationship&gt;
92
    &lt;object&gt;berkley.5.3&lt;/object&gt;
93
  &lt;/triple&gt;
94
  &lt;triple&gt;
95
    &lt;subject&gt;berkley.8.1&lt;/subject&gt;
96
    &lt;relationship&gt;isRelatedTo&lt;/relationship&gt;
97
    &lt;object&gt;berkley.6.1&lt;/object&gt;
98
  &lt;/triple&gt;
99
  &lt;triple&gt;
100
    &lt;subject&gt;berkley.8.1&lt;/subject&gt;
101
    &lt;relationship&gt;isRelatedTo&lt;/relationship&gt;
102
    &lt;object&gt;berkley.7.1&lt;/object&gt;
103
  &lt;/triple&gt;
104
  &lt;triple&gt;
105
    &lt;subject&gt;berkley.14.1&lt;/subject&gt;
106
    &lt;relationship&gt;isRelatedTo&lt;/relationship&gt;
107
    &lt;object&gt;berkley.6.1&lt;/object&gt;
108
  &lt;/triple&gt; </font>
109
  &lt;temporalCoverage&gt; 1992 to 1996&lt;/temporalCoverage&gt;
110
  &lt;geographicCoverage&gt; &lt;/geographicCoverage&gt;
111
  &lt;taxonomicCoverage&gt; &lt;/taxonomicCoverage&gt;
112
&lt;/dataset&gt;
113
  </pre>
114
  
115
  <b>Description of the Package File</b>
116
  <p>Note that the doctype of this document is an unregistered NCEAS specific
117
  DTD (-//NCEAS//eml-dataset-2.0//EN).  The package doctype is an application 
118
  property of Metacat.  Setting this property (and others) is described in 
119
  <a href="./properties.html">Setting Metacat Properties</a>.  The package file
120
  contains <i>n</i> triples.  Each triple has a subject, relationship,
121
  and an object.  This grouping can be read as follows:  &lt;subject&gt; has
122
  &lt;relationship&gt; to &lt;object&gt;.  Each triple is a logical link
123
  between the subject and object with the relationship being a description of that
124
  link.</p>
125
  <b>The Utility of Relations</b>
126
  <p>Relations become useful because many XML data schemas are broken up into 
127
  multiple DTDs.  Thus, there may be many different XML files that are all 
128
  related to each other yet are stored seperately within the system.  Also, 
129
  since we, here at NCEAS, are developing Metacat for use as a metadata 
130
  repository for ecological data, we need some way of linking our metadata 
131
  to the datafiles that they describe.  Packages are the way we do this.</p>
132
  <b>Post Processed Relations</b>
133
  <p>The package file is inserted into Metacat as any other file is.  Its doctype
134
  is checked against the packagedoctype property in the <a href="properties.html">
135
  Metacat.properties file</a>.  If it is of that type, the file is sent
136
  to a postprocessor to be analyzed and inserted into the xml_relation table.  
137
  The table looks like the following:</p>
138
  
139
  <table border="1">
140
    <tr>
141
      <td>relationid</td><td>docid</td><td>packagetype</td>
142
      <td>subject</td><td>subjectdoctype</td>
143
      <td>relationship</td><td>object</td><td>objectdoctype</td>
144
    </tr>
145
    <tr>
146
      <td>1</td>
147
      <td>berkley.5</td>
148
      <td>-//NCEAS//eml-dataset-2.0//EN</td>
149
      <td>berkley.6.1</td>
150
      <td>null</td>
151
      <td>isRelatedTo</td>
152
      <td>berkley.5.3</td>
153
      <td>null</td>
154
    </tr>
155
    <tr>
156
      <td>2</td>
157
      <td>berkley.5</td>
158
      <td>-//NCEAS//eml-dataset-2.0//EN</td>
159
      <td>berkley.7.1</td>
160
      <td>null</td>
161
      <td>isRelatedTo</td>
162
      <td>berkley.6.1</td>
163
      <td>null</td>
164
    </tr>
165
    <tr>
166
      <td>3</td>
167
      <td>berkley.5</td>
168
      <td>-//NCEAS//eml-dataset-2.0//EN</td>
169
      <td>berkley.8.1</td>
170
      <td>null</td>
171
      <td>isRelatedTo</td>
172
      <td>berkley.5.3</td>
173
      <td>null</td>
174
    </tr>
175
    <tr>
176
      <td>4</td>
177
      <td>berkley.5</td>
178
      <td>-//NCEAS//eml-dataset-2.0//EN</td>
179
      <td>berkley.8.1</td>
180
      <td>null</td>
181
      <td>isRelatedTo</td>
182
      <td>berkley.6.1</td>
183
      <td>null</td>
184
    </tr>
185
    <tr>
186
      <td>5</td>
187
      <td>berkley.5</td>
188
      <td>-//NCEAS//eml-dataset-2.0//EN</td>
189
      <td>berkley.8.1</td>
190
      <td>null</td>
191
      <td>isRelatedTo</td>
192
      <td>berkley.7.1</td>
193
      <td>null</td>
194
    </tr>
195
    <tr>
196
      <td>6</td>
197
      <td>berkley.5</td>
198
      <td>-//NCEAS//eml-dataset-2.0//EN</td>
199
      <td>berkley.14.1</td>
200
      <td>null</td>
201
      <td>isRelatedTo</td>
202
      <td>berkley.6.1</td>
203
      <td>null</td>
204
    </tr>
205
  </table>
206
  
207
  <p>Once, the system has processed the package file and inserted the relations
208
  into the xml_relation table, the files relations are always returned to with it
209
  in the <a href="./metacatquery.html">resultset</a> of a query.</p>
210

    
211
  <b>Package Views (formerly known as 'backtracking')</b>
212
  <p>Package View is a feature that was intentionally left out of the 
213
  <a href="./Metacatquery.html">Queries and Results</a> section.  Package views 
214
  involves sending a doctype (called a returndoctype) along with a query request.  
215
  When there is a hit from that query, the system will check the doctype of the 
216
  hit document against the returndoctype.  If the doctypes do not match, 
217
  the system checks the xml_relation table to see if that document has been packed
218
  by document of that doctype. If such package document exists, it
219
  is returned instead of the one which was originally hit.  If no such
220
  package document exists, then the document which was originally hit is returned.  
221
  This allows a display system (such as a web browser) to try to display a 
222
  certain type of document.</p>
223
  <p>For example:  Take our package file from above.  Say we do a query for 
224
  "intertidal" which returns the document berkley.6 of type -//NCEAS//eml-entity-2.0//EN.
225
  However, we have set returndoctype equal to "-//NCEAS//eml-dataset-2.0//EN".
226
  When berkley.6 is hit, the system will check its package documents to see if 
227
  it is of type -//NCEAS//eml-dataset-2.0//EN.  Since it is, 
228
  (relationid 1, 2 and 4) document berkley.5 is returned instead of berkley.6.
229
  <p>From a client the returndoctype is a servlet parameter.
230
  A URL with a returndoctype would look something like: </p>
231
  <pre>http://server.domain.com/Metacat?action=query&amp;anyfield=%&amp;qformat=html&amp;returndoctype=-//NCEAS//eml-dataset-2.0//EN</pre>
232
  <p>The system then inserts the returndoctype parameter value into a pathquery
233
  document as illustrated in <a href="./metacatquery.html">Queries and Results</a>.
234
  </p>
235
  
236
  
237
  <br>
238
  <a href="./metacatapi.html">Back</a> | <a href="./metacattour.html">Home</a> | 
239
  <a href="./replication.html">Next</a>
240
  
241

    
242
</BODY>
243
</HTML>
(50-50/69)