{
    "mode": "perldoc",
    "parameter": "RDF::Redland::Node",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3ANode/json",
    "generated": "2026-10-06T10:55:41Z",
    "synopsis": "use RDF::Redland;\nmy $node1=new RDF::Redland::Node(\"Hello, World!\");\nmy $node2=new RDF::Redland::Node($uri); # $uri is an RDF::Redland::URI\nmy $node3=$node2->clone;\nmy $node4=new RDF::Redland::URINode(\"http://example.com/\");\nmy $node5=new RDF::Redland::LiteralNode(\"Hello, World!\");\nmy $node6=new RDF::Redland::XMLLiteral(\"<tag>content</tag>\");\nmy $node7=new RDF::Redland::BlankNode(\"genid1\");\n# alternate more verbose ways:\nmy $node4=RDF::Redland::Node->newfromuri(\"http://example.com/\");\nmy $node5=RDF::Redland::Node->newliteral(\"Hello, World!\");\nmy $node6=RDF::Redland::Node->newxmlliteral(\"<tag>content</tag>\");\nmy $node7=RDF::Redland::Node->newfromblankidentifier(\"genid1\");\n...\nprint $node4->uri->asstring,\"\\n\";  # Using RDF::Redland::URI::asstring\nprint $node5->literalvalueaslatin1,\"\\n\";",
    "sections": {
        "NAME": {
            "content": "RDF::Redland::Node - Redland RDF Node (RDF Resource, Property, Literal) Class\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use RDF::Redland;\nmy $node1=new RDF::Redland::Node(\"Hello, World!\");\nmy $node2=new RDF::Redland::Node($uri); # $uri is an RDF::Redland::URI\nmy $node3=$node2->clone;\n\nmy $node4=new RDF::Redland::URINode(\"http://example.com/\");\nmy $node5=new RDF::Redland::LiteralNode(\"Hello, World!\");\nmy $node6=new RDF::Redland::XMLLiteral(\"<tag>content</tag>\");\nmy $node7=new RDF::Redland::BlankNode(\"genid1\");\n\n# alternate more verbose ways:\nmy $node4=RDF::Redland::Node->newfromuri(\"http://example.com/\");\nmy $node5=RDF::Redland::Node->newliteral(\"Hello, World!\");\nmy $node6=RDF::Redland::Node->newxmlliteral(\"<tag>content</tag>\");\nmy $node7=RDF::Redland::Node->newfromblankidentifier(\"genid1\");\n...\n\nprint $node4->uri->asstring,\"\\n\";  # Using RDF::Redland::URI::asstring\nprint $node5->literalvalueaslatin1,\"\\n\";\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This class represents RDF URIs, literals and blank nodes in the RDF graph.\n",
            "subsections": []
        },
        "CONSTRUCTORS": {
            "content": "new [STRING | URI | NODE]\nCreate a new URI node, literal node or copy an existing node.\n\nIf a literal *STRING* is given, make a plain literal node. If a the argument is of type\n*URI* (perl URI or RDF::Redland::URI), make a resource node.\n\nOtherwise if the argument is an RDF::Redland::Node *NODE*, copy it.\n\nnewfromuri URI\nCreate a new URI node. *URI* can be either a RDF::Redland::URI object, a perl URI class or a\nliteral string.\n\nAn alternative is:\n\nnew RDF::Redland::URINode(\"http://example.org/\");\n\nnewliteral STRING [DATATYPE [XMLLANGUAGE]]\nCreate a new literal node for a literal value *STRING*. Optional datatype URI *DATATYPE*\n(RDF::Redland::URI, perl URI or string) and language (xml:lang attribute) *XMLLANGUAGE* may\nalso be given.\n\nAn alternative is:\n\nnew RDF::Redland::LiteralNode(\"Hello, World!\");\nnew RDF::Redland::LiteralNode(\"Bonjour monde!\", undef, \"fr\");\n\nnewxmlliteral STRING\nCreate a new XML datatyped literal node for the XML in *STRING*.\n\nAn alternative is:\n\nnew RDF::Redland::XMLLiteral(\"<tag>content</tag>\");\n\nnewfromblankidentifier IDENTIFIER\nCreate a new blank node with blank node identifier *IDENTIFIER*.\n\nAn alternative is:\n\nnew RDF::Redland::BlankNode(\"id\");\n\nclone\nCopy a RDF::Redland::Node.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "uri Get the current URI of the node as an RDF::Redland::URI object.\n\nblankidentifier\nGet the current blank identifier of the node\n\ntype\nGet the node type. It is recommended to use the isresource, isliteral or isblank methods\nin preference to this (both simpler and quicker).\n\nThe current list of types that are supported are:\n\n$RDF::Redland::Node::TypeResource\n$RDF::Redland::Node::TypeLiteral\n$RDF::Redland::Node::TypeBlank\n\nExample:\n\nif ($node->type == $RDF::Redland::Node::TypeResource) {\nprint \"Node is a resource with URI \", $node->uri->asstring, \"\\n\";\n} else {\n...\n}\n\nisresource\nReturn true if node is a resource (with a URI)\n\nisliteral\nReturn true if node is a literal\n\nisblank\nReturn true if node is a blank nodeID\n\nliteralvalue\nGet the node literal value string as UTF-8 (when the node is of type\n$RDF::Redland::Node::TypeLiteral)\n\nliteralvalueaslatin1\nGet the node literal value string converted from UTF-8 to ISO Latin-1 (when the node is of\ntype $RDF::Redland::Node::TypeLiteral)\n\nliteralvaluelanguage\nGet the node literal XML language (when the node is of type\n$RDF::Redland::Node::TypeLiteral) or undef if not present.\n\nliteralvalueiswfxml\nReturn non 0 if the literal string is well formed XML (when the node is of type\n$RDF::Redland::Node::TypeLiteral).\n\nliteraldatatype\nReturn the RDF::Redland::URI of the literal datatype or undef if it is not a datatype.\n\nasstring\nReturn the RDF::Redland::Node formatted as a string (UTF-8 encoded).\n\nequals NODE\nReturn non zero if this node is equal to NODE\n",
            "subsections": []
        },
        "OLDER METHODS": {
            "content": "newfromliteral STRING XMLLANGUAGE ISWF\nCreate a new RDF::Redland::Node object for a literal value *STRING* with XML language\n(xml:lang attribute) *XMLLANGUAGE* and if content is well formed XML, when *ISWF* is non\n0. *XMLLANGUAGE* is optional can can be set to undef.\n\nThis method remains but using newliteral is preferred. Instead, for plain literals use:\n\n$node=new RDF::Redland::Node(\"blah\")\n\nnewfromtypedliteral STRING [DATATYPE [XMLLANGUAGE]]\nRenamed to newliteral with same arguments.\n\nnewfromuristring URISTRING\nCreate a new RDF::Redland::Node object for a resource with URI *URISTRING*. It is\nequivalent to use the shorter:\n\n$a=new RDF::Redland::Node->newfromuri($uristring)\n\nnewfromnode NODE\nCreate a new RDF::Redland::Node object from existing RDF::Redland::Node *NODE* (copy\nconstructor). It is equivalent to use:\n\n$newnode=$oldnode->clone\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "RDF::Redland::Statement\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Dave Beckett - http://www.dajobe.org/\n",
            "subsections": []
        }
    },
    "summary": "RDF::Redland::Node - Redland RDF Node (RDF Resource, Property, Literal) Class",
    "flags": [],
    "examples": [],
    "see_also": []
}