本文整理了Java中org.apache.jena.query.Query.getBaseURI
方法的一些代码示例,展示了Query.getBaseURI
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getBaseURI
方法的具体详情如下:
包路径:org.apache.jena.query.Query
类名称:Query
方法名:getBaseURI
暂无
代码示例来源: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: apache/jena
@Override
public NodeValue eval(NodeValue v, FunctionEnv env)
{
String baseIRI = null ;
if ( env.getContext() != null )
{
Query query = (Query)env.getContext().get(ARQConstants.sysCurrentQuery) ;
if ( query != null )
baseIRI = query.getBaseURI() ;
}
return NodeFunctions.iri(v, baseIRI) ;
}
代码示例来源:origin: SmartDataAnalytics/DL-Learner
String baseURI = query.getBaseURI();
query.setBaseURI((String) null);
代码示例来源:origin: com.marklogic/marklogic-jena
private SPARQLQueryDefinition prepareQueryDefinition(Query query) {
JenaDatabaseClient client = markLogicDatasetGraph.getDatabaseClient();
SPARQLQueryDefinition qdef = client.newQueryDefinition(query.toString());
if (query.getBaseURI() != null) {
qdef.setBaseUri(query.getBaseURI());
} else {
query.setBaseURI((String) null);
}
if (markLogicDatasetGraph.getRulesets() != null) {
qdef.setRulesets(markLogicDatasetGraph.getRulesets());
}
bindVariables(qdef, this.initial, markLogicDatasetGraph);
QueryDefinition constrainingQueryDefinition = markLogicDatasetGraph.getConstrainingQueryDefinition();
qdef.setConstrainingQueryDefinition(constrainingQueryDefinition);
return qdef;
}
代码示例来源:origin: apache/jena
protected void runTestWorker(Query query, Syntax syntax)
{
IndentedLineBuffer buff = new IndentedLineBuffer() ;
query.serialize(buff, syntax) ;
String baseURI = null ;
if ( ! query.explicitlySetBaseURI() )
// Not in query - use the same one (e.g. file read from) .
baseURI = query.getBaseURI() ;
// Query syntax and algebra tests.
try {
QueryUtils.checkParse(query) ;
}
catch (RuntimeException ex)
{
System.err.println("**** Test: "+getName()) ;
System.err.println("** "+ex.getMessage()) ;
System.err.println(query) ;
throw ex ;
}
try {
QueryUtils.checkOp(query, true) ;
} catch (SSEParseException ex)
{
System.err.println("**** Test: "+getName()) ;
System.err.println("** Algebra error: "+ex.getMessage()) ;
}
}
代码示例来源:origin: apache/jena
private DatasetGraph prepareDataset(DatasetGraph originalDataset, Query query) {
DatasetDescription dsDesc = DatasetDescription.create(query, context) ;
DatasetGraph dsg = originalDataset;
if ( dsg != null ) {
if ( dsDesc != null ) {
if ( query.hasDatasetDescription() )
dsg = dynamicDataset(dsDesc, dsg, false);
}
return dsg;
}
// No DatasetGraph
if ( ! query.hasDatasetDescription() )
throw new QueryExecException("No dataset and no dataset description for query");
// DatasetDescription : Build it.
String baseURI = query.getBaseURI() ;
if ( baseURI == null )
baseURI = IRIResolver.chooseBaseURI().toString() ;
dsg = DatasetUtils.createDatasetGraph(dsDesc, baseURI ) ;
return dsg ;
}
代码示例来源:origin: apache/jena
if ( ! query.explicitlySetBaseURI() )
baseURI = query.getBaseURI() ;
内容来源于网络,如有侵权,请联系作者删除!