Skip to content

Add isPartOf link #5653

Description

@jbrown-xentity

User Story

In order to show dataset relationships, data researchers want the link to the relevant datasets represented in the isPartOf metadata.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • GIVEN a dataset has an isPartOf metadata filled out appropriately (or is harvested via WAF collection type)
    WHEN the dataset is viewed on catalog
    THEN a link to the "parent" record is displayed

  • GIVEN a dataset is referenced by other datasets with isPartOf
    WHEN the dataset is viewed on catalog
    THEN a link to the child records and/or a link to search all child records is shown.

Background

Came out of user testing.

Security Considerations (required)

None

Sketch

Here is an example:

I would expect this to be done as some type of dynamic API checking on page load, and if the search result for the isPartOf (searching the isPartOf field to see if it's a parent, and if the dataset has that field, searching identifier for the content of that field) has content, then a special block of HTML should be displayed.

Please note that metadata wise, there's no reason a dataset can't be a parent AND a child. We should always check if someone is a parent, and if the isPartOf field exists then check to make sure it exists via API and then link to it. If there are multiple matches, prioritize the one in the same org and harvest source.

Activity

  1. added
    CatalogRelated to catalog component playbooks/roles
    and removed on Mar 6, 2026
  2. moved this from 📥 Queue to 📟 Sprint Backlog in data.gov team boardon Mar 12, 2026
  3. SueValente commented on Mar 12, 2026

    @SueValente
    Contributor

    Should we give the user a search parameter? Do we have a good sense of collections and how are they messing with search results?

  4. jbrown-xentity commented on Mar 12, 2026

    @jbrown-xentity
    ContributorAuthor

    Should we give the user a search parameter? Do we have a good sense of collections and how are they messing with search results?

    I think the concept of "parent" and "child" isn't DCAT-US1.1, it's CKAN collections that we created. I think that just muddies the waters. I wouldn't do a search parameter. Most of the time when we did that it was related to trying to find the "true" count and get around the collections filtering.

    I would provide a link on the dataset details page, because I consider it a dataset detail.

  5. moved this from 📟 Sprint Backlog to 🏗 In Progress [8] in data.gov team boardon Mar 16, 2026
  6. self-assigned this
    on Mar 16, 2026
  7. neilmb commented on Mar 17, 2026

    @neilmb

    isPartOf is also derivable from ISO documents, so we need to change how we are setting those parent identifiers when those are in WAF collections. If it's in a WAF collection and it has a parent identifier, always use that.

    MDTranslator can also find an "identifier" inside the XML files and can put that into the transformed JSON. If that happens in an XML dataset that is the parent of a waf-collection, then we won't have the right "identifier" in that parent to make that connection with its children who are presuming that the parent's URL is the identifier.

  8. rshewitt commented on Mar 17, 2026

    @rshewitt
    Contributor

    with fix merged all waf-collection sources are being force harvested

  9. rshewitt commented on Mar 24, 2026

    @rshewitt
    Contributor

    for waf-collections every document has the same isPartOf including the parent. the parent is identified when isPartOf == identifier. children are found from opensearch by looking for isPartOf == [some value].

    dcatus (at the source) is different because the parent may not know its parenthood but it can if we process it like waf-collections. i think we should do that in the harvester instead of the catalog (it's inefficient by calculating the parent/child relationship per search results page load and per "show more results"). it's not something that needs to be calculated that many times. it can be determined on each harvest of the source.

    what i'm proposing is we add a parent/child calculation at the beginning of harvesting for dcatus sources so that by the time the data gets to catalog the relationship is known and works.

    this is a graph problem. here's the scenarios which can come up that we need to address and fix per harvest source (changes would occur on the Dataset table not the original harvest record)

    • all children no parent (remains a collection but there's simply no parent record)
    • no children 1 parent (don't include isPartOf for parent. it's just a regular document)
    • chain of parents (a->b->c->d). use the earliest descendant as the parent. everything else is child. so "d" is the parent and everything else is its child.
    • multiple collections and single docs (a->b c->d e ). this would be 2 separate collections with 1 non-collection doc.
    • circular references ( a->b->a). this would need to be fixed.
  10. FuhuXia commented on Mar 24, 2026

    @FuhuXia
    Member

    It is a headache to build the parent-child relation. I can see it is even a more headache to maintain the relations.

    We have worked out the strategy to show the collection in catalog-next with solr. We can do the same for OpenSearch. It does need an extra OpenSearch query each time you do a dataset listing to figure out whether any of the listed dataset is a parent, if we want to label a parent.

  11. moved this from 🏗 In Progress [8] to 👀 Needs Review in data.gov team boardon Mar 31, 2026
  12. moved this from 👀 Needs Review to ✔ Done in data.gov team boardon Apr 15, 2026
  13. closed this as completedby moving to ✔ Done in data.gov team boardon Apr 15, 2026
  14. moved this from ✔ Done to 🗄 Closed in data.gov team boardon Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CatalogRelated to catalog component playbooks/roles

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions