Skip to content

Commit

Permalink
Allow superclasses as traversal target (#455, #467)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed May 31, 2021
1 parent d0a3e35 commit 77ec7f4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions frontend/src/semantic-search/dropdown-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ function applicableTo(range: string): (Model) => boolean {
async function normalizeRange(model: Model): Promise<Graph> {
let range;
const precedent = model.get('precedent');
if (precedent) range = precedent.get(rdfs.range) || [precedent];
const ontology = await ldChannel.request('ontology:promise');
if (!range) range = ontology.filter(isRdfsClass);
range = getRdfSubClasses(range);
if (precedent) {
range = precedent.get(rdfs.range);
range = range ? getRdfSubClasses(range) : [precedent];
} else {
const ontology = await ldChannel.request('ontology:promise');
range = ontology.filter(isRdfsClass);
}
const rangeGraph = new Graph(range)
each(range, cls => {
const superClasses = cls.get(rdfs.subClassOf);
each(superClasses, rangeGraph.remove.bind(rangeGraph));
});
return rangeGraph;
}

Expand Down

0 comments on commit 77ec7f4

Please sign in to comment.