本文整理了Java中fr.inria.corese.kgram.core.Query.getExtension
方法的一些代码示例,展示了Query.getExtension
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getExtension
方法的具体详情如下:
包路径:fr.inria.corese.kgram.core.Query
类名称:Query
方法名:getExtension
暂无
代码示例来源:origin: fr.inria.corese/kgram
public boolean hasDefinition(){
return getExtension() != null || getGlobalQuery().getExtension() != null;
}
代码示例来源:origin: fr.inria.corese/kgram
public Extension getCreateExtension() {
if (getExtension() == null){
setExtension(new Extension());
}
return getExtension();
}
代码示例来源:origin: fr.inria.corese/kgram
public Expr getLocalExpression(String name){
if (getExtension() != null){
Expr exp = getExtension().get(name);
if (exp != null){
return exp.getFunction();
}
}
return null;
}
代码示例来源:origin: fr.inria.corese/kgram
public Extension getActualExtension(){
return getGlobalQuery().getExtension();
}
代码示例来源:origin: Wimmics/corese
/**
* templates share profile function definitions
* function st:optimize(){} : run TransformerVisitor to optimize template
*/
public void profile() {
Query profile = getTemplate(STL_PROFILE);
if (profile != null) {
if (profile.getExtension() != null) {
// share profile function definitions in templates
fr.inria.corese.compiler.parser.Transformer tr = fr.inria.corese.compiler.parser.Transformer.create();
tr.definePublic(profile.getExtension(), profile, false);
TransformerVisitor tv = new TransformerVisitor(profile.getExtension().get(Transformer.STL_OPTIMIZE) != null);
for (Query t : getTemplates()) {
t.addExtension(profile.getExtension());
tv.visit(t);
}
for (Query t : getNamedTemplates()) {
t.addExtension(profile.getExtension());
tv.visit(t);
}
}
}
}
代码示例来源:origin: fr.inria.corese/compiler
public boolean getLinkedFunction(String label) {
if (! isLinkedFunction()){
return false;
}
String path = NSManager.namespace(label);
if (loaded.containsKey(path)) {
return true;
}
logger.info("Load Linked Function: " + label);
loaded.put(path, path);
Query imp = sparql.parseQuery(path);
if (imp != null && imp.hasDefinition()) {
// loaded functions are exported in Interpreter
definePublic(imp.getExtension(), imp);
return true;
}
return false;
}
代码示例来源:origin: Wimmics/corese
public boolean getLinkedFunction(String label) {
if (! isLinkedFunction()){
return false;
}
String path = NSManager.namespace(label);
if (loaded.containsKey(path)) {
return true;
}
logger.info("Load Linked Function: " + label);
loaded.put(path, path);
Query imp = sparql.parseQuery(path);
if (imp != null && imp.hasDefinition()) {
// loaded functions are exported in Interpreter
definePublic(imp.getExtension(), imp);
return true;
}
return false;
}
代码示例来源:origin: Wimmics/corese
if (qprofile.getExtension() != null){
tr.definePublic(qprofile.getExtension(), qprofile, false);
for (Query t : qe.getTemplates()) {
t.addExtension(qprofile.getExtension());
t.addExtension(qprofile.getExtension());
代码示例来源:origin: Wimmics/corese
Extension ext = q.getExtension();
Transformer t = getTransformer(env, p);
代码示例来源:origin: fr.inria.corese/corese-core
/**
* Default result when all templates fail
*/
IDatatype defaut(IDatatype dt, Query q) {
if (isBoolean()) {
return defaultBooleanResult();
}
int ope = defaut;
if (q != null) {
// Expr exp = q.getProfile(STL_DEFAULT);
Extension ext = q.getExtension();
if (ext != null) {
Expr exp = ext.get(STL_DEFAULT);
if (exp != null) {
ope = exp.getBody().oper(); //getExp(1).oper();
}
}
}
return display(dt, ope);
}
代码示例来源:origin: Wimmics/corese
/**
* Default result when all templates fail
*/
IDatatype defaut(IDatatype dt, Query q) {
if (isBoolean()) {
return defaultBooleanResult();
}
int ope = defaut;
if (q != null) {
// Expr exp = q.getProfile(STL_DEFAULT);
Extension ext = q.getExtension();
if (ext != null) {
Expr exp = ext.get(STL_DEFAULT);
if (exp != null) {
ope = exp.getBody().oper(); //getExp(1).oper();
}
}
}
return display(dt, ope);
}
代码示例来源:origin: Wimmics/corese
IDatatype eval(String name, IDatatype dt, IDatatype def, Environment env) {
if (env != null && env.getQuery() != null) {
Query q = env.getQuery();
Extension ext = q.getExtension();
if (ext != null) {
Expr function = ext.get(name, (dt == null) ? 0 : 1);
if (function != null) {
IDatatype dt1 = new Funcall(name).call((Interpreter) exec.getEvaluator(),
(Binding) env.getBind(), env, exec.getProducer(), (Function) function, param(dt));
return dt1;
}
}
}
return def;
}
代码示例来源:origin: fr.inria.corese/corese-core
IDatatype eval(String name, IDatatype dt, IDatatype def, Environment env) {
if (env != null && env.getQuery() != null) {
Query q = env.getQuery();
Extension ext = q.getExtension();
if (ext != null) {
Expr function = ext.get(name, (dt == null) ? 0 : 1);
if (function != null) {
IDatatype dt1 = new Funcall(name).call((Interpreter) exec.getEvaluator(),
(Binding) env.getBind(), env, exec.getProducer(), (Function) function, param(dt));
return dt1;
}
}
}
return def;
}
代码示例来源:origin: fr.inria.corese/corese-core
/**
* Load templates from directory (.rq) or from a file (.rul)
*/
void init() {
setOptimize(table.isOptimize(pp));
Loader load = new Loader(this);
load.setDataset(ds);
qe = load.load(getTransformation());
// templates share profile functions
qe.profile();
// templates share table: transformation -> Transformer
complete();
if (isCheck()) {
check();
}
setHasDefault(qe.getTemplate(STL_DEFAULT) != null);
Query profile = qe.getTemplate(STL_PROFILE);
if (profile != null && profile.getExtension() != null) {
Expr exp = profile.getExtension().get(STL_AGGREGATE);
if (exp != null) {
defAggregate = exp.getBody().oper();
}
}
qe.sort();
}
代码示例来源:origin: Wimmics/corese
/**
* Load templates from directory (.rq) or from a file (.rul)
*/
void init() {
setOptimize(table.isOptimize(pp));
Loader load = new Loader(this);
load.setDataset(ds);
qe = load.load(getTransformation());
// templates share profile functions
qe.profile();
// templates share table: transformation -> Transformer
complete();
if (isCheck()) {
check();
}
setHasDefault(qe.getTemplate(STL_DEFAULT) != null);
Query profile = qe.getTemplate(STL_PROFILE);
if (profile != null && profile.getExtension() != null) {
Expr exp = profile.getExtension().get(STL_AGGREGATE);
if (exp != null) {
defAggregate = exp.getBody().oper();
}
}
qe.sort();
}
内容来源于网络,如有侵权,请联系作者删除!