04 Nov 2013 02:39:17 UTC
- Distribution: URI-BNode
- Module version: 0.06
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (886 / 0 / 6)
- KwaliteeBus factor: 1
- 92.86% Coverage
- License: apache_2_0
- Perl: v5.10.0
- Activity24 month
- Download (31.26KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:DORIAN Dorian Taylorand 1 contributors
- Dorian Taylor, C<< <dorian at cpan.org> >>
- 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
$IDis undefined or empty, one will be generated using Data::UUID::NCName. If
$IDhas 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
$NEWVALwhich 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/asdfand 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.