#!/usr/bin/env perl
use
strict;
use
warnings;
use
Data::Printer;
# Object.
# instance of (P31) human (Q5)
my
$obj
= Wikibase::Datatype::Snak->new(
'datatype'
=>
'wikibase-item'
,
'datavalue'
=> Wikibase::Datatype::Value::Item->new(
'value'
=>
'Q5'
,
),
'property'
=>
'P31'
,
);
# Get structure.
# Dump to output.
p
$struct_hr
;
# Output:
# \ {
# datatype "wikibase-item",
# datavalue {
# type "wikibase-entityid",
# value {
# entity-type "item",
# id "Q5",
# numeric-id 5
# }
# },
# property "P31",
# snaktype "value"
# }