Skip to content

Add a check to drop StatPop nodes#677

Open
vish-cs wants to merge 1 commit into
datacommonsorg:masterfrom
vish-cs:statpop
Open

Add a check to drop StatPop nodes#677
vish-cs wants to merge 1 commit into
datacommonsorg:masterfrom
vish-cs:statpop

Conversation

@vish-cs

@vish-cs vish-cs commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a check to ignore StatisticalPopulation nodes during pipeline processing. It adds a helper method isStatisticalPopulation in GraphUtils and the corresponding constant in Vocabulary. Feedback suggests simplifying the isStatisticalPopulation method by removing redundant namespace stripping, as getPropertyValues already handles this, allowing for a direct contains check.

Comment on lines +116 to +124
public static boolean isStatisticalPopulation(PropertyValues pvs) {
List<String> types = getPropertyValues(pvs.getPvsMap(), Property.typeOf.name());
for (String type : types) {
if (McfUtil.stripNamespace(type).equals(Vocabulary.STATISTICAL_POPULATION_TYPE)) {
return true;
}
}
return false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The helper method getPropertyValues already strips namespaces from the returned values (using McfUtil.stripNamespace). Therefore, calling McfUtil.stripNamespace(type) again inside the loop is redundant. We can simplify this method by directly checking if the returned list contains Vocabulary.STATISTICAL_POPULATION_TYPE.

  public static boolean isStatisticalPopulation(PropertyValues pvs) {
    return getPropertyValues(pvs.getPvsMap(), Property.typeOf.name())
        .contains(Vocabulary.STATISTICAL_POPULATION_TYPE);
  }

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.

2 participants