It will be deprecated once we have the general GUI for displaying different info of a task for the user.

@deprecated

@param \core_kernel_classes_Resource $resource
@return Report
975859
public function getReportByLinkedResource(\core_kernel_classes_Resource $resource)
    {
        $taskResource = $this->getTaskResource($resource);

        if ($taskResource !== null) {
            $report = $taskResource->getOnePropertyValue($this->getProperty(Task::PROPERTY_REPORT));

            if ($report) {
                $report = Report::jsonUnserialize($report->literal);
            } else {
                $status = $this->getTaskLog()->getStatus($taskResource->getUri());
                $msg = __('Task is in \'%s\' state', $status);

                $report = $status == TaskLogInterface::STATUS_FAILED
                    ? Report::createFailure($msg)
                    : Report::createInfo($msg);
            }
        } else {
            $report = Report::createFailure(__('Resource is not the task placeholder'));
        }

        return $report;
    }
1015336
public function update(ResourceInterface $resource)
    {
        $event = $this->createResourceEvent($resource);
        $this->dispatcher->dispatch($this->config->getEventName('pre_update'), $event);

        if (!$event->isPropagationStopped()) {
            $this->persistResource($event);

            $this->dispatcher->dispatch($this->config->getEventName('post_update'), $event);
        }

        return $event;
    }
1278996
protected function collectResource($resource)
    {
        if ($resource instanceof MissingValue) {
            return $resource;
        }

        $collects = $this->collects();

        $this->collection = $collects && ! $resource->first() instanceof $collects
            ? $resource->mapInto($collects)
            : $resource->toBase();

        return $resource instanceof AbstractPaginator
                    ? $resource->setCollection($this->collection)
                    : $this->collection;
    }
571341
public function getLockData(core_kernel_classes_Resource $resource)
    {
        $values = $resource->getPropertyValues($this->getLockProperty());
        if ((is_array($values)) && (count($values)==1)) {
            return OntoLockData::getLockData(array_pop($values));
        } else {
            return null;
        }

    }
223705
public function indexOf( common_Object $resource)
    {
        $returnValue = null;

        
        $returnValue = -1;
        foreach($this->sequence as $index => $_resource){
        	if ($_resource instanceof  core_kernel_classes_Resource){
				if($resource->equals($_resource)){
					return $index;
				}
        	}
		}
        

        return $returnValue;
    }
399205
protected function renderTag(Resource $resource) {
		$tag = new Tag('link');
		
		$tag->rel  = 'stylesheet';
		$tag->type = 'text/css';
		$tag->href = $resource->getUrl();
		
		return $tag->render();
	}
1174402
public function getResourceId($resource): string
    {
        if (is_resource($resource)) {
            $data = stream_get_meta_data($resource);
            $resource = $data['wrapper_data'];
        }

        return spl_object_hash($resource);
    }
96348
public function getRdfTriples( core_kernel_classes_Resource $resource)
    {
        $returnValue = null;
        
        $query = 'SELECT * FROM statements WHERE subject = ? AND '.$this->getModelReadSqlCondition().' ORDER BY predicate';
        $result = $this->getPersistence()->query($query, array($resource->getUri()));
        
        $returnValue = new core_kernel_classes_ContainerCollection(new common_Object(__METHOD__));
        while ($statement = $result->fetch()) {
            $triple = new core_kernel_classes_Triple();
            $triple->modelid = $statement["modelid"];
            $triple->subject = $statement["subject"];
            $triple->predicate = $statement["predicate"];
            $triple->object = $statement["object"];
            $triple->id = $statement["id"];
            $triple->epoch = $statement["epoch"];
            $triple->lg = $statement["l_language"];
            $triple->author = $statement["author"];
            $returnValue->add($triple);
        }

        return $returnValue;
    }
491201
public function getExportForm(core_kernel_classes_Resource $resource)
    {
        if ($resource instanceof \core_kernel_classes_Class) {
            $formData = ['class' => $resource];
        } else {
            $formData = ['class' => $this->getClass($resource)];
        }
        $form = new MetadataExporterForm($formData);

        return $form->getForm();
    }
583053
protected function loadResource(ResourceInterface $resource)
    {
        $res = $this->doLoad($resource);
        $this->notify($resource);

        return $res;
    }
427991
public function getTypes( core_kernel_classes_Resource $resource)
    {
        $returnValue = array();

        
		$sqlQuery = 'SELECT object FROM statements WHERE subject = ? and predicate = ?';
        $sth = $this->getPersistence()->query($sqlQuery,array($resource->getUri(), OntologyRdf::RDF_TYPE));

        while ($row = $sth->fetch()){
            $uri = $this->getPersistence()->getPlatForm()->getPhpTextValue($row['object']);
            $returnValue[$uri] = new core_kernel_classes_Class($uri);
        }        
        

        return (array) $returnValue;
    }
