Commits

Konstantin Baierer committed 5ab2648

inherited attributes were not imported/exported. now they should be

  • Participants
  • Parent commits d5cdd1a

Comments (0)

Files changed (3)

lib/MooseX/Semantic/Role/RdfImport.pm

 use MooseX::Semantic::Types qw(TrineResource);
 use Set::Object;
 use namespace::autoclean;
+use Log::Log4perl;
+my $logger = Log::Log4perl->get_logger(__PACKAGE__);
 
 with(
     'MooseX::Semantic::Role::Resource',
 sub _instantiate_one_object {
     my ($cls, $model, $resource, $instance_class, $unfinished_resources) = @_;
     # warn Dumper [$unfinished_resources->elements];
+    # warn Dumper $resource;
+    unless ($instance_class) {
+        warn Dumper $model;
+        warn Dumper $cls;
+        warn Dumper $resource;
+        die "DEATH";
+    }
     if (! $instance_class->does('MooseX::Semantic::Role::Resource')) {
         warn "Resource $resource can't be instantiated as $instance_class ($instance_class doesn't MooseX::Semantic::Role::Resource)";
         return;

lib/MooseX/Semantic/Types.pm

 
 
 class_type CPAN_URI, { class => 'URI' };
+# coerce( CPAN_URI,
+#     from Str, via { if (/^[a-z]+:/) { URI->new($_) },
+# );
 
 coerce( TrineBlankOrUndef,
     from Bool, via { return undef unless $_; RDF::Trine::Node::Blank->new },

lib/MooseX/Semantic/Util/TypeConstraintWalker.pm

 use Data::Dumper;
 use MooseX::Semantic::Types qw(UriStr);
 use feature qw(switch);
+use Log::Log4perl;
+my $logger = Log::Log4perl->get_logger(__PACKAGE__);
 
 sub _find_parent_type {
     my ($self, $attr_or_type_constraint, $needle, %opts) = @_;
 
 sub _find_parent_type_for_type_constraint {
     my ($self, $type_constraint, $needle, %opts) = @_;
+    # warn Dumper $type_constraint->name;
+    # warn Dumper $needle;
     $opts{max_depth} = 9999 unless defined $opts{max_depth};
     $opts{max_width} = 9999 unless defined $opts{max_width};
     $opts{current_depth} = 0 unless $opts{current_depth};
         $cb->{$_} = defined $cb_opts->{$_} ? $cb_opts->{$_} : sub {}
     }
     ATTR:
-    for my $attr_name ($self->meta->get_attribute_list) {
-        my $attr = $self->meta->get_attribute($attr_name);
+    for my $attr ($self->meta->get_all_attributes) {
+        my $attr_name = $attr->name;
+        # my $attr = $self->meta->get_attribute($attr_name);
         next unless ($attr->does('MooseX::Semantic::Meta::Attribute::Trait'));
         my $attr_type = $attr->type_constraint;