com.hp.hpl.jena.query.Query.setSyntax()方法的使用及代码示例

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

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

Query.setSyntax介绍

暂无

代码示例

代码示例来源:origin: com.hp.hpl.jena/arq

@Override
protected Query parse$(final Query query, String queryString)
{
  query.setSyntax(Syntax.syntaxARQ) ;
  Action action = new Action() {
    public void exec(ARQParser parser) throws Exception
    {
      parser.QueryUnit() ;
    }
  } ;
  perform(query, queryString, action) ;
  validateParsedQuery(query) ;
  return query ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

@Override
protected Query parse$(final Query query, String queryString)
{
  query.setSyntax(Syntax.syntaxSPARQL_10) ;
  Action action = new Action() {
    public void exec(SPARQLParser10 parser) throws Exception
    {
      parser.QueryUnit() ;
    }
  } ;
  perform(query, queryString, action) ;
  validateParsedQuery(query) ;
  return query ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
protected Query parse$(final Query query, String queryString)
{
  query.setSyntax(Syntax.syntaxARQ) ;
  Action action = new Action() {
    @Override
    public void exec(ARQParser parser) throws Exception
    {
      parser.QueryUnit() ;
    }
  } ;
  perform(query, queryString, action) ;
  validateParsedQuery(query) ;
  return query ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

@Override
protected Query parse$(final Query query, String queryString)
{
  query.setSyntax(Syntax.syntaxSPARQL_11) ;
  Action action = new Action() {
    public void exec(SPARQLParser11 parser) throws Exception
    {
      parser.QueryUnit() ;
    }
  } ;
  perform(query, queryString, action) ;
  validateParsedQuery(query) ;
  return query ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
protected Query parse$(final Query query, String queryString)
{
  query.setSyntax(Syntax.syntaxSPARQL_10) ;
  Action action = new Action() {
    @Override
    public void exec(SPARQLParser10 parser) throws Exception
    {
      parser.QueryUnit() ;
    }
  } ;
  perform(query, queryString, action) ;
  validateParsedQuery(query) ;
  return query ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
protected Query parse$(final Query query, String queryString)
{
  query.setSyntax(Syntax.syntaxSPARQL_11) ;
  Action action = new Action() {
    @Override
    public void exec(SPARQLParser11 parser) throws Exception
    {
      parser.QueryUnit() ;
    }
  } ;
  perform(query, queryString, action) ;
  validateParsedQuery(query) ;
  return query ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

syntaxURI = query.getSyntax() ;
else
  query.setSyntax(syntaxURI) ;

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

syntaxURI = query.getSyntax() ;
else
  query.setSyntax(syntaxURI) ;

代码示例来源:origin: com.hp.hpl.jena/arq

@Override
protected Query parse$(Query q, String s)
  q.setSyntax(Syntax.syntaxRDQL) ;
  PrefixMapping pm = new PrefixMapping2(ARQConstants.getGlobalPrefixMap(), q.getPrefixMapping()) ;
  q.setPrefixMapping(pm) ;

代码示例来源:origin: com.github.ansell.pellet/pellet-query

@Override
public Query parse(Query query, String queryString) throws QueryParseException {
  if( query == null )
    throw new NullPointerException();
  query.setSyntax( TerpSyntax.getInstance() );
  final SparqlOwlLexer lexer = new SparqlOwlLexer( new ANTLRStringStream( queryString ) );
  final CommonTokenStream tokenStream = new CommonTokenStream( lexer );
  final SparqlOwlParser parser = new SparqlOwlParser( tokenStream );
  SparqlOwlParser.query_return result;
  try {
    result = parser.query();
  } catch( RecognitionException e ) {
    throw new QueryParseException( format( "%s %s", parser.getErrorHeader( e ), parser
        .getErrorMessage( e, parser.getTokenNames() ) ), e.line, e.charPositionInLine );
  }
  final CommonTree t = (CommonTree) result.getTree();
  final CommonTreeNodeStream nodes = new CommonTreeNodeStream( t );
  nodes.setTokenStream( tokenStream );
  final SparqlOwlTreeARQ treeWalker = new SparqlOwlTreeARQ( nodes );
  try {
    treeWalker.query( query );
  } catch( RecognitionException e ) {
    throw new QueryParseException( format( "%s %s", treeWalker.getErrorHeader( e ),
        treeWalker.getErrorMessage( e, parser.getTokenNames() ) ), e.line,
        e.charPositionInLine );
  }
  return query;
}

相关文章