public function createUniqueLabel(core_kernel_classes_Class $clazz, $subClassing = false)
    {
        if ($subClassing) {
            $labelBase = $clazz->getLabel() . '_' ;
            $count = count($clazz->getSubClasses()) +1;
        } else {
            $labelBase = $clazz->getLabel() . ' ' ;
            $count = count($clazz->getInstances()) +1;
        }

        $options = [
            'lang'              => \common_session_SessionManager::getSession()->getDataLanguage(),
            'like'              => false,
            'recursive'         => false
        ];

        do {
            $exist = false;
            $label =  $labelBase . $count;
            $result = $clazz->searchInstances(array(OntologyRdfs::RDFS_LABEL => $label), $options);
            if (count($result) > 0) {
                $exist = true;
                $count ++;
            }
        } while ($exist);

        return (string) $label;
    }
public function createUniqueLabel(core_kernel_classes_Class $clazz, $subClassing = false)
    {
        if ($subClassing) {
            $labelBase = $clazz->getLabel() . '_' ;
            $count = count($clazz->getSubClasses()) +1;
        } else {
            $labelBase = $clazz->getLabel() . ' ' ;
            $count = count($clazz->getInstances()) +1;
        }

        $options = [
            'lang'              => \common_session_SessionManager::getSession()->getDataLanguage(),
            'like'              => false,
            'recursive'         => false
        ];

        do {
            $exist = false;
            $label =  $labelBase . $count;
            $result = $clazz->searchInstances(array(OntologyRdfs::RDFS_LABEL => $label), $options);
            if (count($result) > 0) {
                $exist = true;
                $count ++;
            }
        } while ($exist);

        return (string) $label;
    }
public function createUniqueLabel ( core_kernel_classes_Class $ clazz , $ subClassing = false ) { if ( $ subClassing ) { $ labelBase = $ clazz -> getLabel ( ) . '_' ; $ count = count ( $ clazz -> getSubClasses ( ) ) + 1 ; } else { $ labelBase = $ clazz -> getLabel ( ) . ' ' ; $ count = count ( $ clazz -> getInstances ( ) ) + 1 ; } $ options = [ 'lang' => \ common_session_SessionManager :: getSession ( ) -> getDataLanguage ( ) , 'like' => false , 'recursive' => false ] ; do { $ exist = false ; $ label = $ labelBase . $ count ; $ result = $ clazz -> searchInstances ( array ( OntologyRdfs :: RDFS_LABEL => $ label ) , $ options ) ; if ( count ( $ result ) > 0 ) { $ exist = true ; $ count ++ ; } } while ( $ exist ) ; return ( string ) $ label ; }
Short description of method createUniqueLabel

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  core_kernel_classes_Class $clazz
@param  boolean $subClassing
@throws \common_exception_Error
@return string
Short description of method createUniqueLabel