---
name: "RDF::Trine::Node"
section: "3pm"
platform: "linux"
package: "librdf-trine-perl"
version: "1.019-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/RDF::Trine::Node"
---

# RDF::Trine::Node(3pm)

Base class for RDF Nodes

## NAME

RDF::Trine::Node - Base class for RDF Nodes

## VERSION

This document describes RDF::Trine::Node version 1.019

## FUNCTIONS

- "ntriples\_escape ( $value )"

  Returns the passed string value with special characters (control characters, Unicode, etc.) escaped, suitable for printing inside an N-Triples or Turtle encoded literal.

## METHODS

- "is\_node"

  Returns true if this object is a RDF node, false otherwise.

- "is\_nil"

  Returns true if this object is the nil-valued node.

- "is\_blank"

  Returns true if this RDF node is a blank node, false otherwise.

- "is\_resource"

  Returns true if this RDF node is a resource, false otherwise.

- "is\_literal"

  Returns true if this RDF node is a literal, false otherwise.

- "is\_variable"

  Returns true if this RDF node is a variable, false otherwise.

- "as\_string"

  Returns the node in a string form.

- "as\_ntriples"

  Returns the node in a string form suitable for NTriples serialization.

- "sse"

  Returns the SSE serialization of the node.

- "equal ( $node )"

  Returns true if the two nodes are equal, false otherwise.

- "compare ( $node\_a, $node\_b )"

  Returns -1, 0, or 1 if `$node_a` sorts less than, equal to, or greater than `$node_b` in the defined SPARQL ordering, respectively. This function may be used as the function argument to `"<sort"`\>.

- "as\_hashref"

  Returns a hashref representing the node in an RDF/JSON-like manner.

  See `"as_hashref"` at RDF::Trine::Model for full documentation of the hashref format.

- "from\_sse ( $string, $context )"

  Parses the supplied SSE-encoded string and returns a RDF::Trine::Node object.

## BUGS

Please report any bugs or feature requests to through the GitHub web interface at \<https://github.com/kasei/perlrdf/issues\>.

## AUTHOR

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

## COPYRIGHT

Copyright (c) 2006-2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
