DOI-USGS / gems-tools-pro

GeMS Tools for ArcGIS Pro
Creative Commons Zero v1.0 Universal
45 stars 15 forks source link

Build Metadata tool (2.14.4; version of 8/21/23): "Start with embedded metadata?" option? #80

Open alwunder opened 11 months ago

alwunder commented 11 months ago

I noticed after running the Build Metadata tool that the xml output for attributes has not retained the internal metadata definitions that are applied to the database which I build from a XML workspace document. This includes Esri-defined fields (OBJECTID, Shape, etc.) as well as basic GeMS fields.

For example, the OBJECTID field in every feature class in my gdb has the following attr metadata tag:

      <attr>
        <attrlabl>OBJECTID</attrlabl>
        <attrdef>Internal feature number</attrdef>
        <attrdefs>Esri</attrdefs>
        <attrdomv>
          <udom>Sequential unique whole numbers that are automatically generated.</udom>
        </attrdomv>
      </attr>

The metadata tool output shows the following:

      <attr>
        <attrlabl>OBJECTID</attrlabl>
        <attrdef>Internal feature number</attrdef>
        <attrdefs>ESRI</attrdefs>
        <attrdomv>
          <udom>Unrepresentable domain</udom>
        </attrdomv>
      </attr>

I also tested this by commenting out some of the attribute items in my_definitions.py and the metadata tool gave errors that the definitions for those items were missing in the output even though they are defined internally.

I'm not sure how big of an issue this really is, but I wanted to point it out. I have no problem using my_definitions.py as it mirrors the embedded definitions. I don't know how many folks are working with databases that have metadata built in. I've also never used the GeMS Create New Database tool and am not sure if it creates internal metadata for entities and attributes.

ethoms-usgs commented 11 months ago

Yes, I have been meaning to write new code or a new tool to work better with embedded metadata. As you note, the Build Metadata tool right now doesn't care if there are existing embedded entity and attribute definitions. It builds everything off the definition files but I have been hearing from a few people that they write a lot of metadata in the Catalog editor so I need to better accommodate that workflow.

And, no, the Create Database tool writes no metadata, but I like that idea.

alwunder commented 11 months ago

I see now after reading on the wiki (https://github.com/DOI-USGS/gems-tools-pro/wiki/GeMS-Tools-Documentation#build-metadata) that only top level embedded metadata are captured from the database using the "Start with embedded metadata?" option. Interestingly, that's the only thing my databases DON'T have... I always did that at the end (or not at all...) and relied on the external metadata since each database is a little different in title, author, methods, etc.

ethoms-usgs commented 11 months ago

Exactly. This is something I need to address. Either a new tool that migrates table metadata up to the top level or build it into the Build Metadata tool. Probably the latter is better so that the embedded metadata aren't changed, but in that case the external xml file can still be imported manually if the user wants it.

alwunder commented 11 months ago

Agreed, that seems like the best option to me as well. Hopefully, that makes it on to the list of enhancements!