Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
remove claims with rank 'deprecated'
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Jan 12, 2024
1 parent 86185a5 commit 1297a67
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/core/adapters/getWikidataSoftware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,9 @@ function createGetClaimDataValue(params: { entity: Entity }) {
}

return statementClaim
.filter(x => x.rank !== "deprecated")
.sort((a, b) => {
const getWeight = (rank: (typeof a)["rank"]) => {
if (rank === "preferred") return 2;
if (rank === "normal") return 1;
return 0;
};
const getWeight = (rank: (typeof a)["rank"]) => (rank === "preferred" ? 1 : 0);
return getWeight(b.rank) - getWeight(a.rank);
})
.filter(x => x.mainsnak.snaktype === "value")
Expand Down

0 comments on commit 1297a67

Please sign in to comment.