#!/usr/bin/env perl
my
$obj
= Wikibase::Datatype::MediainfoStatement->new(
'id'
=>
'M123$00C04D2A-49AF-40C2-9930-C551916887E8'
,
'snak'
=> Wikibase::Datatype::MediainfoSnak->new(
'property'
=>
'P170'
,
'snaktype'
=>
'novalue'
,
),
'property_snaks'
=> [
Wikibase::Datatype::MediainfoSnak->new(
'datavalue'
=> Wikibase::Datatype::Value::String->new(
'value'
=>
'Lviatour'
,
),
'property'
=>
'P4174'
,
),
Wikibase::Datatype::MediainfoSnak->new(
'datavalue'
=> Wikibase::Datatype::Value::String->new(
),
'property'
=>
'P2699'
,
),
Wikibase::Datatype::MediainfoSnak->new(
'datavalue'
=> Wikibase::Datatype::Value::String->new(
'value'
=>
'Lviatour'
,
),
'property'
=>
'P2093'
,
),
Wikibase::Datatype::MediainfoSnak->new(
'datavalue'
=> Wikibase::Datatype::Value::Item->new(
'value'
=>
'Q33231'
,
),
'property'
=>
'P3831'
,
),
],
);
print
'Id: '
.
$obj
->id.
"\n"
;
print
'Statement: '
.
$obj
->snak->property.
' -> '
;
if
(
$obj
->snak->snaktype eq
'value'
) {
print
$obj
->snak->datavalue->value.
"\n"
;
}
elsif
(
$obj
->snak->snaktype eq
'novalue'
) {
print
"-\n"
;
}
elsif
(
$obj
->snak->snaktype eq
'somevalue'
) {
print
"?\n"
;
}
print
"Qualifiers:\n"
;
foreach
my
$property_snak
(@{
$obj
->property_snaks}) {
print
"\t"
.
$property_snak
->property.
' -> '
.
$property_snak
->datavalue->value.
"\n"
;
}
print
'Rank: '
.
$obj
->rank.
"\n"
;