Skip to content

How to encode special characters in a list? #7

@edeutsch

Description

@edeutsch

There will be a need to encode special characters in the data that will sometimes interfere with parsing. We should address this in the spec.

Proposed general rules:

  • A backslash anywhere in the description line MUST be escaped with the backslash character
  • Open and close parentheses or square brackets in the data MUST be escaped with the backslash character
  • A pipe character ( | ) in pipe-separated-value (PSV) fields MUST be escaped with the backslash character, but only MAY be separated in ordinary fields

In a scalar value:
Wrong: \GName=EPB\41
Correct: \GName=EPB\41
Wrong: \Comment=I like \crazy characters
Correct: \Comment=I like \crazy characters
Wrong: \Comment=I like parentheses like this ()
Correct: \Comment=I like parentheses like this ()

In a list:
Wrong: \PName=(Nucleolar protein \NOP5)(Nucleolar protein 5(five))
Correct: \PName=(Nucleolar protein \NOP5)(Nucleolar protein 5(five))
Wrong: \PName=(EPB\41)(PAR)53)(PAR[53])
Correct: \PName=(EPB\41)(PAR)53)(PAR[53])
Correct: \PName=(sp|O75530|EED_HUMAN) okay because \PName is not a PSV field
Correct: \PName=(sp|O75530|EED_HUMAN)
Wrong: \VariantSimple=(1|I)(21|K|dbSNP|COS[]MIC) if the optionalTag is "dbSNP|COS[]MIC"
Correct: \VariantSimple=(1|I)(21|K|dbSNP|COS[]MIC)
Correct: \VariantSimple=(1|I)(21|K|[dbSNP][COS[]MIC])

icky. But it must be dealt with. XML neatly avoids all these problems.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions