Added query optimization to GraphSailConnection