-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: add system labels to system entities.
- Loading branch information
Showing
11 changed files
with
259 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; under version 2 | ||
* of the License (non-upgradable). | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2023 (original work) Open Assessment Technologies SA; | ||
* | ||
*/ | ||
|
||
namespace oat\generis\model\kernel\persistence\starsql; | ||
|
||
use RecursiveIterator; | ||
|
||
class FlatRecursiveIterator extends \IteratorIterator implements RecursiveIterator | ||
{ | ||
public function hasChildren() | ||
{ | ||
return false; | ||
} | ||
|
||
public function getChildren() | ||
{ | ||
return new \EmptyIterator(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/** | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; under version 2 | ||
* of the License (non-upgradable). | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2002-2008 (original work) 2014 Open Assessment Technologies SA | ||
* | ||
*/ | ||
|
||
use oat\generis\model\data\Model; | ||
use oat\generis\model\kernel\persistence\smoothsql\search\ComplexSearchService; | ||
use oat\generis\model\kernel\persistence\starsql\FlatRecursiveIterator; | ||
|
||
/** | ||
* Iterator over all triples | ||
* | ||
* @author joel bout <joel@taotesting.com> | ||
* @package generis | ||
*/ | ||
class core_kernel_persistence_starsql_StarIterator extends \IteratorIterator implements \RecursiveIterator | ||
{ | ||
public function __construct(Model $model) | ||
{ | ||
/** @var ComplexSearchService $search */ | ||
$search = $model->getSearchInterface(); | ||
$query = $search->query(); | ||
|
||
$queryOptions = $query->getOptions(); | ||
$queryOptions['system_only'] = true; | ||
$query->setOptions($queryOptions); | ||
|
||
parent::__construct($search->getGateway()->search($query)); | ||
} | ||
|
||
public function hasChildren() | ||
{ | ||
return true; | ||
} | ||
|
||
public function current() | ||
{ | ||
$current = parent::current(); | ||
|
||
if ($current instanceof \core_kernel_classes_Literal) { | ||
$current = new \core_kernel_classes_Resource($current->literal); | ||
} | ||
|
||
return $current; | ||
} | ||
|
||
|
||
public function getChildren() | ||
{ | ||
/** @var \core_kernel_classes_Resource $currentResource */ | ||
$currentResource = $this->current(); | ||
|
||
return new FlatRecursiveIterator($currentResource->getRdfTriples()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.