public static function createInstance( core_kernel_classes_Class $clazz, $label = '', $comment = '', $uri = '')
    {
        $returnValue = null;

        
		$newUri = (!empty($uri)) ? self::checkProvidedUri($uri) : common_Utils::getNewUri();
		$newResource = new core_kernel_classes_Class($newUri);
		$propertiesValues = array(OntologyRdf::RDF_TYPE => $clazz->getUri());
		
		if (!empty($label)) {
			$propertiesValues[OntologyRdfs::RDFS_LABEL] = $label;
		}
		
		if (!empty($comment)) {
			$propertiesValues[OntologyRdfs::RDFS_COMMENT] = $comment;
		}
		
		$check = $newResource->setPropertiesValues($propertiesValues);
		if ($check){
			$returnValue = $newResource;
		}
		else{
			$msg = "Failed to create an instance of class '" . $clazz->getUri() . "'.";
			throw new common_Exception($msg);
			common_Logger::e($msg);
		}
        

        return $returnValue;
    }
public static function createInstance( core_kernel_classes_Class $clazz, $label = '', $comment = '', $uri = '')
    {
        $returnValue = null;

        
		$newUri = (!empty($uri)) ? self::checkProvidedUri($uri) : common_Utils::getNewUri();
		$newResource = new core_kernel_classes_Class($newUri);
		$propertiesValues = array(OntologyRdf::RDF_TYPE => $clazz->getUri());
		
		if (!empty($label)) {
			$propertiesValues[OntologyRdfs::RDFS_LABEL] = $label;
		}
		
		if (!empty($comment)) {
			$propertiesValues[OntologyRdfs::RDFS_COMMENT] = $comment;
		}
		
		$check = $newResource->setPropertiesValues($propertiesValues);
		if ($check){
			$returnValue = $newResource;
		}
		else{
			$msg = "Failed to create an instance of class '" . $clazz->getUri() . "'.";
			throw new common_Exception($msg);
			common_Logger::e($msg);
		}
        

        return $returnValue;
    }
public static function createInstance ( core_kernel_classes_Class $ clazz , $ label = '' , $ comment = '' , $ uri = '' ) { $ returnValue = null ; $ newUri = ( ! empty ( $ uri ) ) ? self :: checkProvidedUri ( $ uri ) : common_Utils :: getNewUri ( ) ; $ newResource = new core_kernel_classes_Class ( $ newUri ) ; $ propertiesValues = array ( OntologyRdf :: RDF_TYPE => $ clazz -> getUri ( ) ) ; if ( ! empty ( $ label ) ) { $ propertiesValues [ OntologyRdfs :: RDFS_LABEL ] = $ label ; } if ( ! empty ( $ comment ) ) { $ propertiesValues [ OntologyRdfs :: RDFS_COMMENT ] = $ comment ; } $ check = $ newResource -> setPropertiesValues ( $ propertiesValues ) ; if ( $ check ) { $ returnValue = $ newResource ; } else { $ msg = "Failed to create an instance of class '" . $ clazz -> getUri ( ) . "'." ; throw new common_Exception ( $ msg ) ; common_Logger :: e ( $ msg ) ; } return $ returnValue ; }
Short description of method createInstance

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  Class clazz
@param  string label
@param  string comment
@param  string uri
@return core_kernel_classes_Resource
Short description of method createInstance