private static Map < Variable , Type > getLabelVarTypeMap ( TransactionOLTP tx , Set < Fragment > allFragments ) { Map < Variable , Type > labelVarTypeMap = new HashMap <> ( ) ; allFragments . stream ( ) . filter ( LabelFragment . class :: isInstance ) . forEach ( fragment -> { // TODO: labels() should return ONE label instead of a set SchemaConcept schemaConcept = tx . getSchemaConcept ( Iterators . getOnlyElement ( ( ( LabelFragment ) fragment ) . labels ( ) . iterator ( ) ) ) ; if ( schemaConcept != null && ! schemaConcept . isRole ( ) && ! schemaConcept . isRule ( ) ) { labelVarTypeMap . put ( fragment . start ( ) , schemaConcept . asType ( ) ) ; } } ) ; return labelVarTypeMap ; }
find all vars representing types