Examples of GraphQuery


Examples of org.openrdf.query.GraphQuery

    queryBuilder.append(" CONSTRUCT *");
    queryBuilder.append(" FROM {} foaf:name {name};");
    queryBuilder.append("         foaf:mbox {mbox}");
    queryBuilder.append(" USING NAMESPACE foaf = <" + FOAF_NS + ">");

    GraphQuery query = testCon.prepareGraphQuery(QueryLanguage.SERQL, queryBuilder.toString());
    query.setBinding("name", nameBob);

    GraphQueryResult result = query.evaluate();

    try {
      assertTrue(result != null);
      assertTrue(result.hasNext());

View Full Code Here

Examples of org.openrdf.query.GraphQuery

    assertConnected();

    GraphBuildingRDFHandler aHandler = new GraphBuildingRDFHandler();

    try {
      GraphQuery aQuery = mConnection.prepareGraphQuery(mQueryLang, theQuery);
      aQuery.evaluate(aHandler);     
      return aHandler.getGraph();   
    }
    catch (Exception e) {
      throw new QueryException(e);
    }
View Full Code Here

Examples of org.openrdf.query.GraphQuery

    }
    return (Value[][]) results.toArray(new Value[0][0]);
  }

  private static Graph doGraphQuery(RepositoryConnection con, String query) throws RepositoryException, MalformedQueryException, QueryEvaluationException {
    GraphQuery resultsTable = con.prepareGraphQuery(QueryLanguage.SPARQL, query);
    GraphQueryResult statements = resultsTable.evaluate();
    Graph g = new GraphImpl();

    Vector<Value[]> results = new Vector<Value[]>();
    for (int row = 0; statements.hasNext(); row++) {
      Statement pairs = statements.next();
View Full Code Here

Examples of org.openrdf.query.GraphQuery

    }
    return (Value[][]) results.toArray(new Value[0][0]);
  }

  private static Graph doGraphQuery(RepositoryConnection con, String query) throws RepositoryException, MalformedQueryException, QueryEvaluationException {
    GraphQuery resultsTable = con.prepareGraphQuery(QueryLanguage.SPARQL, query);
    GraphQueryResult statements = resultsTable.evaluate();
    Graph g = new GraphImpl();

    Vector<Value[]> results = new Vector<Value[]>();
    for (int row = 0; statements.hasNext(); row++) {
      Statement pairs = statements.next();
View Full Code Here

Examples of org.openrdf.query.GraphQuery

  public GraphQuery prepareGraphQuery(QueryLanguage language, final String query, String baseURI) throws RepositoryException, MalformedQueryException {

    if (language != QueryLanguage.SPARQL)
      throw new UnsupportedQueryLanguageException(" : Only SPARQL queries are supported");

    GraphQuery q = new VirtuosoGraphQuery() {
      public GraphQueryResult evaluate() throws QueryEvaluationException {
        return executeSPARQLForGraphResult(query, getDataset(), getIncludeInferred(), getBindings());
      }

      public void evaluate(RDFHandler handler) throws QueryEvaluationException, RDFHandlerException {
View Full Code Here

Examples of org.openrdf.query.GraphQuery

   */
//??TODO use another new options timeout
  public GraphQuery prepareGraphQuery(QueryLanguage language, final String query, String baseURI)
    throws StoreException, MalformedQueryException
  {
    GraphQuery q = new VirtuosoGraphQuery() {
      public GraphResult evaluate() throws StoreException {
        return executeSPARQLForGraphResult(query, getDataset(), getIncludeInferred(), getBindings());
      }
    };
    return q;
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.