NAME
Wikibase::Datatype::MediainfoSnak - Wikibase mediainfo snak datatype.
SYNOPSIS
use Wikibase::Datatype::MediainfoSnak;
my $obj = Wikibase::Datatype::MediainfoSnak->new(%params);
my $datavalue = $obj->datavalue;
my $property = $obj->property;
my $snaktype = $obj->snaktype;
DESCRIPTION
This datatype is snak class for representing relation between property and value. This datatype is used in statements in Commons structured data instead of snak datatype.
METHODS
new
my $obj = Wikibase::Datatype::MediainfoSnak->new(%params);
Constructor.
Returns instance of object.
datavalue
Value of data. Parameter is required.
property
Property name (like /^P\d+$/). Parameter is required.
snaktype
Snak type. Parameter is string with these possible values: novalue somevalue value Parameter is optional. Default value is 'value'.
datavalue
my $datavalue = $obj->datavalue;
Get data value.
Returns instance of Wikibase::Datatype::Value.
property
my $property = $obj->property;
Get property name.
Returns string.
snaktype
my $snaktype = $obj->snaktype;
Get snak type.
Returns string.
ERRORS
new():
From Mo::utils::check_required():
Parameter 'datavalue' is required.
Parameter 'property' is required.
From Mo::utils::check_isa():
Parameter 'datavalue' must be a 'Wikibase::Datatype::Value' object.
From Wikibase::Datatype::Utils::check_property():
Parameter 'property' must begin with 'P' and number after it.
Parameter 'snaktype' = '%s' isn't supported.
EXAMPLE
use strict;
use warnings;
use Wikibase::Datatype::MediainfoSnak;
use Wikibase::Datatype::Value::Item;
# Object.
my $obj = Wikibase::Datatype::MediainfoSnak->new(
'datavalue' => Wikibase::Datatype::Value::Item->new(
'value' => 'Q14946043',
),
'property' => 'P275',
);
# Get value.
my $datavalue = $obj->datavalue->value;
# Get property.
my $property = $obj->property;
# Get snak type.
my $snaktype = $obj->snaktype;
# Print out.
print "Property: $property\n";
print "Value: $datavalue\n";
print "Snak type: $snaktype\n";
# Output:
# Property: P275
# Value: Q14946043
# Snak type: value
DEPENDENCIES
Error::Pure, List::MoreUtils, Mo, Mo::utils, Readonly, Wikibase::Datatype::Utils.
SEE ALSO
- Wikibase::Datatype
-
Wikibase datatypes.
- Wikibase::Datatype::Snak
-
Wikibase snak datatype.
REPOSITORY
https://github.com/michal-josef-spacek/Wikibase-Datatype
AUTHOR
Michal Josef Špaček mailto:skim@cpan.org
LICENSE AND COPYRIGHT
© 2020-2023 Michal Josef Špaček
BSD 2-Clause License
VERSION
0.32