- SEE ALSO
- LICENSE AND COPYRIGHT
URI::BNode - RDF blank node identifiers which are also URI objects
my $bnode = URI::BNode->new; print "$bnode\n"; # something like _:EH_kW827XQ6vvX0yF8YzRA
This module has two purposes:
Provide a reliable factory interface for generating RDF blank nodes (via random UUIDs permuted through Data::UUID::NCName).
When an RDF blank node class is a subclass of URI, you can use identity tests to make more robust RDF interfaces, like so:
$node->isa('URI'); # either URI or bnode, but not literal $node->isa('URI::BNode'); # narrow it down further
Along the same vein, coerce string literals into the correct class by heuristic:
my $subject = '_:foo'; my $node = URI::BNode->new($subject); # _:foo becomes a bnode # URI::BNode->new('http://foo/') would properly become # a URI::http object.
Creates a new blank node identifier. If
$ID is undefined or empty, one will be generated using Data::UUID::NCName. If
$ID has a value, it must either begin with
_: or conform to the blank node syntax from the Turtle spec. Other values, including other URIs, will be passed to the URI constructor.
Alias for "opaque".
Retrieve or, if supplied a value, replace the blank node's value with a new one. This method will croak if passed a
$NEWVAL which doesn't match the spec in http://www.w3.org/TR/turtle/#BNodes.
Takes a URI::urn::uuid object and turns it into a blank node. Can be invoked as either a class or an instance method.
Return the skolemized URI (
$AUTHORITY/.well-known/genid/...) for a given blank node. See RDF 1.1 Concepts.
Take a skolemized URI like
http://foo.com/.well-known/genid/asdf and turn it into
<dorian at cpan.org>
Please report any bugs or feature requests to
bug-uri-bnode at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-BNode. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
Copyright 2013 Dorian Taylor.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.