Wikibase::Datatype::Reference - Wikibase reference datatype.
use Wikibase::Datatype::Reference; my $obj = Wikibase::Datatype::Reference->new(%params); my $snaks_ar = $obj->snaks;
This datatype is reference class for all references in claim.
new
my $obj = Wikibase::Datatype::Reference->new(%params);
Constructor.
Returns instance of object.
snaks
Reference to array with Wikibase::Datatype::Snak instances. Parameter is required.
my $snaks_ar = $obj->snaks;
Get snaks.
Returns reference to array of Wikibase::Datatype::Snak instances.
new(): From Mo::utils::check_array_object(): Parameter 'snaks' must be a array. Snak isn't 'Wikibase::Datatype::Snak' object. From Mo::utils::check_required(): Parameter 'snaks' is required.
use strict; use warnings; use Wikibase::Datatype::Reference; use Wikibase::Datatype::Snak; use Wikibase::Datatype::Value::String; # Object. my $obj = Wikibase::Datatype::Reference->new( 'snaks' => [ Wikibase::Datatype::Snak->new( 'datatype' => 'string', 'datavalue' => Wikibase::Datatype::Value::String->new( 'value' => 'text', ), 'property' => 'P11', ), ], ); # Get value. my $snaks_ar = $obj->snaks; # Print out number of snaks. print "Number of snaks: ".@{$snaks_ar}."\n"; # Output: # Number of snaks: 1
Error::Pure, Mo, Mo::utils.
Wikibase datatypes.
Wikibase snak datatype.
https://github.com/michal-josef-spacek/Wikibase-Datatype
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© Michal Josef Špaček 2020-2021
BSD 2-Clause License
0.08
To install Wikibase::Datatype, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wikibase::Datatype
CPAN shell
perl -MCPAN -e shell install Wikibase::Datatype
For more information on module installation, please visit the detailed CPAN module installation guide.