The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Wikibase::Datatype::Value::Lexeme - Wikibase lexeme value datatype.

SYNOPSIS

use Wikibase::Datatype::Value::Lexeme;

my $obj = Wikibase::Datatype::Value::Lexeme->new(%params);
my $type = $obj->type;
my $value = $obj->value;

DESCRIPTION

This datatype is item class for representation of wikibase lexeme (e.g. L42284).

METHODS

new

my $obj = Wikibase::Datatype::Value::Lexeme->new(%params);

Constructor.

Returns instance of object.

  • value

    Value of instance. Parameter must be in form /^L\d+$/ (regexp). Parameter is required.

type

my $type = $obj->type;

Get type. This is constant 'item'.

Returns string.

value

my $value = $obj->value;

Get value.

Returns string.

ERRORS

new():
        From Wikibase::Datatype::Utils::check_entity():
                Parameter 'value' must begin with 'Q' and number after it.
        From Wikibase::Datatype::Value::new():
                Parameter 'value' is required.

EXAMPLE

use strict;
use warnings;

use Wikibase::Datatype::Value::Lexeme;

# Object.
my $obj = Wikibase::Datatype::Value::Lexeme->new(
        'value' => 'L42284',
);

# Get value.
my $value = $obj->value;

# Get type.
my $type = $obj->type;

# Print out.
print "Type: $type\n";
print "Value: $value\n";

# Output:
# Type: item
# Value: L42284

DEPENDENCIES

Error::Pure, Mo, Wikibase::Datatype::Utils, Wikibase::Datatype::Value.

SEE ALSO

Wikibase::Datatype::Value

Wikibase datatypes.

REPOSITORY

https://github.com/michal-josef-spacek/Wikibase-Datatype

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2020-2023 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.33