Menu

#152 Metadata key values - Old and new underscores now rendered as Space

For Review
open
nobody
None
5
2014-11-11
2014-09-18
Alex
No

ORC Trove: https://labtrove.orc.soton.ac.uk/

Under the "Component" and "Equipment" keys in my HALO notebook summary, a lot of the values are duplicated although they are identical (defined in earlier post and selected from dropdown list in new post). See https://labtrove.orc.soton.ac.uk/halo

This is also seen in the post view. See https://labtrove.orc.soton.ac.uk/halo/288/Time_delay_relay_for_seed_laser_and_amplifier.html

Discussion

  • Tim Parkinson

    Tim Parkinson - 2014-09-19

    In HALO notebook, I can see duplicated:
    Component: Hamamatsu G12183-003K
    Equipment: Manlight ML20-CW-R-TKS-1550

    I agree that you should only see one copy of each one with a count of two per key.
    I will have a delve into the database to see if there are any loose spaces in any of the values.

     

    Last edit: Tim Parkinson 2014-09-22
  • Tim Parkinson

    Tim Parkinson - 2014-09-19

    ....... but I don't think I'll find one because both copies seem to point to the same notebook entry.

     
  • Tim Parkinson

    Tim Parkinson - 2014-09-19

    There is an unpublished draft revision of the "Time delay relay..." entry.
    I wonder if that is significant? If the draft isn't going to be published then
    could you try deleting the draft to see if the duplicate values go away?
    (Or finish and publish the draft).

     
  • Tim Parkinson

    Tim Parkinson - 2014-09-19

    Can't reproduce on Aurora test machine.
    I notice that when I try to export your Time delay relay entry as XML then it seems to fail to do so. Database digging required I think (or a different browser first).

     
  • Tim Parkinson

    Tim Parkinson - 2014-09-22

    LabTrove seems to think there are two slightly distinct values for the two duplicated values:

    <a href="https://labtrove.orc.soton.ac.uk/halo/meta/COMPONENT/value/Hamamatsu%2BG12183-003K">Hamamatsu G12183-003K</a>
    <a href="https://labtrove.orc.soton.ac.uk/halo/meta/COMPONENT/value/Hamamatsu_G12183-003K">Hamamatsu G12183-003K</a>
    

    and

    <a href="https://labtrove.orc.soton.ac.uk/halo/meta/EQUIPMENT/value/Manlight%2BML20-CW-R-TKS-1550">Manlight ML20-CW-R-TKS-1550</a>
    <a href="https://labtrove.orc.soton.ac.uk/halo/meta/EQUIPMENT/value/Manlight_ML20-CW-R-TKS-1550">Manlight ML20-CW-R-TKS-1550</a>
    

    Each duplicated value has one version where the space has been encoded as a '_' and another where the space has been encoded as a '+' (%2B').

    This could be something to do with the browser's Encoding or it could be that LabTrove encodes values in different ways depending on the paths through the code. (My money is on the latter).

    Alex, can you remember if you saved drafts from different browsers or from different machines (with the same or different browser)?

     
  • Alex

    Alex - 2014-09-22

    All done on same browser on same machine. I remember seeing the '_' take the place of spaces in key values on earlier posts, but not on the recent post.

     
  • Alex

    Alex - 2014-11-11

    Tim, has this progressed any further? I'm about to start using LabTrove again in vain and could do with a solid answer. Even if it's just deleting the duplicate metadata entries and associating the posts that include the deleted entry with the newer entry instead. There aren't many entries so doing this by hand would take 5 minutes.

     
  • Tim Parkinson

    Tim Parkinson - 2014-11-11

    Sorry Alex, I seem to have let this drift.

    There is a bug but there is also a workaround.
    Before roundabout July this year, what used to happen is that Values containing spaces had those spaces turned into and stored as underscores '_' and displayed as underscores in future.

    Then we 'improved' LabTrove so that Values could consist of a wider range of characters
    including spaces ' ' which would then be translated into %20 (web URI style) and stored as %20 but displayed as space which is what people wanted.

    However we did not consider what would happen to existing entries in existing notebooks and this is what has affected you. Your later entries have spaces in the values
    ("Manlight ML20-CW-R-TKS-1550" and "Hamamatsu G12183-003K" ) but the older entries
    have underscores that are displayed as underscores with the entry body but spaces on the sidebar so they look the same but (as you point out)
    are counted as distinct in the sidebar summary.
    In addition , if someone adds a key-value
    metadata pair to a new entry and the value really does contain an underscore, then LabTrove will render it as a space on the sidebar. This is a bug we need to fix.

    Your workaround (as you have guessed) is to edit the old entries and change the values to have a space instead of an underscore and republish the entries.
    The sidebar counts will then be correct at the cost of
    perhaps having to link to a new URI if you have referenced those entries from anywhere else.

    Those old entries are: https://labtrove.orc.soton.ac.uk/halo/193/ISRUZ_1550nm_fibre_laser_power_curve_postrepair.html and https://labtrove.orc.soton.ac.uk/halo/141/Photodiode_selection_for_amplifier_stage_cutouts.html
    (as you probably know).

     
  • Tim Parkinson

    Tim Parkinson - 2014-11-11
    • summary: Metadata key values duplicated --> Metadata key values - Old and new underscores now rendered as Space
     
  • Tim Parkinson

    Tim Parkinson - 2014-11-11

    Developers.
    I've updated the Summary to reflect the remaining bug.

    1) Publishing an Entry with a metadata key value containing an underscore will show the underscore with the Entry view but will render the value with a space instead of the underscore on both the sidebar and the metadata drop-down list.
    2) Any old Troves with Entries having metadata key values containing underscores (originally meant to be spaces) will exhibit the same symptoms and new/updated entries with the same value will appear to duplicate key/values as Alex's example.
    We need to check any such troves and migrate them somehow.

     

Log in to post a comment.

MongoDB Logo MongoDB