---
name: "Data::HAL::URI"
section: "3pm"
platform: "linux"
package: "libdata-hal-perl"
version: "1.001-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Data::HAL::URI"
---

# Data::HAL::URI(3pm)

URI wrapper

## NAME

Data::HAL::URI - URI wrapper

## VERSION

This document describes Data::HAL::URI version 1.001

## SYNOPSIS

```
    my $relation = $resource->relation->as_string;
```

## DESCRIPTION

This is a wrapper for URI objects.

## INTERFACE

### Composition

None, but URI methods are delegated through the "uri" attribute.

### Constructors

*"new"*

```
    my $u = Data::HAL::URI->new('http://example.com/something');
```

Takes a string argument, returns a `"Data::HAL::URI"` object.

### Attributes

*"uri"*

Type `"URI"`, **required**, **readonly**, can only be set from the "new" constructor.

This attribute delegates all methods to URI except "as\_string".

### Methods

*"as\_string"*

Returns the original argument to the constructor if still equal to the "uri", where equality also takes CURIE expansion into account, or otherwise the "uri" as string.

The unaltered behaviour is still available through the "uri" accessor, e.g.:

```
    $resource->relation->uri->as_string
```

### Exports

None.

## DIAGNOSTICS

None.

## CONFIGURATION AND ENVIRONMENT

Requires no configuration files or environment variables.
