本文整理了Java中fr.inria.corese.kgram.core.Query.isDebug
方法的一些代码示例,展示了Query.isDebug
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.isDebug
方法的具体详情如下:
包路径:fr.inria.corese.kgram.core.Query
类名称:Query
方法名:isDebug
暂无
代码示例来源:origin: fr.inria.corese/kgram
EvalSPARQL(Query q, Eval e){
eval = e;
query = q;
debug = q.isDebug();
}
代码示例来源:origin: fr.inria.corese/corese-core
boolean isDebug() {
return getQuery().isDebug();
}
代码示例来源:origin: Wimmics/corese
boolean isDebug() {
return getQuery().isDebug();
}
代码示例来源: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/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: fr.inria.corese/kgram
/**
* this eval is a fresh copy
*/
public Mappings subEval(Query q, Node gNode, Stack stack, int n) {
setSubEval(true);
starter(q);
if (q.isDebug()) {
debug = true;
}
eval(gNode, stack, n);
//memory.setResults(save);
return results;
}
代码示例来源:origin: Wimmics/corese
@Override
public Mappings getMappings(Node gNode, List<Node> from, Exp exp, Environment env) {
if (env instanceof Memory) {
if (env.getQuery().isDebug()) {
System.out.println("BGP:\n" + exp);
}
Memory mem = (Memory) env;
Eval eval = mem.getEval();
// prevent loop on BGP exp:
exp.setType(Exp.AND);
Mappings map = eval.subEval(this, gNode, gNode, exp, null);
if (env.getQuery().isDebug()) {
System.out.println("BGP:\n" + map);
}
exp.setType(Exp.BGP);
return map;
} else {
return Mappings.create(query, true);
}
}
代码示例来源:origin: fr.inria.corese/compiler
IDatatype[] evalArguments(Expr exp, Environment env, Producer p, int start) {
IDatatype[] args = new IDatatype[exp.arity() - start];
int i = 0;
for (int j = start; j < exp.arity(); j++) {
args[i] = eval(exp.getExp(j), env, p);
if (args[i] == ERROR_VALUE) {
if (env.getQuery().isDebug()) {
logger.error("Error eval argument: " + exp.getExp(j) + " in: " + exp);
}
return null;
}
i++;
}
return args;
}
代码示例来源:origin: Wimmics/corese
@Override
public void delete(Query query, Mappings lMap, Dataset ds) {
Construct cons = Construct.create(query, gm);
cons.setDebug(query.isDebug());
cons.delete(lMap, ds);
lMap.setGraph(gm.getGraph());
}
}
代码示例来源:origin: Wimmics/corese
IDatatype[] evalArguments(Expr exp, Environment env, Producer p, int start) {
IDatatype[] args = new IDatatype[exp.arity() - start];
int i = 0;
for (int j = start; j < exp.arity(); j++) {
args[i] = eval(exp.getExp(j), env, p);
if (args[i] == ERROR_VALUE) {
if (env.getQuery().isDebug()) {
logger.error("Error eval argument: " + exp.getExp(j) + " in: " + exp);
}
return null;
}
i++;
}
return args;
}
代码示例来源:origin: Wimmics/corese
@Override
public void insert(Query query, Mappings lMap, Dataset ds) {
Construct cons = Construct.create(query, gm);
cons.setDebug(query.isDebug());
cons.insert(lMap, ds);
lMap.setGraph(gm.getGraph());
}
代码示例来源:origin: fr.inria.corese/compiler
/**
* Retrieve a method with name and type
*/
@Override
public Expr getDefineMethod(Environment env, String name, IDatatype type, IDatatype[] param) {
Extension ext = env.getExtension();
if (ext != null) {
if (env.getQuery().isDebug()) {
ext.setDebug(true);
}
Expr ee = ext.getMethod(name, type, param);
if (ee != null) {
return ee;
}
}
return extension.getMethod(name, type, param);
}
代码示例来源:origin: Wimmics/corese
/**
* Retrieve a method with name and type
*/
@Override
public Expr getDefineMethod(Environment env, String name, IDatatype type, IDatatype[] param) {
Extension ext = env.getExtension();
if (ext != null) {
if (env.getQuery().isDebug()) {
ext.setDebug(true);
}
Expr ee = ext.getMethod(name, type, param);
if (ee != null) {
return ee;
}
}
return extension.getMethod(name, type, param);
}
代码示例来源:origin: Wimmics/corese
/**
* run the thread in //
*/
@Override
public void run(){
Mappings res = null;
MyJPanelQuery panel = frame.getPanel();
if (isValidate()){
//res = validate();
res = compile();
if (res != null) {
if (res.getQuery().isDebug()) {
logger.info("\n" + res.getQuery());
}
}
}
else {
res = query();
}
frame.setBuffer(null);
panel.display(res, frame);
//frame.getPanel().display(res,frame);
}
代码示例来源:origin: Wimmics/corese
/**
* construct {} where {} *
*/
void construct(Mappings map, Dataset ds) {
Query query = map.getQuery();
Graph gg = Graph.create();
// can be required to skolemize
gg.setSkolem(isSkolem());
Construct cons = Construct.create(query, new GraphManager(gg));
cons.setDebug(isDebug() || query.isDebug());
cons.construct(map);
map.setGraph(gg);
}
代码示例来源:origin: fr.inria.corese/kgram
void initMemory(Query q) {
if (memory == null) {
// when subquery, memory is already assigned
// assign stack index to EDGE and NODE
q.complete(producer);//service while1 / Query
memory = new Memory(match, evaluator);
memory.setEval(this);
getEvaluator().init(memory);
// create memory bind stack
memory.init(q);
if (hasEvent) {
memory.setEventManager(manager);
}
producer.init(q);
evaluator.start(memory);
debug = q.isDebug();
if (q.isAlgebra()){
complete(q);
}
if (debug){
System.out.println(q);
}
}
}
代码示例来源:origin: fr.inria.corese/compiler
/**
* Define function into Extension Export into Interpreter
*/
void define(ASTExtension aext, Query q) {
Extension ext = q.getCreateExtension();
DatatypeHierarchy dh = new DatatypeHierarchy();
if (q.isDebug()) dh.setDebug(true);
ext.setHierarchy(dh);
for (ASTFunMap m : aext.getMaps()) {
for (Function exp : m.values()) {
ext.define(exp);
if (exp.isPublic()) {
definePublic(exp, q);
}
}
}
}
代码示例来源:origin: Wimmics/corese
/**
* Define function into Extension Export into Interpreter
*/
void define(ASTExtension aext, Query q) {
Extension ext = q.getCreateExtension();
DatatypeHierarchy dh = new DatatypeHierarchy();
if (q.isDebug()) dh.setDebug(true);
ext.setHierarchy(dh);
for (ASTFunMap m : aext.getMaps()) {
for (Function exp : m.values()) {
ext.define(exp);
if (exp.isPublic()) {
definePublic(exp, q);
}
}
}
}
代码示例来源:origin: fr.inria.corese/compiler
public void parse(Atom g, fr.inria.corese.sparql.triple.parser.Exp exp){
for (fr.inria.corese.sparql.triple.parser.Exp pragma : exp.getBody()){
if (query != null && query.isDebug()) Message.log(Message.PRAGMA, pragma);
if (pragma.isTriple()){
Triple t = pragma.getTriple();
if (t.isExp()){
}
else {
triple(g, t, exp);
}
}
else if (pragma.isGraph()){
Source gp = (Source) pragma;
parse(gp.getSource(), gp.getBody().get(0));
}
else if (pragma.isRDFList()){
RDFList list = (RDFList) pragma;
list(g, list);
}
else if (pragma.isAnd()){
parse(g, pragma);
}
}
}
代码示例来源:origin: Wimmics/corese
/**
* Draft test
* Assign class hierarchy to query extension
* Goal: emulate method inheritance for xt:method(name, term)
* Search method name in type hierarchy
* @test select where
*/
void setMethodHandler(Producer p, Environment env){
Extension ext = env.getQuery().getActualExtension();
ASTQuery ast = (ASTQuery) env.getQuery().getAST();
if (ext != null && ext.isMethod() && ast.hasMetadata(Metadata.TEST)){
ClassHierarchy ch = new ClassHierarchy(getGraph(p));
if (env.getQuery().getGlobalQuery().isDebug()){
ch.setDebug(true);
}
ext.setHierarchy(ch);
// WARNING: draft test below
// store current graph in the Interpreter
// hence it does not scale with several graph
// e.g. in server mode
Interpreter.getExtension().setHierarchy(ch);
}
}
内容来源于网络,如有侵权,请联系作者删除!