/** * Print a short description of the rule, just its name if it * has one, otherwise the whole rule description. */ public String toShortString() { if (name != null) { return name; } else { return toString(); } }
/** * Print a short description of the rule, just its name if it * has one, otherwise the whole rule description. */ public String toShortString() { if (name != null) { return name; } else { return toString(); } }
/** * Test parser modes to support backarrow notation are working */ public void testParse() { List<Rule> rules = Rule.parseRules(testRules1); assertEquals("BRule parsing", "[ (?x ?q ?y) <- (?p rdfs:subPropertyOf ?q) (?x ?p ?y) ]", rules.get(0).toString()); assertEquals("BRule parsing", "[ (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b) (?b rdfs:subPropertyOf ?c) ]", rules.get(1).toString()); }
/** * Test parser modes to support backarrow notation are working */ public void testParse() { List<Rule> rules = Rule.parseRules(testRules1); assertEquals("BRule parsing", "[ (?x ?q ?y) <- (?p rdfs:subPropertyOf ?q) (?x ?p ?y) ]", rules.get(0).toString()); assertEquals("BRule parsing", "[ (?a rdfs:subPropertyOf ?c) <- (?a rdfs:subPropertyOf ?b) (?b rdfs:subPropertyOf ?c) ]", rules.get(1).toString()); }
for (int i = 0; i < testRules.length; i++) { Rule r = Rule.parseRule(testRules[i]); assertEquals(testResults[i], r.toString());
for (int i = 0; i < testRules.length; i++) { Rule r = Rule.parseRule(testRules[i]); assertEquals(testResults[i], r.toString());