5
RDF::DOAP::ChangeSets - create pretty ChangeLogs from RDF
9
use RDF::DOAP::ChangeSets;
12
my $file = 'path/to/changelog.rdf';
13
my $file_uri = URI::file->new_abs($file);
15
my $dcs = RDF::DOAP::ChangeSets->new(
16
$file_uri, undef, undef, 'RDFXML');
17
print $dcs->to_string;
21
1
package RDF::DOAP::ChangeSets;
33
our $VERSION = '0.202';
37
This module takes software changelogs written in the RDF DOAP
38
Change Sets vocabulary and produces human-readable changelogs.
42
=item C<< RDF::DOAP::ChangeSets->new($uri, $data, $type, $fmt) >>
44
Creates and initialises an object.
46
$uri is a URL for the input data. The URL is used to query the
47
RDF data for the heading of the output changelog. It may be passed
48
as either a string, or a L<URI> object.
50
$data is the RDF data to use as input. It may be passed as a
51
string, or as an L<RDF::Trine::Model> object. If undefined,
52
this module will attempt to read data from the URL using
55
$type gives the constructor a hint as to the RDF vocabulary you
56
are using. For DOAP Change Sets, use 'current'; for Aaron Cope's
57
Changefile vocab, use 'legacy'; to autodetect, use 'auto'. By
58
default, performs autodetection. This module may crash and burn
59
if you try to mix both vocabs!!
61
$fmt provides a hint as to what RDF format you're using. By
62
default, Turtle is assumed. Valid values are whatever
63
RDF::Trine::Parser->new accepts.
13
our $VERSION = '0.203';
117
65
bless $self, $class;
120
=item C<< $changeset->is_legacy >>
122
Boolean, indicating if a legacy vocab is being used.
129
71
return (lc $self->{'type'} eq 'legacy');
132
=item C<< $changeset->is_current >>
134
Boolean, indicating if the current vocab is being used.
141
77
return !$self->is_legacy(@_);
144
=item C<< $changeset->model >>
146
RDF::Trine::Model object representing the changelog data.
153
83
return $self->{'model'};
156
=item C<< $changeset->uri >>
158
String representing the changelog URI.
165
89
return $self->{'uri'} . '';
168
=item C<< $changeset->to_string >>
170
Creates a human-readable representation of the changelog.
503
415
OPTIONAL { ?item a ?itemtype . }
504
416
OPTIONAL { ?item rdfs:label ?itemlabel . }
506
?item dcs:blame ?blame .
418
?item dcs:blame|dcs:thanks ?blame .
507
419
OPTIONAL { ?blame foaf:nick ?blamenick . }
508
420
OPTIONAL { ?blame foaf:name ?blamename . }
509
421
OPTIONAL { ?blame rdfs:label ?blamename . }
529
RDF::DOAP::ChangeSets - create pretty ChangeLogs from RDF
533
use RDF::DOAP::ChangeSets;
536
my $file = 'path/to/changelog.rdf';
537
my $file_uri = URI::file->new_abs($file);
539
my $dcs = RDF::DOAP::ChangeSets->new(
540
$file_uri, undef, undef, 'RDFXML');
541
print $dcs->to_string;
545
This module takes software changelogs written in the RDF DOAP
546
Change Sets vocabulary and produces human-readable changelogs.
550
=item C<< RDF::DOAP::ChangeSets->new($uri, $data, $type, $fmt) >>
552
Creates and initialises an object.
554
$uri is a URL for the input data. The URL is used to query the
555
RDF data for the heading of the output changelog. It may be passed
556
as either a string, or a L<URI> object.
558
$data is the RDF data to use as input. It may be passed as a
559
string, or as an L<RDF::Trine::Model> object. If undefined,
560
this module will attempt to read data from the URL using
563
$type gives the constructor a hint as to the RDF vocabulary you
564
are using. For DOAP Change Sets, use 'current'; for Aaron Cope's
565
Changefile vocab, use 'legacy'; to autodetect, use 'auto'. By
566
default, performs autodetection. This module may crash and burn
567
if you try to mix both vocabs!!
569
$fmt provides a hint as to what RDF format you're using. By
570
default, Turtle is assumed. Valid values are whatever
571
RDF::Trine::Parser->new accepts.
573
=item C<< $changeset->is_legacy >>
575
Boolean, indicating if a legacy vocab is being used.
577
=item C<< $changeset->is_current >>
579
Boolean, indicating if the current vocab is being used.
581
=item C<< $changeset->model >>
583
RDF::Trine::Model object representing the changelog data.
585
=item C<< $changeset->uri >>
587
String representing the changelog URI.
589
=item C<< $changeset->to_string >>
591
Creates a human-readable representation of the changelog.
593
=item C<< $changeset->to_file($filename) >>
595
Same as C<to_string>, but outputs to a file.