Toby Inkster avatar Toby Inkster committed 8d6dc53 Draft

bugfixey

Comments (0)

Files changed (10)

examples/example1.pl

-use lib "lib";
-use lib "../HTML-Microformats/lib";
-use RDF::TrineShortcuts;
+use RDF::TrineX::Functions -shortcuts;
 use HTML::Microformats;
 use RDF::vCard;
 use JSON -convert_blessed_universally;
 
 my $doc = HTML::Microformats->new_document($html, "http://example.com/", type=>'application/xhtml+xml')->assume_all_profiles;
 
-my $model = rdf_parse(<<'MORE', type=>'turtle', model => $doc->model);
+my $model = rdf_parse(<<'MORE', type=>'turtle', model => $doc->model, base => 'http://example.net/base/');
 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
 @prefix v: <http://www.w3.org/2006/vcard/ns#> .
 @prefix vx: <http://buzzword.org.uk/rdf/vcardx#> .
 	print $c->to_xml;
 	print "\n";
 	print "\n";
-}
+}

examples/example2.pl

-use lib "lib";
 use Data::Dumper;
-use RDF::TrineShortcuts;
+use RDF::TrineX::Functions -shortcuts;
 use HTML::Microformats;
 use RDF::vCard;
 use RDF::vCard::Importer;
 
 my $doc = HTML::Microformats->new_document($html, "http://example.com/", type=>'application/xhtml+xml')->assume_all_profiles;
 
-my $model = rdf_parse(<<'MORE', type=>'turtle', model => $doc->model);
+my $model = rdf_parse(<<'MORE', type=>'turtle', model => $doc->model, base => 'http://example.net/base/');
 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
 @prefix v: <http://www.w3.org/2006/vcard/ns#> .
 @prefix vx: <http://buzzword.org.uk/rdf/vcardx#> .
 my @rv = $importer->import_string($cards);
 print $cards;
 print Dumper([ @rv ]);
-print rdf_string($importer => 'RDFXML');
+print rdf_string($importer->model => 'RDFXML');

examples/example3.pl

 #!/usr/bin/perl
 
 use strict;
-use lib "lib";
 use RDF::vCard;
 use Data::Dumper;
 
 my $i = RDF::vCard::Importer->new;
 my @cards = $i->import_string($vc, lang=>'en');
 
-print Dumper(@cards);
+print Dumper(@cards);
 use RDF::vCard::Exporter;
 use RDF::vCard::Importer;
 
-our $VERSION = '0.009';
+our $VERSION = '0.010';
 
 our $WITH_XML;
 BEGIN {

lib/RDF/vCard/Entity.pm

 use strict;
 
 use JSON qw[];
-use RDF::TrineX::Functions -shortcuts;
+use RDF::TrineX::Functions
+	-shortcuts,
+	statement => { -as => 'rdf_statement' },
+	iri       => { -as => 'rdf_resource' };
 
 sub V    { return 'http://www.w3.org/2006/vcard/ns#' . shift; }
 sub VX   { return 'http://buzzword.org.uk/rdf/vcardx#' . shift; }
 use namespace::clean;
 
 use overload '""' => \&to_string;
-our $VERSION = '0.009';
+our $VERSION = '0.010';
 
 sub new
 {

lib/RDF/vCard/Entity/WithXmlSupport.pm

 use base qw'RDF::vCard::Entity';
 use namespace::clean;
 
-our $VERSION = '0.009';
+our $VERSION = '0.010';
 
 sub promote
 {

lib/RDF/vCard/Exporter.pm

 use MIME::Base64 qw[];
 use RDF::vCard::Entity;
 use RDF::vCard::Line;
-use RDF::TrineX::Functions -shortcuts;
+use RDF::TrineX::Functions
+	-shortcuts,
+	iri => { -as => 'rdf_resource' };
 use Scalar::Util qw[blessed];
 use URI;
 
 sub RDF  { return 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' . shift; }
 sub XSD  { return 'http://www.w3.org/2001/XMLSchema#' . shift; }
 
+sub flatten_node
+{
+	my $node = shift;
+	return $node->value if $node->is_resource || $node->is_literal;
+	return $node->as_ntriples;
+}
+
 use namespace::clean;
 
-our $VERSION = '0.009';
+our $VERSION = '0.010';
 our $PRODID  = sprintf("+//IDN cpan.org//NONSGML %s v %s//EN", __PACKAGE__, $VERSION);
 
 our %dispatch = (

lib/RDF/vCard/Importer.pm

 
 use namespace::clean;
 
-our $VERSION = '0.009';
+our $VERSION = '0.010';
 
 sub new
 {

lib/RDF/vCard/Line.pm

 
 use Encode;
 use MIME::Base64;
-use RDF::TrineX::Functions -shortcuts;
+use RDF::Trine::Namespace qw[xsd];
+use RDF::TrineX::Functions
+	-shortcuts,
+	statement => { -as => 'rdf_statement' },
+	literal   => { -as => 'rdf_literal' },
+	iri       => { -as => 'rdf_resource' };
 use URI::data;
 
 sub V    { return 'http://www.w3.org/2006/vcard/ns#' . shift; }
 use namespace::clean;
 
 use overload '""' => \&to_string;
-our $VERSION = '0.009';
+our $VERSION = '0.010';
 
 sub new
 {
 {
 	my ($self) = @_;
 
-	return rdf_literal($self->value_to_string, datatype=>'date')
+	return rdf_literal($self->value_to_string, undef, $xsd->date)
 		if (defined $self->type_parameters and uc $self->type_parameters->{VALUE} eq 'DATE');
 
-	return rdf_literal($self->value_to_string, datatype=>'dateTime')
+	return rdf_literal($self->value_to_string, undef, $xsd->dateTime)
 		if (defined $self->type_parameters and uc $self->type_parameters->{VALUE} eq 'DATE-TIME');
 
 	return rdf_resource($self->value_to_string)
 
 	if (defined $self->type_parameters->{LANG})
 	{
-		return rdf_literal($self->value_to_string,
-			lang => $self->type_parameters->{LANG});
+		return rdf_literal($self->value_to_string, $self->type_parameters->{LANG});
 	}
 
 	return rdf_literal($self->value_to_string);
 		dcs:item   [ rdfs:label "Switch to Module::Package::RDF."@en ; a dcs:Packaging ]
 	].
 
+my:project :release my:v_0-010.
+my:v_0-010
+	a               :Version ;
+	dc:issued       "2012-06-23"^^xsd:date ;
+	:revision       "0.010"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/RDF-vCard-0.010.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-009 ;
+		dcs:item   [ rdfs:label "Fix various small issues around RDF::TrineShortcuts -> RDF::TrineX::Functions switch."@en ; a dcs:Bugfix ]
+	].
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.