((LDPathFieldQueryImpl)query).setLDPathSelect(ldpath);
} else { //if no LDPath is parsed select the default field
query = queryFactory.createFieldQuery();
Collection<String> selectedFields = new ArrayList<String>();
selectedFields.add(field); //select also the field used to find entities
query.addSelectedFields(selectedFields);
}
if (language == null || language.trim().isEmpty()) {
query.setConstraint(field, new TextConstraint(name, PatternType.wildcard, false));
} else {
query.setConstraint(field, new TextConstraint(name, PatternType.wildcard, false, language));