RDF::NS::Curated(3pm)

RDF::NS::Curated3pm

A curated set of rdf prefixes

Usage

  my $ns = RDF::NS::Curated->new;
  print $ns->uri('foaf'); # prints http://xmlns.com/foaf/0.1/
  print $ns->prefix('http://schema.org/'); # prints schema

Overview

This contains a list of 62 prefix and URI pairs that are commonly used in RDF. The intention is that prefixes in this list can be safely used in code that has a long lifetime. The list has been derived mostly from W3C standards documents, but also some popularity lists. See the source code of this package for the full list.

It is intended to be used with e.g. URI::NamespaceMap.

Methods

"new"

Constructor. Takes no arguments.

uri($prefix)

This will return the URI (as a plain string) of the supplied prefix or "undef" if it is not registered.

prefix($uri)

This will return the prefix corresponding to the supplied URI string or "undef" if it is not registered.

qname($uri)

This will return the qualified name corresponding to the supplied URI string or "undef" if it is not registered. In scalar context, it will return the prefix and local name with a colon, and list context, a two-element array containing prefix and local name.

For example "http://purl.org/dc/terms/name" will return "dc:name" in scalar context and "('dc', 'name')" in list context.

"all"

This will return a hashref with all prefix and URI pairs.

Contributors

Harald Jörg

Disclaimer of warranties

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Bugs

Please report any bugs to <https://github.com/perlrdf/p5-rdf-ns-curated/issues>.

Author

Kjetil Kjernsmo <[email protected]>.

From librdf-ns-curated-perl 1.006-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.