@Override public String toString() { final StringBuilder sb = new StringBuilder(statement.toString().trim()); if (condition != null) { sb.append("\n Condition:\n \t"); sb.append(condition.toString().trim().replace("\n", "\n \t")); } return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("Type: " + type.toString()); sb.append("Statement Patterns:"); sb.append("-------------------"); for(final StatementPattern sp : getPatterns()) { sb.append(sp.toString()); } return sb.toString(); } }
/** * Validate that this is a non-trivial rule. A trivial rule consists of * a statement pattern whose subject, predicate, and object are all * variables (therefore it would match every statement). * @return true if the rule is valid (non-trivial) */ void validate() throws QueryRulesetException { if (!(statement.getSubjectVar().isConstant() || statement.getPredicateVar().isConstant() || statement.getObjectVar().isConstant())) { throw new QueryRulesetException("Statement pattern with no constants would match every statement:\n" + statement.toString()); } }
card = triples; LOG.log(Level.FINE, "cardinality of {0} = {1}", new Object[]{sp.toString(), card}); return card; } else { // stats are not present