File tree 1 file changed +7
-8
lines changed
frontend/src/semantic-search
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,14 @@ function applicableTo(range: string): (Model) => boolean {
39
39
async function normalizeRange ( model : Model ) : Promise < Graph > {
40
40
let range ;
41
41
const precedent = model . get ( 'precedent' ) ;
42
- if ( precedent ) range = precedent . get ( rdfs . range ) || [ precedent ] ;
43
- const ontology = await ldChannel . request ( 'ontology:promise' ) ;
44
- if ( ! range ) range = ontology . filter ( isRdfsClass ) ;
45
- range = getRdfSubClasses ( range ) ;
42
+ if ( precedent ) {
43
+ range = precedent . get ( rdfs . range ) ;
44
+ range = range ? getRdfSubClasses ( range ) : [ precedent ] ;
45
+ } else {
46
+ const ontology = await ldChannel . request ( 'ontology:promise' ) ;
47
+ range = ontology . filter ( isRdfsClass ) ;
48
+ }
46
49
const rangeGraph = new Graph ( range )
47
- each ( range , cls => {
48
- const superClasses = cls . get ( rdfs . subClassOf ) ;
49
- each ( superClasses , rangeGraph . remove . bind ( rangeGraph ) ) ;
50
- } ) ;
51
50
return rangeGraph ;
52
51
}
53
52
You can’t perform that action at this time.
0 commit comments