788335
public function load($resource)
    {
        $features = array();

        if (isset($resource['features'])) {
            foreach ($resource['features'] as $iterator => $hash) {
                $feature = $this->loadFeatureHash($hash, $iterator);
                $features[] = $feature;
            }
        } elseif (isset($resource['feature'])) {
            $feature = $this->loadFeatureHash($resource['feature']);
            $features[] = $feature;
        }

        return $features;
    }
201411
protected function getResourceName($resource)
    {
        if ($resource instanceof ResourceInterface) {
            $resource = $resource->getName();
        }

        if (false === is_string($resource)) {
            throw new InvalidArgumentException(
                'Resource argument must be string or an object implemented "Rad\Authorization\Rbac\ResourceInterface".'
            );
        }

        return $resource;
    }
1001015
public function describeResource($resource,$context=null)
    {
        $resource = $this->labeller->uri_to_alias($resource);
        $query = array(
            "_id" => array(
                _ID_RESOURCE=>$resource,
                _ID_CONTEXT=>$this->getContextAlias($context)));
        return $this->fetchGraph($query,MONGO_DESCRIBE);
    }
1059763
public function getPropertiesValues( core_kernel_classes_Resource $resource, $properties)
    {
        $returnValue = array();

        
        // check whenever or not properties is empty
        if (count($properties) == 0) {
        	return array();
        }
        
        /*foreach($properties as $property){
        	$returnValue[$property->getUri()] = $this->getPropertyValues($resource, $property);
        }*/
        
    	$predicatesQuery = '';
    	//build the predicate query
       	//$predicatesQuery = implode(',', $properties);
		foreach ($properties as $property) {
			$uri = (is_string($property) ? $property : $property->getUri());
			$returnValue[$uri] = array();
			$predicatesQuery .= ", " . $this->getPersistence()->quote($uri) ;
		}
    	$predicatesQuery=substr($predicatesQuery, 1);

        $platform = $this->getPersistence()->getPlatForm();
        $lang = $this->getServiceLocator()->get(SessionService::SERVICE_ID)->getCurrentSession()->getDataLanguage();
        $default = $this->getServiceLocator()->get(UserLanguageServiceInterface::SERVICE_ID)->getDefaultLanguage();
        //the unique sql query
        $query =  'SELECT predicate, object, l_language 
            FROM statements 
            WHERE 
                subject = '.$this->getPersistence()->quote($resource->getUri()).' 
                AND predicate IN ('.$predicatesQuery.')
                AND (l_language = ' . $this->getPersistence()->quote('') . 
                    ' OR l_language = '.$this->getPersistence()->quote($default).
                    ' OR l_language = '.$this->getPersistence()->quote($lang).')
                AND '.$this->getModelReadSqlCondition();
        $result	= $this->getPersistence()->query($query);
        
        $rows = $result->fetchAll();
        $sortedByLg = core_kernel_persistence_smoothsql_Utils::sortByLanguage($this->getPersistence(), $rows, 'l_language', $lang, $default);
        $identifiedLg = core_kernel_persistence_smoothsql_Utils::identifyFirstLanguage($sortedByLg);

        foreach($rows as $row){
        	$value = $platform->getPhpTextValue($row['object']);
			$returnValue[$row['predicate']][] = common_Utils::isUri($value)
				? new core_kernel_classes_Resource($value)
				: new core_kernel_classes_Literal($value);
        }
        
        

        return (array) $returnValue;
    }
9321
public function removeType( core_kernel_classes_Resource $resource,  core_kernel_classes_Class $class)
    {
        $returnValue = (bool) false;

        
        
        $query =  'DELETE FROM statements 
		    		WHERE subject = ? AND predicate = ? AND '. $this->getPersistence()->getPlatForm()->getObjectTypeCondition() .' = ?';
        
        //be sure the property we try to remove is included in an updatable model
		$query .= ' AND '.$this->getModelWriteSqlCondition();
        
        $returnValue = $this->getPersistence()->exec($query,array(
        	$resource->getUri(),
			OntologyRdf::RDF_TYPE,
        	$class->getUri()
        ));
        
        $returnValue = true;
        
        

        return (bool) $returnValue;
    }
418459
static function of($resource)
    {
        if (!is_resource($resource) && get_resource_type($resource) !== 'stream-context')
            throw new \InvalidArgumentException(sprintf(
                'Invalid Context Resource Passed, given: "%s".'
                , \Poirot\Std\flatten($resource)
            ));


        // ..
        $options = stream_context_get_params($resource);
        $context = new ContextStreamSocket($options); // Socket Context can be used as Base Context
        return $context;
    }