URL DataType

The URL type represents Uniform Resource Locators (web addresses and other resource identifiers).

Definition

Type URL https://rustybeam.net/schema/URL
Base Type url
Default Pattern ^(?:https?|ftp|file|mailto|data|tel|ws|wss):(?://)?[\w\-._~:/?#[\]@!$&'()*+,;=%]+$
Constraints {"format": "RFC 3986"}

Accepted Schemes

The default validation pattern accepts URLs with these schemes:

Examples

Usage in Property Definitions

<tr itemscope itemtype="https://rustybeam.net/schema/Property">
    <td><span itemprop="name">homepage</span></td>
    <td><span itemprop="type">URL</span></td>
    <td><span itemprop="cardinality">0..1</span></td>
    <td><span itemprop="description">The organization's homepage</span></td>
</tr>

Usage in Data

<a itemprop="homepage" href="https://example.com">Visit our website</a>

Note: When using URLs in HTML, it's recommended to use appropriate elements like <a href> for links or <img src> for images, with the URL in the relevant attribute.

Validation Notes

See Also