}
@SuppressWarnings("unchecked")
- private static Triple<Double, Double, String> possibleInvertibleExpression(ReadGraph graph, Variable base, String expression) throws DatabaseException {
- if (base == null || expression == null || expression.isEmpty())
+ private static Triple<Double, Double, String> possibleInvertibleExpression(String expression) {
+ if (expression == null || expression.isEmpty())
return null;
InvertBasicExpressionVisitor visitor = new InvertBasicExpressionVisitor();
- //System.out.println("invert : " + expression + " -> " + replaced(expression) + " for " + base.getURI(graph));
Expressions.evaluate(replaced(expression), visitor);
Object result = visitor.getResult();
if (result instanceof Triple)
return null;
}
+ public static Triple<Double, Double, String> parseInvertibleExpression(String expression) {
+ Triple<Double, Double, String> data = possibleInvertibleExpression(expression);
+ if (data == null)
+ return null;
+ String key = data.third.replace(MAGIC, ".");
+ return Triple.make(data.first, data.second, key);
+ }
+
+ private static Triple<Double, Double, String> possibleInvertibleExpression(ReadGraph graph, Variable base, String expression) throws DatabaseException {
+ if (base == null)
+ return null;
+ //System.out.println("invert : " + expression + " -> " + replaced(expression) + " for " + base.getURI(graph));
+ return possibleInvertibleExpression(expression);
+ }
+
public static Variable possibleInvertibleExpressionReferencedProperty(ReadGraph graph, Variable base, String expression) throws DatabaseException {
Triple<Double, Double, String> data = possibleInvertibleExpression(graph, base, expression);
if (data == null)