fr.inria.corese.kgram.core.Query.getTransformer()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中fr.inria.corese.kgram.core.Query.getTransformer方法的一些代码示例,展示了Query.getTransformer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getTransformer方法的具体详情如下:
包路径:fr.inria.corese.kgram.core.Query
类名称:Query
方法名:getTransformer

Query.getTransformer介绍

暂无

代码示例

代码示例来源:origin: Wimmics/corese

String template(){
  Transformer p = (Transformer) query.getTransformer();
  IDatatype dt = p.getResult(map);
  return dt.getLabel();
}

代码示例来源:origin: Wimmics/corese

@Deprecated
String getBind(Query q) {
  Transformer t = (Transformer) q.getTransformer();
  if (t != null) {
    Context c = t.getContext();
    IDatatype dt = c.get(Context.STL_BIND);
    if (dt != null) {
      return dt.getLabel();
    }
  }
  return null;
}

代码示例来源:origin: Wimmics/corese

void complete(Query q, Transformer t, IDatatype uri) {
  t.complete(q, (Transformer) q.getTransformer());
  if (uri != null){
    t.getContext().set(Transformer.STL_TRANSFORM, uri);
  }
}

代码示例来源:origin: fr.inria.corese/kgram

/**
 * Use case: PluginImpl kgram()
 * Query inherits q transformer information
 * @param q 
 */
public void complete(Query q, Object context){
  setEnvironment(q.getEnvironment());
  setTransformer(q.getTransformer());
  setContext(context);
}

代码示例来源:origin: fr.inria.corese/corese-core

/**
 * Transformer Context:
 * st:context = additional st:context graph such as a default SPARQL query graph (SPARQL Tutorial)
 * profile: st:context [ st:uri <uri> ]
 * st:dataset = the triple store dataset, hence we can have a result graph and the dataset graph
 * The dataset give access e.g to the ontology
 * Use case: 
 * bind (st:get(st:dataset) as ?g) graph ?g { }
 * bind (st:get(st:context) as ?g) graph ?g { }.
 */
String process(Mappings map, Graph g, String trans){ 
  Transformer t = Transformer.create(g, trans);
  context.setTransform(trans);        
  complete(context, graph);
  t.setContext(context);
  
  if (map != null && map.getQuery() != null){
    // Transformer inherit Query Transformer Visitor if any
    Transformer tr = (Transformer) map.getQuery().getTransformer();
    if (tr != null && tr.getVisitor() != null){
      t.setVisitor(tr.getVisitor());
    }
  }
  return t.toString();
}

代码示例来源:origin: Wimmics/corese

/**
 * Transformer Context:
 * st:context = additional st:context graph such as a default SPARQL query graph (SPARQL Tutorial)
 * profile: st:context [ st:uri <uri> ]
 * st:dataset = the triple store dataset, hence we can have a result graph and the dataset graph
 * The dataset give access e.g to the ontology
 * Use case: 
 * bind (st:get(st:dataset) as ?g) graph ?g { }
 * bind (st:get(st:context) as ?g) graph ?g { }.
 */
String process(Mappings map, Graph g, String trans){ 
  Transformer t = Transformer.create(g, trans);
  context.setTransform(trans);        
  complete(context, graph);
  t.setContext(context);
  
  if (map != null && map.getQuery() != null){
    // Transformer inherit Query Transformer Visitor if any
    Transformer tr = (Transformer) map.getQuery().getTransformer();
    if (tr != null && tr.getVisitor() != null){
      t.setVisitor(tr.getVisitor());
    }
  }
  return t.toString();
}

代码示例来源:origin: Wimmics/corese

ASTQuery ast = (ASTQuery) q.getAST();
String transform = getTrans(uri);
Transformer t = (Transformer) q.getTransformer(transform);

相关文章