Surface a DataSet's own licence in term info - #88
Merged
Conversation
DataSet term info returns has_license on the term itself as `license`
(QueryLibrary.dataset_term_info), not as `dataset_license`, but
term_info_parse_object only read `dataset_license`. Every DataSet page
therefore came back with "Licenses": {} and the client rendered no
License row, even though the has_license edge was in the KB.
Add the same fallback the dataclass serialiser
(term_info_queries.VFBTerm.get_license) and the legacy Java serialiser
(VFBProcessTermInfoJson.getLicense) already have. Source is left empty
so the panel does not render a Source row linking back to the page you
are already on.
Add parity tests covering both the fallback and the unchanged
dataset_license path.
Contributor
|
Clare72
approved these changes
Aug 7, 2026
Contributor
Author
|
Agreed — deliberate, and it matches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every DataSet page in v2 renders without a License row, e.g.
https://v2.virtualflybrain.org/org.geppetto.frontend/geppetto?id=Berg2025
The licence is in the KB —
(:DataSet {short_form:'Berg2025'})-[:has_license]->(:License {short_form:'VFBlicense_CC_BY_4_0'})— and it shows correctly in theAllDatasetsresults table. It is lost in term-info serialisation.Cause
QueryLibrary.dataset_term_info(VFB_json_schema) uses thelicense()clause, so a dataset's licence comes back inlicense. Images and templates usedataSet_license()and come back indataset_license.term_info_parse_objectonly ever readdataset_license, so DataSet terms serialised as"Licenses": {}. Downstream,VFBProcessTermInfoVFBqueryJson.licenseList()builds the Source + License block fromLicenses{}alone, so with an empty dict no License row is added.The fallback exists everywhere else —
term_info_queries.VFBTerm.get_license()haselif self.license:, and the legacyVFBProcessTermInfoJson.getLicense()has the sameelse if. Only this serialiser lost it, so the row disappeared when v2 moved onto the VFBquery term-info path.Fix
Add the missing branch.
source/source_iriare left empty: the dataset is its own source, and an empty source stops the panel rendering a Source row that links back to the page you are already on. No Java or client change needed — theLicenseslot is already inVFBMain.js's ordered field list.Verification
Parsed against live SOLR after the change:
Three tests added to
test_term_info_parity.pyas Gap E, alongside the gaps this serialiser has already been reconciled against. The two dataset tests fail onmainand pass here; the third asserts thedataset_licensepath is unchanged (JRC2018U keeps both its licence and its source attribution).Note:
test_individual_synonyms_presentin that file already fails onmainand is untouched by this change.