{"id":3266,"date":"2018-07-20T21:11:16","date_gmt":"2018-07-20T21:11:16","guid":{"rendered":"https:\/\/notebooks.dataone.org\/?p=3266"},"modified":"2019-05-24T17:47:13","modified_gmt":"2019-05-24T17:47:13","slug":"week-8-dataone-metadata-parser-application","status":"publish","type":"post","link":"https:\/\/notebooks.dataone.org\/extending-libmagic\/week-8-dataone-metadata-parser-application\/","title":{"rendered":"Week 8: DataONE MetaData parser Application"},"content":{"rendered":"

Hi All,<\/p>\n

This blog is in follow-up with my earlier blogs for the Project 4: Extending Libmagic for Identification of Science Resources<\/a>. This week was very fruitful and we were able to resolve most of our design and development issues for the final application. The application developed is in its final stages with some of the final touches left before release.<\/p>\n

 <\/p>\n

    \n
  1. Unified Labels<\/strong><\/a>: One of our motives was to represent the metadata fields which have different node names across the file formats with the same label. For example, the spatial field in onedcx is represented as “<dcterms:spatial<\/strong>“, whereas in eml-211 node “<coverage”<\/strong>  and its child represent it. They represent the same spatial information about the coverage of the dataset, hence we used the “label” <\/strong>prefix as attributes in the field tag of the config file for representing it.  For example as:  <field label=”Subject”>. <\/strong> The application reads the attribute value and assigns it to the XPath or element tag for that field. While printing the metadata fields and values parsed from the input file, these labels are represented instead of the XPath or element tags.<\/li>\n
  2. getNodeAttr Method:<\/strong> For extracting, the namespace, prefix, and label attributes, the getNodeAttr method was created. It extract the prefix and uri attribute values and creates a hashmap list of it. For the label attribute, it returns the value as String. This method helped in resolving the issue for using the namespace and for creating the common names for different metadata fields across different formats having same context or functionality.<\/li>\n
  3. Escape Characters issue<\/strong>: The tika extracted the file format from the custom-mimetypes.xml file, but it prints the formatId with the escape characters “text\/XML; formatid=“http\\:\\\/\\\/ns.dataone.org\\\/metadata\\\/schema\\\/onedcx\\\/v1.0”. <\/strong>The string generation for the file is handled by the Tika, we couldn’t resolve it. However, the printing of the filetype in our application is handled by us, and we used the replace method of the String class for removal of such characters.<\/li>\n
  4. Null Values<\/strong>: While printing the values for the metadata fields it used to print null values if the field had child nodes. This didn’t look aesthetically pleasing in the representation of the output. For fixing this issue, we printed the values by concatenating it with “;” only if they are not null. This made the output more visually aesthetic.<\/li>\n
  5. The configuration of Other File Formats:<\/strong> The successful implementation of the onedcx and eml-211 file format allowed us to move forward. We created the entries for the other file format in our config file as well.<\/li>\n
  6. Documentation<\/strong>: For documenting the code, we used javadoc utility for providing the information about the classes and its method created.<\/li>\n
  7. Application Jar File: <\/strong>A Jar file for the application needs to be created so that it can be used from the command line, by passing the input file name. Facing issue with the configuration of the project as it states “no main manifest attribute,” <\/strong>error while using the jar file generated. The Manifest file is missing from the project due to which application entry point can’t be found. Working on this issue for resolution.<\/li>\n<\/ol>\n

    In the coming week, below task needs to be completed:<\/p>\n

      \n
    1. Creation of the readme file for the application.<\/li>\n
    2. Creation of application Jar file.<\/li>\n
    3. Two Unit test case.<\/li>\n
    4. Poster creation for the summer internship.<\/li>\n<\/ol>\n

      That\u2019s all for now, see you all next week!<\/p>\n

      Have a great weekend!<\/p>\n

      Resource links: Github-file_identification<\/a>, Github-DataONE Parser,<\/a>  Project Plan<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

      Hi All, This blog is in follow-up with my earlier blogs for the Project 4: Extending Libmagic for Identification of Science Resources. This week was very fruitful and we were able to resolve most of our design and development issues for the final application. The application developed is in its final Continue reading Week 8: DataONE MetaData parser Application<\/span>→<\/span><\/a><\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[389],"tags":[],"_links":{"self":[{"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/posts\/3266"}],"collection":[{"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/comments?post=3266"}],"version-history":[{"count":2,"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/posts\/3266\/revisions"}],"predecessor-version":[{"id":3345,"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/posts\/3266\/revisions\/3345"}],"wp:attachment":[{"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/media?parent=3266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/categories?post=3266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notebooks.dataone.org\/wp-json\/wp\/v2\/tags?post=3266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}