private IndexConstraint createIndexConstraint(Entry<String,Constraint> fieldConstraint) { IndexConstraint indexConstraint = new IndexConstraint(fieldConstraint.getKey(),fieldConstraint.getValue()); switch (fieldConstraint.getValue().getType()) { case value: initValueConstraint(indexConstraint); break; case text: initTextConstraint(indexConstraint); break; case range: initRangeConstraint(indexConstraint); break; case similarity: // handled by the caller directly pass break; default: indexConstraint.setInvalid(String.format("ConstraintType %s not supported by!", fieldConstraint.getValue().getType())); } return indexConstraint; }
private IndexConstraint createIndexConstraint(Entry<String,Constraint> fieldConstraint) { IndexConstraint indexConstraint = new IndexConstraint(fieldConstraint.getKey(),fieldConstraint.getValue()); switch (fieldConstraint.getValue().getType()) { case value: initValueConstraint(indexConstraint); break; case text: initTextConstraint(indexConstraint); break; case range: initRangeConstraint(indexConstraint); break; case similarity: // handled by the caller directly pass break; default: indexConstraint.setInvalid(String.format("ConstraintType %s not supported by!", fieldConstraint.getValue().getType())); } return indexConstraint; }
if(mapping.getFilter().getType() == ConstraintType.text){ serializeConstraint(builder,(TextConstraint)mapping.getFilter()); } else if(mapping.getFilter().getType() == ConstraintType.value){ serializeConstraint(builder,(ValueConstraint)mapping.getFilter()); } else { throw new IllegalStateException(String.format("Constraints of type %s are not supported! Please adapt this implementation!",mapping.getFilter().getType()));
new Object[]{constraint.getType(), field, varPrefix, intend}); boolean added = true; switch (constraint.getType()) { case value: addValueConstraint(queryString, field, (ValueConstraint) constraint, selectedFields, log.warn("Constraint Type '{}' not supported in SPARQL! Constriant {} " + "will be not included in the query!", fieldConstraint.getValue().getType(), fieldConstraint.getValue()); added = false; break;
new Object[]{constraint.getType(), field, varPrefix, intend}); boolean added = true; switch (constraint.getType()) { case value: addValueConstraint(queryString, field, (ValueConstraint) constraint, selectedFields, log.warn("Constraint Type '{}' not supported in SPARQL! Constriant {} " + "will be not included in the query!", fieldConstraint.getValue().getType(), fieldConstraint.getValue()); added = false; break;
if(mapping.getFilter().getType() == ConstraintType.text){ serializeConstraint(builder,(TextConstraint)mapping.getFilter()); } else if(mapping.getFilter().getType() == ConstraintType.value){ serializeConstraint(builder,(ValueConstraint)mapping.getFilter()); } else { throw new IllegalStateException(String.format("Constraints of type %s are not supported! Please adapt this implementation!",mapping.getFilter().getType()));
mapping.getFilter().getType() == ConstraintType.text){ //and of type text
mapping.getFilter().getType() == ConstraintType.text){ //and of type text
mapping.getFilter() != null && mapping.getFilter().getType() == ConstraintType.text){ filtered = new HashSet<Object>(values);//start with all values } else { //start with the values filtered by the global filter switch (mapping.getFilter().getType()) { case value: ValueConstraint valueConstraint = (ValueConstraint)mapping.getFilter(); default: log.warn(String.format("Filter of type %s are not supported -> select all values! (Constraint=%s)", mapping.getFilter().getType(),mapping.getFilter())); break;
mapping.getFilter() != null && mapping.getFilter().getType() == ConstraintType.text){ filtered = new HashSet<Object>(values);//start with all values } else { //start with the values filtered by the global filter switch (mapping.getFilter().getType()) { case value: ValueConstraint valueConstraint = (ValueConstraint)mapping.getFilter(); default: log.warn(String.format("Filter of type %s are not supported -> select all values! (Constraint=%s)", mapping.getFilter().getType(),mapping.getFilter())); break;
boolean similarityConstraintPresent = false; for (Entry<String,Constraint> fieldConstraint : fieldQuery) { if (fieldConstraint.getValue().getType() == ConstraintType.similarity) { log.warn("Unable to create IndexConstraint for Constraint {} (type: {}) and Field {} (Reosens: {})", new Object[]{ fieldConstraint.getValue(), fieldConstraint.getValue().getType(), fieldConstraint.getKey(), indexConstraint.getInvalidMessages() });
boolean similarityConstraintPresent = false; for (Entry<String,Constraint> fieldConstraint : fieldQuery) { if (fieldConstraint.getValue().getType() == ConstraintType.similarity) { log.warn("Unable to create IndexConstraint for Constraint {} (type: {}) and Field {} (Reosens: {})", new Object[]{ fieldConstraint.getValue(), fieldConstraint.getValue().getType(), fieldConstraint.getKey(), indexConstraint.getInvalidMessages() });
jConstraint.put("type", constraint.getType().name()); switch (constraint.getType()) { case value: //both ValueConstraint and ReferenceConstraint ValueConstraint valueConstraint = ((ValueConstraint) constraint); jConstraint.put("type", constraint.getType().name()); default: log.warn("Unsupported Constriant Type " + constraint.getType() + " (implementing class=" + constraint.getClass() + "| toString=" + constraint + ") -> skiped"); break;