1 |
878
|
berkley
|
<!--
|
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="@docrooturl@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 |
881
|
berkley
|
in <i>eml-dataset</i>, <i>eml-literature</i> or <i>eml-software</i> files. A relationship can be defined between two
|
32 |
878
|
berkley
|
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 |
|
|
<?xml version="1.0"?>
|
37 |
|
|
<!DOCTYPE dataset PUBLIC "-//NCEAS//eml-dataset-2.0//EN" "eml-dataset-2.0.dtd">
|
38 |
|
|
<dataset>
|
39 |
|
|
<identifier system="null">berkley.5.3</identifier>
|
40 |
|
|
<shortName>allsp</shortName>
|
41 |
|
|
<title>MARINE sampling data collected between spring 1992 and fall 1996</title>
|
42 |
|
|
<originator>
|
43 |
|
|
<individualName>
|
44 |
|
|
<salutation>Dr.</salutation>
|
45 |
|
|
<givenName>Peter</givenName>
|
46 |
|
|
<surName>Raimondi</surName>
|
47 |
|
|
</individualName>
|
48 |
|
|
<organizationName>UCSC</organizationName>
|
49 |
|
|
<positionName> </positionName>
|
50 |
|
|
<address>
|
51 |
|
|
<deliveryPoint>Biology Dept.</deliveryPoint>
|
52 |
|
|
<deliveryPoint>A309 Earth and Marine Science Building</deliveryPoint>
|
53 |
|
|
<city>Santa Cruz</city>
|
54 |
|
|
<administrativeArea>CA</administrativeArea>
|
55 |
|
|
<postalCode>95060</postalCode>
|
56 |
|
|
<country>USA</country>
|
57 |
|
|
</address>
|
58 |
|
|
<phone phonetype="voice">831-459-1234 x5674</phone>
|
59 |
|
|
<electronicMailAddress>raimondi@biology.ucsc.edu</electronicMailAddress>
|
60 |
|
|
<onlineLink> </onlineLink>
|
61 |
|
|
<role>Originator</role>
|
62 |
|
|
</originator>
|
63 |
|
|
<pubdate> </pubdate>
|
64 |
|
|
<pubplace> </pubplace>
|
65 |
|
|
<series> </series>
|
66 |
|
|
<abstract>
|
67 |
|
|
<paragraph> </paragraph>
|
68 |
|
|
</abstract>
|
69 |
|
|
<keywordSet>
|
70 |
|
|
<keyword keywordType="null">intertidal</keyword>
|
71 |
|
|
<keyword keywordType="null">santa barbara</keyword>
|
72 |
|
|
<keyword keywordType="null">photoplot</keyword>
|
73 |
|
|
<keyword keywordType="null">quadrat</keyword>
|
74 |
|
|
<keywordThesaurus> </keywordThesaurus>
|
75 |
|
|
</keywordSet>
|
76 |
|
|
<additionalInfo>
|
77 |
|
|
<paragraph> </paragraph>
|
78 |
|
|
</additionalInfo> <font color="red">
|
79 |
|
|
<triple>
|
80 |
|
|
<subject>berkley.6.1</subject>
|
81 |
|
|
<relationship>isRelatedTo</relationship>
|
82 |
|
|
<object>berkley.5.3</object>
|
83 |
|
|
</triple>
|
84 |
|
|
<triple>
|
85 |
|
|
<subject>berkley.7.1</subject>
|
86 |
|
|
<relationship>isRelatedTo</relationship>
|
87 |
|
|
<object>berkley.6.1</object>
|
88 |
|
|
</triple>
|
89 |
|
|
<triple>
|
90 |
|
|
<subject>berkley.8.1</subject>
|
91 |
|
|
<relationship>isRelatedTo</relationship>
|
92 |
|
|
<object>berkley.5.3</object>
|
93 |
|
|
</triple>
|
94 |
|
|
<triple>
|
95 |
|
|
<subject>berkley.8.1</subject>
|
96 |
|
|
<relationship>isRelatedTo</relationship>
|
97 |
|
|
<object>berkley.6.1</object>
|
98 |
|
|
</triple>
|
99 |
|
|
<triple>
|
100 |
|
|
<subject>berkley.8.1</subject>
|
101 |
|
|
<relationship>isRelatedTo</relationship>
|
102 |
|
|
<object>berkley.7.1</object>
|
103 |
|
|
</triple>
|
104 |
|
|
<triple>
|
105 |
|
|
<subject>berkley.14.1</subject>
|
106 |
|
|
<relationship>isRelatedTo</relationship>
|
107 |
|
|
<object>berkley.6.1</object>
|
108 |
|
|
</triple> </font>
|
109 |
|
|
<temporalCoverage> 1992 to 1996</temporalCoverage>
|
110 |
|
|
<geographicCoverage> </geographicCoverage>
|
111 |
|
|
<taxonomicCoverage> </taxonomicCoverage>
|
112 |
|
|
</dataset>
|
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 |
881
|
berkley
|
contains <i>n</i> triples. Each triple has a subject, relationship,
|
121 |
878
|
berkley
|
and an object. This grouping can be read as follows: <subject> has
|
122 |
|
|
<relationship> to <object>. 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&anyfield=%&qformat=html&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>
|