/** * @param $value * @param \Concept $concept * @param $field * @param $isLiteral * @param string $key * @param bool $onlyFirst * * @return string the key that was processed */ private function setConceptValue($value, $concept, $field, $isLiteral, $key = '', $onlyFirst = false) { $field = ( 'parent_class' == $key or 'parent_property' == $key ) ? 'ParentUri' : $field; if (is_array($value)) { if ($onlyFirst) { //only take the first one here $value = $isLiteral ? $value[0] : $this->getFqn($value[0]); $oldValue = $concept->getByName(ucfirst($field)); if ($oldValue != $value) { $concept->setByName(ucfirst($field), $value); } return $field . "0"; } else { foreach ($value as $unit) { $unit = $isLiteral ? $unit : $this->getFqn($unit); $oldValue = $concept->getByName(ucfirst($field)); if ($oldValue != $value) { $concept->setByName(ucfirst($field), $unit); } } } } else { $value = $isLiteral ? $value : $this->getFqn($value); $oldValue = $concept->getByName(ucfirst($field)); if ($oldValue != $value) { $concept->setByName(ucfirst($field), $value); } } return $field; }