本文整理了Java中fr.inria.corese.kgram.core.Query.getBody
方法的一些代码示例,展示了Query.getBody
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getBody
方法的具体详情如下:
包路径:fr.inria.corese.kgram.core.Query
类名称:Query
方法名:getBody
暂无
代码示例来源:origin: fr.inria.corese/kgram
public List<Edge> getEdges(){
ArrayList<Edge> list = new ArrayList<Edge>();
getBody().getEdgeList(list);
return list;
}
代码示例来源:origin: Wimmics/corese
/**
* Index Query at load time search occurrence of: ?in rdf:type sql:Select
* ?in rdf:type ?class values ?class { ... }
*/
void add(Query q) {
boolean suc = add(q, q.getBody());
if (!suc) {
list.add(q);
}
}
代码示例来源:origin: Wimmics/corese
public boolean check(Query q) {
return check(q, q.getBody());
}
代码示例来源:origin: fr.inria.corese/kgram
void check(Query q){
query = q;
check(null, q.getBody(), eval.getMemory());
}
代码示例来源:origin: fr.inria.corese/compiler
void visit(Query q) {
query = q;
q.setNodeList(visit(q.getBody()));
}
代码示例来源:origin: Wimmics/corese
void visit(Query q) {
query = q;
q.setNodeList(visit(q.getBody()));
}
代码示例来源:origin: fr.inria.corese/compiler
void debug(Query query){
if (query.isDebug()){
logger.debug(query.getBody().toString());
logger.debug("limit " + query.getLimit());
if (query.isFail()){
logger.debug("Fail at compile time");
}
}
}
代码示例来源:origin: Wimmics/corese
void debug(Query query){
if (query.isDebug()){
logger.debug(query.getBody().toString());
logger.debug("limit " + query.getLimit());
if (query.isFail()){
logger.debug("Fail at compile time");
}
}
}
代码示例来源:origin: fr.inria.corese/corese-core
public Node getPredicate(int i) {
return query.getBody().get(i).getEdge().getEdgeNode();
}
代码示例来源:origin: Wimmics/corese
public Node getPredicate(int i) {
return query.getBody().get(i).getEdge().getEdgeNode();
}
代码示例来源:origin: fr.inria.corese/kgram
/**
* Select Query is empty and does nothing
*/
boolean isEmpty(){
return isSelect()
&& getSelectFun().isEmpty()
&& getBody().size() == 0
&& getValues().getMappings() == null;
}
代码示例来源:origin: fr.inria.corese/kgram
int eval(Node gNode, Query q) {
if (q.isFunctional()) {
// select xpath() as ?val
// select unnest(fun()) as ?x
function();
return 0;
} else {
Stack stack = Stack.create(q.getBody());
set(stack);
return eval(gNode, stack, 0);
}
}
代码示例来源:origin: fr.inria.corese/corese-core
/**
* this = x type c2 :- x type c1 & c1 subclassof c2
* r = c1 subclassof c3 :- c1 subclassof c2 & c2 subclassof c3
*/
public boolean isPseudoTransitive(Rule r) {
if (isPseudoTransitive() && r.isTransitive()){
Node p = r.getUniquePredicate();
Node pp = getQuery().getBody().get(1).getEdge().getEdgeNode();
return p.equals(pp);
}
return false;
}
代码示例来源:origin: fr.inria.corese/corese-core
/**
* is it: graph ?shape { ?sh sh:property ?cst }
*/
void optimize(Query query, String graph, String var) {
if (query.getBody().size() > 0) {
fr.inria.corese.kgram.core.Exp exp = query.getBody().get(0);
if (exp.isGraph() && exp.getGraphName().getLabel().equals(graph)) {
Node n = query.getNode(var);
if (n != null) {
// bind exists node
exp.setNodeList(exp.getNodes(true, false, false));
exp.setBGPAble(true);
exp.cache(n);
}
}
}
}
代码示例来源:origin: Wimmics/corese
/**
* this = x type c2 :- x type c1 & c1 subclassof c2
* r = c1 subclassof c3 :- c1 subclassof c2 & c2 subclassof c3
*/
public boolean isPseudoTransitive(Rule r) {
if (isPseudoTransitive() && r.isTransitive()){
Node p = r.getUniquePredicate();
Node pp = getQuery().getBody().get(1).getEdge().getEdgeNode();
return p.equals(pp);
}
return false;
}
代码示例来源:origin: fr.inria.corese/kgram
void queryNodeList(List<Node> selectList, boolean inSubScope) {
List<Node> subSelectList = getQuery().getSelectNodeList();
if (inSubScope) {
// focus on left optional in query body
// because otherwise select * includes right optional
List<Node> scopeList = getQuery().getBody().getInScopeNodes();
for (Node node : scopeList) {
if (subSelectList.contains(node)) {
add(selectList, node);
}
}
} else {
for (Node node : subSelectList) {
add(selectList, node);
}
}
}
代码示例来源:origin: fr.inria.corese/kgram
void check(Node gNode, Exp exp, Environment env){
switch (exp.type()){
case Exp.EDGE:
edge(gNode, exp, env);
break;
case Exp.QUERY:
check(gNode, exp.getQuery().getBody(), env);
break;
default:
for (Exp ee : exp.getExpList()){
check(gNode, ee, env);
}
}
}
代码示例来源:origin: fr.inria.corese/compiler
void values(Query q, ASTQuery ast){
if (ast.getValues() == null) {
return;
}
bindings(q, ast);
if (q.getValues() != null && isAlgebra()){
if (q.getBody().size() == 0){
q.setBody(q.getValues());
}
else {
Exp exp = Exp.create(JOIN, Exp.create(BGP, q.getValues()), q.getBody());
q.setBody(Exp.create(BGP, exp));
}
}
}
代码示例来源:origin: Wimmics/corese
void values(Query q, ASTQuery ast){
if (ast.getValues() == null) {
return;
}
bindings(q, ast);
if (q.getValues() != null && isAlgebra()){
if (q.getBody().size() == 0){
q.setBody(q.getValues());
}
else {
Exp exp = Exp.create(JOIN, Exp.create(BGP, q.getValues()), q.getBody());
q.setBody(Exp.create(BGP, exp));
}
}
}
代码示例来源:origin: fr.inria.corese/kgram
Query complete(Query q1, Query q2) {
q1.setOuterQuery(this);
q2.setOuterQuery(this);
setGlobalQuery(getBody());
setSelect(q1, q2);
collect();
setAST(q2.getAST());
return this;
}
内容来源于网络,如有侵权,请联系作者删除!