Whether the URI is a relative-path reference.

A relative reference that does not begin with a slash character is termed a relative-path reference.

@param UriInterface $uri

@return bool
@link https://tools.ietf.org/html/rfc3986#section-4.2
324601
public static function isRelativePathReference(UriInterface $uri)
    {
        $uriPath = $uri->getPath();
        return $uri->getScheme() === ''
            && $uri->getAuthority() === ''
            && (!isset($uriPath[0]) || $uriPath[0] !== '/');
    }
735631
protected function createUriPointerMap(UriInterface $uri)
    {
        $uri = clone $uri;
        $uri->normalize();
        $map = array(array($uri->toString(), array()));

        $fragmentPointer = $this->pointerFactory()->createFromUri($uri);
        if ($fragmentPointer->hasAtoms()) {
            $atoms = array();
            $fragmentlessUri = clone $uri;
            $fragmentlessUri->setFragment(null);

            while ($fragmentPointer->hasAtoms()) {
                array_unshift($atoms, $fragmentPointer->lastAtom());
                $fragmentPointer = $fragmentPointer->parent();

                $uri = clone $fragmentlessUri;
                $uri->setFragment($fragmentPointer->string());
                $uri->normalize();

                array_unshift($map, array($uri->toString(), $atoms));
            }
        }

        return $map;
    }
928114
protected function isDtdReference(UriInterface $uri)
    {
        $path = $uri->getPath();

        $flag = '.dtd' === substr($path, -4);

        return $flag;
    }
937231
private String normalizeParentPath(String uri) {
        String relativeUri = extractRelativeUrl(uri, null);
        if (relativeUri.endsWith("/") && relativeUri.length() != 1) {
            relativeUri = StringUtils.removeEndIgnoreCase(relativeUri, "/");
        }
        return relativeUri;
    }
500425
public static function isAbsolutePathReference(UriInterface $uri)
    {
        $uriPath = $uri->getPath();
        return $uri->getScheme() === ''
            && $uri->getAuthority() === ''
            && isset($uriPath[0])
            && $uriPath[0] === '/';
    }
1048456
public function isRelativePathReference():bool{
		return $this->getScheme() === '' && $this->getAuthority() === '' && (!isset($this->getPath()[0]) || $this->getPath()[0] !== '/');
	}
95133
public static function uriWithArguments(UriInterface $uri, array $arguments): UriInterface
    {
        $query = http_build_query($arguments, '', '&', PHP_QUERY_RFC3986);
        return $uri->withQuery($query);
    }
256001
public function getPath(UriInterface $uri)
    {
        $path  = trim($uri->getPath(), '/');
        $parts = explode('/', $path);

        if ($parts[0] === 'v'.Client::API_VERSION) {
            unset($parts[0]);
        }

        return '/'.implode('/', $parts);
    }
131530
public function findURI(string $uri)
    {
        foreach ($this->members as $offset => $member) {
            if ($member->uri == $uri) {
                return $offset;
            }
        }
        return -1;
    }
436672
public function setBase(UriInterface $uri)
    {
        if (! $this->parser->isAbsolute($uri)) {
            throw new InvalidArgumentException('The base URI must be absolute.');
        }

        $this->base = $uri;

        return $this;
    }
54427
private function addPortToUri(UriInterface $uri): UriInterface
    {
        $requestPort = $this->request->getUri()->getPort();

        if (!in_array($requestPort, [80, 443])) {
            $uri = $uri->withPort($requestPort);
        }

        return $uri;
    }
1034540
def _relative(self, uri):
        

        if uri.startswith("http:") or \
           uri.startswith("https:") or \
           uri.startswith("file:") or \
           uri.startswith("/"):
            return uri

        elif exists(uri):
            return relpath(uri, self.basedir)

        else:
            return uri
35398
private function checkRequestUri($path, $uri)
    {
        if (strstr($path, '?') == '?') {
            $uri = rtrim($uri, '/').'/';
        }

        // Url check and path PARSER
        $path = str_replace('~', '\\~', $path);

        if (preg_match('~^'. $path . '$~', $uri, $match)) {
            array_shift($match);

            $this->match = str_replace('/', '', $match);

            return true;
        }

        return false;
    }
275033
final public function withUri(UriInterface $uri, $preserveHost = false): self
    {
        $request = clone $this;
        $request->uri = $uri;

        $uriHost = $uri->getHost();
        if ($preserveHost || $uriHost === '') {
            return $request;
        }

        $uriPort = $uri->getPort();
        if ($uriPort !== null) {
            $uriHost .= ":{$uriPort}";
        }
        return $request->withHeader('Host', $uriHost);
    }
1021258
public function resolveRelativeUri(string $uri): string
    {
        $parts = parse_url($uri);
        if (isset($parts['scheme'])) {
            // absolute URL
            return $uri;
        }

        $baseUri = $this->getUri();
        if (strncmp($baseUri, 'file://', 7) === 0) {
            if (isset($parts['path'][0]) && $parts['path'][0] === '/') {
                // absolute path
                return 'file://' . $parts['path'];
            }
            if (isset($parts['path'])) {
                // relative path
                return dirname($baseUri) . '/' . $parts['path'];
            }

            throw new UnresolvableReferenceException("Invalid URI: '$uri'");
        }

        $baseParts = parse_url($baseUri);
        $absoluteUri = implode('', [
            $baseParts['scheme'],
            '://',
            isset($baseParts['username']) ? $baseParts['username'] . (
                isset($baseParts['password']) ? ':' . $baseParts['password'] : ''
            ) . '@' : '',
            $baseParts['host'] ?? '',
            isset($baseParts['port']) ? ':' . $baseParts['port'] : '',
        ]);
        if (isset($parts['path'][0]) && $parts['path'][0] === '/') {
            $absoluteUri .= $parts['path'];
        } elseif (isset($parts['path'])) {
            $absoluteUri .= rtrim(dirname($baseParts['path'] ?? ''), '/') . '/' . $parts['path'];
        }
        return $absoluteUri
            . (isset($parts['query']) ? '?' . $parts['query'] : '')
            . (isset($parts['fragment']) ? '#' . $parts['fragment'] : '');
    }
1309412
public function resolve(UriInterface $uri, UriInterface $baseUri)
    {
        $baseUriReflector = new ReflectionObject($baseUri);
        if (!$baseUriReflector->hasMethod('resolve')) {
            $baseUri = new Uri($baseUri->toString());
            if ($uri instanceof Uri) {
                $uri = clone $uri;
            } else {
                $uri = new Uri($uri->toString());
            }
        } elseif (!$uri instanceof $baseUri) {
            $uri = $baseUriReflector->newInstance($uri->toString());
        } else {
            $uri = clone $uri;
        }

        return $uri->resolve($baseUri);
    }
1242216
public function isUriPrefixExcluded($uri)
    {
        foreach ($this->excludedUriPrefixes as $excludedPrefix) {
            $excludedPrefix = '/' . trim($excludedPrefix, '/');
            if (mb_stripos($uri, $excludedPrefix) === 0) {
                return true;
            }
        }

        return false;
    }