src/commands/ModelsController.php
private function traverseClasses(array &$classes, $allClasses = null)
    {
        if ($allClasses === null) {
            $allClasses = $classes;
        }

        foreach ($classes as &$class) {
            $parentClasses = ArrayHelper::remove($class, 'rdfs:subClassOf', []);
            if (ArrayHelper::isAssociative($parentClasses)) {
                $parentClasses = [$parentClasses];
            }

            foreach ($parentClasses as $k => $parentClass) {
                $parentClasses[$k] = ArrayHelper::getValue($allClasses, $parentClass['@id']);
                if ($parentClass === null) {
                    continue;
                }
            }

            $this->traverseClasses($parentClasses, $allClasses);

            foreach ($parentClasses as $parentClass) {
                ArrayHelper::setValue($class, 'properties', ArrayHelper::merge(
                    ArrayHelper::getValue($class, 'properties', []),
                    ArrayHelper::getValue($parentClass, 'properties', [])
                ));
            }
        }
    }
private function traverseClasses(array &$classes, $allClasses = null)
    {
        if ($allClasses === null) {
            $allClasses = $classes;
        }

        foreach ($classes as &$class) {
            $parentClasses = ArrayHelper::remove($class, 'rdfs:subClassOf', []);
            if (ArrayHelper::isAssociative($parentClasses)) {
                $parentClasses = [$parentClasses];
            }

            foreach ($parentClasses as $k => $parentClass) {
                $parentClasses[$k] = ArrayHelper::getValue($allClasses, $parentClass['@id']);
                if ($parentClass === null) {
                    continue;
                }
            }

            $this->traverseClasses($parentClasses, $allClasses);

            foreach ($parentClasses as $parentClass) {
                ArrayHelper::setValue($class, 'properties', ArrayHelper::merge(
                    ArrayHelper::getValue($class, 'properties', []),
                    ArrayHelper::getValue($parentClass, 'properties', [])
                ));
            }
        }
    }
Traverse all classes and inherit properties from parents

@param array $classes
@param array $allClasses