/** * Rewrite fun() as ?var in exp Compile exists {} */ Filter compile(Expression exp) { Filter f = compiler.compile(exp); compileExist(f.getExp(), false); return f; }
/** * Rewrite fun() as ?var in exp Compile exists {} */ Filter compile(Expression exp) { Filter f = compiler.compile(exp); compileExist(f.getExp(), false); return f; }
Exp compileEdge(Triple t, boolean opt) { Edge r = compiler.compile(t, ast.isInsertData()); Exp exp = Exp.create(EDGE, r); if (t.isType()) { Exp pe = pathType(ast, t); pe.setSystem(true); exp.setPath(pe); } if (t.isXPath()) { // deprecated ?x xpath() ?y exp.setType(EVAL); Filter xpath = compiler.compile(t.getXPath()); exp.setFilter(xpath); } else if (t.isPath()) { path(t, exp); } else if (ast.isCheck()) { check(t, r); } return exp; }
Exp compileEdge(Triple t, boolean opt) { Edge r = compiler.compile(t, ast.isInsertData()); Exp exp = Exp.create(EDGE, r); if (t.isType()) { Exp pe = pathType(ast, t); pe.setSystem(true); exp.setPath(pe); } if (t.isXPath()) { // deprecated ?x xpath() ?y exp.setType(EVAL); Filter xpath = compiler.compile(t.getXPath()); exp.setFilter(xpath); } else if (t.isPath()) { path(t, exp); } else if (ast.isCheck()) { check(t, r); } return exp; }
/** * * Generate rdf:type/rdfs:subClassOf* */ Exp pathType(ASTQuery ast, Triple t) { Expression re = Term.create(Term.RE_SEQ, ast.createQName(RDFS.rdftype), Term.function(Term.STAR, ast.createQName(RDFS.rdfssubclassof))); Triple p = ast.createPath(t.getSubject(), re, t.getObject()); Edge e = compiler.compile(p, false); Exp exp = Exp.create(PATH, e); re.compile(ast); exp.setRegex(re); return exp; }
/** * * Generate rdf:type/rdfs:subClassOf* */ Exp pathType(ASTQuery ast, Triple t) { Expression re = Term.create(Term.RE_SEQ, ast.createQName(RDFS.rdftype), Term.function(Term.STAR, ast.createQName(RDFS.rdfssubclassof))); Triple p = ast.createPath(t.getSubject(), re, t.getObject()); Edge e = compiler.compile(p, false); Exp exp = Exp.create(PATH, e); re.compile(ast); exp.setRegex(re); return exp; }