Package org.openrdf.query

Examples of org.openrdf.query.TupleQuery.evaluate()


    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


    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

    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

    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

    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);
      }
      results.close();
View Full Code Here

    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()) {
        Value uri = result.next().getBinding(firstBindingName).getValue();
View Full Code Here

    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()) {
        Value uri = result.next().getBinding(firstBindingName).getValue();
View Full Code Here

    try {
      RepositoryConnection con = repos.getConnection();
      try {

        TupleQuery query = con.prepareTupleQuery(QueryLanguage.SPARQL,CLASSES_QUERY_P1 + uri + CLASSES_QUERY_P2);
        TupleQueryResult res = query.evaluate();

        Set<String> seen = new HashSet<String>();
        while (res.hasNext()) {
          BindingSet solution = res.next();
          String clazzURI = solution.getValue("resource").stringValue();
View Full Code Here

              description, name, uri);
          classes.add(clazz);
        }
       
        query = con.prepareTupleQuery(QueryLanguage.SPARQL,PROPERTIES_QUERY_P1 + uri + PROPERTIES_QUERY_P2);
        res = query.evaluate();
        seen = new HashSet<String>();
        while (res.hasNext()) {
          BindingSet solution = res.next();
          String propertyUri = solution.getValue("resource").stringValue();
          if (seen.contains(propertyUri)) {
View Full Code Here

        try {
            RepositoryConnection connection = sesameService.getConnection();
            try {
                connection.begin();
                TupleQuery tupleQuery = connection.prepareTupleQuery(queryLanguage, query);
                TupleQueryResult r = tupleQuery.evaluate();
                try {
                    while (r.hasNext()) {
                        BindingSet s = r.next();
                        Map<String, Value> map = new HashMap<String, Value>();
                        for (Binding binding : s) {
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.