Debian Codegraph @

docs/html/webservice.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <title>Biblio::Citation::Parser 1.10 Documentation - ParaCite Web Service</title>
5 <link rel="stylesheet" href="epdocs.css" type="text/css" />
6 <link rev="made" href="mailto:[email protected]" />
7 </head>
8
9 <body>
10 <table border="0" width="100%" cellspacing="0" cellpadding="3">
11 <tr><td class="block" valign="middle">
12 <big><strong><span class="block">&nbsp;Biblio::Citation::Parser 1.10 Documentation - ParaCite Web Service</span></strong></big>
13 </td></tr>
14 </table>
15
16 <p><a name="__index__"></a></p>
17 <!-- INDEX BEGIN -->
18
19 <ul>
20
21 <li><a href="#the_paracite_web_service">The ParaCite Web Service</a></li>
22 <li><a href="#using_the_web_service_from_perl">Using the Web Service from Perl</a></li>
23 <li><a href="#web_service_examples">Web Service Examples</a></li>
24 <li><a href="#web_service_structures">Web Service Structures</a></li>
25 <ul>
26
27 <li><a href="#paracitesearchresult">ParaciteSearchResult</a></li>
28 <li><a href="#resultelement">ResultElement</a></li>
29 <li><a href="#metadata">Metadata</a></li>
30 </ul>
31
32 </ul>
33 <!-- INDEX END -->
34
35 <hr />
36 <p>
37 </p>
38 <h1><a name="the_paracite_web_service">The ParaCite Web Service</a></h1>
39 <p>The Biblio::Citation::Parser package includes several examples that demonstrate the ParaCite web service, as well as the WSDL definition file. This section explains the web service, and gives an introduction to using it.</p>
40 <p>As ParaCite is written entirely in Perl, there are obvious issues if you wish to use Java, PHP, or another language. The ParaCite web services provides an interface into the reference parsing features of ParaCite, while remaining language agnostic.</p>
41 <p>
42 </p>
43 <hr />
44 <h1><a name="using_the_web_service_from_perl">Using the Web Service from Perl</a></h1>
45 <p>To access the web service from Perl requires the SOAP::Lite module (see Required Software). Once this is present, this is all that is required to connect to the web service:</p>
46 <pre>
47 my $service = SOAP::Lite
48 -&gt; service(&quot;<a href="http://paracite.eprints.org/paracite.wsdl&quot">http://paracite.eprints.org/paracite.wsdl&quot</a>;);</pre>
49 <p>Three functions are now available from the <code>$service</code> variable:</p>
50 <dl>
51 <dt><strong><a name="item_doopenurlconstruct"><strong>doOpenURLConstruct($reference, $baseurl)</strong></a></strong><br />
52 </dt>
53 <dd>
54 This returns an OpenURL, prefixed by the base URL if one is provided.
55 </dd>
56 <p></p>
57 <dt><strong><a name="item_doreferenceparse"><strong>doReferenceParse($reference, $baseurl)</strong></a></strong><br />
58 </dt>
59 <dd>
60 This returns a hash containing the metadata in the reference, and an OpenURL formed using the metadata and the base URL.
61 </dd>
62 <p></p>
63 <dt><strong><a name="item_doparacitesearch"><strong>doParaciteSearch($reference, $baseurl)</strong></a></strong><br />
64 </dt>
65 <dd>
66 This returns an hash containing 'resultElements' (an array of search results), and 'metadata' (a hash of metadata).
67 </dd>
68 <p></p></dl>
69 <p>
70 </p>
71 <hr />
72 <h1><a name="web_service_examples">Web Service Examples</a></h1>
73 <p>The following code parses a reference, and stores the metadata in <code>$metadata</code> and the OpenURL in <code>$openurl</code>:</p>
74 <pre>
75 use SOAP::Lite;
76 my $service = SOAP::Lite
77 -&gt; service(&quot;<a href="http://paracite.eprints.org/paracite.wsdl&quot">http://paracite.eprints.org/paracite.wsdl&quot</a>;);
78 my $base_url = &quot;<a href="http://paracite.eprints.org/cgi-bin/openurl.cgi?&quot">http://paracite.eprints.org/cgi-bin/openurl.cgi?&quot</a>;;
79 my $result = $service
80 -&gt; doReferenceParse(&quot;Jewell, M (2002) Example&quot;, $base_url);
81 my $metadata = $result-&gt;{metadata};
82 my $openurl = $result-&gt;{openURL};</pre>
83 <p>If you do not want the metadata, and just want a link to an OpenURL resolver, the following will do that:</p>
84 <pre>
85 use SOAP::Lite;
86 my $service = SOAP::Lite
87 -&gt; service(&quot;<a href="http://paracite.eprints.org/paracite.wsdl&quot">http://paracite.eprints.org/paracite.wsdl&quot</a>;);
88 my $base_url = &quot;<a href="http://paracite.eprints.org/cgi-bin/openurl.cgi?&quot">http://paracite.eprints.org/cgi-bin/openurl.cgi?&quot</a>;;
89 my $open_url = $service
90 -&gt; doOpenURLConstruct(&quot;Jewell, M (2002) Example&quot;, $base_url);
91
92 Finally, this example uses the doParaciteSearch method to get the first match on a reference:</pre>
93 <pre>
94 use SOAP::Lite;
95 my $service = SOAP::Lite
96 -&gt; service(&quot;<a href="http://paracite.eprints.org/paracite.wsdl&quot">http://paracite.eprints.org/paracite.wsdl&quot</a>;);
97 my $base_url = &quot;<a href="http://paracite.eprints.org/cgi-bin/openurl.cgi?&quot">http://paracite.eprints.org/cgi-bin/openurl.cgi?&quot</a>;;
98 my $query = &quot;Harnad, Stevan (1995) The PostGutenberg Galaxy.&quot;;
99 my $result = $service
100 -&gt; doParaciteSearch($query, $base_url);
101 my $first_result = $result-&gt;{resultElements}-&gt;[0];
102 print &quot;First result is: &quot;.$first_result-&gt;{URL}.&quot;\n&quot;;</pre>
103 <p>The web service automatically adds Google, Scirus, and Vivissimo as resources to the search request, so if no resources match the publication or subject these will be used as fall-backs.</p>
104 <p>
105 </p>
106 <hr />
107 <h1><a name="web_service_structures">Web Service Structures</a></h1>
108 <p>Most of the Paracite structures have been modelled very closely on the Google web service structures to allow some degree of standardisation. Some additions have been made, and some fields are not yet used, but these may change in future versions.</p>
109 <p>
110 </p>
111 <h2><a name="paracitesearchresult">ParaciteSearchResult</a></h2>
112 <dl>
113 <dt><strong><a name="item_resultelements">resultElements</a></strong><br />
114 </dt>
115 <dd>
116 This is an array of resources, along with the search URLs associated with them. See the ResultElement description later in this section.
117 </dd>
118 <p></p>
119 <dt><strong><a name="item_estimatedtotalresultscount">estimatedTotalResultsCount</a></strong><br />
120 </dt>
121 <dd>
122 This returns the number of items in the resultElements array.
123 </dd>
124 <p></p>
125 <dt><strong><a name="item_estimateisexact">estimateIsExact</a></strong><br />
126 </dt>
127 <dd>
128 This currently always returns 1.
129 </dd>
130 <p></p>
131 <dt><strong><a name="item_searchquery">searchQuery</a></strong><br />
132 </dt>
133 <dd>
134 This contains the original reference.
135 </dd>
136 <p></p>
137 <dt><strong><a name="item_openurl">openURL</a></strong><br />
138 </dt>
139 <dd>
140 This contains the OpenURL represented by the reference metadata (prefixed by base URL if one is supplied).
141 </dd>
142 <p></p>
143 <dt><strong><a name="item_metadata">metadata</a></strong><br />
144 </dt>
145 <dd>
146 This is a Metadata object (see later in this section).
147 </dd>
148 <p></p></dl>
149 <p>
150 </p>
151 <h2><a name="resultelement">ResultElement</a></h2>
152 <dl>
153 <dt><strong><a name="item_url">URL</a></strong><br />
154 </dt>
155 <dd>
156 This is a URL that searches the current resource for the reference.
157 </dd>
158 <p></p>
159 <dt><strong><a name="item_template">template</a></strong><br />
160 </dt>
161 <dd>
162 This contains the template of the matching resource interface that was used to generate the search URL.
163 </dd>
164 <p></p>
165 <dt><strong><a name="item_name">name</a></strong><br />
166 </dt>
167 <dd>
168 The name of the resource (e.g. Google).
169 </dd>
170 <p></p>
171 <dt><strong><a name="item_description">description</a></strong><br />
172 </dt>
173 <dd>
174 Some more information about the resource.
175 </dd>
176 <p></p>
177 <dt><strong><a name="item_tollfree">tollfree</a></strong><br />
178 </dt>
179 <dd>
180 A boolean value that is true if the results can be viewed without cost.
181 </dd>
182 <p></p>
183 <dt><strong><a name="item_fulltext">fulltext</a></strong><br />
184 </dt>
185 <dd>
186 A boolean value that is true if a resulting article from this resource will have the full text available.
187 </dd>
188 <p></p>
189 <dt><strong><a name="item_stratum">stratum</a></strong><br />
190 </dt>
191 <dd>
192 An integer representing the stratum in which this resource lies. A complete list of the strata is available at <a href="http://paracite.eprints.org/cgi-bin/views/viewstrata.cgi">http://paracite.eprints.org/cgi-bin/views/viewstrata.cgi</a>
193 </dd>
194 <p></p></dl>
195 <p>
196 </p>
197 <h2><a name="metadata">Metadata</a></h2>
198 <p>All of the fields in Metadata are valid fields in OpenURL metadata. See Table 1 at <a href="http://www.sfxit.com/openurl/openurl.html">http://www.sfxit.com/openurl/openurl.html</a> for a complete list.</p>
199 <table border="0" width="100%" cellspacing="0" cellpadding="3">
200 <tr><td class="block" valign="middle">
201 <big><strong><span class="block">&nbsp;Biblio::Citation::Parser 1.10 Documentation - ParaCite Web Service</span></strong></big>
202 </td></tr>
203 </table>
204
205 </body>
206
207 </html>