Skip to content

Commit 4df1b94

Browse files
committed
Link dataset Reference column to publications (FBrf)
_dataset_enrichment_cypher emitted the pubs/Reference column as a plain '; '-joined list of publication labels, so AlignedDatasets and AllDatasets showed unlinked citations. Emit per-pub [label](short_form) markdown so each reference links to its publication (FBrf), matching how the other queries surface pubs.
1 parent d2fb5c5 commit 4df1b94

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
here = path.abspath(path.dirname(__file__))
55

6-
__version__ = "1.15.3"
6+
__version__ = "1.15.4"
77

88
# Get the long description from the README file
99
with open(path.join(here, 'README.md')) as f:

src/vfbquery/vfb_queries.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5353,7 +5353,8 @@ def _dataset_enrichment_cypher(ds_var: str = "ds") -> str:
53535353
"""Return CALL subqueries that, given a DataSet bound as ``ds_var``,
53545354
aggregate the columns v2 prod surfaces from SOLR:
53555355
5356-
pubs — "; "-joined `core.label` (matches v2's Reference column)
5356+
pubs — "; "-joined per-pub `[label](short_form)` markdown so the
5357+
Reference column links each publication (FBrf)
53575358
license — `[label](short_form)` markdown link
53585359
template/technique/thumbnail — one representative channel-image
53595360
(matches prod's `apoc.cypher.run('… LIMIT 5')` shape)
@@ -5366,7 +5367,7 @@ def _dataset_enrichment_cypher(ds_var: str = "ds") -> str:
53665367
CALL {{
53675368
WITH {ds_var}
53685369
OPTIONAL MATCH ({ds_var})-[:has_reference]->(p:pub)
5369-
RETURN apoc.text.join([l IN collect(DISTINCT coalesce(p.label, p.short_form)) WHERE l IS NOT NULL AND l <> ''], '; ') AS pubs
5370+
RETURN apoc.text.join([x IN collect(DISTINCT CASE WHEN p.short_form IS NULL THEN NULL ELSE apoc.text.format('[%s](%s)', [coalesce(p.label, p.short_form), p.short_form]) END) WHERE x IS NOT NULL], '; ') AS pubs
53705371
}}
53715372
CALL {{
53725373
WITH {ds_var}

0 commit comments

Comments
 (0)