Simple implementation,
        could be better implemented by backend not hitting db for every uri.
499493
def get_many(self, uris):
        
        nodes = {}

        for uri in uris:
            try:
                node = self.get(uri)
            except NodeDoesNotExist:
                continue
            else:
                nodes[uri] = node

        return nodes
1159202
private URI addEndPoint(String endPoint) throws URISyntaxException {

        if (StringUtils.isEmpty(endPoint) || endPoint.equals("/")) {
            return this.baseUri;
        }

        if (this.baseUri.getPath().endsWith("/") || endPoint.startsWith("/")) {
            endPoint = this.baseUri.getPath() + endPoint;
        } else {
            endPoint = this.baseUri.getPath() + "/" + endPoint;
        }

        URI uri = null;

        URIBuilder builder = new URIBuilder();

        builder.setScheme(this.baseUri.getScheme());
        builder.setHost(this.baseUri.getHost());
        builder.setPort(this.baseUri.getPort());
        builder.setPath(endPoint);

        uri = builder.build();
        return uri;
    }
36976
function ( uri ) {
    var ret = {
        folder: false,
        redirect: false
    };

    uri = uri.replace( rSlash, "" );

    for ( var i = serverConfig.siteData.siteLayout.layout.length; i--; ) {
        var layout = serverConfig.siteData.siteLayout.layout[ i ];

        // Break out if folder matched
        if ( ret.folder ) {
            break;
        }

        // Skip hidden navigations
        //if ( layout.identifier === "_hidden" ) {
        //    continue;
        //}

        for ( var j = layout.links.length; j--; ) {
            var link = layout.links[ j ];

            // Matched a root level folder uri request
            if ( rIndexFolder.test( link.typeName ) && link.urlId === uri ) {
                if ( rFolder && keyFiles.folderList ) {
                    break;

                } else if ( rIndex && keyFiles.indexList ) {
                    break;

                } else {
                    ret.folder = true;
                    ret.redirect = ("/" + link.children[ 0 ].urlId + "/");
                    break;
                }
            }
        }
    }

    return ret;
}
868836
def processURI(self, uri, prefix=''):
        
        components = urlparse.urlparse(uri)
        query = dict(urlparse.parse_qsl(components.query))
        bust = True
        bust &= bool(query)  # bust the cache if the query has stuff in it
        # bust the cache if the query key 'cache' isn't true
        bust &= query.get('cache') != 'true'
        return prefix + components.path, bust
452341
private void addQueryParameters(HttpRequestBase request, Map<String, String> params) {
        if (params != null) {
            URIBuilder builder = new URIBuilder(request.getURI());
            for(Map.Entry<String, String> param : params.entrySet()) {
                builder.addParameter(param.getKey(), param.getValue());
            }
            try {
                request.setURI(builder.build());
            } catch (URISyntaxException e) {
                throw new RuntimeException("Unable to construct API URI", e);
            }
        }
    }
1117576
def prepare(method, request_uri, params = {})
      method = method.downcase.to_s

      if TheBigDB.api_key.is_a?(String) and !TheBigDB.api_key.empty?
        params.merge!("api_key" => TheBigDB.api_key)
      end

      # we add the API version to the URL, with a trailing slash and the rest of the request
      request_uri = "/v#{TheBigDB.api_version}" + (request_uri.start_with?("/") ? request_uri : "/#{request_uri}")

      if method == "get"
        encoded_params = TheBigDB::Helpers::serialize_query_params(params)
        @http_request = Net::HTTP::Get.new(request_uri + "?" + encoded_params)
      elsif method == "post"
        @http_request = Net::HTTP::Post.new(request_uri)
        @http_request.set_form_data(TheBigDB::Helpers::flatten_params_keys(params))
      else
        raise ArgumentError, "The request method must be 'get' or 'post'"
      end

      @http_request["user-agent"] = "TheBigDB RubyWrapper/#{TheBigDB::VERSION::STRING}"

      client_user_agent = {
        "publisher" => "thebigdb",
        "version" => TheBigDB::VERSION::STRING,
        "language" => "ruby",
        "language_version" => "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})",
      }

      @http_request["X-TheBigDB-Client-User-Agent"] = JSON(client_user_agent)

      self
    end
21076
private URI decodeHarURI(URI rawURI, Configuration conf) throws IOException {
    String tmpAuth = rawURI.getAuthority();
    //we are using the default file
    //system in the config
    //so create a underlying uri and
    //return it
    if (tmpAuth == null) {
      //create a path
      return FileSystem.getDefaultUri(conf);
    }
    String host = rawURI.getHost();
    String[] str = host.split("-", 2);
    if (str[0] == null) {
      throw new IOException("URI: " + rawURI + " is an invalid Har URI.");
    }
    String underLyingScheme = str[0];
    String underLyingHost = (str.length > 1)? str[1]:null;
    int underLyingPort = rawURI.getPort();
    String auth = (underLyingHost == null && underLyingPort == -1)?
                  null:(underLyingHost+":"+underLyingPort);
    URI tmp = null;
    if (rawURI.getQuery() != null) {
      // query component not allowed
      throw new IOException("query component in Path not supported  " + rawURI);
    }
    try {
      tmp = new URI(underLyingScheme, auth, rawURI.getPath(),
            rawURI.getQuery(), rawURI.getFragment());
    } catch (URISyntaxException e) {
        // do nothing should not happen
    }
    return tmp;
  }
