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

js pushed a commit to tag dev-release-0.13_1
in repository librdf-generator-void-perl.

commit 1ffe90b3bbe2c493079cb5a05c274b7203b89c87
Author: Kjetil Kjernsmo <kje...@kjernsmo.net>
Date:   Wed Jul 17 11:47:38 2013 +0200

    Put progress statements here and there
---
 lib/RDF/Generator/Void.pm       | 20 +++++++++++++++++---
 lib/RDF/Generator/Void/Stats.pm |  6 ++----
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/lib/RDF/Generator/Void.pm b/lib/RDF/Generator/Void.pm
index d16cb59..7a8b3a2 100644
--- a/lib/RDF/Generator/Void.pm
+++ b/lib/RDF/Generator/Void.pm
@@ -11,6 +11,7 @@ use RDF::Generator::Void::Stats;
 # use less ();
 use utf8;
 use URI::Split qw(uri_split uri_join);
+use Progress::Any;
 
 use aliased 'RDF::Generator::Void::Meta::Attribute::ObjectList';
 
@@ -100,6 +101,9 @@ has dataset_uri => (
                                                  coerce   => 1,
                                                 );
 
+my $progress = Progress::Any->get_indicator(task => "compute");
+
+
 # This will create a URN with a UUID by default
 sub _build_dataset_uri {
        my ($self) = @_;
@@ -231,7 +235,9 @@ a model, one will be created for you.
 sub generate {
        my $self = shift;
        my $void_model = shift || RDF::Trine::Model->temporary_model;
-
+       $progress->pos(0);
+       $progress->target($self->inmodel->size + 10);
+       $progress->update(message => "Adding base statements");
        local $self->{void_model} = $void_model;
 
        # Start generating the actual VoID statements
@@ -260,7 +266,7 @@ sub generate {
                                                                                
                                 
iri('http://www.w3.org/2000/01/rdf-schema#label'),
                                                                                
                            literal("RDF::Generator::Void, Version $VERSION", 
'en')));
        }
-
+       $progress->update(message => "Adding base statements");
 
        foreach my $endpoint ($self->all_endpoints) {
                $void_model->add_statement(statement(
@@ -293,6 +299,7 @@ sub generate {
                                                                                
                         literal($self->inmodel->size, undef, $xsd->integer),
                                                                                
                        ));
 
+       $progress->update(message => "Adding base statements");
        if ($self->has_urispace) {
                $void_model->add_statement(statement(
                                                                                
                                 $self->dataset_uri,
@@ -303,6 +310,7 @@ sub generate {
                $self->_generate_counts($void->entities, 
$self->stats->entities);
        }
 
+
        return $void_model if ($self->has_level && $self->level == 0);
        $self->_generate_counts($void->distinctSubjects, 
$self->stats->subjects);
        $self->_generate_counts($void->properties, $self->stats->properties);
@@ -314,6 +322,8 @@ sub generate {
 
        $self->_generate_propertypartitions;
        $self->_generate_classpartitions;
+       $progress->update(message => "Finishing"); 
+
        return $void_model;
 }
 
@@ -325,6 +335,7 @@ sub _generate_counts {
                                                                                
                                                $predicate,
                                                                                
                                                literal($count, undef, 
$xsd->integer),
                                                                                
                                          ));
+       $progress->update(message => "Adding counts statements");
 }
 
 sub _generate_propertypartitions {
@@ -353,7 +364,7 @@ sub _generate_propertypartitions {
                                                 literal(scalar keys 
%{$counts->{'countobjects'}}, undef, $xsd->integer)));
         }
 
-                
+        $progress->update(message => "Adding property partition statements"); 
 
   }
 }
@@ -374,6 +385,7 @@ sub _generate_classpartitions {
     $self->{void_model}->add_statement(statement($blank,
                                                 $void->triples,
                                                 literal($count, undef, 
$xsd->integer)));
+        $progress->update(message => "Adding class partition statements"); 
   }
 }
 
@@ -394,6 +406,8 @@ sub _generate_most_common_vocabs {
                                                                                
                                                        iri($vocab),
                                                                                
                                                  ));
        }
+       $progress->update(message => "Adding vocabulary statements"); 
+       
 }
 
 
diff --git a/lib/RDF/Generator/Void/Stats.pm b/lib/RDF/Generator/Void/Stats.pm
index e2462c0..0382c3d 100644
--- a/lib/RDF/Generator/Void/Stats.pm
+++ b/lib/RDF/Generator/Void/Stats.pm
@@ -83,10 +83,8 @@ sub BUILD {
        # Initialize local hashes to count stuff.
        my (%vocab_counter, %entities, %properties, %subjects, %objects, 
%classes);
        my $progress = Progress::Any->get_indicator(task => "compute");
-       $progress->pos(0);
  
        my $gen = $self->generator;
-       $progress->target($gen->inmodel->size);
 
        # Here, we take the data in the model we want to generate
        # statistics for and we iterate over it. Doing it this way, we
@@ -130,9 +128,8 @@ sub BUILD {
                        
$properties{$st->predicate->uri_value}{'countsubjects'}{$st->subject->sse} = 1;
                        
$properties{$st->predicate->uri_value}{'countobjects'}{$st->object->sse} = 1;
                }
-               $progress->update(message => "Triple examined");
+               $progress->update(message => "Examening triples");
        });
-       $progress->finish;
 
 
        # Finally, we update the attributes above, they are returned as a 
side-effect
@@ -145,6 +142,7 @@ sub BUILD {
                $self->propertyPartitions(\%properties);
                $self->classPartitions(\%classes);
        }
+       $progress->update(message => "Data transfer");
 }
 
 =head1 FURTHER DOCUMENTATION

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/librdf-generator-void-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

Reply via email to