diff --git a/model/Concept.php b/model/Concept.php index a5217ee77..cd6538233 100644 --- a/model/Concept.php +++ b/model/Concept.php @@ -533,7 +533,8 @@ public function getProperties() if ($superprop) { $superprop = EasyRdf\RdfNamespace::shorten($superprop) ? EasyRdf\RdfNamespace::shorten($superprop) : $superprop; } - $propobj = new ConceptProperty($prop, $proplabel, $superprop); + $notsort = $this->vocab->getConfig()->sortByNotation(); + $propobj = new ConceptProperty($prop, $proplabel, $superprop, $notsort); if ($propobj->getLabel() !== null) { // only display properties for which we have a label diff --git a/model/ConceptProperty.php b/model/ConceptProperty.php index 5bd771892..e61b2ba0a 100644 --- a/model/ConceptProperty.php +++ b/model/ConceptProperty.php @@ -15,19 +15,21 @@ class ConceptProperty private $values; /** flag whether the values are sorted, as we do lazy sorting */ private $is_sorted; + private $sort_by_notation; /** * Label parameter seems to be optional in this phase. * @param string $prop property type eg. 'rdf:type'. * @param string $label */ - public function __construct($prop, $label, $super=null) + public function __construct($prop, $label, $super=null, $notsort=false) { $this->prop = $prop; $this->label = $label; $this->values = array(); $this->is_sorted = true; $this->super = $super; + $this->sort_by_notation = $notsort; } /** @@ -86,7 +88,7 @@ private function sortValues() { if (!empty($this->values)) { uksort($this->values, function($a, $b) { - return strcoll(strtolower($a),strtolower($b)); + return $this->sort_by_notation ? strnatcasecmp($a, $b) : strcoll(strtolower($a),strtolower($b)); }); } $this->is_sorted = true;