Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.prepareTupleQuery()


    String query = "SELECT DISTINCT manifestFile " + "FROM {x} rdf:first {manifestFile} "
        + "USING NAMESPACE " + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";

    TupleQueryResult manifestResults = con.prepareTupleQuery(QueryLanguage.SERQL, query, MANIFEST_FILE).evaluate();

    while (manifestResults.hasNext()) {
      BindingSet bindingSet = manifestResults.next();
      String manifestFile = bindingSet.getValue("manifestFile").toString();
      suite.addTest(SPARQLQueryTest.suite(manifestFile, factory));
View Full Code Here


  // implements edu.lehigh.swat.bench.ubt.api.Repository.issueQuery(...)
  public QueryResult issueQuery(Query query) {

    try {
      RepositoryConnection con = repository.getConnection();
      TupleQueryResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query.getString()).evaluate();
      con.close();

      return new LUBMQueryResult(queryResult);
    }
    catch (MalformedQueryException e) {
View Full Code Here

    Vector<Value> classes = new Vector<Value>();
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT DISTINCT x FROM {x} rdf:type {y} WHERE isResource(y) AND " +
          "y = <" + OWL.OBJECTPROPERTY + ">";
            TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
            TupleQueryResult results = q.evaluate();
            while (results.hasNext()) {
                BindingSet s = results.next();
        Value result = s.getValue("x");
        classes.add(result);
View Full Code Here

    Vector<Value> classes = new Vector<Value>();
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT DISTINCT x FROM {x} rdf:type {y} WHERE isResource(y) AND " +
          "y = <" + OWL.DATATYPEPROPERTY + ">";
            TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
            TupleQueryResult results = q.evaluate();
            while (results.hasNext()) {
                BindingSet s = results.next();
        Value result = s.getValue("x");
        classes.add(result);
View Full Code Here

    Vector<Value> classes = new Vector<Value>();
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT DISTINCT x FROM {x} rdf:type {y} WHERE isResource(y) AND " +
          "y = <" + OWL.ANNOTATIONPROPERTY + ">";
            TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
            TupleQueryResult results = q.evaluate();
            while (results.hasNext()) {
                BindingSet s = results.next();
        Value result = s.getValue("x");
        classes.add(result);
View Full Code Here

  private Iterator<Value> listClasses(Repository repo) {
    Vector<Value> classes = new Vector<Value>();
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT DISTINCT x FROM {x} p {y}";
            TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
            TupleQueryResult results = q.evaluate();
            while (results.hasNext()) {
                BindingSet s = results.next();
        Value result = s.getValue("x");
        classes.add(result);
View Full Code Here

    Vector<Value> objects = new Vector<Value>();
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT y FROM {<" + ((URI) subject).toString() + ">} <"
              + property.toString() + "> {y}";
            TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
            TupleQueryResult results = q.evaluate();
            while (results.hasNext()) {
                BindingSet s = results.next();
        Value result = s.getValue("x");
        objects.add(result);
View Full Code Here

    boolean answer = false;
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT * FROM {<" + ((URI) subject).toString() + ">} <"
              + property.toString() + "> {y}";
            TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
            TupleQueryResult results = q.evaluate();
      answer = results.hasNext();
      results.close();
      conn.close();
    } catch (Exception e) {
View Full Code Here

    Statement answer = null;
    try {
      RepositoryConnection conn = m_source.getConnection();
      String query = "SELECT y FROM {<" + ((URI) subject).toString() + ">} <"
              + property.toString() + "> {y}";
      TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SERQL, query);
      TupleQueryResult results = q.evaluate();
      if (results.hasNext()) {
        Value object = results.next().getValue("y");
        answer = new StatementImpl(subject, property, object);
      }
View Full Code Here

    Vector<Resource> resources = new Vector<Resource>();
    RepositoryConnection conn;
    try {
      conn = in.getConnection();

      TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, this._SPARQL);
      TupleQueryResult result = tupleQuery.evaluate();

      String firstBindingName = result.getBindingNames().get(0);

      while (result.hasNext()) {
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.