Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1143

Extension REST API does not support multiple context values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: BIGDATA_RELEASE_1_4_0
    • Fix Version/s: None
    • Component/s: B+Tree

      Description

      This was first reported for DELETE-BY-ACCESS-PATH. The RemoteRepository is using this pattern to build up these URL query parameters (similar code applies for other REST API methods).

                  if (remove.context != null && remove.context.length > 0) {
                      // set the default context.
                      opts.addRequestParam("context-uri", toStrings(remove.context));
                  }
      

      However, this was not properly turned into multiple URL query parameters in AbstractConnectOptions:

          static public void addQueryParams(final StringBuilder urlString,
                  final Map<String, String[]> requestParams)
                  throws UnsupportedEncodingException {
              if (requestParams == null)
                  return;
              boolean first = true;
              for (Map.Entry<String, String[]> e : requestParams.entrySet()) {
                  urlString.append(first ? "?" : "&");
                  first = false;
                  final String name = e.getKey();
                  final String[] vals = e.getValue();
                  if (vals == null) {
                      urlString.append(URLEncoder.encode(name, RemoteRepository.UTF8));
                  } else {
                      for (String val : vals) {
                          urlString.append(URLEncoder.encode(name, RemoteRepository.UTF8));
                          urlString.append("=");
                          urlString.append(URLEncoder.encode(val, RemoteRepository.UTF8));
                      }
                  }
              } // next Map.Entry
      
          }
      

      The problem is that the "&" character was not appended if the array of values was of length GT ONE. In this case the values were concatenated together rather than appearing as distinct URL query parameter values.

      See BLZG-1209 Resource... contexts not encoded/decoded according to openrdf semantics (REST API)

        Attachments

          Activity

            People

            Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: