[libmodule-install-rdf-perl] 01/34: Ubercool RDF-driven build system.

Jonas Smedegaard js at alioth.debian.org
Fri Aug 9 14:36:15 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmodule-install-rdf-perl.

commit b80866b967756caedd4beafd3815bd261366e83f
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Sat Oct 1 18:40:42 2011 +0000

    Ubercool RDF-driven build system.
    
    --HG--
    branch : Module-Install-RDF
    extra : convert_revision : svn%3A3fe8e991-6959-4966-b76d-b07eca2b6e37/Module-Install-RDF%40953
---
 Makefile.PL                     |    1 +
 Module-Install-RDF-0.001.tar.gz |  Bin 0 -> 38279 bytes
 TODO                            |    2 ++
 lib/Module/Install/Admin/RDF.pm |   40 ++++++++++++++++++++++++++
 lib/Module/Install/RDF.pm       |   60 +++++++++++++++++++++++++++++++++++++++
 meta/changes.ttl                |   18 ++++++++++++
 meta/deps.ttl                   |   10 +++++++
 meta/doap.ttl                   |   35 +++++++++++++++++++++++
 meta/makefile.ttl               |    8 ++++++
 t/01basic.t                     |    3 ++
 10 files changed, 177 insertions(+)

diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..01e5b33
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1 @@
+use inc::Module::Package 'RDF:standard';
diff --git a/Module-Install-RDF-0.001.tar.gz b/Module-Install-RDF-0.001.tar.gz
new file mode 100644
index 0000000..ccec036
Binary files /dev/null and b/Module-Install-RDF-0.001.tar.gz differ
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..f3cf0be
--- /dev/null
+++ b/TODO
@@ -0,0 +1,2 @@
+- Investigate using named graphs.
+- Document how other Module::Install plugins can build on this one.
diff --git a/lib/Module/Install/Admin/RDF.pm b/lib/Module/Install/Admin/RDF.pm
new file mode 100644
index 0000000..c3666e0
--- /dev/null
+++ b/lib/Module/Install/Admin/RDF.pm
@@ -0,0 +1,40 @@
+package Module::Install::Admin::RDF;
+
+use 5.008;
+use base qw(Module::Install::Base);
+use strict;
+
+use RDF::Trine qw[];
+use Scalar::Util qw[];
+use URI::file qw[];
+
+our $VERSION = '0.001';
+
+my $Model = {};
+
+sub rdf_metadata
+{
+	my ($self) = @_;
+	
+	my $addr = Scalar::Util::refaddr($self->_top);
+	return $Model->{$addr} if defined $Model->{$addr};
+	my $model = $Model->{$addr} = RDF::Trine::Model->new;
+	
+	my $turtle = RDF::Trine::Parser->new('Turtle');
+	while (<meta/*.{ttl,turtle,nt}>)
+	{
+		my $iri = URI::file->new_abs($_);
+		$turtle->parse_file_into_model("$iri", $_, $model);
+	}
+
+	my $rdfxml = RDF::Trine::Parser->new('RDFXML');
+	while (<meta/*.{rdf,rdfxml,rdfx}>)
+	{
+		my $iri = URI::file->new_abs($_);
+		$rdfxml->parse_file_into_model("$iri", $_, $model);
+	}
+	
+	return $model;
+}
+
+1;
diff --git a/lib/Module/Install/RDF.pm b/lib/Module/Install/RDF.pm
new file mode 100644
index 0000000..0bd61c6
--- /dev/null
+++ b/lib/Module/Install/RDF.pm
@@ -0,0 +1,60 @@
+package Module::Install::RDF;
+
+use 5.008;
+use base qw(Module::Install::Base);
+use strict;
+
+our $VERSION = '0.001';
+our $AUTHOR_ONLY = 1;
+
+sub rdf_metadata
+{
+	my $self = shift;
+	$self->admin->rdf_metadata(@_) if $self->is_admin;
+}
+
+1;
+
+__END__
+=head1 NAME
+
+Module::Install::RDF - advanced metadata for your distribution
+
+=head1 SYNOPSIS
+
+In Makefile.PL:
+
+  rdf_metadata;
+
+=head1 DESCRIPTION
+
+This module doesn't really do much on its own, but is a pre-requisite for 
+L<Module::Install::DOAP>.
+
+Specifically, it reads all the RDF it can find in the distribution's 'meta'
+directory and exposes it for other modules to make use of.
+
+=head1 BUGS
+
+Please report any bugs to L<http://rt.cpan.org/>.
+
+=head1 SEE ALSO
+
+L<Module::Install>,
+L<Module::Install::DOAP>,
+L<Module::Install::DOAPChangeSets> .
+
+L<http://www.perlrdf.org/>.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink at cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2011 by Toby Inkster
+
+This library is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
diff --git a/meta/changes.ttl b/meta/changes.ttl
new file mode 100644
index 0000000..b7ef23b
--- /dev/null
+++ b/meta/changes.ttl
@@ -0,0 +1,18 @@
+ at prefix :        <http://usefulinc.com/ns/doap#> .
+ at prefix dcs:     <http://ontologi.es/doap-changeset#> .
+ at prefix dc:      <http://purl.org/dc/terms/> .
+ at prefix foaf:    <http://xmlns.com/foaf/0.1/> .
+ at prefix my:      <http://purl.org/NET/cpan-uri/dist/Module-Install-RDF/> .
+ at prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+ at prefix toby:    <http://tobyinkster.co.uk/#> .
+ at prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
+
+my:project :release my:v_0-001 .
+my:v_0-001
+
+	a               :Version ;
+	dc:issued       "2011-10-01"^^xsd:date ;
+	:revision       "0.001"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Module-Install-RDF-0.001.tar.gz> ;
+	rdfs:label      "Initial release" .
+
diff --git a/meta/deps.ttl b/meta/deps.ttl
new file mode 100644
index 0000000..4d60581
--- /dev/null
+++ b/meta/deps.ttl
@@ -0,0 +1,10 @@
+ at prefix : <http://purl.org/NET/cpan-uri/terms#> .
+
+<http://purl.org/NET/cpan-uri/dist/Module-Install-RDF/project>
+	:requires
+		"Scalar::Util" ,
+		"Module::Install 1.00" ,
+		"RDF::Trine 0.112" ,
+		"URI::file 4.0" ;
+	:test_requires
+		"Test::More 0.61" .
diff --git a/meta/doap.ttl b/meta/doap.ttl
new file mode 100644
index 0000000..8615cc1
--- /dev/null
+++ b/meta/doap.ttl
@@ -0,0 +1,35 @@
+ at prefix :        <http://usefulinc.com/ns/doap#> .
+ at prefix dcs:     <http://ontologi.es/doap-changeset#> .
+ at prefix dc:      <http://purl.org/dc/terms/> .
+ at prefix foaf:    <http://xmlns.com/foaf/0.1/> .
+ at prefix my:      <http://purl.org/NET/cpan-uri/dist/Module-Install-RDF/> .
+ at prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+ at prefix toby:    <http://tobyinkster.co.uk/#> .
+ at prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
+
+my:project
+
+	a               :Project ;
+	:name           "Module-Install-RDF" ;
+	:shortdesc      "advanced metadata for your distribution"@en ;
+	:programming-language  "Perl" ;
+	:homepage       <https://metacpan.org/release/Module-Install-RDF> ;
+	:download-page  <https://metacpan.org/release/Module-Install-RDF> ;
+	:bug-database   <http://rt.cpan.org/Dist/Display.html?Queue=Module-Install-RDF> ;
+	:repository     [ a :SVNRepository ; :browse <http://goddamn.co.uk/svn-web/perlmods/browse/Module-Install-RDF/> ] ;
+	:maintainer     toby:i ;
+	:developer      toby:i ;
+	:documenter     toby:i ;
+	:tester         toby:i ;
+	:created        "2011-09-30"^^xsd:date ;
+	:license        <http://dev.perl.org/licenses/> ; 
+	:category       [ rdfs:label "Semantic Web" ] , [ rdfs:label "Packaging" ]  .
+
+toby:i
+
+	a               foaf:Person ;
+	foaf:name       "Toby Inkster" ;
+	foaf:homepage   <http://tobyinkster.co.uk/> ;
+	foaf:page       <https://metacpan.org/author/TOBYINK> ;
+	foaf:mbox       <mailto:tobyink at cpan.org> ;
+	<http://www.w3.org/2002/07/owl#sameAs> <http://purl.org/NET/cpan-uri/person/tobyink> .
diff --git a/meta/makefile.ttl b/meta/makefile.ttl
new file mode 100644
index 0000000..3185bfc
--- /dev/null
+++ b/meta/makefile.ttl
@@ -0,0 +1,8 @@
+ at prefix : <http://purl.org/NET/cpan-uri/terms#> .
+
+<http://purl.org/NET/cpan-uri/dist/Module-Install-RDF/project>
+	:perl_version_from _:main ;
+	:version_from _:main ;
+	:readme_from _:main .
+
+_:main <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName> "lib/Module/Install/RDF.pm" .
diff --git a/t/01basic.t b/t/01basic.t
new file mode 100644
index 0000000..b83bc91
--- /dev/null
+++ b/t/01basic.t
@@ -0,0 +1,3 @@
+use Test::More tests => 2;
+BEGIN { use_ok('Module::Install::RDF') };
+BEGIN { use_ok('Module::Install::Admin::RDF') };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-install-rdf-perl.git



More information about the Pkg-perl-cvs-commits mailing list