Java Code Examples for org.apache.jena.sparql.path.Path#visit()

The following examples show how to use org.apache.jena.sparql.path.Path#visit() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SPARQLExtPathWriter.java    From sparql-generate with Apache License 2.0 5 votes vote down vote up
private void visitPath(Path path, boolean needParensThisTime) {
    if (alwaysInnerParens) {
        needParensThisTime = true;
    }
    boolean b = needParens;
    needParens = needParensThisTime;
    path.visit(this);
    needParens = b;
}
 
Example 2
Source File: SPARQLExtPathWriter.java    From sparql-generate with Apache License 2.0 5 votes vote down vote up
private void printPathMod(String mod, Path path) {
    boolean doParens = (needParens || alwaysInnerParens);
    if (doParens) {
        out.print("(");
    }
    path.visit(this);
    if (doParens) {
        out.print(")");
    }
    out.print(mod);
}
 
Example 3
Source File: SPARQLExtPathWriter.java    From sparql-generate with Apache License 2.0 4 votes vote down vote up
public static void write(IndentedWriter out, Path path, SerializationContext context) {
    PathWriterWorker w = new PathWriterWorker(out, context);
    path.visit(w);
    out.flush();
}