IHTSDO / snow-owl

Snow Owl Terminology Server. This version is no longer maintained. Please use the upstream version or the alternate Snowstorm Terminology Server.
Apache License 2.0
11 stars 1 forks source link

WRP-2860: Present concept hierarchy and description search results using preferred synonym or FSN #18

Closed apeteri closed 8 years ago

apeteri commented 8 years ago

This PR introduces the query parameter preferredDescriptionType to the browser endpoint's getConceptChildren and searchDescriptions methods, and converts them to use internal requests.

The default (and backwards compatible) behaviour is to retrieve the FSN for all results, making them available on property fsn; setting this parameter to SYNONYM will collect preferred synonyms instead and sets the term on property preferredSynonym. Only one of these properties will be set, depending on the current value of preferredDescriptionType.

For performance reasons, the isLeaf*** values on concepts returned from getConceptChildren will only be valid for the tree determined by the form query parameter, the other value will always be set to false; eg. if the inferred tree is queried, only the isLeafInferred value will be set accordingly.

The Accept-Language header controls the order of preference in which language reference sets will be checked for a preferred description. Non-international dialects should be specified with the -x- extension notation, eg. an Accept-Language header with the value of da-DK-x-554461000005103;q=0.8,en-US;q=0.5 will check the presence of a description preferred in the Danish language reference set, and if no such FSN or SYN is present, falls back to the US English preferred one.

kaicode commented 8 years ago

This is looking good but a new commit indicates it might still be in progress. Will check with you in the morning 👻