Summary
Uses the ArcGIS metadata translation engine or an XSLT transformation to export metadata content from ArcGIS to a stand-alone metadata XML file. The exported metadata will be formatted to satisfy the metadata standard associated with the specified translation.
Metadata for items in ArcGIS is stored in the ArcGIS metadata format. Use the ArcGIS to translations to export ArcGIS metadata to another metadata XML format. For example, do this to share information outside of ArcGIS by publishing it to a metadata catalog. Different metadata catalogs accept information in different XML formats. ArcGIS metadata can be exported to different formats if you must publish your information to metadata catalogs with different requirements.
When using a to ISO 19139 translation, the exported metadata will be formatted following the rules defined in ISO standard 19139, Geographic information — Metadata — XML schema implementation, and its associated XML Schemas. The same translation is used to export metadata according to an ISO metadata profile. The translation accounts for the metadata style selected in ArcGIS. For example, when the selected metadata style is North American Profile of ISO 19115:2003 – Geographic information – Metadata, the output file will be formatted appropriately for that ISO metadata profile.
When using the ArcGIS to FGDC translation, the exported metadata will be formatted following the Federal Geographic Data Committee (FGDC) Content Standard for Digital Geospatial Metadata (CSDGM) XML format. The resulting file can be published to GeoPlatform.gov, for example.
FGDC to translations handle information in the item's metadata, which is formatted according to the FGDC CSDGM XML format. This content appears under the FGDC Metadata (read-only) heading in the Description tab when you are using a metadata style that gives you full access to the item's metadata. This content may have been provided with the current release of ArcGIS Desktop using the FGDC metadata editor add-in or using the FGDC metadata editor provided with ArcGIS Desktop 9.3.1 or earlier releases.
The to ArcGIS translations convert other metadata XML formats to the ArcGIS metadata format. This is an important step in the process of importing metadata that exists in another format to an ArcGIS item; however, several additional steps are also required to achieve the best results. Use the Import Metadata tool with the appropriate translation to complete this task instead.
Usage
A new metadata translator is provided with the current release of ArcGIS Desktop—the ArcGIS to ISO 19139 translator, ARCGIS2ISO19139.xml. All ISO-based metadata styles have been updated to use this translator. Any geoprocessing models or Python scripts that export metadata to the ISO 19139 format should be updated to use this translator as well.
The earlier ArcGIS or ESRI-ISO to ISO 19139 translator, ESRI_ISO2ISO19139.xml, continues to be provided; however, there are several known issues with this translator that can't be resolved. Any existing 9.3.1 metadata in the ESRI-ISO format must be upgraded to the ArcGIS metadata format to successfully export the item's metadata content to the ISO 19139 format with the ArcGIS to ISO 19139 translator, ARCGIS2ISO19139.xml.
When metadata is translated to the ArcGIS metadata format using a to ArcGIS translation, the original document is included in the resulting metadata as an enclosure. You can access the original document from the Metadata Properties dialog box in ArcCatalog.
The metadata content validation messages provided by this tool account for detailed conditions documented in the metadata standard that can't be tested using XML Schema validation. For example, in ISO 19115-based metadata, the value of the metadata hierarchy-level element determines if a topic category is required or not; this condition can't be tested using an XML Schema.
A topic category is required if the item contains spatial data. If the item is identified as spatial data but a topic category is missing, the validation error reported is Validation failed: em:Resource($a) --> es:not(em:Dataset($a)); em:identificationInfo($a, $b), em:topicCategory($b, $c), em:lookupCodeName($c, gmxRes:MD_TopicCategoryCode). This statement means that the item has to either not be a dataset or a valid topic category code must be provided, and in this case, neither is true.
The output files produced by this tool can't be stored in a geodatabase. If the Current_workspace environment is set to a geodatabase, the output files will be stored in a different location, as described below.
- If Current_workspace is set to a file or personal geodatabase, the output files will be stored in the folder in which the geodatabase is stored.
- If Current_workspace is set to an enterprise or workgroup geodatabase, the output files will be stored in the location defined by the system TEMP environment variable.
The Source Metadata parameter has a complex data type. If you use this tool in a model, create a variable for the Source Metadata parameter in ModelBuilder by right-clicking the tool, pointing to Make Variable, pointing to From Parameter, and then clicking Source Metadata.
Each Translator, except the ArcGIS to FGDC and ArcGIS to ISO 19139 translators, references files containing validation rules. The message Starting validation indicates validation is beginning to use the rules in the specified file. The validation rules defined in ISO19139_min_schema.txt cover the minimum mandatory requirements for ISO metadata, and the rules defined in ESRI-ISO_schema.txt address the remaining metadata elements.
These rules identify if mandatory elements have been provided, if conditional elements are required and provided, and if the value provided in a metadata element is of the correct data type. Validation rules can't detect cardinality issues such as only one purpose element is allowed but two have been provided. Any validation issues found are reported as warnings in the tool's messages. For example, a metadata contact is required in ISO metadata. The following warning indicates complete metadata contact information hasn't been provided: Validation failed: em:Metadata($a) --> em:contact($a, $b), em:CI_ResponsibleParty($b); that is, a metadata contact hasn't been provided at all, or the contact information provided doesn't follow the rules for contacts defined in the CI_ResponsibleParty information class in the ISO 19115 metadata standard.
After validation, the translator generates the output metadata XML file. Cardinality rules are tested at this time. If more than the expected number of elements exist, none of them will be written to the output metadata XML file. Some validation issues prevent the translator from generating valid output XML and will also be reported as warnings in this phase. For example, if a valid metadata contact hasn't been provided, this information can't be included in the output: Error [InvalidForSome]: <MD_Metadata> for-some clause: em:contact(v:Metadata, v:Object) <contact>; that is, one or more contact elements could not be added to the MD_Metadata element in the output XML file. This message is a warning even though it begins with the word error.
The Translator XML files that configure a translation are provided with ArcGIS Desktop in the installation location in the Metadata\Translator folder. If you open one of these files in an XML editor you'll see the translator element has an attribute stopOnErrors. This attribute can have one of three values: yes, no, or any. When including this tool in a model, you may prefer to copy one of the default Translators and change the stopOnErrors value to produce the desired behavior.
- no—the default value. Translation continues if warnings are encountered. If an error is encountered, translation stops and an incomplete output file will be created; this file will not likely contain well-formed XML. The tool completes successfully.
- yes—if a warning or error is encountered, translation stops. An incomplete output file will be created containing the translation results produced before the problem was encountered; this file will not likely contain well-formed XML. The tool completes successfully.
- any—if a warning or error is encountered, translation stops. No output file will be created, and the tool will fail.
Syntax
ESRITranslator_conversion (source, translator, {output}, {logfile})
Parameter | Explanation | Data Type |
source | The item whose metadata will be converted or a stand-alone XML file that will be converted. | Data Element; Layer |
translator | An XML file that defines the conversion that will be performed. The translator files provided with ArcGIS Desktop can be found in the <ArcGIS Installation Location>\Metadata\Translator folder. The following translators are provided:
A translator file must be specified. This tool does not have a default value for this parameter. | File |
output (Optional) | A stand-alone XML file that will be created containing the converted metadata. To check for problems in the metadata using the Esri Metadata Translator's translation engine and not produce an output XML file, provide the pound sign (#) instead of a file name. | File |
logfile (Optional) | A text file that will be created listing the warnings and errors that occurred during the conversion process. To export metadata without producing a log file, use the pound sign (#) instead of a file name. A log file will not be created when using the ArcGIS to FGDC translation even if a log file name is provided. | File |
Code sample
Export ArcGIS metadata
Exports ArcGIS metadata to an XML file that is formatted correctly for the ISO 19139 metadata standard.
import arcpy
from arcpy import env
env.workspace = "C:/data"
#set local variables
dir = arcpy.GetInstallInfo("desktop")["InstallDir"]
translator = dir + "Metadata/Translator/ESRI_ISO2ISO19139.xml"
arcpy.ESRITranslator_conversion ("locations.shp", translator,
"locations_19139.xml", "locations_19139.txt")
Environments
Licensing information
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes