Match graph and sentence