| 1 |
NAME |
| 2 |
RDF::NS::Curated - A curated set of RDF prefixes |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
my $ns = RDF::NS::Curated->new; |
| 6 |
print $ns->uri('foaf'); # prints http://xmlns.com/foaf/0.1/ |
| 7 |
print $ns->prefix('http://schema.org/'); # prints schema |
| 8 |
|
| 9 |
DESCRIPTION |
| 10 |
This contains a list of 62 prefix and URI pairs that are commonly used in |
| 11 |
RDF. The intention is that prefixes in this list can be safely used in |
| 12 |
code that has a long lifetime. The list has been derived mostly from W3C |
| 13 |
standards documents, but also some popularity lists. See the source code |
| 14 |
of this package for the full list. |
| 15 |
|
| 16 |
It is intended to be used with e.g. URI::NamespaceMap. |
| 17 |
|
| 18 |
Methods |
| 19 |
`new` |
| 20 |
Constructor. Takes no arguments. |
| 21 |
|
| 22 |
`uri($prefix)` |
| 23 |
This will return the URI (as a plain string) of the supplied prefix or |
| 24 |
`undef` if it is not registered. |
| 25 |
|
| 26 |
`prefix($uri)` |
| 27 |
This will return the prefix corresponding to the supplied URI string |
| 28 |
or `undef` if it is not registered. |
| 29 |
|
| 30 |
`qname($uri)` |
| 31 |
This will return the qualified name corresponding to the supplied URI |
| 32 |
string or `undef` if it is not registered. In scalar context, it will |
| 33 |
return the prefix and local name with a colon, and list context, a |
| 34 |
two-element array containing prefix and local name. |
| 35 |
|
| 36 |
For example `http://purl.org/dc/terms/name` will return `dc:name` in |
| 37 |
scalar context and `('dc', 'name')` in list context. |
| 38 |
|
| 39 |
`all` |
| 40 |
This will return a hashref with all prefix and URI pairs. |
| 41 |
|
| 42 |
BUGS |
| 43 |
Please report any bugs to |
| 44 |
<https://github.com/perlrdf/p5-rdf-ns-curated/issues>. |
| 45 |
|
| 46 |
SEE ALSO |
| 47 |
RDF::NS, XML::CommonNS, RDF::Prefixes. |
| 48 |
|
| 49 |
AUTHOR |
| 50 |
Kjetil Kjernsmo <[email protected]>. |
| 51 |
|
| 52 |
CONTRIBUTORS |
| 53 |
Harald Jörg |
| 54 |
|
| 55 |
COPYRIGHT AND LICENCE |
| 56 |
This software is copyright (c) 2015, 2017, 2018, 2023 by Kjetil Kjernsmo. |
| 57 |
|
| 58 |
This is free software; you can redistribute it and/or modify it under the |
| 59 |
same terms as the Perl 5 programming language system itself. |
| 60 |
|
| 61 |
DISCLAIMER OF WARRANTIES |
| 62 |
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
| 63 |
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
| 64 |
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 65 |
|