Examples of prepareTupleQuery()


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

        + "        mf:action {} qt:query {query}; " + "                     qt:data {input} "
        + "USING NAMESPACE " + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>, "
        + "  tck = <urn:openrdf.org:sesame:tests#> ";

    TupleResult tests = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
    while (tests.hasNext()) {
      BindingSet testBindings = tests.next();
      String testName = ((Literal)testBindings.getValue("testName")).getLabel();
      String inputFile = testBindings.getValue("input").toString();
      String queryFile = testBindings.getValue("query").toString();
View Full Code Here

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

          + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>,"
          + "  qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";

      List<String> graphNames = new ArrayList<String>();

      TupleResult graphs = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
      while (graphs.hasNext()) {
        BindingSet graphBindings = graphs.next();
        graphNames.add(graphBindings.getValue("graph").toString());
      }
      graphs.close();
View Full Code Here

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

         RepositoryConnection con = _repository.getConnection();
         try
         {
           BindingSet bindingSet;

           TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, String.format(SELECT_CodeList_TEMPLATE,codeList));
           TupleQueryResult result = tupleQuery.evaluate();
              
           if(result.hasNext())
             {                
               bindingSet = result.next();
View Full Code Here

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

             
            }
          }else{
            //return values without metadata
            RepositoryConnection connection = dataRepo.getConnection();
            TupleQuery compiledQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, query);
            TupleQueryResult results = compiledQuery.evaluate()
           
         
            BindingSet set;
            Resource r;
View Full Code Here

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

      if (con!=null) {
        try {
         
          String query = "prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT DISTINCT * WHERE {<"+r+"> rdf:type ?o }";
 
          TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, query);
 
          TupleQueryResult result = tupleQuery.evaluate();
          try {
            String firstBindingName = result.getBindingNames().get(0);
            while (result.hasNext()) {
View Full Code Here

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

      }
      if (con!=null) {
        try {
          String query = "prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT DISTINCT ?o WHERE { ?s rdf:type ?o } ORDER BY ?o";
 
          TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, query);
 
          TupleQueryResult result = tupleQuery.evaluate();
          try {
            String firstBindingName = result.getBindingNames().get(0);
            while (result.hasNext()) {
View Full Code Here

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

    }
    try {

      String query = "prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?s WHERE { ?s rdf:type <" + uri + "> }";

      TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, query);
      TupleQueryResult result = tupleQuery.evaluate();

      try {

        String firstBindingName = result.getBindingNames().get(0);
View Full Code Here

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

                "} " +
                "GROUP BY ?c1 ?p ?c2";

        System.out.println(queryString);

        TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
        TupleQueryResult result = tupleQuery.evaluate();
        try {
          while (result.hasNext()) {
            BindingSet bindingSet = result.next();
            Value valueOfC1 = bindingSet.getValue("c1");
View Full Code Here

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

                "} " +
                "GROUP BY ?c ?p";

        System.out.println(queryString);

        TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
        TupleQueryResult result = tupleQuery.evaluate();
        try {
          while (result.hasNext()) {
            BindingSet bindingSet = result.next();
            Value valueOfC = bindingSet.getValue("c");
View Full Code Here

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

                RepositoryConnection connection = repository.getConnection();
                TupleQueryResult result = null;
                try
                {

                    TupleQuery tupleQuery = connection.prepareTupleQuery( language, query );

                    for (Map.Entry<String, Value> stringValueEntry : getBindings( bindings ).entrySet())
                    {
                        tupleQuery.setBinding(stringValueEntry.getKey(), stringValueEntry.getValue());
                    }
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.