Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(advanced-search): support subclasses in cross-resource query (#685)
  • Loading branch information
mdelez committed Mar 17, 2022
1 parent 3b159b5 commit fde5d99
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -81,11 +81,16 @@ export class ResourceAndPropertySelectionComponent implements OnInit, OnChanges
(onto: Map<string, ReadOntology>) => {

const resClasses = onto.get(ontologyIri).getClassDefinitionsByType(ResourceClassDefinition);

if (this.resourceClassRestriction !== undefined) {
this.resourceClasses = resClasses.filter(
(resClassDef: ResourceClassDefinition) => resClassDef.id === this.resourceClassRestriction
);
const subclasses = resClasses.filter(
(resClassDef: ResourceClassDefinition) =>
resClassDef.subClassOf.indexOf(this.resourceClassRestriction) > -1
);

this.resourceClasses = this.resourceClasses.concat(subclasses);
} else {
this.resourceClasses = resClasses;
}
Expand Down

0 comments on commit fde5d99

Please sign in to comment.