public function getTranslatedProperties(core_kernel_classes_Resource $instance, $lang)
    {
        $returnValue = array();

        try {
            foreach ($instance->getTypes() as $clazz) {
                foreach ($clazz->getProperties(true) as $property) {
                    if ($property->isLgDependent() || $property->getUri() == OntologyRdfs::RDFS_LABEL) {
                        $collection = $instance->getPropertyValuesByLg($property, $lang);
                        if ($collection->count() > 0) {
                            if ($collection->count() == 1) {
                                $returnValue[$property->getUri()] = (string)$collection->get(0);
                            } else {
                                $propData = array();
                                foreach ($collection->getIterator() as $collectionItem) {
                                    $propData[] = (string)$collectionItem;
                                }
                                $returnValue[$property->getUri()] = $propData;
                            }
                        }
                    }
                }
            }
        } catch (\Exception $e) {
            print $e;
        }

        return (array) $returnValue;
    }
public function getTranslatedProperties(core_kernel_classes_Resource $instance, $lang)
    {
        $returnValue = array();

        try {
            foreach ($instance->getTypes() as $clazz) {
                foreach ($clazz->getProperties(true) as $property) {
                    if ($property->isLgDependent() || $property->getUri() == OntologyRdfs::RDFS_LABEL) {
                        $collection = $instance->getPropertyValuesByLg($property, $lang);
                        if ($collection->count() > 0) {
                            if ($collection->count() == 1) {
                                $returnValue[$property->getUri()] = (string)$collection->get(0);
                            } else {
                                $propData = array();
                                foreach ($collection->getIterator() as $collectionItem) {
                                    $propData[] = (string)$collectionItem;
                                }
                                $returnValue[$property->getUri()] = $propData;
                            }
                        }
                    }
                }
            }
        } catch (\Exception $e) {
            print $e;
        }

        return (array) $returnValue;
    }
public function getTranslatedProperties ( core_kernel_classes_Resource $ instance , $ lang ) { $ returnValue = array ( ) ; try { foreach ( $ instance -> getTypes ( ) as $ clazz ) { foreach ( $ clazz -> getProperties ( true ) as $ property ) { if ( $ property -> isLgDependent ( ) || $ property -> getUri ( ) == OntologyRdfs :: RDFS_LABEL ) { $ collection = $ instance -> getPropertyValuesByLg ( $ property , $ lang ) ; if ( $ collection -> count ( ) > 0 ) { if ( $ collection -> count ( ) == 1 ) { $ returnValue [ $ property -> getUri ( ) ] = ( string ) $ collection -> get ( 0 ) ; } else { $ propData = array ( ) ; foreach ( $ collection -> getIterator ( ) as $ collectionItem ) { $ propData [ ] = ( string ) $ collectionItem ; } $ returnValue [ $ property -> getUri ( ) ] = $ propData ; } } } } } } catch ( \ Exception $ e ) { print $ e ; } return ( array ) $ returnValue ; }
get the properties of an instance for a specific language

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  core_kernel_classes_Resource $instance
@param  string $lang
@return array
get the properties of an instance for a specific language