-
This question came form a DataONE community member recently:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The For example, the query To find the URL for the data files that a particular metadata object documents, we can add another field to our results list: ExampleGoal: Find the URLs for all data objects that have something to do with jellyfish The query:
The fields to return:
Example result: <doc>
<str name="title">Jellyfish and forage fish catch data, Bering Sea, 2004-2012</str>
<arr name="documents">
<str>45b9581c-ef1a-4aed-9028-b5069fe5d5ee</str>
<str>28c5a386-ff2f-4e24-9264-fe04c76b7a88</str>
</arr>
</doc> The result shows that the "Jellyfish and forage fish catch" data package comprises two data files with the IDs Find the URL for one of the data files We can now use the ID of each data file to find more information about it, including the URL, using another Solr query. For example, the query... <doc>
<str name="formatId">text/csv</str>
<str name="formatType">DATA</str>
<long name="size">67463</long>
<str name="dataUrl">https://cn.dataone.org/cn/v2/resolve/28c5a386-ff2f-4e24-9264-fe04c76b7a88</str>
</doc> Showing that this object is a 67KB CSV data file which can be downloaded at https://cn.dataone.org/cn/v2/resolve/28c5a386-ff2f-4e24-9264-fe04c76b7a88. Construct the URL instead If we just want to download the data right away without doing a second query, then we can construct the dataUrl ourselves, by attaching the base URL More information: |
Beta Was this translation helpful? Give feedback.
The
dataUrl
field defines the "URL that can be used to resolve the location of the object given its PID," where object can refer to either a metadata document (like EML), a resource map, or a data object (like a CSV). The DataONE Solr index is populated from metadata (e.g. EML) and resource maps, not the content of data files. Most common queries to our index search for text that is contained within the metadata document, and so the associateddataUrl
in the search result gives the URL to the metadata object, not the associated data files.For example, the query
title:*jellyfish*
means: "find all documents where the title element contains the term 'jellyfish'". Only metadata objects have a…