本文整理了Java中fr.inria.edelweiss.kgram.core.Query.isTemplate
方法的一些代码示例,展示了Query.isTemplate
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.isTemplate
方法的具体详情如下:
包路径:fr.inria.edelweiss.kgram.core.Query
类名称:Query
方法名:isTemplate
暂无
代码示例来源:origin: fr.inria.wimmics/corese-core
public void defQuery(Query q) {
if (q.isTemplate()) {
defTemplate(q);
} else {
list.add(q);
}
}
代码示例来源:origin: fr.inria.wimmics/corese-core
/**
* Process type check queries
*/
void query(Graph g) {
for (String q : QUERIES) {
Mappings map = query(g, QUERY + q);
if (map.getQuery().isTemplate()){
System.out.println(map.getTemplateResult().getLabel());
}
else if (map.size() > 0) {
System.out.println(map);
}
}
}
代码示例来源:origin: fr.inria.wimmics/corese-core
@Override
public String toString(){
if (query != null && query.isTemplate()){
Node node = map.getTemplateResult();
if (node != null){
return node.getLabel();
}
return "";
}
if (graph == null){
return "";
}
Transformer p = createPP();
return p.toString();
}
代码示例来源:origin: fr.inria.wimmics/corese-core
@Override
public String stringValue(Data data) {
Mappings m = data.getMappings();
if (m.getQuery().isTemplate()){
return m.getTemplateStringResult();
}
ResultFormat f = ResultFormat.format(m);
return f.toString();
}
代码示例来源:origin: fr.inria.wimmics/kggui
if (q.isTemplate() || ast.isAsk() || ast.getErrors() != null){
tabbedPaneResults.setSelectedIndex(XML_PANEL);
} else{
displayGraph((Graph) map.getGraph(), ast.getNSM());
else if (map.getQuery().isTemplate() && map.getQuery().isPragma(KGGRAPH)) {
display(map, ast.getNSM());
代码示例来源:origin: fr.inria.wimmics/corese-core
@Override
public String stringValue(Data data) {
Mappings m = data.getMappings();
if (m == null){
ResultFormat f = ResultFormat.create(data.getGraph(), format);
return f.toString();
}
if (m.getQuery().isTemplate()){
return m.getTemplateStringResult();
}
ResultFormat f = ResultFormat.create(m, format);
return f.toString();
}
代码示例来源:origin: fr.inria.wimmics/sparql
String format(Computer eval, Binding b, Environment env, Producer prod) {
String sep = " ";
if (getArg() != null) {
// separator as an evaluable expression: st:nl()
IDatatype dt = getArg().eval(eval, b, env, prod);
sep = dt.getLabel();
} else {
if (getModality() != null) {
sep = getModality();
}
if (env.getQuery().isTemplate()) {
if (sep.equals("\n") || sep.equals("\n\n")) {
// get the indentation by evaluating a predefined st:nl()
// computed by PluginImpl/Transformer
// same as: separator = 'st:nl()'
Expression nl = (Expression) env.getQuery().getTemplateNL().getFilter().getExp();
IDatatype dt = nl.eval(eval, b, env, prod);
String str = dt.getLabel();
if (sep.equals("\n\n")) {
str = NL + str;
}
sep = str;
}
}
}
return sep;
}
代码示例来源:origin: fr.inria.wimmics/corese-core
String mapToString(){
Query q = map.getQuery();
if (q == null) {
return "";
}
ASTQuery ast = (ASTQuery) q.getAST();
if (q.isTemplate()
|| (q.hasPragma(Pragma.TEMPLATE) && map.getGraph() != null)) {
return TemplateFormat.create(map).toString();
} else {
if (type == UNDEF_FORMAT) {
if (q.isConstruct()) {
type = getConstructFormat();
}
else {
type = getSelectFormat();
}
}
return process(map, type);
}
}
代码示例来源:origin: fr.inria.wimmics/corese-core
@Override
public Data run(Data data) throws EngineException {
if (isDefault && data.getMappings() != null && data.getMappings().getQuery().isTemplate()){
// former SPARQLProcess is a template {} where {}
// this Transformer is default transformer : return former template result
return data;
}
Transformer t = Transformer.create(data.getGraph(), getPath());
setTransfomer(t);
init(t, data, getContext());
Data res = new Data(data.getGraph());
IDatatype dt = t.process();
if (dt != null){
res.setTemplateResult(dt.getLabel());
res.setDatatypeValue(dt);
}
res.setProcess(this);
complete(t, res);
return res;
}
代码示例来源:origin: fr.inria.wimmics/corese-core
else if (map.getQuery().isTemplate()){
内容来源于网络,如有侵权,请联系作者删除!