448750
private String appendQueryParams(String uri, Map<String, Object> headers) {
        if (!headers.containsKey(QUERY_PARAM_HEADER_NAME)) {
            return uri;
        }

        String requestUri = uri;
        StringBuilder queryParamBuilder = new StringBuilder();
        String queryParams = headers.get(QUERY_PARAM_HEADER_NAME).toString();

        StringTokenizer tok = new StringTokenizer(queryParams, ",");
        if (tok.hasMoreTokens()) {
            while (requestUri.endsWith("/")) {
                requestUri = requestUri.substring(0, requestUri.length() - 1);
            }

            queryParamBuilder.append("?").append(tok.nextToken());
        }

        while (tok.hasMoreTokens()) {
            queryParamBuilder.append("&").append(tok.nextToken());
        }

        return requestUri + queryParamBuilder.toString();
    }
616321
@Override
    public void setURI(URI uri) throws URIException {
        // only set the host if specified by the URI
        if (uri.isAbsoluteURI()) {
            this.httphost = new HttpHost(uri);
        }
        // set the path, defaulting to root
        setPath(
            uri.getPath() == null
            ? "/"
            : uri.getEscapedPath()
        );
        setQueryString(uri.getEscapedQuery());
    }
1313239
private String pageUri(final UriTemplate uriTemplate, final int skip, final int limit) {
        if (limit == MAX_VALUE) {
            return uriTemplate.expand();
        }
        return uriTemplate.set(skipVar(), skip).set(limitVar(), limit).expand();
    }
958642
def post(self, uri, body=None, **kwargs):
        """"""
        return self.fetch('post', uri, kwargs.pop("query", {}), body, **kwargs)
948046
def in_general_ns(uri):
    """"""
    RDFuri = RDF.uri
    RDFSuri = RDFS.uri

    for ns in (RDFuri, RDFSuri, OWL, SKOS, DC):
        if uri.startswith(ns):
            return True
    return False
203076
def _append_params_to_uri(cls, uri, params):
        

        if params:
            return uri + cls._DELIMITER_URL_QUERY + urlencode(params)

        return uri
1218185
def namify(root_uri):
    ''''''

    root_uri = unidecode.unidecode(decode(unquote(root_uri), 'utf-8'))

    generic_domains = set(['localhost', 'herokuapp', 'appspot'])
    urlp = urlparse.urlparse(fix_scheme(root_uri))
    formatargs = collections.defaultdict(list)

    netloc = urlp.netloc.lower()
    if ']' in netloc:
        domain = netloc.rsplit(']:', 1)[0]  # don't need port
    elif ':' in netloc:
        domain = netloc.rsplit(':', 1)[0]  # don't need port
    else:
        domain = netloc

    if not translate(domain,"abcdef:.[]").isdigit():
        if '.' in domain:
            domain, tld = domain.rsplit('.', 1)
        else:
            tld = ''
        if '.' in domain:
            subdomain, domain = domain.rsplit('.', 1)
        else:
            subdomain = ''

        if subdomain != 'www':
            formatargs['subdomain'] = subdomain.split('.')
        if domain not in generic_domains:
            formatargs['domain'].append(domain)
        if len(tld) == 2:
            formatargs['tld'].append(tld.upper())
        elif tld != 'com':
            formatargs['tld'].append(tld)

    formatargs['path'].extend(p for p in urlp.path.lower().split('/') if p)
    formatargs['qargs'].extend(r for q in urlp.query.split(',')
                               for r in q.split('=') if q and r)

    def capify(s):
        '''Capitalizes the first letter of a string, but doesn't downcase the
        rest like .title()'''
        return s if not s else s[0].upper() + s[1:]

    def piece_filter(piece):
        if piece.lower() == 'api':
            formatargs['api'] = True
            return ''
        elif re.match(r'v[\d.]+', piece):
            formatargs['version'].extend(['.', piece])
            return ''
        elif 'api' in piece:
            return piece.replace('api', 'API')
        else:
            return piece

    chain = itertools.chain
    pieces = map(capify, map(piece_filter, chain(
        formatargs['subdomain'],
        formatargs['domain'],
        formatargs['tld'],
        formatargs['path'],
        formatargs['qargs'],
    )))
    return '{pieces}{api}{vrsn}'.format(pieces=''.join(pieces),
                                        api='API' if formatargs['api'] else '',
                                        vrsn=''.join(formatargs['version']),
    )
356720
public function filterRequestUri()
    {
        if ( !empty( $this->versionToken ) )
        {
            // Remove the first occurrence of version token
            $versionSearch = '/' . $this->versionToken;
            $versionPos = strpos( $this->request->uri, $versionSearch );
            if ( $versionPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $versionPos, strlen( $versionSearch ) );
            }
        }
        if ( !empty( $this->apiProviderToken ) )
        {
            // Remove the first occurrence of API provider token
            $providerSearch = '/' . $this->apiProviderToken;
            $providerPos = strpos( $this->request->uri, $providerSearch );
            if ( $providerPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $providerPos, strlen( $providerSearch ) );
            }
        }
    }
1337084
private void handleBaseUriLink(EntityBuilder builder, String baseUri) {
        if (StringUtils.isBlank(baseUri)) {
            return;
        }
        Link link = LinkBuilder.newInstance().setRelationship(Link.RELATIONSHIP_BASEURI).setHref(baseUri).build();
        builder.addLink(link);
    }
278949
def resource_uri(self):
        
        primary_key_value = getattr(self, self.primary_key(), None)
        return '/{}/{}'.format(self.endpoint(), primary_key_value)