Skip to content
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

How to encode special characters in a list? #7

Open
edeutsch opened this issue Jul 6, 2018 · 1 comment
Open

How to encode special characters in a list? #7

edeutsch opened this issue Jul 6, 2018 · 1 comment

Comments

@edeutsch
Copy link
Contributor

edeutsch commented Jul 6, 2018

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?

@edeutsch
Copy link
Contributor Author

edeutsch commented Jul 6, 2018

ah, it looks like GitHub has neatly removed some backslashes, so the above examples make no sense. We'll need to move this issue to a Google doc or something to preserve formatting.

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

No branches or pull requests

1 participant