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

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

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

Query.getBaseURI介绍

暂无

代码示例

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

  1. /**
  2. * Add the settings from the prolog handler argument.
  3. * @param pfxHandler The PrologHandler to read from
  4. */
  5. public void addAll(PrologHandler pfxHandler) {
  6. String val = StringUtils.defaultIfEmpty(pfxHandler.query.getBaseURI(),
  7. query.getBaseURI());
  8. if (val != null) {
  9. setBase(val);
  10. }
  11. addPrefixes(pfxHandler.query.getPrefixMapping());
  12. }

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

  1. /**
  2. * Add the settings from the prolog handler argument.
  3. * @param pfxHandler The PrologHandler to read from
  4. */
  5. public void addAll(PrologHandler pfxHandler) {
  6. String val = StringUtils.defaultIfEmpty(pfxHandler.query.getBaseURI(),
  7. query.getBaseURI());
  8. if (val != null) {
  9. setBase(val);
  10. }
  11. addPrefixes(pfxHandler.query.getPrefixMapping());
  12. }

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

  1. @Override
  2. public NodeValue eval(NodeValue v, FunctionEnv env)
  3. {
  4. String baseIRI = null ;
  5. if ( env.getContext() != null )
  6. {
  7. Query query = (Query)env.getContext().get(ARQConstants.sysCurrentQuery) ;
  8. if ( query != null )
  9. baseIRI = query.getBaseURI() ;
  10. }
  11. return NodeFunctions.iri(v, baseIRI) ;
  12. }

代码示例来源:origin: SmartDataAnalytics/DL-Learner

  1. String baseURI = query.getBaseURI();
  2. query.setBaseURI((String) null);

代码示例来源:origin: com.marklogic/marklogic-jena

  1. private SPARQLQueryDefinition prepareQueryDefinition(Query query) {
  2. JenaDatabaseClient client = markLogicDatasetGraph.getDatabaseClient();
  3. SPARQLQueryDefinition qdef = client.newQueryDefinition(query.toString());
  4. if (query.getBaseURI() != null) {
  5. qdef.setBaseUri(query.getBaseURI());
  6. } else {
  7. query.setBaseURI((String) null);
  8. }
  9. if (markLogicDatasetGraph.getRulesets() != null) {
  10. qdef.setRulesets(markLogicDatasetGraph.getRulesets());
  11. }
  12. bindVariables(qdef, this.initial, markLogicDatasetGraph);
  13. QueryDefinition constrainingQueryDefinition = markLogicDatasetGraph.getConstrainingQueryDefinition();
  14. qdef.setConstrainingQueryDefinition(constrainingQueryDefinition);
  15. return qdef;
  16. }

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

  1. protected void runTestWorker(Query query, Syntax syntax)
  2. {
  3. IndentedLineBuffer buff = new IndentedLineBuffer() ;
  4. query.serialize(buff, syntax) ;
  5. String baseURI = null ;
  6. if ( ! query.explicitlySetBaseURI() )
  7. // Not in query - use the same one (e.g. file read from) .
  8. baseURI = query.getBaseURI() ;
  9. // Query syntax and algebra tests.
  10. try {
  11. QueryUtils.checkParse(query) ;
  12. }
  13. catch (RuntimeException ex)
  14. {
  15. System.err.println("**** Test: "+getName()) ;
  16. System.err.println("** "+ex.getMessage()) ;
  17. System.err.println(query) ;
  18. throw ex ;
  19. }
  20. try {
  21. QueryUtils.checkOp(query, true) ;
  22. } catch (SSEParseException ex)
  23. {
  24. System.err.println("**** Test: "+getName()) ;
  25. System.err.println("** Algebra error: "+ex.getMessage()) ;
  26. }
  27. }

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

  1. private DatasetGraph prepareDataset(DatasetGraph originalDataset, Query query) {
  2. DatasetDescription dsDesc = DatasetDescription.create(query, context) ;
  3. DatasetGraph dsg = originalDataset;
  4. if ( dsg != null ) {
  5. if ( dsDesc != null ) {
  6. if ( query.hasDatasetDescription() )
  7. dsg = dynamicDataset(dsDesc, dsg, false);
  8. }
  9. return dsg;
  10. }
  11. // No DatasetGraph
  12. if ( ! query.hasDatasetDescription() )
  13. throw new QueryExecException("No dataset and no dataset description for query");
  14. // DatasetDescription : Build it.
  15. String baseURI = query.getBaseURI() ;
  16. if ( baseURI == null )
  17. baseURI = IRIResolver.chooseBaseURI().toString() ;
  18. dsg = DatasetUtils.createDatasetGraph(dsDesc, baseURI ) ;
  19. return dsg ;
  20. }

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

  1. if ( ! query.explicitlySetBaseURI() )
  2. baseURI = query.getBaseURI() ;

相关文章