Skip to content

Feature/orcid push#4125

Open
ivanmrsulja wants to merge 24 commits into
vivo-project:mainfrom
ivanmrsulja:feature/orcid-push
Open

Feature/orcid push#4125
ivanmrsulja wants to merge 24 commits into
vivo-project:mainfrom
ivanmrsulja:feature/orcid-push

Conversation

@ivanmrsulja

@ivanmrsulja ivanmrsulja commented Nov 28, 2025

Copy link
Copy Markdown
Member

Issues: #4074, #4075

linked Vitro PR: 504

What does this pull request do?

Integrates ORCID push workflow using Member API credentials.

What's new?

  • edu.cornell.mannlib.vivo.orcid.controller.OrcidDisallowPushHandler
  • edu.cornell.mannlib.vivo.orcid.controller.OrcidAllowPushHandler
  • edu.cornell.mannlib.vivo.orcid.controller.OrcidMemberCallbackHandler
  • edu.cornell.mannlib.vivo.orcid.export
  • edu.cornell.mannlib.vivo.orcid.service
  • edu.cornell.mannlib.vivo.orcid.util

How should this be tested?

Configure VIVO ORCID credentials in runtime.properties file (Ask @chenejac for sandbox credentials). Navigate to researcher profile when logged in as researcher (you can bind researcher account to any person entity). Click on Allow ORCID push and complete the OAuth2 workflow (keep in mind that you will have to create ORCID Sandbox account beforehand, your regular ORCID account won't work). After this, periodic dissemination of research information should be performed to your ORCID profile.

Interested parties

@chenejac

Reviewers' expertise

Please add any new expertise in the list which might be needed for reviewing your PR or remove any of the listed if it is not needed.

Candidates for reviewing this PR should have some of the following expertises:

  1. Java
  2. HTML, CSS, JavaScript
  3. FreeMarker
  4. SPARQL

occ.getSetting(OrcidClientContext.Setting.WEBAPP_BASE_URL) +
occ.getSetting(OrcidClientContext.Setting.CALLBACK_PATH);

String authUrl = "https://sandbox.orcid.org/oauth/authorize" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why sandbox?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Left by mistake, fixed it now 😄


if (converterClass == null) {
return null; // should never happen
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this level of generalization here? Can we just introduce OrcidObjectConverter interface which will be implemented by EducationConverter, WorkConverter, etc with toOrcidModel method instead? Is this approach applied at some other parts of VIVO/Vitro which you just adopted?

Comment on lines +5 to +15
public static String FIND_ALL_EDUCATION =
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" +
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n" +
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n" +
"PREFIX owl: <http://www.w3.org/2002/07/owl#>\n" +
"PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>\n" +
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n" +
"PREFIX obo: <http://purl.obolibrary.org/obo/>\n" +
"PREFIX vivo: <http://vivoweb.org/ontology/core#>\n" +
"PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>\n" +
"PREFIX bibo: <http://purl.org/ontology/bibo/>\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we consider moving those SPARQL queries to n3 files, to make it configurable without changing java code, building, deploying, etc? Might be that some institutions would like to add some filters, additional criteria.


:vitrodocumentModifier_organizations_filter
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryI18nDocumentModifier> ,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file changes are part of this task (pushing data into ORCID)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It wasn't, my mistake, I removed it from PR. Thanks for noticing!

vitro-search:facetResults true ;
vitro-search:filterField :field_organizations ;
vitro-search:id "organizations" ;
vitro-search:isUriValues true ;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file changes are part of this task (pushing data into ORCID)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above, removed from PR.

@@ -0,0 +1,26 @@
{
"Book": "book",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ivanmrsulja can you use here the full URI as a key? This short key might introduce some issues in some cases.

WHERE {
<%s> vivo:relatedBy ?authorship .
?authorship vivo:relates ?resource .
?resource <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?workType .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ivanmrsulja instead of mostSpecificType to use rdf:type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ivanmrsulja without using rdf:type subclasses wouldn't have proper orcid types. So rdf:type should be used.


OPTIONAL {
?resource vivo:dateTimeValue ?dtValue .
?dtValue vivo:dateTime ?publicationDate .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Date time precision should be taken into account

}
}

FILTER (STR(?resource) > "%s")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest to get the instances to be pushed in the first run and collect information for data export in another run. In current state SPARQL queries look complicated and not efficient.


private static Map<String, String> loadWorkTypeMappings() {
try (InputStream is = WorkConverter.class
.getClassLoader()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest to move type mapping inside sparql query.

}

@Nullable
private Class<?> getConverterClass(ExportSet exportSet) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would suggest to avoid using reflection api. It creates more safety issues and complicates the code, so it should be avoided, especially for new code.

@litvinovg

litvinovg commented Jun 18, 2026

Copy link
Copy Markdown
Member

@ivanmrsulja I tried to test export for person positions, but it didn't work for me for some reason. Could you extend test instructions on what data should be entered for testing pushing different types of data?

@chenejac

Copy link
Copy Markdown
Contributor

@ivanmrsulja I tried to test export for person positions, but it didn't work for me for some reason. Could you extend test instructions on what data should be entered for testing pushing different types of data?

I believe required fields are specified here - https://info.orcid.org/documentation/integration-guide/admin-guide-to-affiliations/#Required

It means affiliation should be linked with Organisation which is described with name, city, country and rorId.

@chenejac chenejac mentioned this pull request Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push VIVO employment / education information into the ORCID affiliation record Push VIVO works information into the ORCID registry

3 participants