Package org.openrdf.query

Examples of org.openrdf.query.Binding


    Iterator<Value> bindingIter = GraphUtil.getObjectIterator(graph, solutionNode, BINDING);
    while (bindingIter.hasNext()) {
      Value bindingNode = bindingIter.next();

      if (bindingNode instanceof Resource) {
        Binding binding = getBinding((Resource)bindingNode);
        bindingSet.addBinding(binding);
      }
      else {
        throw new RDFHandlerException("Value for " + BINDING + " is not a resource: " + bindingNode);
      }
View Full Code Here


                        for(BindingSet nextRow : results.getBindingSets()) {
                            Map<String,RDFNode> row = new HashMap<String, RDFNode>();
                           
                            for(String nextBindingName : fieldNames) {
                                if(nextRow.hasBinding(nextBindingName)) {
                                    Binding nextBinding = nextRow.getBinding(nextBindingName);
                                    //Map<String,String> nodeDef = (Map<String,String>) entry.getValue();
                                    Value nodeDef = nextBinding.getValue();
                                    RDFNode node = null;
                                    if(nodeDef instanceof org.openrdf.model.URI) {
                                        node = new URI(nodeDef.stringValue());
                                    } else if(nodeDef instanceof org.openrdf.model.BNode) {
                                        node = new BNode(((org.openrdf.model.BNode)nodeDef).getID());
View Full Code Here

  @Override
  public Map<String, String> mapRow(BindingSet bindingSet) {
    Map<String, String> result = new HashMap<String, String>();
    Iterator<Binding> it = bindingSet.iterator();
    while (it.hasNext()) {
      Binding b = it.next();
      result.put(b.getName(), b.getValue().stringValue());
    }
    return result;
  }
View Full Code Here

            openBraces(); // start of new solution

            Iterator<Binding> bindingIter = bindingSet.iterator();
            while (bindingIter.hasNext()) {
                Binding binding = bindingIter.next();

                writeKeyValue(binding.getName(), binding.getValue());

                if (bindingIter.hasNext()) {
                    writeComma();
                }
            }
View Full Code Here

TOP

Related Classes of org.openrdf.query.Binding

Copyright © 2018 www.massapicom. 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.