Package org.apache.jena.rfc3986


package org.apache.jena.rfc3986
Implementation of RFC 3986 (URI), RFC 3987 (IRI). As is common, these are referred to as "3986" regardless just as java.net.URI covers IRIs. java.net.URI parses and allocates and follows RFC 2396 with modifications (several of which are in RFC 3986). This provides a fast checking operation which does not copy the various parts of the IRI and which creates a single object. The cost of extracting and allocating strings happen when the getter for the component is called. Implements the algorithms specified in RFC 3986 operations for:
  • Checking a string matches the IRI grammar.
  • Extracting components of an IRI
  • Normalizing an IRI
  • Resolving an IRI against a base IRI.
  • Relativizing an IRI for a given base IRI.
  • Building an IRI from components.
Additions:
  • Scheme specific rules for Linked Data HTTP and URNs.
HTTP IRIs forbid the "user@" part which is strongly discouraged in IRIs.
Some additional checks for RFC 8141 for URNs are included such as being of the form urn:NID:NSS. Restrictions and limitations:
  • Only java characters supported (i.e. UTF16 16 bit characters)
  • No normal form C checking when checking
RFCs:

Obsoleted RFCs:

RFC 3986 Grammar

Appendix A. Collected ABNF for URI

RFC 3987 modifications Grammar

2.2. ABNF for IRI References and IRIs