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

Display name vocabulary term #20

Open
korygin opened this issue Sep 17, 2018 · 12 comments
Open

Display name vocabulary term #20

korygin opened this issue Sep 17, 2018 · 12 comments
Labels

Comments

@korygin
Copy link

korygin commented Sep 17, 2018

Hello,

Are there any plans to define a standard vocabulary term for adding display name annotations to CSDL schema elements, such as properties, parameters, etc.? This seems to be a common issue OData APIs often have to address.

Thanks,

Alex Korygin

@ralfhandl
Copy link
Contributor

Hi Alex,

for API doumentation you can use Core.Description and Core.LongDescription.

Data visualization is a trickier topic, and depending on the concrete use cases the demand for annotations quickly diverges. Have a look at the SAP vocabularies SAP Common (which defines "Label", "QuickInfo", and much more) and SAP UI (which defines "Chart", "KPI", and also much more 😄) to see how complex this can quickly get, and whether you can find much beyond "Label" that could be standardized across multiple companies and software products.

Thanks
Ralf

@korygin
Copy link
Author

korygin commented Sep 18, 2018

Thanks, Ralf. I know very well how complex this can get. We also have our own vocabularies and even extended protocols defined on top of OData. Our vocabulary terms vary from primitive to complex types, their values can be static or resolved dynamically from the payload at run-time.
One of the things that we found consistent across multiple products though is the requirement to provide the display names / labels as well as the ability to logically group properties for displaying in UI widgets such as property grids. So I thought I would ask about the former since it appears to be a simpler case. :)

@oasis-tcs oasis-tcs deleted a comment from korygin Sep 18, 2018
@oasis-tcs oasis-tcs deleted a comment from korygin Sep 18, 2018
@ralfhandl

This comment has been minimized.

@ralfhandl
Copy link
Contributor

Yes, Common.Label and UI.FieldGroup were among the first terms we added. Yet even grouping properties isn't enough: just one grouping level, or subgroups? Just grid layout, or more closely grouped properties with group-specific arrangement? And so on.

That leaves the "label" / "display name" / "title" as the only candidate for a standard term...

@korygin
Copy link
Author

korygin commented Sep 19, 2018 via email

@ralfhandl
Copy link
Contributor

Hi Alex,

Yes, it would be a hard journey to get to an agreed and useful display/UI vocabulary. And it would be useful for others if we invest the time. After all we managed to get a standard Capabilities vocabulary going.

As you have your display vocabulary and have access to SAP's UI vocabulary you could go ahead and try to extract a common subset. If that works out, we can discuss on how to get to a standard vocabulary.

Would that work for you?

Thanks in advance
Ralf

@korygin
Copy link
Author

korygin commented Sep 20, 2018 via email

@korygin
Copy link
Author

korygin commented Sep 25, 2018 via email

@ralfhandl
Copy link
Contributor

Hi Alex,

That seems to be a good starting point. Below some explanations on why we did what we did.

Looking forward to your comments
Ralf

Remarks

  • Label can be added to any schema element. Heading is a special case for use in table column headers, and I'd rather have just one term in a standard vocabulary, e.g. DisplayName.

  • Text is to pair a "code/id" property to a corresponding string property containing a text for the code/id, e.g. CountryCode and CountryName.

  • ValueList: simple hierarchical dependency, e.g. Country - City, is covered by having multiple In or InOut parameters. Say a form contains a Country and a City input field, then the ValueList for City could point to an entity set with both fields in it, and have InOut parameters for Country and City. If a user has already filled in a Country, then the value list popup would only show cities for that country. If the Country field is empty, all cities would be shown, and picking a city would also fill the country field.

  • Title: that can be useful as a separate term, we've rolled it into HeaderInfo/Title.

  • HeaderInfo: yes, you can slice that in n different ways, one of the reasons why coming up with a standardized Display vocabulary is difficult 😄. The URLs typically are Path expressions pointing to a string property containing the URL.

  • FieldGroup: this is intentionally flat and represents a "mini form". Groups of groups we do via the Facet annotation: a collection facet contains multiple reference facets, each of which reference a field group. Reference facets can also reference charts, tables, ..., and you can nest the collection facets arbitrarily deep. Think of facets as a tree of nested "frames" whose leafs are then filled with concrete stuff. This allows grouping a chart with a list, grouping that group with a form, grouping that group with ....
    Took some discussion to come up with that separation of "group/frame inner node" and "concrete leaf node", and similar discussions in other organizations may very well come up with something completely different.

@korygin
Copy link
Author

korygin commented Sep 28, 2018

Hi Ralf,

  • Label - I agree that just one DisplayName term would be better

  • Text - it's a property path, isn't it? The thing that confused me was that the term's type is declared as Edm.String rather than Edm.PropertyPath.

  • ValueList - so, if I understand it correctly, both parent and child values are expected to be present in the same resource set (collection). If that's the case then the list is really "flat". It may be impossible to flatten some of our value lists because we have lists with an arbitrary hierarchy depth, some with as many as thousands of items. Also, our value lists can be exposed as contained entity sets, meaning in order to get to the list the client really needs to know predecessor(s) key(s). Another question would be how the client knows what form field needs to be updated based on selection made at the upper level of hierarchy if there is more than one input bound to the same list. For example, suppose there is a form with 4 drop-downs: Origin Country / Origin City and Destination Country / Destination City - all bound to the same list. If a new selection is made in Origin Country drop-down, how does the client know that only Origin City drop-down needs to be updated with the new list of cities, but not Destination City?

  • Title - again we are in agreement that a separate term may be useful.

  • HeaderInfo - I was just trying to avoid duplication. :) If an entity type has the header info with description and at the same time the core description annotation, which one should the client consider?

Thanks!

Alex

@korygin
Copy link
Author

korygin commented Mar 19, 2019

Hi Ralf,

Have there been any progress on the display vocabulary? Is there anything else I can help with to get this thing off the ground?

Thanks,

Alex

@ralfhandl
Copy link
Contributor

Hi Alex,

Sorry, we are currently busy with finalizing OData Version 4.01, so no progress on this topic.

Thanks
Ralf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants