Ask Pathway Tools logo   Pathway Tools Question & Answer forum for SRI's Pathway Tools

Ask Your Question
0

HTML tags and entites supported in pathway tools

asked 2020-07-03 08:46:59 -0500

mdubois gravatar image

updated 2020-07-03 08:49:37 -0500

Dear all,

It is possible to include some HTML tags (for example <i>) and entities (for example &alpha;) in various fields.

I have found various documents that present a subset of the supported tags and entities but I would like to know if the exact list can be found somewhere.

Thanks in advance, Mathieu

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-07-03 15:10:17 -0500

Suzanne Paley gravatar image

Yes, for name, comment (summary), and some other fields, many html tags and entities are supported. If there are other fields you are asking about, let me know what they are, and I can check for you. I don't think we have an exact list anywhere -- we tend to add them as we discover we need them. For the &; entities, we support all the greek letters and many others, e.g. plusmn, ge, le, gt, lt, reg, copy, trade, rarr, larr, harr, deg, dagger, bull and more. We also accept many accented characters, but convert them to the corresponding non-accented versions for display in the desktop software (some of the above-mentioned entities are also converted to standard ascii for display in the desktop software). The tags we accept are i, b, strong, em, u, sup, sub, h1, h2, h3, br, a, img. Other tags are accepted but ignored for desktop display.

If there are other tags or entities you need, let us know, and we may be able to add support for them, but probably not if they involve complicated formatting (e.g. tables, lists, grids, flexboxes). And we can't support css style directives in the desktop software.

If you run Pathway Tools as a web server, then any tags and entities will be passed through to the web output, even if they can't be displayed optimally in the desktop software, so it can still be worth including them.

edit flag offensive delete link more

Comments

Thanks for the detailed explanation. To give you some context, we extract some information from frames into an SQL DB (this is used to display results on MicroScope) and we would like to remove tags and entities from the name of reactions and compounds (to ease queries). I guess that the rules for names are a bit more strict (for instance, I think that <img> is not allowed). However, that still left a lot of possibilities. So I am looking for rules that could help me to automatize this process.

mdubois gravatar imagemdubois ( 2020-07-03 17:57:40 -0500 )edit

I don't suppose you are using the Lisp API, are you? We have a lisp function strip-html-tags that does this.

Suzanne Paley gravatar imageSuzanne Paley ( 2020-07-04 11:39:06 -0500 )edit

BTW, for names, I expect the only tags you are likely to come across would be i, sup, sub and maybe b. However, there are lots of &; entities that can appear in names.

Suzanne Paley gravatar imageSuzanne Paley ( 2020-07-04 11:43:22 -0500 )edit

Thanks Suzanne. We are using the LISP API: a Java program sends commands to the LISP interpreter and transform the results into Java objects which are inserted into an SQL DB. So I think we can use the function you pointed out. Is there a documentation somewhere ?

mdubois gravatar imagemdubois ( 2020-07-05 14:55:55 -0500 )edit

We don't seem to have it documented anywhere, but it's very straightforward, takes a string as argument and outputs a string with appropriate tag removal and substitutions. Here are some examples:
EC(19): (strip-html-tags "(1,4-α-D-glucosyl)n-glucosyl glucogenin")
"(1,4-alpha-D-glucosyl)n-glucosyl glucogenin"
EC(20): (strip-html-tags "β-D-Glc-(1→4)-β-D-Glc-(1→3)-α-D-Gal-diphosphoundecaprenol")
"beta-D-Glc-(1->4)-beta-D-Glc-(1->3)-alpha-D-Gal-diphosphoundecaprenol"
EC(21): (strip-html-tags "(24R,25R)-3α,7α,12α,24-tetrahydroxy-5β-cholestanoyl CoA")
"(24R,25R)-3alpha,7alpha,12alpha,24-tetrahydroxy-5beta-cholestanoyl CoA"
EC(22): (strip-html-tags "(-)-endo-α-bergamotene")
"(-)-endo-alpha-bergamotene"

Suzanne Paley gravatar imageSuzanne Paley ( 2020-07-07 00:38:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-03 08:46:59 -0500

Seen: 594 times

Last updated: Jul 03