gdcc / dataverse-external-vocab-support Goto Github PK
View Code? Open in Web Editor NEWScripts and material related to using external vocabulary services with Dataverse
License: Apache License 2.0
Scripts and material related to using external vocabulary services with Dataverse
License: Apache License 2.0
Free text is allowed:
But you get a validation error (the normal one: "Validation Error โ Required fields were missed or there was a validation error. Please scroll down to see details.") and when you scroll down, there are no errors. No * with a hint of what to fix. Nothing in server.log, nothing in the JS console.
@qqmyers says the free text stuff should be controlled by this (so not Dataverse code):
(that's the commit I tested on, by the way, 6055e9a).The ROR community has some type-ahead demos that use Bloodhound. See https://github.com/ror-community/ror-typeahead-demos . It should be possible to adapt our existing script to use Bloodhound and/or other aspects of the demos' designs if it looks like they have advantages (or just to reduce the amount of custom code we have).
The proposal of the issue is to permit HTTP headers customization with external controlled vocabulary services. This headers will be use when Dataverse make request to external vocabulary services.
This issue is linked to IQSS/dataverse#10316
UNESCO and Agrovoc were presented as selections in a type-ahead. We'd want to use a dropdown to handle these two selections instead.
The field names were updated in the metadata block but not in the example json config. The example cvocconf.json needs to be updated - basically cut/paste the new names from the block. See #8214.
I picked up IQSS/dataverse#9150 but I've been a bit blocked by a working example of an external vocab script.
I tried getting the ROR/Author Affiliation script working, which I had tested early on when this (awesome) PR was created:
However, as of IQSS/dataverse@ecc23c0ebf (post 5.12.1 "develop" branch), the affiliation script doesn't seem to "just work" anymore.
I have a theory that it's breaking because an extra div was introduced in line 286 in this commit: IQSS/dataverse@8c4c3d3#diff-5ff0dd346b5d156cd409cd8a793e99ad72fbbe677bd1ec54e44406b2858cb2b4R286 . If that's right, the affiliation script doesn't work for 5.12 and newer.
Here's my ugly hack to get it working again:
-var authorSelector = "div#metadata_author ~ div.dataset-field-values div.edit-compound-field";
+var authorSelector = "#datasetForm\\:tabView\\:j_idt1619\\:0\\:j_idt1622\\:5\\:editCompoundValueFragment div.dataset-field-values div.edit-compound-field";
Obviously, we don't want those ugly and brittle j_idt1619
values that JSF injects into the pages. I'm not so good with CSS but I'm hoping someone (maybe even the original authors of PR #9, @Kris-LIBIS and @KaDee) might have a better, cleaner suggestion.
Or maybe we need to add more id
's to divs in the JSF code? Someday we plan to move to React.
Anyway, with the hack above in place, I can see the magnifying glass and inserting values seems to work. Here are a couple screenshots:
There's an issue in this sprint that's even more related to all this:
One final thing I'll mention is that @qqmyers suggested not having "authorAffiliation" twice in examples/config/affiliation.json
so I changed field-name
to just "author" but I haven't tested this much, but he's right. As soon as I made this switch I was able to see the final HTML annotated with "data cvoc" here and there. So this seems important too as a prerequisite to the the hack above.
{
- "field-name": "authorAffiliation",
+ "field-name": "author",
"term-uri-field": "authorAffiliation",
In a recent demo of external vocab there was text populated in the advanced search page. This is good and we want this, as it greatly increases the usefulness of this feature.
One small change request - there was some text added on the advanced search page - for example, "Add a Term" was shown in at least one of the boxes. This is different than other search boxes which have no text. @qqmyers mentioned that a possible solution would be to make a change to handle the different context (entry vs search) so that the same text is not pre-populated in both scenarios.
In a recent demo of external vocabulary, on the page for creating a dataset, there was a vertically compressed view for adding a term. @qqmyers mentioned that this may be because the JS did not know the size of the box when the page was loaded.
In a recent demo it was suggested that the test/demo block be renamed to something different than "cvocDemoMetadata" in order to make demos more aligned with actual use. If this get prioritized I'm happy to provide some suggestions!
"skosmos.dev.finto.fi" has to be replaced by "demo.skosmos.org" globally in the relevant examples/config/* files for the Skosmos examples to work.
In a recent demo of external vocabulary, we looked at how the terms that dataset depositors choose appear on the dataset page when those terms include a URI.
To replicate:
pip install jsonschema-cli
jsonschema-cli validate CVocConf.schema.json cvoc-conf.singlevocab.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.