private boolean scopeContainsInstance ( GraqlCompute query ) { if ( scopeTypeLabels ( query ) . isEmpty ( ) ) return false ; List < Pattern > checkSubtypes = scopeTypeLabels ( query ) . stream ( ) . map ( type -> Graql . var ( "x" ) . isa ( Graql . type ( type . getValue ( ) ) ) ) . collect ( Collectors . toList ( ) ) ; return tx . stream ( Graql . match ( Graql . or ( checkSubtypes ) ) , false ) . iterator ( ) . hasNext ( ) ; }
Helper method to check whether the concept types in the scope have any instances