Understanding URIs: Components and Functions
23 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the authority component of a URI consist of?

  • Userinfo and host name followed by an optional port (correct)
  • Only the port number
  • Path segments without the host
  • Just the host name
  • What is the purpose of the query component in a URI?

  • Indicate the path of the resource
  • Contain non-hierarchical data, often in name/value pairs (correct)
  • Provide hierarchical identifiers for the resource
  • Define the default port for the scheme
  • In which order are the URI components typically listed?

  • Scheme, host, path, query, fragment (correct)
  • Authority, scheme, path, query, fragment
  • Query, fragment, path, scheme, authority
  • Scheme, path, authority, query, fragment
  • What character indicates the beginning of the query section in a URI?

    <p>? (D)</p> Signup and view all the answers

    What must a path component do if an authority is present in the URI?

    <p>The path must begin with a '/' (A)</p> Signup and view all the answers

    What is a URI scheme responsible for defining?

    <p>The format and roles of the rest of the URI components (C)</p> Signup and view all the answers

    What does the fragment identifier in a URI refer to?

    <p>A specific section within the resource (A)</p> Signup and view all the answers

    What syntax should a path follow when there is no authority in a URI?

    <p>Paths cannot begin with two slashes (A)</p> Signup and view all the answers

    What defines a Uniform Resource Identifier (URI)?

    <p>It specifies a resource using a location and protocol. (B)</p> Signup and view all the answers

    Which of the following components of a URI can include a fragment identifier?

    <p>Path (C)</p> Signup and view all the answers

    How are URI schemes and hosts treated regarding case sensitivity?

    <p>Both scheme and host are case-insensitive. (C)</p> Signup and view all the answers

    What is the purpose of percent-encoding in a URI?

    <p>To represent characters that are not allowed in a URI. (B)</p> Signup and view all the answers

    Which statement is true regarding URI comparison?

    <p>Normalization is applied before string comparison for case insensitivity. (A)</p> Signup and view all the answers

    What is an Internationalized Resource Identifier (IRI)?

    <p>A URI that includes Unicode characters. (D)</p> Signup and view all the answers

    In the context of relative references, what does resolution of a URI involve?

    <p>Combining the reference with its base URI to resolve its location. (C)</p> Signup and view all the answers

    What is a valid structure of a complete URI?

    <p>hostname:port/path?query#fragment (D)</p> Signup and view all the answers

    Which of the following characters is considered a reserved character in URIs?

    <h1>(B)</h1> Signup and view all the answers

    How is percent-encoding represented in a URI?

    <p>As a character triplet beginning with '%' (B)</p> Signup and view all the answers

    Which of these URI examples contains a percent-encoded space character?

    <p>file:///media/Movies/What%27s%20Up%2C%20Tiger%20Lily%3F%20%281966%29/ (A)</p> Signup and view all the answers

    What component of a URI typically represents a fragment identifier?

    <p>The portion after a '#' symbol (C)</p> Signup and view all the answers

    In URI comparison, what determines if two URIs are equivalent?

    <p>Case of hexadecimal digits in percent-encoded octets does not affect equivalency (A)</p> Signup and view all the answers

    Which of the following describes a relative URI reference?

    <p>A URI specified by its relation to another URI (B)</p> Signup and view all the answers

    What does the syntax of a URI include for hierarchical organization?

    <p>Components like host, port, path, query, and fragment identifier (B)</p> Signup and view all the answers

    Flashcards

    What is the scheme in a URI?

    The scheme identifies the type of URI, e.g., "http", "https", "ftp", "mailto".

    What is the hier-part in a URI?

    The hier-part includes the authority (if any) followed by the path, indicating the location of the resource within the authority.

    What is the authority in a URI?

    It specifies the host (like a website's domain name, e.g., "example.com") and optionally, the user information (username and password) and the port number.

    What is the path in a URI?

    It indicates a sequence of path segments separated by '/' (slashes), similar to file directory structures.

    Signup and view all the flashcards

    What is the query in a URI?

    The query component allows for passing additional data to the resource, often in the form of key-value pairs.

    Signup and view all the flashcards

    What is the fragment in a URI?

    It represents a specific portion of the resource, usually accessed by name or id.

    Signup and view all the flashcards

    What is a default port used for in a URI?

    Some protocols define a default port that is used if no explicit port is provided in the URI. E.g., "http" typically uses port 80.

    Signup and view all the flashcards

    What does the query component in a URI represent?

    It indicates the data is not hierarchical, often used for key-value pairs that provide additional information about the resource.

    Signup and view all the flashcards

    Uniform Resource Identifier (URI)

    A URL that specifies where a resource is located on the internet. It acts as a unique identifier for each resource, ensuring that we can find it consistently.

    Signup and view all the flashcards

    Uniform Resource Locator (URL)

    A specific type of URI that uses the HTTP protocol to access web resources. It's commonly used to browse websites.

    Signup and view all the flashcards

    Relative Reference Resolution

    A mechanism for referencing files or resources relative to the current document. This allows you to easily link to items within the same website or directory.

    Signup and view all the flashcards

    Absolute URL

    A URL that incorporates specific elements like a scheme (e.g., http), a host (e.g., example.com), and a path (e.g., /docs/howto/theme.css). They provide a complete path to a resource.

    Signup and view all the flashcards

    URI Comparison

    The process of comparing URLs to determine if they refer to the same resource. Though URLs can be written in different ways, the contents are considered equivalent if they identify the same resource.

    Signup and view all the flashcards

    Normalization

    A process of simplifying URLs by removing unnecessary parts or inconsistencies. This helps standardize URLs and makes comparisons easier.

    Signup and view all the flashcards

    Reserved Characters

    The collection of characters that are permitted in a URI, including letters, numbers, and special characters used to organize the information.

    Signup and view all the flashcards

    Unreserved Characters

    A set of characters that are allowed in a URI without needing special encoding. These characters generally represent normal alphanumeric characters.

    Signup and view all the flashcards

    What is a URI?

    A Uniform Resource Identifier (URI) is a string of characters that uniquely identifies a resource on the internet, such as a website, file, or email address.

    Signup and view all the flashcards

    How are URIs structured?

    URIs are hierarchical and organized in a structured way, breaking down the resource's location into components.

    Signup and view all the flashcards

    What are reserved characters in URIs?

    Reserved characters in URIs have special meanings and are used to separate parts of the URI, like the protocol, host, and path. They cannot be used directly within these parts.

    Signup and view all the flashcards

    What are unreserved characters in URIs?

    Unreserved characters can be used directly within the different parts of the URI as they don't have special meanings.

    Signup and view all the flashcards

    What is percent-encoding?

    Percent-encoding is used to represent characters that are not allowed in URIs. It replaces these characters with a '%' followed by two hexadecimal digits representing their numerical value.

    Signup and view all the flashcards

    How does percent-encoding work practically?

    Examples of percent-encoding include replacing a space character with %20 and replacing the special character 'ü' with %C3%BC.

    Signup and view all the flashcards

    Are hex digits case-sensitive?

    URIs are case-insensitive when it comes to percent-encoded octets, meaning uppercase and lowercase hexadecimal digits are considered equivalent.

    Signup and view all the flashcards

    What character encoding is used for URIs?

    The specification for URIs does not mandate any particular character encoding, but UTF-8 is commonly used.

    Signup and view all the flashcards

    Study Notes

    Uniform Resource Identifier (URI)

    • A compact sequence of characters identifying an abstract or physical resource.
    • A resource isn't necessarily available on the web.
    • URIs can be assigned to real-world objects or concepts.
    • Current standard: RFC 3986, published in January 2005.
    • The standard was developed by Tim Berners-Lee, Roy Fielding, and Larry Masinter.
    • The URI is on the website: https://www.rfc-editor.org/rfc/rfc3986

    URI (1)

    • Each URI starts with a scheme name followed by a colon (:) and then the scheme-specific part.
    • Scheme specifications define scheme-specific syntax within certain limits.
    • The Internet Assigned Numbers Authority (IANA) is responsible for administering URI schemes.
    • The IANA website is: https://www.iana.org/

    Well-Known URI Schemes

    • file: Defined in RFC 8089 (February 2017)
    • http/https: Defined in RFC 9110 (June 2022)
    • mailto: Defined in RFC 6068 (October 2010)
    • about: Defined in RFC 6694 (August 2012)

    Dereferencing

    • Accessing a resource identified by a URI.
    • In most cases, "access" means retrieving a representation of the resource.

    URL vs URN (1)

    • Uniform Resource Locator (URL): Identifies resources by their location.
    • RFC 1738 (December 1994) defines URLs
    • Uniform Resource Name (URN): Persistent and location-independent resource identifiers.
    • RFC 2141 (May 1997) defines URN syntax

    URL vs URN (2)

    • The distinction between URLs and URNs is now obsolete.
    • RFC 3305 (August 2002) clarifies URIs, URLs, and URNs and provides recommendations.

    URL vs URN (3)

    • A URI can be a locator, a name, or both.
    • URI schemes don't need to be categorized as URL or URN.
    • A URL formally identifies resources through a representation of their access mechanism (location).

    URN

    • A Uniform Resource Name (URN) is a persistent, location-independent identifier.
    • A URN is a URI that's assigned under the urn URI scheme.
    • See RFC 8141 (April 2017) for more details.

    WHATWG Standard (1)

    • The WHATWG URL Living Standard aims to align RFC 3986 and RFC 3987 with contemporary implementations.
    • It also aims to standardize the term "URL" and enhance the URL's existing JavaScript API.
    • The URL Living Standard is available at https://url.spec.whatwg.org/

    WHATWG Standard (2)

    • WHATWG aims for uniform handling of URIs and IRIs (Internationalized Resource Identifiers).
    • It recognizes a URL as a universal identifier.

    URI vs URL (IETF vs WHATWG)

    • Various blog posts by Daniel Stenberg discuss the differences between URIs and URLs, as well as other topics.

    URI Examples

    • A collection of various URI examples is provided.

    URI Characters (1)

    • Specific characters are reserved for use in URIs.
    • Other characters are unreserved.

    URI Characters (2)

    • Percent-encoding is employed to represent data octets when their corresponding characters are not allowed or are used as delimiters.
    • Percent-encoded data uses the % followed by two hexadecimal characters.

    URI Characters (3)

    • Examples of percent-encoding are given.

    URI Syntax (1)

    • URI syntax is hierarchically organized, with components listed in decreasing significance (left to right).
    • Common syntax components include scheme, hier-part, and fragment components.

    URI Syntax (2)

    • Examples of URI syntax are shown, including the respective scheme, host, path, query, and fragment components for each example.

    URI Syntax (3)

    • In 2009, Tim Berners-Lee expressed regret for including double slashes in URIs, while acknowledging it seemed like a good idea at the time.

    Authority

    • The authority component specifies the jurisdiction of the remainder of the URI.
    • Syntax: [userinfo '@'] host [' : ' port]

    Path

    • A sequence of path segments separated by slashes.
    • The beginning and end components of path syntax can be empty or begin with a "/" character.
    • Special path components like '.' and '..' have their predefined meanings and are useful to navigate file system structures.

    Query

    • The query component is indicated by the "?" character, followed by name/value pairs delimited by an "&."
    • Name/value pairs are used to convey non-hierarchical data, like input values to describe forms.

    Fragment Identifier (1)

    • A fragment identifier is indicated by a "#" symbol and is used to identify a specific part within the primary resource.
    • It can also convey additional information about that portion of the resource.

    Fragment Identifier (2)

    • Scheme specifications often do not include directives on fragment identifiers.
    • Fragment identifiers are considered independent from the definition of the scheme.

    Meaning of the Fragment Identifier (1)

    • For HTML resources, fragment identifiers refer to specific parts within the document or provide state information for in-page scripts.

    Meaning of the Fragment Identifier (2)

    • Application/xml, text/xml, and /*+xml media types use the fragment identifiers based on the XPointer Framework (W3C Recommendation, 2003).

    Absolute URI, URI-reference, relative reference

    • An 'Absolute URI' does not contain a fragment identifier.
    • A URI-Reference might have a fragment component.
    • A 'relative reference' is a scheme specific subpart of a URI.

    URI-reference Examples

    • Various URI-reference examples are provided.

    Same-document reference

    • A URI reference specifies a URI identical except for fragment component to the base URI.
    • Dereferencing such a reference should not cause any new retrieval actions.

    Establishing a Base URI

    • Base URI for relative references can be embedded within the media content.
    • For XML, base URI is specified through the XML:base attribute.
    • For HTML, a base element supplies a base URI.
    • If there isn't a base URI and the URI reference is encapsulated within another entity, the base URI is the base URI of the encompassing entity. Otherwise, the base URI depends on the application.

    Relative Reference Resolution Examples (1 & 2)

    • Examples of relative reference resolution are shown based on a given base URI.

    Relative Reference Resolution Examples (3)

    • Detailed example of resolving relative references within an HTML document.

    URI Comparison (1)

    • Scheme and host components of URI are case-insensitive, other components (typically) are case-sensitive unless otherwise defined.

    URI Comparison (2)

    • A possible definition of URI equivalence is when both identify the same resource; practically, URIs are compared as strings (after normalization).

    JavaScript API

    • The WHATWG URL Living Standard defines a JavaScript API for operating with and manipulating URLs.
    • There are examples provided of how to use JavaScript for handling URL properties and operations.

    Internationalized Resource Identifier (IRI) (1)

    • IRIs are built using Unicode/UCS characters, not just ASCII characters.
    • IRI components and reserved characters are managed based on the standards of the URI specification.

    Internationalized Resource Identifier (IRI) (2)

    • Examples of IRIs are shown.

    Internationalized Resource Identifier (IRI) (3)

    • IRIs can be mapped to equivalent URIs, one character at a time.
    • Conversion to and from octets employing UTF-8 and %HH hexadecimal notation is described.

    Internationalized Resource Identifier (IRI) (4)

    • Advantages of using IRIs include improved usability for non-Latin-based languages.
    • A potential risk of homograph attacks is detailed, where similar-looking characters might lead to unintended resource access.

    XML Base (1)

    • The XML Base recommendation (W3C, 2009) establishes base URIs within XML documents through the xml:base attribute.
    • This approach handles relative references within the XML documents.

    XML Base (2)

    • Example demonstrated showing how the xml:base attribute affects the resolution of relative references within XML documents.

    URL Shortening (1)

    • Long URLs can be shortened using HTTP redirection.
    • The utility of URL shortening lies in creating more aesthetic and compact identifiers to resources.
    • Originally, Twitter messages had a limitation of 140 characters.

    URL Shortening (2)

    • A list of URL-shortening services/APIs (e.g., GitHub, Twitter, Wikipedia, TinyURL, Bitly) is presented.

    URL Shortening: TinyURL & Bitly (Info)

    • Detailed information on TinyURL and Bitly URL-shortening services is given, including the service provider, web page, HTTP status code, registration, URL provision, tracking, and API access information.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    This quiz tests your knowledge about Uniform Resource Identifiers (URIs), focusing on their components like scheme, authority, and query. You'll learn how these parts work together to form a complete URI, including aspects like percent-encoding and case sensitivity. Challenge yourself with questions on the structure and function of URIs!

    More Like This

    Use Quizgecko on...
    Browser
    Browser