-
Notifications
You must be signed in to change notification settings - Fork 491
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
CVOC 9276 Initializing integration of ontoportal #10145
CVOC 9276 Initializing integration of ontoportal #10145
Conversation
…cabulary configuration options in order to support ontoportal service
} | ||
|
||
if(cvocUiUrl != null) { | ||
term = term.replace(cvocUiUrl, cvocUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason the script couldn't use the correct term? It could still get the Ui form for display/front-end query purposes.
…es function to work with double parameters of ontoportal retrievalUri
@@ -466,6 +496,11 @@ public void registerExternalTerm(JsonObject cvocEntry, String term) { | |||
} | |||
} | |||
} | |||
|
|||
if(isOntoportal) { | |||
isExternal = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's POC do not keep it. won't work with free text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A workaround would be to use https://
as uriSpace
if (headers == null) { | ||
headers = Json.createObjectBuilder().build(); | ||
} | ||
|
||
boolean isExternal = false; | ||
JsonObject vocabs = cvocEntry.getJsonObject("vocabs"); | ||
for (String key: vocabs.keySet()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix it with && allow-free-text == false
logger.fine("protocol:"+ cvocEntry.getString("protocol")); | ||
String[] values = new String[2]; | ||
values[0] = dfv.getValue(); | ||
if("ontoportal".equals(cvocEntry.getString("protocol"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we want for all protocol to just share managed-fields and have a way to do it better using java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition could be if retrievalUri
has more than {0}
search for the the fields that are named ex: {vocabularyName}/classes/{term-uri-field}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: This appears to work for me to get the values for the other child fields with the same parent:
if(dft.getParentDatasetFieldType()!=null) {
logger.info("Parent is " + dft.getParentDatasetFieldType().getName());
for(DatasetField dfc: df.getParentDatasetFieldCompoundValue().getChildDatasetFields()) {
logger.info("Found value: " + dfc.getValue());
}
}
Does that do what you need (along with checking the fdc.getDatasetFieldType to be able to match against the type name)?
Following the call on Google group discussion "Controlled Vocabularies : Integrate Ontoportal as a new supported third-party vocabulary service"; All the work around Ontoportal integration will be handled with small PRs of generic code (closing this POC). |
What this PR does / why we need it:
The PR is set as draft as it's a first part of a long development and discussion with Dataverse members.
This PR is the result of tests, work on a Proof of Concept to support Agroportal (one instance of Ontoportal).
The goal was to try to implement Ontoportal using Ontoportal API + apikey (required by Ontoportal API Endpoints) starting from skosmos.js and cvoc-conf.json.
We decided to try to hide as possible the apikey and share not API but rather UI Urls for
keywordTermURL
andkeywordVocabularyURI
.This PR adds some external controlled vocabulary configuration options in order to support ontoportal service.
Options are :
cvoc-ui-url
a url of human interface wherecvoc-url
is the api urlheaders
that allows to add some headers required by thecvoc-url
, in Ontoportal case the apikey.headers
option may not be enough on security matter, an idea is to have a proxy application that is used just to hide the apikey (as a java http request with apikey in header cannot be seen).For example :
cvoc-url=https://demo.dataverse.org/ontoportal_proxy
that will request API enpoints ofhttps://data.agroportal.lirmm.fr
. Such a proxy must handle good CORS parameters.Which issue(s) this PR closes:
Starts developments for #9276
Suggestions on how to test this:
Here are the files that have been used to make it work under
develop
branch :Demo:
agroportal_demo.mp4
Other informations:
@DS-INRA will reach out soon to ask for a meeting
PR description will be improved every time possible.