Skip to content

Commit

Permalink
Merge pull request #18 from geneontology/extensions-form
Browse files Browse the repository at this point in the history
now using new shex and display the extension
  • Loading branch information
tmushayahama authored May 30, 2024
2 parents f2a33eb + 04c7302 commit aca0e1a
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 144 deletions.
12 changes: 9 additions & 3 deletions src/@noctua.form/data/config/data-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ export class DataUtils {
public static getPredicates(shapes: ShexShapeAssociation[], subjectIds?: string[], objectIds?: string[], excludeFromExtension = true): string[] {
const matchedPredicates = new Set<string>();

console.log(shapes, subjectIds, objectIds, excludeFromExtension)

// If neither subjectIds nor objectIds is provided, return all predicates
if (!subjectIds && !objectIds) {
shapes.forEach((shape) => {
if (shape.exclude_from_extensions !== excludeFromExtension) {

if (excludeFromExtension) {
if (!shape.exclude_from_extensions) {
matchedPredicates.add(shape.predicate);
}
} else {
matchedPredicates.add(shape.predicate);
}

});

console.log('matchedPredicates', matchedPredicates)
return [...matchedPredicates];
}

Expand Down
168 changes: 111 additions & 57 deletions src/@noctua.form/data/shape-terms.json

Large diffs are not rendered by default.

Loading

0 comments on commit aca0e1a

Please sign in to comment.