Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

How to access the article id? #113

Closed
davidcmoulton opened this issue Mar 20, 2020 · 3 comments · Fixed by #118
Closed

How to access the article id? #113

davidcmoulton opened this issue Mar 20, 2020 · 3 comments · Fixed by #118
Labels
question Further information is requested released on @next

Comments

@davidcmoulton
Copy link
Collaborator

I need to access the id of an eLife article in order to be able to populate the lists introduced in #111. I think it's represented by the data structure described at https://github.com/stencila/thema/blob/next/src/examples/articleKitchenSink.json#L66(?) which is:

{
  ...
  "identifiers": [
    ...
    {
      "type": "PropertyValue",
      "name": "publisher-id",
      "propertyID": "https://registry.identifiers.org/registry/publisher-id",
      "value": "49574"
    },
    ...
  ]
  ...

It looks like the identifiers block maps to

@custom-selector :--identifiers [data-itemprop~='identifiers'];

in the generated selectors.css, but the individual identifier publisher-id doesn't have a selector.

Querying the DOM of each example artilce using e.g.

const ids = first(':--identifiers')
console.log(':--identifiers', ids)

returns null in the browser in all cases, suggesting that no identifiers are coming through as yet.

Is my understanding correct? Is there something extra I need to do in order to get this data, or does it depend on a change to Encoda to expose it?

@davidcmoulton davidcmoulton added the question Further information is requested label Mar 20, 2020
@nokome
Copy link
Member

nokome commented Mar 22, 2020

Is my understanding correct? Is there something extra I need to do in order to get this data, or does it depend on a change to Encoda to expose it?

Yes, your understanding is correct, there needs to be an update in Encoda to expose that. I will try to do that today.

nokome added a commit to stencila/encoda that referenced this issue Mar 25, 2020
This has been checked against GSDTT.

Related to #413 and stencila/thema#113.
@nokome
Copy link
Member

nokome commented Mar 25, 2020

I have implemented this in Encoda. Now for an eLife article, the identifiers property of an Article originally decoded from JATS, gets encoded in HTML as:

        <ul data-itemprop="identifiers">
          <li itemscope="" itemtype="http://schema.org/PropertyValue" itemprop="identifier">
            <meta itemprop="propertyID"
              content="https://registry.identifiers.org/registry/publisher-id"><span
              itemprop="name">publisher-id</span><span itemprop="value">50356</span></li>
          <li itemscope="" itemtype="http://schema.org/PropertyValue" itemprop="identifier">
            <meta itemprop="propertyID" content="https://registry.identifiers.org/registry/doi">
            <span itemprop="name">doi</span><span itemprop="value">10.7554/eLife.50356</span></li>
          <li itemscope="" itemtype="http://schema.org/PropertyValue" itemprop="identifier">
            <meta itemprop="propertyID"
              content="https://registry.identifiers.org/registry/elocation-id"><span
              itemprop="name">elocation-id</span><span itemprop="value">e50356</span></li>
        </ul>

I have tested this against https://search.google.com/structured-data/testing-tool/ and it looks good there:

image

Note that the id name and value are spans so will be visible in all themes without some specific styling.

I shall follow up with a PR that upgrades the version of Encoda (which should be in the process of getting released as I write).

nokome added a commit that referenced this issue Mar 25, 2020
@stencila-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 1.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested released on @next
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants