Wikibase::Datatype::Value::Sense - Wikibase sense value datatype.
use Wikibase::Datatype::Value::Sense; my $obj = Wikibase::Datatype::Value::Sense->new(%params); my $type = $obj->type; my $value = $obj->value;
This datatype is sense class for representation of wikibase item (e.g. L34727-S1).
new
my $obj = Wikibase::Datatype::Value::Sense->new(%params);
Constructor.
Returns instance of object.
value
Value of instance. Parameter must be in form /^L\d+-S\d+$/ (regexp). Parameter is required.
type
my $type = $obj->type;
Get type. This is constant 'sense'.
Returns string.
my $value = $obj->value;
Get value.
new(): From Wikibase::Datatype::Value::new(): Parameter 'value' is required. From Wikibase::Datatype::Utils::check_sense(): Parameter 'value' must begin with 'L' and number, dash, S and number after it.
use strict; use warnings; use Wikibase::Datatype::Value::Sense; # Object. my $obj = Wikibase::Datatype::Value::Sense->new( 'value' => 'L34727-S1', ); # Get value. my $value = $obj->value; # Get type. my $type = $obj->type; # Print out. print "Type: $type\n"; print "Value: $value\n"; # Output: # Type: sense # Value: L34727-S1
Error::Pure, Mo, Wikibase::Datatype::Utils, Wikibase::Datatype::Value.
Wikibase datatypes.
https://github.com/michal-josef-spacek/Wikibase-Datatype
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2020-2023 Michal Josef Špaček
BSD 2-Clause License
0.33
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.