~ubuntu-branches/ubuntu/trusty/liburi-namespacemap-perl/trusty

« back to all changes in this revision

Viewing changes to README

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2013-01-22 20:40:25 UTC
  • Revision ID: package-import@ubuntu.com-20130122204025-ne97x0q6a562tz38
Tags: upstream-0.06
ImportĀ upstreamĀ versionĀ 0.06

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
NAME
 
2
    URI::NamespaceMap - Class holding a collection of namespaces
 
3
 
 
4
VERSION
 
5
    Version 0.06
 
6
 
 
7
SYNOPSIS
 
8
      use URI::NamespaceMap;
 
9
      my $map = URI::NamespaceMap->new( { xsd => 'http://www.w3.org/2001/XMLSchema#' } );
 
10
      $map->namespace_uri('xsd')->as_string;
 
11
      my $foaf = URI::Namespace->new( 'http://xmlns.com/foaf/0.1/' );
 
12
      $map->add_mapping(foaf => $foaf);
 
13
      $map->add_mapping(rdf => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' );
 
14
      $map->list_prefixes;  #  ( 'foaf', 'rdf', 'xsd' )
 
15
 
 
16
DESCRIPTION
 
17
    This module provides an object to manage multiple namespaces for
 
18
    creating URI::Namespace objects and for serializing.
 
19
 
 
20
METHODS
 
21
    "new ( [ \%namespaces ] )"
 
22
        Returns a new namespace map object. You can pass a hash reference
 
23
        with mappings from local names to namespace URIs (given as string or
 
24
        RDF::Trine::Node::Resource) or namespaces_map with a hashref.
 
25
 
 
26
    "add_mapping ( $name => $uri )"
 
27
        Adds a new namespace to the map. The namespace URI can be passed as
 
28
        string or a URI::Namespace object.
 
29
 
 
30
    "remove_mapping ( $name )"
 
31
        Removes a namespace from the map given a prefix.
 
32
 
 
33
    "namespace_uri ( $name )"
 
34
        Returns the namespace object (if any) associated with the given
 
35
        prefix.
 
36
 
 
37
    "list_namespaces"
 
38
        Returns an array of URI::Namespace objects with all the namespaces.
 
39
 
 
40
    "list_prefixes"
 
41
        Returns an array of prefixes.
 
42
 
 
43
    "uri ( $prefixed_name )"
 
44
        Returns a URI for an abbreviated string such as 'foaf:Person'.
 
45
 
 
46
    prefix_for "uri ($uri)"
 
47
        Returns the associated prefix (or potentially multiple prefixes,
 
48
        when called in list context) for the given URI.
 
49
 
 
50
    abbreviate "uri ($uri)"
 
51
        Complement to "namespace_uri". Returns the given URI in "foo:bar"
 
52
        format or "undef" if it wasn't matched, therefore the idiom
 
53
 
 
54
            my $str = $nsmap->abbreviate($uri_node) || $uri->as_string;
 
55
 
 
56
        may be useful for certain serialization tasks.
 
57
 
 
58
WARNING
 
59
    Avoid using the names 'can', 'isa', 'VERSION', and 'DOES' as namespace
 
60
    prefix, because these names are defined as method for every Perl object
 
61
    by default. The method names 'new' and 'uri' are also forbidden. Names
 
62
    of methods of Moose::Object must also be avoided.
 
63
 
 
64
AUTHORS
 
65
    Chris Prather, "<chris@prather.org>" Kjetil Kjernsmo,
 
66
    "<kjetilk@cpan.org>" Gregory Todd Williams, "<gwilliams@cpan.org>"
 
67
 
 
68
CONTRIBUTORS
 
69
    Dorian Taylor
 
70
 
 
71
BUGS
 
72
    Please report any bugs using github
 
73
    <https://github.com/kjetilk/URI-NamespaceMap/issues>
 
74
 
 
75
SUPPORT
 
76
    You can find documentation for this module with the perldoc command.
 
77
 
 
78
        perldoc URI::NamespaceMap
 
79
 
 
80
COPYRIGHT & LICENSE
 
81
    Copyright 2012 Gregory Todd Williams, Chris Prather and Kjetil Kjernsmo
 
82
 
 
83
    This program is free software; you can redistribute it and/or modify it
 
84
    under the same terms as Perl itself.
 
85