Skip to content

metadata XML upload #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Sep 22, 2012
Merged

metadata XML upload #394

merged 25 commits into from
Sep 22, 2012

Conversation

tomkralidis
Copy link
Member

This PR allows for users to upload an XML metadata document as part of their data upload. Notes:

  • on new data upload, if user chooses XML field, title and abstract are disabled and values will be picked up by XML metadata parser/setter
  • layers uploaded with XML metadata can update their metadata by uploading a new XML document
  • the XML metadata document (on create or update) is processed and set with GeoNode specific values (URLs, etc.) before being set in the DB
  • supports Dublin Core, FGDC CSDGM and ISO 19139:2007

This will likely bring up issues of signals and what fields should go where again, hence I've not included tests until we agree (where tests will go will depend on this discussion).


if 'xml' in files:
md_xml, md_title, md_abstract = update_metadata(layer_uuid, open(files['xml']).read(), saved_layer)
Layer.objects.filter(uuid=layer_uuid).update(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This model update looks a lot like the 4 lines following (492-495). Is there something I'm missing?

@ingenieroariel
Copy link
Member

The use case we have in the bank for this is the following:

We receive the metadata from consultants in ISO format, but would like to use GeoNode to keep it up to date. Using GeoNode as a metadata editor, since the people editing it are not going to be the ones who created it in the first place.

As such, the main use for this functionality would be to upload data in xml format (for the initial values) and edit after that. This pull request blocks the ability for people to edit metadata even if they had an xml file that only contained title and nothing else, as such I am -1 on merging it until editing metadata is supported.

@jj0hns0n
Copy link
Contributor

To be clear, @ingenieroariel, you want the user to be able to upload xml
metadata, then edit it via the metadata editor? @tomkralidis, I know we
have discussed several pitfalls and problems with this use case, can you
elaborate on those?

On Wed, Sep 19, 2012 at 9:04 AM, Ariel Núñez [email protected]:

The use case we have in the bank for this is the following:

We receive the metadata from consultants in ISO format, but would like to
use GeoNode to keep it up to date. Using GeoNode as a metadata editor,
since the people editing it are not going to be the ones who created it in
the first place.

As such, the main use for this functionality would be to upload data in
xml format (for the initial values) and edit after that. This pull request
blocks the ability for people to edit metadata even if they had an xml file
that only contained title and nothing else, as such I am -1 on merging it
until editing metadata is supported.


Reply to this email directly or view it on GitHubhttps://github.com//pull/394#issuecomment-8696125.

@tomkralidis
Copy link
Member Author

@ingenieroariel the main drawback is that if someone uploads a rich XML document, given that GeoNode's Layer model is a limited subset, parsing the XML to GeoNode model.will result in a lossy transfer.

The blocking is by design so that edits are done via XML if XML was the initial upload mechanism (if I had an XML document with a single element, I wouldn't upload it at all and just use the editor).

This has been discussed previously, and is a known limitation.

Options:

  • If we want full XML document <-> GeoNode model compatibility, this requires some heavy lifting on the model, as well as the front end UI (which was not in scope of this PR)
  • if we are okay with having XML uploaded and then discarded to make way for quickly filling in the form by way of XML upload, then we can remove the hooks that force 'edit by XML upload only', and always save XML to the DB per ISO

@jj0hns0n
Copy link
Contributor

I think we need to go with this second option here in the short term and
then look into the first option in more detail at some later date.
Basically chalk up this lossiness as a known limitation.

On Wed, Sep 19, 2012 at 9:49 AM, Tom Kralidis [email protected]:

@ingenieroariel https://github.com/ingenieroariel the main drawback is
that if someone uploads a rich XML document, given that GeoNode's Layer
model is a limited subset, parsing the XML to GeoNode model.will result in
a lossy transfer.

The blocking is by design so that edits are done via XML if XML was the
initial upload mechanism (if I had an XML document with a single element, I
wouldn't upload it at all and just use the editor).

This has been discussed previously, and is a known limitation.

Options:

  • If we want full XML document <-> GeoNode model compatibility, this
    requires some heavy lifting on the model, as well as the front end UI
    (which was not in scope of this PR)

  • if we are okay with having XML uploaded and then discarded to make
    way for quickly filling in the form by way of XML upload, then we can
    remove the hooks that force 'edit by XML upload only', and always save XML
    to the DB per ISO


    Reply to this email directly or view it on GitHubhttps://github.com/metadata XML upload #394#issuecomment-8697660.

@ingenieroariel
Copy link
Member

I agree with Jeffrey, let's go with option 2.

On Wed, Sep 19, 2012 at 12:52 PM, Jeffrey Johnson
[email protected]:

I think we need to go with this second option here in the short term and
then look into the first option in more detail at some later date.
Basically chalk up this lossiness as a known limitation.

On Wed, Sep 19, 2012 at 9:49 AM, Tom Kralidis [email protected]:

@ingenieroariel https://github.com/ingenieroariel the main drawback
is
that if someone uploads a rich XML document, given that GeoNode's Layer
model is a limited subset, parsing the XML to GeoNode model.will result
in
a lossy transfer.

The blocking is by design so that edits are done via XML if XML was the
initial upload mechanism (if I had an XML document with a single
element, I
wouldn't upload it at all and just use the editor).

This has been discussed previously, and is a known limitation.

Options:

  • If we want full XML document <-> GeoNode model compatibility, this
    requires some heavy lifting on the model, as well as the front end UI
    (which was not in scope of this PR)
  • if we are okay with having XML uploaded and then discarded to make
    way for quickly filling in the form by way of XML upload, then we can
    remove the hooks that force 'edit by XML upload only', and always save
    XML
    to the DB per ISO


Reply to this email directly or view it on GitHub<
https://github.com/GeoNode/geonode/pull/394#issuecomment-8697660>.


Reply to this email directly or view it on GitHubhttps://github.com//pull/394#issuecomment-8697773.

@jj0hns0n
Copy link
Contributor

I think its even ok to include this kind of 'warning' right in the form
itself. I.e. if metadata was originally uploaded, and then the user tries
to edit it with the editor, just show a warning in the page that notifies
them that some of their original metadata could be lost. Not sure if we
can actually determine if it will be lost, but if so, then just show it
then.

On Wed, Sep 19, 2012 at 9:54 AM, Ariel Núñez [email protected]:

I agree with Jeffrey, let's go with option 2.

On Wed, Sep 19, 2012 at 12:52 PM, Jeffrey Johnson
[email protected]:

I think we need to go with this second option here in the short term and
then look into the first option in more detail at some later date.
Basically chalk up this lossiness as a known limitation.

On Wed, Sep 19, 2012 at 9:49 AM, Tom Kralidis [email protected]:

@ingenieroariel https://github.com/ingenieroariel the main drawback
is
that if someone uploads a rich XML document, given that GeoNode's
Layer
model is a limited subset, parsing the XML to GeoNode model.will
result
in
a lossy transfer.

The blocking is by design so that edits are done via XML if XML was
the
initial upload mechanism (if I had an XML document with a single
element, I
wouldn't upload it at all and just use the editor).

This has been discussed previously, and is a known limitation.

Options:

  • If we want full XML document <-> GeoNode model compatibility, this
    requires some heavy lifting on the model, as well as the front end UI
    (which was not in scope of this PR)
  • if we are okay with having XML uploaded and then discarded to make
    way for quickly filling in the form by way of XML upload, then we can
    remove the hooks that force 'edit by XML upload only', and always save
    XML
    to the DB per ISO


Reply to this email directly or view it on GitHub<
https://github.com/GeoNode/geonode/pull/394#issuecomment-8697660>.


Reply to this email directly or view it on GitHub<
https://github.com/GeoNode/geonode/pull/394#issuecomment-8697773>.


Reply to this email directly or view it on GitHubhttps://github.com//pull/394#issuecomment-8697859.

@tomkralidis
Copy link
Member Author

@ingenieroariel @jj0hns0n : updates made per recommendation. For review and comment.

ingenieroariel added a commit that referenced this pull request Sep 22, 2012
@ingenieroariel ingenieroariel merged commit f498818 into GeoNode:dev Sep 22, 2012
cspanring pushed a commit to MAPC/geonode that referenced this pull request Feb 6, 2013
cspanring pushed a commit to MAPC/geonode that referenced this pull request Feb 6, 2013
marthamareal pushed a commit to marthamareal/geonode that referenced this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants