In computer hypertext, a fragment identifier is a string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource.
The fragment identifier introduced by a hash mark #
is the optional last part of a URL for a document. It is typically used to identify a portion of that document. The generic syntax is specified in RFC 3986. The hash-mark separator in URIs is not part of the fragment identifier.
In URIs, a hash mark #
introduces the optional fragment near the end of the URL. The generic RFC 3986 syntax for URIs also allows an optional query part introduced by a question mark ?
. In URIs with a query and a fragment, the fragment follows the query. Query parts depend on the URI scheme and are evaluated by the server—e.g., http:
supports queries unlike ftp:
. Fragments depend on the document MIME type and are evaluated by the client (web browser). Clients are not supposed to send URI fragments to servers when they retrieve a document, and without help from a local application (see below) fragments do not participate in HTTP redirections. [1]
A URI ending with #
is permitted by the generic syntax and is a kind of empty fragment. In MIME document types such as text/html
or any XML type, empty identifiers to match this syntactically legal construct are not permitted. Web browsers typically display the top of the document for an empty fragment.
The fragment identifier functions differently to the rest of the URI: its processing is exclusively client-sided with no participation from the web server, though the server typically helps to determine the MIME type, and the MIME type determines the processing of fragments. When an agent (such as a web browser) requests a web resource from a web server, the agent sends the URI to the server, but does not send the fragment. Instead, the agent waits for the server to send the resource, and then the agent processes the resource according to the document type and fragment value. [2]
text/html
pages such as http://www.example.org/foo.html#bar
the fragment refers to the element with id="bar"
. #:~:text=foo
will cause the browser to search for foo
, highlight the matching text, and scroll to it. Besides the start and end, the snippet can also specify a context: text that must precede or follow foo
but won't be highlighted (example that searches for 'vision' preceded by 'night').:target
CSS pseudoclass; Wikipedia uses this to highlight the selected reference. Notably CSS display: block
can be used to show content only if it is the target, and otherwise hidden by display: none
.name
attribute (allowed only for some elements) had a similar purpose in now obsolete browsers. If present name
and id
must be identical.xml:id
or similar id
attributes follow the Name
-syntax and begin with a letter, underscore, or colon. Notably they cannot begin with a digit or hyphen. [6] xml:id
is one of the few generic XML attributes, e.g., xml:lang
, which can be used without explicitly declaring a namespace. [7] In XHTML id
has to be used, because XHTML was specified before xml:id
existed.http://www.example.org/foo.xml#xpointer(//Rube)
refers to all XML elements named "Rube" in the document identified by the URI http://www.example.org/foo.xml. An XPointer processor, given that URI, would obtain a representation of the document (such as by requesting it from the Internet) and would return a representation of the document's "Rube" elements.http://www.w3.org/2004/02/skos/core#broader
identifies the concept "broader" in SKOS Core vocabulary, but it does not refer to a specific part of the resource identified by http://www.w3.org/2004/02/skos/core
, a complete RDF file in which semantics of this specific concept is declared, along with other concepts in the same vocabulary. text/plain
documents RFC 5147 specifies a fragment identifier for the character and line positions and ranges within the document using the keywords "char
" and "line
". Browser support seems lacking. [8] The following example identifies lines 11 through 20 of a text document: http://example.com/document.txt#line=10,20
text/csv
documents, RFC 7111 specifies a fragment identifier as a selector for rows, columns, and cells using the keywords "row
" , "col
", and "cell
", for example: http://example.com/data.csv#row=4
– Selects the 4th row.http://example.com/data.csv#col=2
– Selects 2nd column.http://example.com/data.csv#row=5-7
– Selects three consecutive rows starting with 5th row.http://example.com/data.csv#row=5-*
– Selects all rows starting with 5th row.http://example.com/data.csv#cell=4,1-6,2
– Selects a region that starts at the 4th row and the 1st column and ends at the 6th row and the 2nd column.t
and xywh
. Therefore, one can use the following media fragments URI in the src
attribute of the audio
or video
HTML5 element: http://example.com/foo.mp4#t=10,20
http://example.com/bar.webm#t=40,80&xywh=160,120,320,240
#01h25m30s
to start playing at the specified position, [10] and YouTube uses similar code such as #t=3m25s
. [11] location.hash
– note that Javascript can be also used with other document types. With the rise of AJAX, some websites use fragment identifiers to emulate the back button behavior of browsers for page changes that do not require a reload, or to emulate subpages. application/pdf
documents PDF viewers recognize a number of fragment identifiers. [13] [14] For instance, a URL ending in .pdf#page=35
will cause most readers to open the PDF and scroll to page 35. Several other parameters are possible, including #nameddest=
(similar to HTML anchors), #search="word1 word2"
, #zoom=
, etc. Multiple parameters can be combined with ampersands: http://example.org/doc.pdf#view=fitb&nameddest=Chapter3
.viewBox()
, preserveAspectRatio()
, and transform()
. [15] Several proposals have been made for fragment identifiers for use with plain text documents (which cannot store anchor metadata), or to refer to locations within HTML documents in which the author has not used anchor tags:
https://pypi.python.org ... zodbbrowser-0.3.1.tar.gz#md5=38dc89f294b24691d3f0d893ed3c119c
!
. It was used in a now-deprecated approach to index dynamic single-page applications. An exclamation mark is illegal in HTML4 (but not in HTML5 [19] ), XHTML, and XML identifiers, granting certain degree of separation from that functionality. http://example.com/page?query#!state
history.pushState()
[22] method. [23] #!s!search terms
. Adding a number after the s (#!s10!
) indicates that the browser should search for the nth occurrence of the search term. A negative number (#!s-3!
) starts searching backwards from the end of the document. A Greasemonkey script is available to add this functionality to compatible browsers. [24] http://example.com/index.html#!s3!search terms
match
". [25] They also describe a prototype implementation as an extension for the Firefox browser. For example, the following would find the case-insensitive text "RFC" anywhere in the document: http://example.com/document.txt#match=[rR][fF][cC]
words
" is the first proposal in this scheme. [26] The following example would search a document for the first occurrence of the string "some context for a search term" and then highlight the words "search term": http://example.com/index.html#:words:some-context-for-a-(search-term)
#FWS+C
, where F is the length of the first word (up to five characters), W is the first word itself, S is the length of the selected text and C is a 32-bit CRC of the selected text. [28] They implemented a variant of this scheme as an extension for the Firefox browser, [29] using the form #LFWS+C
, where L is the length of the fragment itself, in two hex digits. Linking to the word "Fragment" using the implemented variant would yield: http://example.com/index.html#115Fragm8+-52f89c4c
A document type definition (DTD) is a set of markup declarations that define a document type for an SGML-family markup language.
Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.
The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser.
A Uniform Resource Identifier (URI) is a string of characters that unambiguously identifies a particular resource. To guarantee uniformity, all URIs follow a predefined set of syntax rules, but also maintain extensibility through a separately defined hierarchical naming scheme.
An HTML element is a type of HTML document component, one of several types of HTML nodes. HTML document is composed of a tree of simple HTML nodes, such as text nodes, and HTML elements, which add semantics and formatting to parts of document. Each element can have HTML attributes specified. Elements can also have content, including other elements and text.
vCard, also known as VCF, is a file format standard for electronic business cards. vCards are often attached to e-mail messages, but can be exchanged in other ways, such as Multimedia Messaging Service (MMS), on the World Wide Web, instant messaging or through QR code. They can contain name and address information, telephone numbers, e-mail addresses, URLs, logos, photographs, and audio clips.
A Uniform Resource Name (URN) is a Uniform Resource Identifier (URI) that uses the urn
scheme.
Web annotation refers to
On the World Wide Web, a query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML form.
XML Signature defines an XML syntax for digital signatures and is defined in the W3C recommendation XML Signature Syntax and Processing. Functionally, it has much in common with PKCS#7 but is more extensible and geared towards signing XML documents. It is used by various Web technologies such as SOAP, SAML, and others.
The data URI scheme is a uniform resource identifier (URI) scheme that provides a way to include data in-line in Web pages as if they were external resources. It is a form of file literal or here document. This technique allows normally separate elements such as images and style sheets to be fetched in a single Hypertext Transfer Protocol (HTTP) request, which may be more efficient than multiple HTTP requests, and used by several browser extensions to package images as well as other multimedia contents in a single HTML file for page saving. As of 2015, data URIs are fully supported by most major browsers, and partially supported in Internet Explorer and Microsoft Edge.
JavaScript Object Notation is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types. It is a very common data format, with a diverse range of applications, such as serving as a replacement for XML in AJAX systems.
Percent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. Although it is known as URL encoding, it is, in fact, used more generally within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN). As such, it is also used in the preparation of data of the application/x-www-form-urlencoded
media type, as is often used in the submission of HTML form data in HTTP requests.
A web resource, or simply resource, is any identifiable thing, whether digital, physical, or abstract. Resources are identified using Uniform Resource Identifiers. In the Semantic Web, web resources and their semantic properties are described using the Resource Description Framework.
The feed URI scheme was a suggested uniform resource identifier (URI) scheme designed to facilitate subscription to web feeds; specifically, it was intended that a news aggregator be launched whenever a hyperlink to a feed
URI was clicked in a web browser. The scheme was intended to flag a document in a syndication format such as Atom or RSS. The document would be typically served over HTTP.
URI normalization is the process by which URIs are modified and standardized in a consistent manner. The goal of the normalization process is to transform a URI into a normalized URI so it is possible to determine if two syntactically different URIs may be equivalent.
A media type is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. Media types were originally defined in Request for Comments RFC 2045 (MIME) Part One: Format of Internet Message Bodies in November 1996 as a part of MIME specification, for denoting type of email message content and attachments; hence the original name, MIME type. Media types are also used by other internet protocols such as HTTP and document file formats such as HTML, for similar purposes.
The file URI scheme is a URI scheme defined in RFC 8089, typically used to retrieve files from within one's own computer.
A document type declaration, or DOCTYPE, is an instruction that associates a particular XML or SGML document with a document type definition (DTD). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.
A Uniform Resource Locator (URL), colloquially termed a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI), although many people use the two terms interchangeably. Thus http://www.example.com
is a URL, while www.example.com
is not.</ref> URLs occur most commonly to reference web pages (http), but are also used for file transfer (ftp), email (mailto), database access (JDBC), and many other applications.
Pypi has the habit to append an md5 fragment to its egg urls, we'll use it to check the already present distribution files in the cache