Package org.openrdf.query

Examples of org.openrdf.query.BindingSet


      Iterable<? extends BindingSet> queryResult2, Map<BNode, BNode> bNodeMapping, int idx)
  {
    boolean result = false;

    if (idx < queryResult1.size()) {
      BindingSet bs1 = queryResult1.get(idx);

      List<BindingSet> matchingBindingSets = findMatchingBindingSets(bs1, queryResult2, bNodeMapping);

      for (BindingSet bs2 : matchingBindingSets) {
        // Map bNodes in bs1 to bNodes in bs2
View Full Code Here


      request.acceptTupleQueryResult();
      execute(request);
      TupleResult result = request.getTupleQueryResult();
      try {
        if (result.hasNext()) {
          BindingSet bindings = result.next();
          return (BNode)bindings.getValue(BNODE);
        }
        return null;
      }
      finally {
        result.close();
View Full Code Here

    List<Resource> contextList = new ArrayList<Resource>();

    TupleResult contextIDs = client.contexts().list();
    try {
      while (contextIDs.hasNext()) {
        BindingSet bindingSet = contextIDs.next();
        Value context = bindingSet.getValue("contextID");

        if (context instanceof Resource) {
          contextList.add((Resource)context);
        }
      }
View Full Code Here

          writeln(separatorLine);

          // Write table rows

          while (tupleQueryResult.hasNext()) {
            BindingSet bindingSet = tupleQueryResult.next();
            resultCount++;

            sb.setLength(0);
            for (String bindingName : bindingNames) {
              Value value = bindingSet.getValue(bindingName);
              String valueStr = getStringRepForValue(value, namespaces);

              sb.append("| ").append(valueStr);
              StringUtil.appendN(' ', columnWidth - valueStr.length(), sb);
            }
View Full Code Here

    List<RepositoryInfo> result = new ArrayList<RepositoryInfo>();

    try {
      TupleResult responseFromServer = client.repositories().list();
      while (responseFromServer.hasNext()) {
        BindingSet bindingSet = responseFromServer.next();
        RepositoryInfo repInfo = new RepositoryInfo();

        String id = LiteralUtil.getLabel(bindingSet.getValue("id"), null);

        if (skipSystemRepo && id.equals(SystemRepository.ID)) {
          continue;
        }

        Value uri = bindingSet.getValue("uri");
        String description = LiteralUtil.getLabel(bindingSet.getValue("title"), null);

        if (uri instanceof URI) {
          try {
            repInfo.setLocation(new URL(uri.toString()));
          }
View Full Code Here

   *---------*/

  public BindingSet next()
    throws StoreException
  {
    BindingSet rightBindings = rightCursor.next();

    while (rightBindings == null) {
      // right cursor exhausted
      rightCursor.close();

      BindingSet leftBindings = leftCursor.next();
      if (leftBindings != null) {
        rightCursor = strategy.evaluate(rightArg, leftBindings);
        rightBindings = rightCursor.next();
      }
      else {
View Full Code Here

   *---------*/

  public BindingSet next()
    throws StoreException
  {
    BindingSet leftBindings = null;
    BindingSet rightBindings = rightCursor.next();

    while (rightBindings != null || (leftBindings = leftCursor.next()) != null) {
      if (rightBindings == null) {
        // right cursor exhausted
        rightCursor.close();
View Full Code Here

    try {
      List<Entry> orderedEntries = new ArrayList<Entry>();
      Map<Key, Entry> entries = new HashMap<Key, Entry>();

      BindingSet bindingSet;
      while ((bindingSet = iter.next()) != null) {
        Key key = new Key(group, bindingSet);
        Entry entry = entries.get(key);

        if (entry == null) {
View Full Code Here

    Cursor<BindingSet> iter = strategy.evaluate(group.getArg(), parentBindings);

    try {
      Map<Key, Entry> entries = new HashMap<Key, Entry>();

      BindingSet sol;
      while ((sol = iter.next()) != null) {
        Key key = new Key(group, sol);
        Entry entry = entries.get(key);

        if (entry == null) {
View Full Code Here

    }

    @Override
    public boolean equals(Object other) {
      if (other instanceof Key && other.hashCode() == hash) {
        BindingSet otherSolution = ((Key)other).bindingSet;

        for (String name : group.getGroupBindingNames()) {
          Value v1 = bindingSet.getValue(name);
          Value v2 = otherSolution.getValue(name);

          if (!ObjectUtil.nullEquals(v1, v2)) {
            return false;
          }
        }
View Full Code Here

TOP

Related Classes of org.openrdf.query.BindingSet

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.