本文整理了Java中org.apache.jena.sparql.algebra.Algebra.toQuadForm()
方法的一些代码示例,展示了Algebra.toQuadForm()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Algebra.toQuadForm()
方法的具体详情如下:
包路径:org.apache.jena.sparql.algebra.Algebra
类名称:Algebra
方法名:toQuadForm
[英]Turn an algebra expression into quadpattern form
[中]将代数表达式转换为四元模式形式
代码示例来源:origin: apache/jena
@Override
protected Op modifyOp(Op op)
{
op = super.modifyOp(op) ;
op = Algebra.toQuadForm(op) ;
return op ;
}
代码示例来源:origin: apache/jena
@Override
protected Op modifyOp(Op op)
{
op = super.modifyOp(op) ;
op = Algebra.toQuadForm(op) ;
return op ;
}
代码示例来源:origin: apache/jena
private static void outputAlgebraQuads(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException
{
outStream.println("<p>Quad structure:</p>") ;
final Op op = Algebra.toQuadForm(Algebra.compile(query)) ;
outputQueryOp(outStream, query, op, lineNumbers) ;
}
代码示例来源:origin: org.apache.jena/jena-fuseki-core
private static void outputAlgebraQuads(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException
{
outStream.println("<p>Quad structure:</p>") ;
final Op op = Algebra.toQuadForm(Algebra.compile(query)) ;
outputQueryOp(outStream, query, op, lineNumbers) ;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static SparqlView create(String name, QuadPattern quadPattern, Element element) {
Op tmp = Algebra.compile(element);
Op op = Algebra.toQuadForm(tmp);
SparqlView result = create(name, quadPattern, op);
return result;
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-algebra
public static ProjectedQuadFilterPattern transform(Element element) {
Op op = Algebra.compile(element);
op = Algebra.toQuadForm(op);
ProjectedQuadFilterPattern result = transform(op);
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static ProjectedQuadFilterPattern transform(Element element) {
Op op = Algebra.compile(element);
op = Algebra.toQuadForm(op);
ProjectedQuadFilterPattern result = transform(op);
return result;
}
代码示例来源:origin: apache/jena
private static void outputAlgebraOptQuads(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException
{
outStream.println("<p>Alebgra, with general quads optimizations:</p>") ;
final Op op = Algebra.optimize(Algebra.toQuadForm(Algebra.compile(query))) ;
outputQueryOp(outStream, query, op, lineNumbers) ;
}
代码示例来源:origin: org.apache.jena/jena-fuseki-core
private static void outputAlgebraOptQuads(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException
{
outStream.println("<p>Alebgra, with general quads optimizations:</p>") ;
final Op op = Algebra.optimize(Algebra.toQuadForm(Algebra.compile(query))) ;
outputQueryOp(outStream, query, op, lineNumbers) ;
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-algebra
public static ProjectedQuadFilterPattern transform(Query query) {
Op op = Algebra.compile(query);
op = Algebra.toQuadForm(op);
op = TransformReplaceConstants.transform(op);
ProjectedQuadFilterPattern result = transform(op);
return result;
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-algebra
public static Graph queryToGraph(Query query) {
Op op = Algebra.toQuadForm(Algebra.compile(query));
Op nop = normalizeOp(op, false);
Graph result = queryToGraph(nop);
return result;
}
代码示例来源:origin: apache/jena
private static void algebraQuads(JsonBuilder obj, Query query) {
Op op = Algebra.compile(query) ;
op = Algebra.toQuadForm(op) ;
obj.key(jAlgebraQuads).value(string(query, op)) ;
}
代码示例来源:origin: apache/jena
public static void printQuad(IndentedWriter out, Query query, boolean printOptimized)
{
Op op = Algebra.compile(query) ;
if ( printOptimized )
op = Algebra.optimize(op) ;
op = Algebra.toQuadForm(op) ;
WriterSSE.out(out, op, query) ;
// SerializationContext sCxt = new SerializationContext(query) ;
// op.output(out, sCxt) ;
out.flush() ;
}
}
代码示例来源:origin: apache/jena
private static void algebraOptQuads(JsonBuilder obj, Query query) {
Op op = Algebra.compile(query) ;
op = Algebra.toQuadForm(op) ;
op = Algebra.optimize(op) ;
obj.key(jAlgebraOptQuads).value(string(query, op)) ;
}
代码示例来源:origin: apache/jena
@Override
protected Op modifyOp(Op op)
{
op = Substitute.substitute(op, getStartBinding()) ;
// Optimize (high-level)
op = super.modifyOp(op) ;
// Quadification
// Only apply if not a rewritten DynamicDataset
if ( ! isDynamicDataset() )
op = Algebra.toQuadForm(op) ;
// Record it.
setOp(op) ;
return op ;
}
代码示例来源:origin: apache/jena
protected Op op(String pattern, Mode mode) {
Op op = SSE.parseOp(pattern) ;
if ( mode == Mode.QUADS )
op = Algebra.toQuadForm(op) ;
else if ( mode == Mode.QUADBLOCKS )
op = Algebra.toQuadBlockForm(op) ;
return op ;
}
}
代码示例来源:origin: apache/jena
@Override
protected Op modifyOp(Op op)
{
op = Substitute.substitute(op, getStartBinding()) ;
// Optimize (high-level)
op = super.modifyOp(op) ;
// Quadification
// Only apply if not a rewritten DynamicDataset
if ( ! isDynamicDataset() )
op = Algebra.toQuadForm(op) ;
// Record it.
setOp(op) ;
return op ;
}
代码示例来源:origin: apache/jena
/** query->algebra/quads->OpAsQuery->query */
private static Query[] roundTripQueryQuad(String query) {
Query orig = QueryFactory.create(query, Syntax.syntaxSPARQL_11);
Op toReconstruct = Algebra.compile(orig);
toReconstruct = Algebra.toQuadForm(toReconstruct);
Query got = OpAsQuery.asQuery(toReconstruct);
Query[] r = { orig, got };
return r;
}
代码示例来源:origin: apache/jena
private static void test4(String pattern, String... joinForm)
{
Query q = QueryFactory.create("PREFIX : <http://example/> SELECT * "+pattern) ;
Op op = Algebra.compile(q.getQueryPattern()) ;
op = Algebra.toQuadForm(op) ;
test(op, joinForm) ;
}
代码示例来源:origin: apache/jena
private static void test(String patternString, boolean optimize, String... strExpected)
{
Query q = QueryFactory.create("SELECT * WHERE "+patternString) ;
Op op = Algebra.compile(q) ;
if ( optimize )
op = Algebra.optimize(op) ;
op = Algebra.toQuadForm(op) ;
Op op2 = SSE.parseOp(StrUtils.strjoinNL(strExpected)) ;
assertEquals(op2, op) ;
}
}
内容来源于网络,如有侵权,请联系作者删除!