Examples of ARQParser


Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

      pelletInfGraph.prepare();

      QueryParameters queryParameters = new QueryParameters( initialBinding );

      ARQParser parser = new ARQParser( handleVariableSPO );
      // The parser uses the query parameterization to resolve parameters
      // (i.e. variables) in the query
      parser.setInitialBinding( initialBinding );

      com.clarkparsia.pellet.sparqldl.model.Query q = parser.parse( query, kb );
      // The query uses the query parameterization to resolve bindings
      // (i.e. for instance if the parameter variable is in query
      // projection, we need to add the initial binding to the resulting
      // bindings manually)
      q.setQueryParameters( queryParameters );
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

  }
   
  @Before
  public void before() {
    kb = new JenaLoader().createKB(base + kbFile);
    parser = new ARQParser();
  }
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

  public static void beforeClass() {
    ARQTerpParser.registerFactory();
   
    JenaLoader loader = new JenaLoader();
    kb = loader.createKB(base+"parent.ttl");
     parser = new ARQParser();
  }
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

  public static QueryExec getQueryExec() {
    return new CombinedQueryEngine();
  }

  public static QueryParser getParser() {
    return new ARQParser();
  }
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

 
  @Test
  public void classQuery() {   
    classes( A, B, C );
   
    Query query1 = new ARQParser().parse(
      "PREFIX rdf: <" + Namespaces.RDF + "> " +
      "PREFIX owl: <" + Namespaces.OWL + "> " +
      "SELECT ?c WHERE { ?c rdf:type owl:Class }", kb );
   
    testQuery( query1, new ATermAppl[][] { { A }, { B }, { C }, { TOP }, { BOTTOM } } )
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

      pelletInfGraph.prepare();

      QueryParameters queryParameters = new QueryParameters(initialBinding);

      ARQParser parser = new ARQParser(handleVariableSPO);
      // The parser uses the query parameterization to resolve parameters
      // (i.e. variables) in the query
      parser.setInitialBinding(initialBinding);

      com.clarkparsia.pellet.sparqldl.model.Query q = parser.parse(query, kb);
      // The query uses the query parameterization to resolve bindings
      // (i.e. for instance if the parameter variable is in query
      // projection, we need to add the initial binding to the resulting
      // bindings manually)
      q.setQueryParameters(queryParameters);
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

    this( pattern, true );
  }

  public SparqlDLStage(BasicPattern pattern, boolean handleVariableSPO) {
    this.pattern = pattern;
    this.parser = new ARQParser(handleVariableSPO);

    initVars();
  }
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.parser.ARQParser

        PelletInfGraph pelletInfGraph = (PelletInfGraph) graph;

        KnowledgeBase kb = pelletInfGraph.getKB();
        pelletInfGraph.prepare();

        ARQParser parser = new ARQParser();
        // The parser uses the query parameterization to resolve
        // parameters
        // (i.e. variables) in the query
        parser.setInitialBinding( initialBinding );

        try {
          parser.parse( query, kb );
          // parsing successful so we can use Pellet engine
          engineType = QueryEngineType.PELLET;
        } catch( UnsupportedQueryException e ) {
          // parsing failed so we will use the mixed engine
          engineType = QueryEngineType.MIXED;
View Full Code Here

Examples of com.hp.hpl.jena.sparql.lang.arq.ARQParser

    }
   
    private Expr parseSPARQL(ByteArrayInputStream in) throws Throwable
    {
        try {
            ARQParser parser = new ARQParser(in) ;
            parser.setQuery(query) ;
            return parser.Expression() ;
        }
        catch (com.hp.hpl.jena.sparql.lang.arq.ParseException ex)
        { throw new QueryParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn) ; }
        catch (com.hp.hpl.jena.sparql.lang.arq.TokenMgrError tErr)
        { throw new QueryParseException(tErr.getMessage(),-1,-1) ; }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.lang.arq.ARQParser

    // All throwable handling.
    private static void perform(Query query, String string, Action action)
    {
        Reader in = new StringReader(string) ;
        ARQParser parser = new ARQParser(in) ;

        try {
            query.setStrict(true) ;
            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.arq.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.