I need to get the values for an annotation on an article.

Im doing this:

//get all annotations for an article
$result = smwfGetStore()->getProperties($article);

for ($i = 0; $i < $size; $i++){

//for the actual property I ask for the value in article.
$v = smwfGetStore()->getPropertyValues($article, $result[$i]);
$dataItem = $v[0];
$type= $dataItem->getDIType();

if ($type == 9){
$value= $dataItem->getTitle();
}elseif ($type == 6){
$value = $dataItem->getSerialization();
$value= $dataItem->getLabel();

I get all the annotations names but I can get the actual values of the properties.
I have an error on the line$type= $dataItem->getDIType();

Im working with SMW 1.7.1