Provide backward compatibility for predicate methods.

This commit is contained in:
Jim Balhoff 2022-09-19 13:53:04 -04:00
parent 27f87a42f4
commit 15361ad600
1 changed files with 20 additions and 8 deletions

View File

@ -71,6 +71,10 @@ public class Turtle {
public class Complex extends Triple {
protected List<Predicate> predicates = new ArrayList<Predicate>();
public Complex predicate(String predicate, String object) {
return predicate(predicate, object, false);
}
public Complex predicate(String predicate, String object, boolean asList) {
predicateSet.add(predicate);
objectSet.add(object);
@ -83,6 +87,10 @@ public class Turtle {
return linkedPredicate(predicate, new StringType(object), link);
}
public Complex predicate(String predicate, Triple object) {
return predicate(predicate, object, false);
}
public Complex predicate(String predicate, Triple object, boolean asList) {
Predicate p = getPredicate(predicate);
if (p == null) {
@ -120,6 +128,10 @@ public class Turtle {
return this;
}
public Complex predicate(String predicate) {
return predicate(predicate, false);
}
public Complex predicate(String predicate, boolean asList) {
predicateSet.add(predicate);
Complex c = complex();