This is an automated email from the git hooks/post-receive script. js pushed a commit to branch master in repository librdf-ns-perl.
commit e1237ca4d532027e39b7bd07b4f26702216a213f Merge: 9872e9e 0c40bdc Author: Jonas Smedegaard <d...@jones.dk> Date: Thu Jan 12 11:57:19 2017 +0100 New upstream version 20170111 Changes | 20 +++++++ META.json | 4 +- META.yml | 2 +- README | 12 ++--- lib/App/rdfns.pm | 2 +- lib/RDF/NS.pm | 18 +++---- lib/RDF/NS/Trine.pm | 4 +- lib/RDF/NS/URIS.pm | 4 +- lib/RDF/SN.pm | 4 +- share/prefix.cc | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/prefix.t | 3 +- 11 files changed, 197 insertions(+), 26 deletions(-) diff --cc Changes index 60e72de,9fd60ca..f7f2083 --- a/Changes +++ b/Changes @@@ -1,3 -1,25 +1,23 @@@ -{{$NEXT}} - + 20170111 2017-01-11 17:02:03 CET + - 1922 prefixes + - added: apf art asawoo bb bblfish biml bioc cdt clinic cpack crime + crowd dash datex dbfo dcap dcatapit dcodata dpn driver duv eame + eccpubsub ecoll efrbroo ensembl eol esproc fno fo frgeo html + iana ifc ioto ipsv isidore ispra jpost kees latitude ldq ldqm + leak leaks literal llr lsq lyon markus mdi meat merge meshv mls + mmm mmoon mod ncbigene ndnp neotec neotecbib obeu ondc ontolex + ontology ontop or organ pcdm pdf planet pm pmd pmo pmofn pmonb + pmopb pmovn ppr prohow rdaad rdaar rdabs rdacarx rdacdt rdacpc + rdaft rdagen rdaill rdalay rdapf rdapm rdaspc rdaterm rdavf + rdfp rdfsharp ruian sdm sdmxc sdmxcode sdmxm semiot sg sgfn sgg + sgiter soch solid sorg spv studiop sx system tarql tgm tissue + undata vam vogd voidex vplan wab wdv webac ws year yso + - changed: cdm content dbpediaowl dul fn gen ic jolux ludo media mm nuts + ogc res role san seas units verb wikipedia wp + + -{{$NEXT}} ++20170111 2017-01-11 17:02:03 CET + 20160409 2016-04-09 14:03:22 CEST - 1793 prefixes - added: dwciri sdterms diff --cc META.yml index 307ede1,0000000..be9f1da mode 100644,000000..100644 --- a/META.yml +++ b/META.yml @@@ -1,35 -1,0 +1,35 @@@ +--- +abstract: 'Just use popular RDF namespace prefixes from prefix.cc' +author: + - 'Jakob Voß' +build_requires: {} +configure_requires: + Module::Build::Tiny: '0.039' +dynamic_config: 0 +generated_by: 'Dist::Zilla version 5.036, Dist::Milla version v1.0.15, CPAN::Meta::Converter version 2.150001' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: RDF-NS +no_index: + directory: + - t + - xt + - inc + - share + - eg + - examples +requires: + File::ShareDir: '1.00' + perl: v5.12.0 +resources: + bugtracker: https://github.com/nichtich/RDF-NS/issues + homepage: https://github.com/nichtich/RDF-NS + repository: https://github.com/nichtich/RDF-NS.git - version: '20160409' ++version: '20170111' +x_contributors: + - 'Andreas Koenig <a...@cpan.org>' + - 'Jakob Voss <ja...@nichtich.de>' + - 'Jakob Voss <v...@gbv.de>' + - 'Sergey Romanov <comple...@rambler.ru>' diff --cc README index f47fb44,0000000..97c5629 mode 100644,000000..100644 --- a/README +++ b/README @@@ -1,183 -1,0 +1,183 @@@ +NAME + + RDF::NS - Just use popular RDF namespace prefixes from prefix.cc + +SYNOPSIS + - use RDF::NS '20160409'; # check at compile time - my $ns = RDF::NS->new('20160409'); # check at runtime ++ use RDF::NS '20170111'; # check at compile time ++ my $ns = RDF::NS->new('20170111'); # check at runtime + + $ns->foaf; # http://xmlns.com/foaf/0.1/ + $ns->foaf_Person; # http://xmlns.com/foaf/0.1/Person + $ns->foaf('Person'); # http://xmlns.com/foaf/0.1/Person + $ns->uri('foaf:Person'); # http://xmlns.com/foaf/0.1/Person + + use RDF::NS; # get rid if typing '$' by defining a constant + use constant NS => RDF::NS->new('20111208'); + NS->foaf_Person; # http://xmlns.com/foaf/0.1/Person + + $ns->SPAQRL('foaf'); # PREFIX foaf: <http://xmlns.com/foaf/0.1/> + $ns->TTL('foaf'); # @prefix foaf: <http://xmlns.com/foaf/0.1/> . + $ns->XMLNS('foaf'); # xmlns:foaf="http://xmlns.com/foaf/0.1/" + + # load your own mapping from a file + $ns = RDF::NS->new("mapping.txt"); + + # select particular mappings + %map = $ns->SELECT('rdf,dc,foaf'); + $uri = $ns->SELECT('foo|bar|doz'); # returns first existing namespace + + # instances of RDF::NS are just blessed hash references + $ns->{'foaf'}; # http://xmlns.com/foaf/0.1/ + bless { foaf => 'http://xmlns.com/foaf/0.1/' }, 'RDF::NS'; + print (scalar keys %$ns) . "prefixes\n"; + $ns->COUNT; # also returns the number of prefixes + +DESCRIPTION + + Hardcoding URI namespaces and prefixes for RDF applications is neither + fun nor maintainable. In the end we all use more or less the same + prefix definitions, as collected at http://prefix.cc. This module + includes all these prefixes as defined at specific snapshots in time. + These snapshots correspond to version numbers of this module. By + selecting particular versions, you make sure that changes at prefix.cc + won't affect your programs. + + The command line client rdfns is installed automatically with this + module: + + $ rdfns rdf,foaf.ttl + @prefix foaf: <http://xmlns.com/foaf/0.1/> . + @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . + + This module does not require RDF::Trine, which is recommended + nevertheless. (at least version 0.140). If you prefer RDF::NS to return + instances of RDF::Trine::Node::Resource instead of plain strings, use + RDF::NS::Trine. RDF::NS::URIS is a similar module that returns + instances of URI. + + The code repository of this module contains an update script + <https://github.com/nichtich/RDF-NS/blob/master/update.pl> to download + the current prefix-namespace mappings from http://prefix.cc. + +GENERAL METHODS + + In most cases you only need the following lowercase methods. + + new ( [ $file_or_date ] [ %options ] ) + + Create a new namespace mapping from a selected file, date, or hash + reference. The special string "any" or the value 1 can be used to get + the newest mapping, but you should better select a specific version, as + mappings can change, violating backwards compatibility. Supported + options include warn to enable warnings and at to specify a date. + + "prefix" + + Returns the namespace for prefix if namespace prefix is defined. For + instance $ns->foaf returns http://xmlns.com/foaf/0.1/. + + "prefix_name" + + Returns the namespace plus local name, if namespace prefix is defined. + For instance $ns->foaf_Person returns http://xmlns.com/foaf/0.1/Person. + + uri ( $short | "<$URI>" ) + + Expand a prefixed URI, such as foaf:Person or foaf_Person. + Alternatively you can expand prefixed URIs with method calls, such as + $ns->foaf_Person. If you pass an URI wrapped in < and >, it will not be + expanded but returned as given. + +SERIALIZATION METHODS + + TTL ( prefix[es] ) + + Returns a Turtle/Notation3 @prefix definition or a list of such + definitions in list context. Prefixes can be passed as single arguments + or separated by commas, vertical bars, and spaces. + + SPARQL ( prefix[es] ) + + Returns a SPARQL PREFIX definition or a list of such definitions in + list context. Prefixes can be passed as single arguments or separated + by commas, vertical bars, and spaces. + + XMLNS ( prefix[es] ) + + Returns an XML namespace declaration or a list of such declarations in + list context. Prefixes can be passed as single arguments or separated + by commas, vertical bars, and spaces. + + TXT ( prefix[es] ) + + Returns a list of tabular-separated prefix-namespace-mappings. + + BEACON ( prefix[es] ) + + Returns a list of BEACON format prefix definitions (not including + prefixes). + +LOOKUP METHODS + + PREFIX ( $uri ) + + Get a prefix of a namespace URI, if it is defined. This method does a + reverse lookup which is less performant than the other direction. If - multiple prefixes are defined, it is not determinstic which one is - returned! If you need to call this method frequently and with - deterministic response, better create a reverse hash (method REVERSE). ++ multiple prefixes are defined, the first in sorted order is returned. ++ If you need to call this method frequently and with deterministic ++ response, better create a reverse hash (method REVERSE). + + PREFIXES ( $uri ) + - Get all known prefixes of a namespace URI. ++ Get all known prefixes of a namespace URI in sorted order. + + REVERSE + + Calling $ns->REVERSE is equal to RDF::SN->new($ns). See RDF::SN for + details. + + SELECT ( prefix[es] ) + + In list context, returns a sorted list of prefix-namespace pairs, which + can be used to assign to a hash. In scalar context, returns the + namespace of the first prefix that was found. Prefixes can be passed as + single arguments or separated by commas, vertical bars, and spaces. + +INTERNAL METHODS + + SET ( $prefix => $namespaces [, $warn ] ) + + Set or add a namespace mapping. Errors are ignored unless enabled as + warnings with the third argument. Returns true if the mapping was + successfully added. + + MAP ( $code [, prefix[es] ] ) + + Internally used to map particular or all prefixes. Prefixes can be + selected as single arguments or separated by commas, vertical bars, and + spaces. In scalar context, $_ is set to the first existing prefix (if + found) and $code is called. In list context, found prefixes are sorted + at mapped with $code. + + GET ( $uri ) + + This method is used internally to create URIs as return value of the + URI method and all lowercase shortcut methods, such as foaf_Person. By + default it just returns $uri unmodified. + +SEE ALSO + + There are several other CPAN modules to deal with IRI namespaces, for + instance RDF::Trine::Namespace, RDF::Trine::NamespaceMap, + URI::NamespaceMap, RDF::Prefixes, RDF::Simple::NS, + RDF::RDFa::Parser::Profile::PrefixCC, Class::RDF::NS, XML::Namespace, + XML::CommonNS etc. + +COPYRIGHT AND LICENSE + + This software is copyright (c) 2013- by Jakob Voß. + + This is free software; you can redistribute it and/or modify it under + the same terms as the Perl 5 programming language system itself. + -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/librdf-ns-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits