org.apache.jena.query.Query.getPrefixMapping()方法的使用及代码示例

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

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

Query.getPrefixMapping介绍

暂无

代码示例

代码示例来源:origin: apache/jena

public PrefixMapping getPrefixes() {
  return query.getPrefixMapping();
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

public PrefixMapping getPrefixes() {
  return query.getPrefixMapping();
}

代码示例来源:origin: apache/jena

/**
 * Add prefixes from a prefix mapping.
 * @param prefixes THe prefix mapping to add from.
 */
public void addPrefixes(PrefixMapping prefixes) {
  query.getPrefixMapping().setNsPrefixes(prefixes);
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

/**
 * Add prefixes from a prefix mapping.
 * @param prefixes THe prefix mapping to add from.
 */
public void addPrefixes(PrefixMapping prefixes) {
  query.getPrefixMapping().setNsPrefixes(prefixes);
}

代码示例来源:origin: apache/jena

private Object makeNodeOrPath(Object o)
{
  return makeNodeOrPath(o, query.getPrefixMapping() );
}

代码示例来源:origin: apache/jena

public ExprFactory getExprFactory() {
  return new ExprFactory( query.getPrefixMapping() );
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

private Object makeNodeOrPath(Object o)
{
  return makeNodeOrPath(o, query.getPrefixMapping() );
}

代码示例来源:origin: at.researchstudio.sat/won-core

public PrefixMapping getPrefixMapping() {
  return getQuery().getPrefixMapping();
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

public ExprFactory getExprFactory() {
  return new ExprFactory( query.getPrefixMapping() );
}

代码示例来源:origin: apache/jena

public SDBRequest(Store store, Query query, Context context)
{ 
  super(store) ;
  this.query = query ;
  
  this.prefixMapping = null ;
  if ( query != null )
    prefixMapping = query.getPrefixMapping() ;
  if ( context == null )
    context = SDB.getContext() ;
  this.context = new Context(context) ;
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

@Override
  public Query apply(Query query) {
    Query result = doClone ? query.cloneQuery() : query;

    result.getPrefixMapping().setNsPrefixes(prefixMapping);
    return result;
  }
}

代码示例来源:origin: rdfhdt/hdt-java

public static PrefixMapping getMapping(ExecutionContext ctx) {
  Query query = (Query) ctx.getContext().get(ARQConstants.sysCurrentQuery);        
  return query.getPrefixMapping();
}

代码示例来源:origin: apache/jena

public static void print(Store store, Query query, QueryEngineSDB queryEngine)
{
  if ( queryEngine == null )
    queryEngine = new QueryEngineSDB(store, query) ;
  Op op = queryEngine.getPlan().getOp() ;
  System.out.println(op.toString(query.getPrefixMapping())) ;
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

@Override
public QueryExecution createQueryExecution(Query query) {
  Query q = doClone ? query.cloneQuery() : query;
  q.getPrefixMapping().setNsPrefixes(prefixMapping);
  QueryExecution result = super.createQueryExecution(q);
  return result;
}

代码示例来源:origin: apache/jena

private void insertPrefixesInto(Model model) {
  try {
    if ( dataset != null ) {
      // Load the models prefixes first
      PrefixMapping m = dataset.getDefaultModel();
      model.setNsPrefixes(m);
    }
    // Then add the queries (just the declared mappings)
    // so the query declarations override the data sources.
    model.setNsPrefixes(query.getPrefixMapping());
  }
  catch (Exception ex) {
    Log.warn(this, "Exception in insertPrefixes: " + ex.getMessage(), ex);
  }
}

代码示例来源:origin: apache/jena

protected static void stripNamespacesAndBase(Query q) {
    Map<String, String> prefixes = q.getPrefixMapping().getNsPrefixMap();
    for (String prefix : prefixes.keySet()) {
      q.getPrefixMapping().removeNsPrefix(prefix);
    }
    q.setBaseURI((String)null);
  }
}

代码示例来源:origin: apache/jena

/**
 * Add the settings from the prolog handler argument.
 * @param pfxHandler The PrologHandler to read from
 */
public void addAll(PrologHandler pfxHandler) {
  String val = StringUtils.defaultIfEmpty(pfxHandler.query.getBaseURI(),
      query.getBaseURI());
  if (val != null) {
    setBase(val);
  }
  addPrefixes(pfxHandler.query.getPrefixMapping());
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

/**
 * Add the settings from the prolog handler argument.
 * @param pfxHandler The PrologHandler to read from
 */
public void addAll(PrologHandler pfxHandler) {
  String val = StringUtils.defaultIfEmpty(pfxHandler.query.getBaseURI(),
      query.getBaseURI());
  if (val != null) {
    setBase(val);
  }
  addPrefixes(pfxHandler.query.getPrefixMapping());
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

@Override
  public Query get() {
    Query result = new Query();

    if(prologue != null) {
      result.setBaseURI(prologue.getBaseURI());
//            PrefixMappingImpl tmp = new PrefixMappingImpl();
//            // Note: Query parsing may modify the prefixes, hence create a copy of the prefix mappings
//            tmp.setNsPrefixes(prologue.getPrefixMapping());
      result.getPrefixMapping().setNsPrefixes(prologue.getPrefixMapping());
    }

    return result;
  }

代码示例来源:origin: apache/jena

public QueryIterOpSQL(OpSQL op, 
          QueryIterator input ,
          ExecutionContext context)
{ 
  super(input, context) ;
  this.opSQL = op ;
  SDBRequest req = op.getRequest() ;
  if ( req == null )
    this.request = null ;
  else {
    PrefixMapping pmap = req.getQuery() == null ? null : req.getQuery().getPrefixMapping() ;
    this.request = 
      op.getRequest() == null 
      ? null
      : new SDBRequest(op.getRequest().getStore(), pmap, context.getContext()) ;
  }
}

相关文章