@@ -4160,17 +4160,42 @@ def _owlery_query_to_results(owl_query_string: str, short_form: str, return_data
41604160 technique_label_raw = technique_info .get ('label' , '' )
41614161 technique = unquote (technique_label_raw ) if technique_label_raw else ''
41624162
4163- # Thumbnail — canonical `[](ref)` form.
4164- thumbnail_url = image_info .get ('image_thumbnail' , '' )
4165- if thumbnail_url :
4166- # Convert to HTTPS and use non-transparent version
4167- thumbnail_url = thumbnail_url .replace ('http://' , 'https://' ).replace ('thumbnailT.png' , 'thumbnail.png' )
4168-
4169- # Format thumbnail with proper markdown link (matching Neo4j behavior)
4170- if template_label :
4171- anatomy_label = unquote (anatomy_label_for_alt )
4172- alt_text = f"{ anatomy_label } aligned to { template_label } "
4173- thumbnail = f"[]({ class_short_form } )"
4163+ # Thumbnail(s) -- emit EVERY example image for this term so the
4164+ # V2 Images column carousels them. The Java
4165+ # VFBqueryJsonProcessor.imageMarkdownToVariableJson builds a
4166+ # multi-image carousel Variable from a '; '-joined list of
4167+ # `[](ref)` items. Template_Space and
4168+ # Imaging_Technique above stay single (the representative
4169+ # first image).
4170+ if anatomy_images and len (anatomy_images ) > 0 :
4171+ image_wrappers = anatomy_images
4172+ else :
4173+ image_wrappers = []
4174+ for entry in field_data .get ('channel_image' , []) or []:
4175+ if isinstance (entry , dict ) and 'image' in entry :
4176+ image_wrappers .append ({'channel_image' : entry , 'anatomy' : None })
4177+ elif isinstance (entry , dict ):
4178+ image_wrappers .append ({'channel_image' : entry .get ('channel_image' , {}) or {}, 'anatomy' : None })
4179+ thumbnail_items = []
4180+ for wrapper in image_wrappers :
4181+ wci = wrapper .get ('channel_image' , {}) or {}
4182+ wimg = wci .get ('image' , {}) or {}
4183+ wurl = wimg .get ('image_thumbnail' , '' )
4184+ if not wurl :
4185+ continue
4186+ wurl = wurl .replace ('http://' , 'https://' ).replace ('thumbnailT.png' , 'thumbnail.png' )
4187+ wtmpl = wimg .get ('template_anatomy' , {}) or {}
4188+ wtmpl_raw = (wtmpl .get ('symbol' ) or wtmpl .get ('label' , '' )) if wtmpl else ''
4189+ wtmpl_label = unquote (wtmpl_raw ) if wtmpl_raw else ''
4190+ if not wtmpl_label :
4191+ continue
4192+ wanat = wrapper .get ('anatomy' ) or {}
4193+ wlabel_raw = wanat .get ('label' ) if isinstance (wanat , dict ) and wanat .get ('label' ) else anatomy_label_for_alt
4194+ wlabel = unquote (wlabel_raw ) if wlabel_raw else ''
4195+ wref = wanat .get ('short_form' ) if isinstance (wanat , dict ) and wanat .get ('short_form' ) else class_short_form
4196+ walt = f"{ wlabel } aligned to { wtmpl_label } "
4197+ thumbnail_items .append (f"[]({ wref } )" )
4198+ thumbnail = "; " .join (thumbnail_items )
41744199
41754200 # Build row
41764201 row = {
0 commit comments