Skip to content

Fix np created using#95

Merged
vijay-prema merged 6 commits into
mainfrom
fix-np-created-using
May 18, 2026
Merged

Fix np created using#95
vijay-prema merged 6 commits into
mainfrom
fix-np-created-using

Conversation

@vijay-prema
Copy link
Copy Markdown
Contributor

@vijay-prema vijay-prema commented May 10, 2026

A workaround to resolve the issue of older nanopubs created using templates that had no hasNanopubLabelPattern specified and fell back to using NP created using... as the title.

The best label in these cases, is to use the label of the first introduced subject. This workaround has been applied to:

  • All search results
  • Nanopub viewer
  • Zotero search picker and also works when importing via zotero (although obviously doesn't fix np titles that were already imported).
  • Referencing NPs panel in NP viewer

TODO:

  • Title/Full-text search still shows NP created using for some reason update: unfortunately this cannot be fixed in the query due to assertion graph being unavailable for the /text search endpoints
  • Make a note in the steering file about how pubinfo is automatically bound and that rebinding it in graph:npa results in it actually being unbound (check that the wording here is correct, perhaps ask Tobias). Also how certain things are not available in the full-text search endpoint (pubinfo?). Perhaps ask Tobias to lay out all those "privileged info" or maybe they are available somewhere (even just code).
  • Refactor some of the duplicated code (getting the best label from startswith/label/description)

TODO (potential followups):

There is one small issue for which there is not a good workaround - if you see a title based on the "label of the first introduced subject" and try to search for it later by title, you will be confused as it wont show up in results. This is because its still searching within the title in the SPARQL query which is still going to be NP created using.... The user would only find it if they change to Full-text search mode. Possible solutions:

  • Change the search queries to also search the text of "label of the first introduced subject" when in title-only search mode. Might be bloating/over-complicating the queries?
  • Default to full-text search. Initial search will be slower and in some cases return lots of results and more noise (unless in future this becomes a better kind of semantic search or improved search algorithm which cuts noise and puts signal on top).

There are also likely other places where the label of a NP is shown. For example in comboboxes for certain creation templates where you search and select an NP to reference, and in the viewer for the same NP where the referenced NP is shown. It becomes a bit of a a "whackamole" at that point. For now I think the main issue of search result lists being confusing, has been resolved.

BEFORE

image

AFTER

image

@vijay-prema vijay-prema self-assigned this May 10, 2026
@vijay-prema vijay-prema merged commit 52f680d into main May 18, 2026
7 checks passed
@vijay-prema vijay-prema deleted the fix-np-created-using branch May 19, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant