Hello lists,
when inserting metadata into GeoNetwork (tested with GN 2.4.1) it changes
the metadata. It happens both when doing file insert and when doing
copy/paste insert.
First: in the process of insertion, the method
"setNamespacePrefixUsingSchemas(Element md)" adds prefixes to the default
namespace, essentially removing the default namespace and making it a
qualified, additional namespace. Why is that?
The metadata does not become more or less valid in doing this, and when
processed by e.g. XSLT or any other metadata-reading function, there should
be no difference at all. However if the user later on adds new elements
without prefixing them with a namespace, those new elements will not be in
any namespace (certain to invalidate the XML). So the *behaviour* of the
document is changed quite lots by this namespace-changing operation. Seems
to me that GeoNetwork is making choices here that the user did not ask for !
Second: the insertion process continues and applies the XSLT
"update-fixed-info.xsl". This changes lots of things in the metadata,
including :
- it inserts gmd:fileIdentifier, if it is not present in the metadata
- it overwrites gmd:dateStamp, gmd:metadataStandardName,
gmd:metadataStandardVersion
- it generates values for gml:id attributes
- it sets a hard-coded value to attribute srsName, if it's empty
- it inserts attribute gco:nilReason="missing" for empty gco:CharacterString
elements
- it autocompletes relative locations for codelists to an absolute location
- it does something incomprehensible to gmd:linkage, in some cases
- it does something, incl. uppercasing, to gmd:languageCode
Now, it has been stated by various people on this list recently that
GeoNetwork should not take any action changing metadata (see the discussions
on the editor saving empty optional elements and missing elements from
OGCWXS harvesting). The reason to oppose any action by GeoNetwork towards
more valid metadata being: <quote>[to avoid] the kind of "We know what you
want" type of behavior</quote>.
So if we wish to be consistent in that approach, GN should not mess with the
metadata when it is inserted. Therefore I think we should remove the
functions described above. Any reason why not ?
Kind regards
Heikki Doeleman