Skip to content
Permalink
Browse files
feat(advanced-search): support subclasses in cross-resource query (#685)
  • Loading branch information
mdelez committed Mar 17, 2022
1 parent 3b159b5 commit fde5d995eb02ef9b1bf56f386cb64c51785619d6
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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;
}

0 comments on commit fde5d99

Please sign in to comment.