Package org.openrdf.query

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


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


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

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

    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);
        while (result.hasNext()) {
View Full Code Here

            throw new YardException(message, e);
        }
        if(dataset != null){ //respect the configured contexts
            sparqlOuery.setDataset(dataset);
        }
        return sparqlOuery.evaluate();
    }
   
    @Override
    public QueryResultList<Representation> findRepresentation(FieldQuery parsedQuery) throws YardException, IllegalArgumentException {
        if(parsedQuery == null){
View Full Code Here

        Set<Project> projects = new HashSet<Project>();
        TupleQueryResult result = null;
        try
        {
            TupleQuery tupleQuery = repositoryConnection.prepareTupleQuery( QueryLanguage.SERQL, projectQuery );
            result = tupleQuery.evaluate();
            while ( result.hasNext() )
            {
                BindingSet set = result.next();

                String groupId = set.getBinding( ProjectUri.GROUP_ID.getObjectBinding() ).getValue().toString();
View Full Code Here

                tupleQuery.setBinding( ProjectUri.CLASSIFIER.getObjectBinding(),
                                       valueFactory.createLiteral( publicKeyTokenId ) );
                project.setPublicKeyTokenId( publicKeyTokenId.replace( ":", "" ) );
            }

            result = tupleQuery.evaluate();

            if ( !result.hasNext() )
            {
               
                //if ( artifactType != null && ArtifactTypeHelper.isDotnetAnyGac( artifactType ) )
View Full Code Here

        throws RepositoryException, MalformedQueryException, QueryEvaluationException
    {
        String query = "SELECT * FROM {x} p {y}";
        TupleQuery tq = repositoryConnection.prepareTupleQuery( QueryLanguage.SERQL, query );
        tq.setBinding( "x", classifierUri );
        TupleQueryResult result = tq.evaluate();

        while ( result.hasNext() )
        {
            BindingSet set = result.next();
            for ( Iterator<Binding> i = set.iterator(); i.hasNext(); )
View Full Code Here

                                           Value dependencyUri )
        throws RepositoryException, MalformedQueryException, QueryEvaluationException
    {
        TupleQuery tq = repositoryConnection.prepareTupleQuery( QueryLanguage.SERQL, dependencyQuery );
        tq.setBinding( "x", dependencyUri );
        TupleQueryResult dependencyResult = tq.evaluate();
        try
        {
            while ( dependencyResult.hasNext() )
            {
                ProjectDependency projectDependency = new ProjectDependency();
View Full Code Here

              SailRepositoryConnection connection = (SailRepositoryConnection)
                  database.getRepository().getConnection();
             
              try {
                  TupleQuery query = _builder.makeTupleQuery(_itemVar, connection);
                  TupleQueryResult queryResult = query.evaluate();
                  try {
                      while (queryResult.hasNext()) {
                          BindingSet bindingSet = queryResult.next();
                          Value v = bindingSet.getValue(_itemVar.getName());
                          if (v instanceof URI) {
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.