RAMADDA supports a simple import/export xml format.
Here is a simple test.zip entries file that you can import. It contains a single file entry defined in an entries.xml file and its associated data file (test.txt). In your RAMADDA, go to File->Import Entries menu and you can upload a .zip file or the entries.xml directly.
The folder.xml example just defines a set of folders with associated metadata.
Inside the entry tag you can have any number of metadata tags. You define the type and the attribute values.
Note: This only works for the more simple metadata elements like tag, personnel, etc. The more complex
ones with nested structured would require knowing RAMADDA's internal (and rather ill thought out) metadata storage model.
A simple metadata xml tag looks like:
When harvesting files or configuring Server Side Files
RAMADDA will look on the file system for an entry XML configuration file to use as a template when creating entries for the files and folders being ingested or displayed. For a given file RAMADDA will look for the following entry xml file in the file's parent directory:
<entries> <entry name="test.png" description="" type="file" id="0" file="test.png" parent="<some parent entry id>" south="-7.926" west="-198.358" north="71.864" east="-3.950" fromdate="2008-08-19 16:01:00 GMT" todate="2008-08-19 16:01:00 GMT" </entries>A simple way to see the example entry xml is to create a folder or file entry in RAMADDA. Set its description, time, spatial bounds, etc and add a number of properties to it. Or create a tree of folders and files. Then do File->Export. Uzip the .zip file and look at the entries.xml
- The type attribute is the data types available in RAMADDA.
- The parent is the actual parent id in RAMADDA or may be an id of another entry defined in the XML file.
- The fromdata, todate, south, west, east, north and description are all optional.
- The id attribute will not be the actual id of the entry but allows you to reference the entries elsewhere. For example, you
could create a folder entry and then another entry that is a child of the folder:
<entries> <entry name="Some folder" id="somedummyid0" parent="<some parent entry id>" type="group" /> <entry name="test.png" description="" type="file" id="somedummyid1" file="test.png" parent="somedummyid0" /> </entries>
7.2.0 Importing Entries
7.2.1 Metadata
So to add a "tag" metadata use the xml:<entry ...> ... <metadata type="some type" attr1="atribute 1 value" attr2="attribute 2 value" .../>
If you have values that don't work as XML attributes due to their content or their length you can include them as tags. The encoded="false" says this is unencoded text. The default is encoded=true which implies the text is base64 encoded (see below).<metadata inherited="false" type="enum_tag" attr1="TAG VALUE">
A simple way to see the metadata xml is to create a folder or other entry in RAMADDA. Add a number of properties to it then do File->Export. Uzip the .zip file and look at the entries.xml Note: the contents of the attr tags are CDATA blocks of base64 encoded text. Base64 encoding of the text is the default and is what is expected when RAMADDA ingests this XML unless you have encoded=false.<metadata inherited="true" type="some type"> <attr index="1" encoded="false"><![CDATA[value 1]]></attr> <attr index="2" encoded="false"><![CDATA[value 2]]></attr> ... </metadata>
<metadata inherited="true" type="some type"> <attr index="1"><![CDATA[TlNGLU9QUA==]]></attr> <attr index="2"><![CDATA[SW5jcmV=]]></attr> ... </metadata>
7.2.2 Harvest Configuration
.<filename>.ramadda.xml .dir.ramadda.xml .file.ramadda.xml .ramadda.xmlSo if you had:
dir1 file1.txt file2.txt dir2The file types and metadata could be configured with:
.dir1.ramadda.xml dir1 file1.txt .file1.txt.ramadda.xml file2.txt .file2.txt.ramadda.xml .dir2.ramadda.xml dir2You could also place a single .ramadda.xml as a sibling file of dir1 and dir2 to configure their types. A directory can also contain its own entry xml file:
.this.ramadda.xmlYou could also have .this.ramadda.xml for each directory:
dir1 .this.ramadda.xml file1.txt file2.txt dir2 .this.ramadda.xml