#!/usr/bin/env perl
my
$obj
= Wikibase::Datatype::Statement->new(
'id'
=>
'Q123$00C04D2A-49AF-40C2-9930-C551916887E8'
,
'snak'
=> Wikibase::Datatype::Snak->new(
'datatype'
=>
'wikibase-item'
,
'datavalue'
=> Wikibase::Datatype::Value::Item->new(
'value'
=>
'Q5'
,
),
'property'
=>
'P31'
,
),
'property_snaks'
=> [
Wikibase::Datatype::Snak->new(
'datatype'
=>
'wikibase-item'
,
'datavalue'
=> Wikibase::Datatype::Value::Item->new(
'value'
=>
'Q474741'
,
),
'property'
=>
'P642'
,
),
],
'references'
=> [
Wikibase::Datatype::Reference->new(
'snaks'
=> [
Wikibase::Datatype::Snak->new(
'datatype'
=>
'wikibase-item'
,
'datavalue'
=> Wikibase::Datatype::Value::Item->new(
'value'
=>
'Q53919'
,
),
'property'
=>
'P248'
,
),
Wikibase::Datatype::Snak->new(
'datatype'
=>
'external-id'
,
'datavalue'
=> Wikibase::Datatype::Value::String->new(
'value'
=>
'113230702'
,
),
'property'
=>
'P214'
,
),
Wikibase::Datatype::Snak->new(
'datatype'
=>
'time'
,
'datavalue'
=> Wikibase::Datatype::Value::Time->new(
'value'
=>
'+2013-12-07T00:00:00Z'
,
),
'property'
=>
'P813'
,
),
],
),
],
);
print
'Id: '
.
$obj
->id.
"\n"
;
print
'Claim: '
.
$obj
->snak->property.
' -> '
.
$obj
->snak->datavalue->value.
"\n"
;
print
"Qualifiers:\n"
;
foreach
my
$property_snak
(@{
$obj
->property_snaks}) {
print
"\t"
.
$property_snak
->property.
' -> '
.
$property_snak
->datavalue->value.
"\n"
;
}
print
"References:\n"
;
foreach
my
$reference
(@{
$obj
->references}) {
print
"\tReference:\n"
;
foreach
my
$reference_snak
(@{
$reference
->snaks}) {
print
"\t\t"
.
$reference_snak
->property.
' -> '
.
$reference_snak
->datavalue->value.
"\n"
;
}
}
print
'Rank: '
.
$obj
->rank.
"\n"
;