Search in sources :

Example 1 with NullPath

use of com.inova8.intelligentgraph.path.NullPath in project com.inova8.intelligentgraph by peterjohnlawrence.

the class IntelligentGraphRepository method getPath.

public Path getPath(String boundPredicatePattern, CustomQueryOptions customQueryOptions) {
    logger.debug("getPath{}\n", boundPredicatePattern);
    PathResults pathValues = getPaths(boundPredicatePattern, null);
    if (pathValues == null) {
        // this.getEvaluationContext().getTracer().tracePathReturnNull(this, boundPredicatePattern);
        return new NullPath();
    } else if (pathValues.hasNext()) {
        Path path = (Path) pathValues.next();
        // this.getEvaluationContext().getTracer().tracePathReturn(this, boundPredicatePattern,path);
        return path;
    } else {
        // this.getEvaluationContext().getTracer().tracePathEmpty(this, boundPredicatePattern);
        pathValues.close();
        return new NullPath();
    }
}
Also used : Path(com.inova8.intelligentgraph.path.Path) NullPath(com.inova8.intelligentgraph.path.NullPath) NullPath(com.inova8.intelligentgraph.path.NullPath) PathResults(com.inova8.intelligentgraph.results.PathResults)

Example 2 with NullPath

use of com.inova8.intelligentgraph.path.NullPath in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Thing method getPath.

/**
 * Gets the path.
 *
 * @param predicatePattern the predicate pattern
 * @return the path
 */
public Path getPath(String predicatePattern) {
    logger.debug("getPath{}\n", predicatePattern);
    PathResults pathValues = getPaths(predicatePattern, null);
    if (pathValues == null) {
        this.getEvaluationContext().getTracer().tracePathReturnNull(this, predicatePattern);
        return new NullPath();
    } else if (pathValues.hasNext()) {
        Path path = (Path) pathValues.next();
        this.getEvaluationContext().getTracer().tracePathReturn(this, predicatePattern, path);
        return path;
    } else {
        this.getEvaluationContext().getTracer().tracePathEmpty(this, predicatePattern);
        pathValues.close();
        return new NullPath();
    }
}
Also used : Path(com.inova8.intelligentgraph.path.Path) NullPath(com.inova8.intelligentgraph.path.NullPath) NullPath(com.inova8.intelligentgraph.path.NullPath) PathResults(com.inova8.intelligentgraph.results.PathResults)

Aggregations

NullPath (com.inova8.intelligentgraph.path.NullPath)2 Path (com.inova8.intelligentgraph.path.Path)2 PathResults (com.inova8.intelligentgraph.results.PathResults)2