<commit_before><?php

/**
 * Class for handling concept property values.
 */
class ConceptPropertyValue extends VocabularyDataObject
{
  /** property type */
  private $type;
  /** content language */
  private $clang;

  public function __construct($model, $vocab, $resource, $prop, $clang='')
  {
    parent::__construct($model, $vocab, $resource);
    $this->submembers = array();
    $this->type = $prop;
    $this->clang = $clang;
  }

  public function __toString()
  {
    if ($this->label === null)
      return "";
    return $this->label;
  }

  public function getLang()
  {
    return $this->lang;
  }

  public function getLabel($lang='')
  {
    if ($this->clang)
      $lang = $this->clang;
    if ($this->resource->label($lang) !== null) { // current language
      return $this->resource->label($lang);
    } elseif ($this->resource->label($this->vocab->getDefaultLanguage()) !== null) { // vocab default language
      return $this->resource->label($this->vocab->getDefaultLanguage());
    } elseif ($this->resource->label() !== null) { // any language
      return $this->resource->label();
    } elseif ($this->resource->getLiteral('rdf:value', $lang) !== null) { // current language
      return $this->resource->getLiteral('rdf:value', $lang); 
    } elseif ($this->resource->getLiteral('rdf:value') !== null) { // any language
      return $this->resource->getLiteral('rdf:value');
    } 
    $label = $this->resource->shorten() ? $this->resource->shorten() : $this->getUri();
    return $label;
  }

  public function getUri()
  {
    return $this->resource->getUri();
  }

  public function getVocab()
  {
    return $this->vocab;
  }
  
  public function getVocabName()
  {
    return $this->vocab->getTitle();
  }

  public function addSubMember($member, $lang='')
  {
    $label = $member->getLabel($lang) ? $member->getLabel($lang) : $member->getLabel();
    $this->submembers[$label->getValue()] = $member;
    $this->sortSubMembers();
  }

  public function getSubMembers()
  {
    if (empty($this->submembers))
      return null;
    return $this->submembers;
  }

  private function sortSubMembers()
  {
    if (!empty($this->submembers))
      ksort($this->submembers);
  }

}
<commit_msg>adding a getter for the type property<commit_after><?php

/**
 * Class for handling concept property values.
 */
class ConceptPropertyValue extends VocabularyDataObject
{
  /** property type */
  private $type;
  /** content language */
  private $clang;

  public function __construct($model, $vocab, $resource, $prop, $clang='')
  {
    parent::__construct($model, $vocab, $resource);
    $this->submembers = array();
    $this->type = $prop;
    $this->clang = $clang;
  }

  public function __toString()
  {
    if ($this->label === null)
      return "";
    return $this->label;
  }

  public function getLang()
  {
    return $this->lang;
  }

  public function getLabel($lang='')
  {
    if ($this->clang)
      $lang = $this->clang;
    if ($this->resource->label($lang) !== null) { // current language
      return $this->resource->label($lang);
    } elseif ($this->resource->label($this->vocab->getDefaultLanguage()) !== null) { // vocab default language
      return $this->resource->label($this->vocab->getDefaultLanguage());
    } elseif ($this->resource->label() !== null) { // any language
      return $this->resource->label();
    } elseif ($this->resource->getLiteral('rdf:value', $lang) !== null) { // current language
      return $this->resource->getLiteral('rdf:value', $lang); 
    } elseif ($this->resource->getLiteral('rdf:value') !== null) { // any language
      return $this->resource->getLiteral('rdf:value');
    } 
    $label = $this->resource->shorten() ? $this->resource->shorten() : $this->getUri();
    return $label;
  }

  public function getType() {
    return $this->type;
  }

  public function getUri()
  {
    return $this->resource->getUri();
  }

  public function getVocab()
  {
    return $this->vocab;
  }
  
  public function getVocabName()
  {
    return $this->vocab->getTitle();
  }

  public function addSubMember($member, $lang='')
  {
    $label = $member->getLabel($lang) ? $member->getLabel($lang) : $member->getLabel();
    $this->submembers[$label->getValue()] = $member;
    $this->sortSubMembers();
  }

  public function getSubMembers()
  {
    if (empty($this->submembers))
      return null;
    return $this->submembers;
  }

  private function sortSubMembers()
  {
    if (!empty($this->submembers))
      ksort($this->submembers);
  }

}

{'fraction_non_alphanumeric': 0.18458820931773018, 'fraction_numerical': 0.0, 'mean_word_length': 3.322519083969466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 108, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1982287', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1434, 'n_words': 293}