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

Recommendation: Update Anchor Links to Match Case of Class Names & Add Anchors for all properties. #432

Open
kayaelle opened this issue May 16, 2022 · 3 comments

Comments

@kayaelle
Copy link
Contributor

It's not required for there to be anchor links but it's recommended to make classes and properties more efficiently accessible.

Recommendation: update/add anchor links for all properties and update anchors for class names to match case.

@amiller-ims
Copy link
Collaborator

I thought I'd share how the anchors are being generated now. I've omitted quite a bit, but this is the part that would be affected by your proposal:

Classes (e.g. Achievement)

<section id="{class mpsId}">
  <h3>{title}</h3>
  <table>
    <tr>
      <td>{property.name}</td>
      ...
   </tr>
  </table>
</section>

{class mpsId} is the Model Processing Service (MPS) id for the class. It looks like "org.1edtech.ob.v3p0.achievementsubject.class".

{title} is either a custom title for the section provided by the spec author, or the class name. In either case, Respec generates an id for the <h3> element from the contents of the header (which is either the custom title or the class name) by applying the lowerCase() function to the contents. That leads to id="achievement" for example.

As you can see, no id is currently provided for the individual properties. If an anchor id were generated, it could not be the property name because the same property name are used in so many classes.

I hope this information informs the discussion about improving the way data models are rendered.

@amiller-ims
Copy link
Collaborator

Is this so the context file naturally expands IRI to URLs pointing to a definition of a term? I was wrong to suggest using the data model as the target. The context only defines a term once, while the data model defines it every time it appears.

I think vocab file we created is a better target: https://github.com/IMSGlobal/openbadges-specification/blob/develop/ob_v3p0/vocab.html. I think we created it for this exact purpose.

I'll setup a GitHub action to publish the vocab.html file to GitHub pages so you can use it as the base for the IRIs in the context file. For example,

"achievement": {"@id": "https://imsglobal.github.io/openbadges-specification/vocab.html#Achievement", "@type": "@id"}

@danblickensderfer
Copy link
Contributor

Work group ok with moving this to Final

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

No branches or pull requests

3 participants