---
name: "RDF::Query::Node::Literal"
section: "3pm"
platform: "linux"
package: "librdf-query-perl"
version: "2.919-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/RDF::Query::Node::Literal"
---

# RDF::Query::Node::Literal(3pm)

RDF Node class for literals

## NAME

RDF::Query::Node::Literal - RDF Node class for literals

## VERSION

This document describes RDF::Query::Node::Literal version 2.919.

## METHODS

Beyond the methods documented below, this class inherits methods from the RDF::Query::Node and RDF::Trine::Node::Literal classes.

- "datetime"

  Returns a DateTime object from the literal if the literal value is in W3CDTF format.

- "as\_sparql"

  Returns the SPARQL string for this node.

- "as\_hash"

  Returns the query as a nested set of plain data structures (no objects).

- "is\_simple\_literal"

  Returns true if the literal is "simple" -- is a literal without datatype or language.

- "is\_numeric\_type"

  Returns true if the literal is a known (xsd) numeric type.

- "numeric\_value"

  Returns the numeric value of the literal (even if the literal isn't a known numeric type.

- "type\_list"

  Returns a two-item list suitable for use as the second and third arguments to RDF::Query::Node::Literal constructor. The two returned values correspond to literal language tag and literal datatype URI, respectively.

## AUTHOR

```
 Gregory Todd Williams <gwilliams@cpan.org>
```
