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

OpenAlex web and JSON translator #3269

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

adam3smith
Copy link
Collaborator

No description provided.

OpenAlex JSON.js Outdated Show resolved Hide resolved
OpenAlex JSON.js Show resolved Hide resolved
OpenAlex.js Outdated


function detectWeb(doc, url) {
if (url.includes('/works/w')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that it matches the regex we're using below, just in case - don't want to detect and then throw an error in doWeb()

Co-authored-by: Abe Jellinek <jellinek@berkeley.edu>
@adam3smith adam3smith marked this pull request as draft March 15, 2024 20:37
@adam3smith adam3smith marked this pull request as ready for review March 15, 2024 21:13
@bjohas
Copy link

bjohas commented Mar 23, 2024

This is great, many thanks!

Can I check whether the translator will add the openalex id to the Zotero record?

@adam3smith
Copy link
Collaborator Author

Ah, no. What would be the right format? I understand that they like the namespace prefix to be included? So openalex.org/W12345 ?

adam3smith added a commit to adam3smith/utilities-1 that referenced this pull request Mar 29, 2024
OpenAlex JSON.js Outdated
@@ -165,6 +165,7 @@ function parseIndividual(data) {
for (let tag of tags) {
item.tags.push(tag.keyword);
}
item.extra = "openalex: " + data.ids.openalex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe capitalize? The site seems to use "OpenAlex" consistently.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a key:value pair, I figured I'd use the key that they use from their API? also more consistent with general Zotero & CSL variable naming. Happy to change though, obviously doesn't make a huge difference either way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We capitalize other identifier names in Extra, e.g. "ADS Bibcode".

@adam3smith
Copy link
Collaborator Author

@AbeJellinek I think this should be all set

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

Successfully merging this pull request may close these issues.

None yet

3 participants