server/src/tests/Libraries/Mergers/CocoonTextRdfMergerTest.php
author ymh <ymh.work@gmail.com>
Thu, 09 Feb 2017 15:05:36 +0100
changeset 504 4ab820b387da
parent 152 dd6b3adde73b
child 520 d6adc4047ede
permissions -rw-r--r--
Correct the handling of created date. Should correct #0025744
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
114
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
use CorpusParole\Libraries\Mergers\CocoonSoundRdfMerger;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
use CorpusParole\Libraries\Mergers\CocoonTextRdfMerger;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use CorpusParole\Libraries\CocoonUtils;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
use EasyRdf\Graph;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
use EasyRdf\Resource;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
use EasyRdf\Literal;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
use Illuminate\Foundation\Testing\WithoutMiddleware;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
use Illuminate\Foundation\Testing\DatabaseMigrations;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
use Illuminate\Foundation\Testing\DatabaseTransactions;
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
class CocoonTextRdfMergerTest extends TestCase
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
{
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    const TEST_INPUT_DOCS = [
504
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    18
        'SOUND' => __DIR__.'/files/CocoonTextRdfMergerTest/sound.ttl',
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    19
        'SOUND_NO_MOD' => __DIR__.'/files/CocoonTextRdfMergerTest/sound_no_mod.ttl',
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    20
        'SOUND_NO_CREATED' => __DIR__.'/files/CocoonTextRdfMergerTest/sound_no_created.ttl',
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    21
        'TEXT' => __DIR__.'/files/CocoonTextRdfMergerTest/text.ttl',
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    22
        'TEXT_CREATED' => __DIR__.'/files/CocoonTextRdfMergerTest/text_created.ttl'
114
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
    ];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
    private $inputGraphes = [];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
    private $resGraph = [];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
    function __construct(string $name = null) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
        parent::__construct($name);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
    public function setUp() {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
        parent::setUp();
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
        foreach(CocoonTextRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
504
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    36
            $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", file_get_contents($inputDoc));
114
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
        $merger = new CocoonTextRdfMerger();
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
        $this->resGraph['SOUND_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT']);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
        $merger = new CocoonSoundRdfMerger();
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
        $this->resGraph['TEXT_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND']);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
        $merger = new CocoonTextRdfMerger();
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
        $this->resGraph['SOUND_NO_MOD_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_MOD'], $this->inputGraphes['TEXT']);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
        $merger = new CocoonSoundRdfMerger();
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
        $this->resGraph['TEXT_SOUND_NO_MOD'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND_NO_MOD']);
504
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    47
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    48
        $merger = new CocoonSoundRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    49
        $this->resGraph['CREATED_TEXT_NO_CREATED_SOUND_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND_NO_CREATED']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    50
        $merger = new CocoonSoundRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    51
        $this->resGraph['CREATED_TEXT_SOUND_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['TEXT_CREATED'], $this->inputGraphes['SOUND_NO_CREATED']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    52
        $merger = new CocoonSoundRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    53
        $this->resGraph['CREATED_TEXT_NO_CREATED_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    54
        $merger = new CocoonSoundRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    55
        $this->resGraph['CREATED_TEXT_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT_CREATED'], $this->inputGraphes['SOUND']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    56
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    57
        $merger = new CocoonTextRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    58
        $this->resGraph['CREATED_SOUND_NO_CREATED_TEXT_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_CREATED'], $this->inputGraphes['TEXT']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    59
        $merger = new CocoonTextRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    60
        $this->resGraph['CREATED_SOUND_TEXT_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    61
        $merger = new CocoonTextRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    62
        $this->resGraph['CREATED_SOUND_NO_CREATED_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_CREATED'], $this->inputGraphes['TEXT_CREATED']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    63
        $merger = new CocoonTextRdfMerger();
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    64
        $this->resGraph['CREATED_SOUND_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT_CREATED']);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
    65
114
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
    public function tearDown() {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
        parent::tearDown();
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
    /**
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
     * Just test that the construct and setup are ok
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
     *
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
     * @return void
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
     */
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
    public function testInit()
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
    {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
        $this->assertTrue(true);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
        //echo $this->resGraph->serialise('turtle');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
    /**
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
     * Test merge modified merge TEXT into SOUND
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
     *
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
     * @return void
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
     */
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
    public function testModifiedSoundText() {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
        $resGraph = $this->resGraph["SOUND_TEXT"];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
        $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
        $this->assertNotNull($providedCHO);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
        $this->assertNotNull($baseNode);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
        $outputValuesStr = [];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
            array_push($outputValuesStr, strval($outputValue));
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
        $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
        foreach ($baseNode->all($this->inputGraphes['SOUND']->resource("http://purl.org/dc/terms/modified")) as $value) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
            $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
    /**
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
     * Test one to one mapping
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
     *
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
     * @return void
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
     */
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
    public function testModifiedTextSound() {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
        $resGraph = $this->resGraph["TEXT_SOUND"];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
        $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
        $this->assertNotNull($providedCHO);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
        $this->assertNotNull($baseNode);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
        $outputValuesStr = [];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
            array_push($outputValuesStr, strval($outputValue));
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
        $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
        foreach ($baseNode->all($this->inputGraphes['SOUND']->resource("http://purl.org/dc/terms/modified")) as $value) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
            $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
    /**
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
     * Test one to one mapping
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
     *
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
     * @return void
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
     */
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
    public function testSoundNoModifiedText() {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
        $resGraph = $this->resGraph["SOUND_NO_MOD_TEXT"];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
        $baseNode = $this->inputGraphes['TEXT']->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
        $this->assertNotNull($providedCHO);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
        $this->assertNotNull($baseNode);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
        $outputValuesStr = [];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
            array_push($outputValuesStr, strval($outputValue));
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   151
        $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
        // must contain the TEXT modified value (since SOUND has none)
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
        foreach ($baseNode->all($this->inputGraphes['TEXT']->resource("http://purl.org/dc/terms/modified")) as $value) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
            $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   157
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   158
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   160
    /**
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
     * Test one to one mapping
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   162
     *
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
     * @return void
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
     */
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
    public function testTextSoundNoModified() {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
        $resGraph = $this->resGraph["TEXT_SOUND_NO_MOD"];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
        $baseNode = $this->inputGraphes['TEXT']->get('edm:ProvidedCHO', '^rdf:type');
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
        $this->assertNotNull($providedCHO);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
        $this->assertNotNull($baseNode);
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
        $outputValuesStr = [];
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
            array_push($outputValuesStr, strval($outputValue));
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   177
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
        $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
        // must contain the TEXT modified value (since SOUND has none)
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
        foreach ($baseNode->all($this->inputGraphes['TEXT']->resource("http://purl.org/dc/terms/modified")) as $value) {
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
            $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph");
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
        }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
    }
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
116
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   187
    public function testRightsWebResource() {
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   188
        $properties = [
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   189
            "http://purl.org/dc/elements/1.1/rights",
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   190
            'http://purl.org/dc/terms/license',
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   191
            'http://purl.org/dc/terms/accessRights',
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   192
        ];
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   193
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   194
        $resGraph = $this->resGraph["SOUND_TEXT"];
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   195
        $webResourceList = $resGraph->all('edm:WebResource', '^rdf:type');
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   196
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   197
        //just check that they have all these resources.
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   198
        //TODO: check that the same rights are kept (difficult)
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   199
        foreach ($webResourceList as $webResource) {
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   200
            foreach ($properties as $prop) {
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   201
                $outputValuesStr = [];
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   202
                foreach($webResource->all($resGraph->resource($prop)) as $outputValue) {
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   203
                    array_push($outputValuesStr, strval($outputValue));
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   204
                }
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   205
                $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   206
            }
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   207
        }
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   208
    }
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   209
117
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   210
    public function testRightDifferent() {
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   211
        $resGraph = $this->resGraph["SOUND_TEXT"];
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   212
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   213
        $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   214
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   215
        $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   216
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   217
        $this->assertNotNull($license, "The licence must not be null");
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   218
        $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   219
        $this->assertEquals(config('corpusparole.corpus_doc_default_cc_rights'), $license->getUri(), "License must be default licence");
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   220
    }
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   221
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   222
    public function testRightSame() {
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   223
        $resGraph = $this->resGraph["SOUND_NO_MOD_TEXT"];
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   224
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   225
        $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   226
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   227
        $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   228
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   229
        $this->assertNotNull($license, "The licence must not be null");
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   230
        $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   231
        $this->assertEquals('http://creativecommons.org/licenses/by-nc-sa/4.0/', $license->getUri(), "License must be default licence");
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   232
    }
7abc74acf392 When merging ore:aggregation, process the license correctly, if different or null, the default is use, if the same, this is the value used
ymh <ymh.work@gmail.com>
parents: 116
diff changeset
   233
116
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   234
504
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   235
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   236
     * Test merge created merge TEXT with no created into SOUND with no created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   237
     * Should have no values
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   238
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   239
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   240
    public function testCreatedSoundNocreatedTextNoCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   241
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   242
        $resGraph = $this->resGraph["CREATED_SOUND_NO_CREATED_TEXT_NO_CREATED"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   243
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   244
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   245
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   246
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   247
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   248
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   249
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   250
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   251
        $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   252
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   253
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   254
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   255
     * Test merge created merge TEXT with created into SOUND with no created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   256
     * Should have no values
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   257
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   258
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   259
    public function testCreatedSoundNoCreatedTextCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   260
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   261
        $resGraph = $this->resGraph["CREATED_SOUND_NO_CREATED_TEXT"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   262
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   263
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   264
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   265
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   266
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   267
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   268
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   269
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   270
        $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   271
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   272
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   273
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   274
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   275
     * Test merge created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   276
     * Merge TEXT with no created into SOUND with created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   277
     * Should have no values
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   278
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   279
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   280
    public function testCreatedSoundCreatedTextNoCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   281
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   282
        $resGraph = $this->resGraph["CREATED_SOUND_TEXT_NO_CREATED"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   283
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   284
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   285
        $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   286
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   287
        $this->assertNotNull($baseNode);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   288
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   289
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   290
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   291
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   292
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   293
        $this->assertNotEmpty($outputValuesStr, "we must foundvalues to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   294
        $this->assertCount(1, $outputValuesStr, "We should have one value");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   295
        $baseCreated = $baseNode->get("<http://purl.org/dc/terms/created>");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   296
        $this->assertEquals($outputValuesStr[0], strval($baseCreated), "We must same value than in sound");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   297
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   298
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   299
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   300
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   301
     * Test merge created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   302
     * Merge TEXT with created into SOUND with created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   303
     * Should have no values
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   304
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   305
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   306
    public function testCreatedSoundCreatedTextCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   307
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   308
        $resGraph = $this->resGraph["CREATED_SOUND_TEXT"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   309
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   310
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   311
        $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   312
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   313
        $this->assertNotNull($baseNode);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   314
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   315
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   316
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   317
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   318
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   319
        $this->assertNotEmpty($outputValuesStr, "we must found values to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   320
        $this->assertCount(1, $outputValuesStr, "We should have one value");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   321
        $baseCreated = $providedCHO->get("<http://purl.org/dc/terms/created>");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   322
        $this->assertEquals($outputValuesStr[0], strval($baseCreated), "We must same value than in sound");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   323
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   324
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   325
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   326
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   327
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   328
     * Test merge created merge SOUND with no created into TEXT with no created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   329
     * Should have no values
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   330
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   331
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   332
    public function testCreatedTextNocreatedSoundNoCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   333
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   334
        $resGraph = $this->resGraph["CREATED_TEXT_NO_CREATED_SOUND_NO_CREATED"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   335
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   336
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   337
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   338
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   339
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   340
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   341
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   342
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   343
        $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   344
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   345
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   346
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   347
     * Test merge created merge SOUND with created into TEXT with no created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   348
     * Should have one value from sound
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   349
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   350
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   351
    public function testCreatedTextNoCreatedSoundCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   352
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   353
        $resGraph = $this->resGraph["CREATED_TEXT_NO_CREATED_SOUND"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   354
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   355
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   356
        $soundNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   357
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   358
        $this->assertNotNull($soundNode);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   359
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   360
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   361
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   362
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   363
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   364
        $this->assertNotEmpty($outputValuesStr, "we must foundvalues to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   365
        $this->assertCount(1, $outputValuesStr, "We should have one value");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   366
        $soundCreated = $soundNode->get("<http://purl.org/dc/terms/created>");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   367
        $this->assertEquals($outputValuesStr[0], strval($soundCreated), "We must same value than in sound");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   368
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   369
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   370
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   371
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   372
     * Test merge created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   373
     * Merge SOUND with no created into TEXT with created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   374
     * Should have no values
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   375
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   376
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   377
    public function testCreatedTextCreatedSoundNoCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   378
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   379
        $resGraph = $this->resGraph["CREATED_TEXT_SOUND_NO_CREATED"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   380
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   381
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   382
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   383
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   384
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   385
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   386
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   387
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   388
        $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   389
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   390
    }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   391
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   392
    /**
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   393
     * Test merge created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   394
     * Merge SOUND with created into TEXT with created
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   395
     * Should have one value
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   396
     * @return void
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   397
     */
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   398
    public function testCreatedTextCreatedSoundCreated() {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   399
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   400
        $resGraph = $this->resGraph["CREATED_TEXT_SOUND"];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   401
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   402
        $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   403
        $soundNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   404
        $this->assertNotNull($providedCHO);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   405
        $this->assertNotNull($soundNode);
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   406
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   407
        $outputValuesStr = [];
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   408
        foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   409
            array_push($outputValuesStr, strval($outputValue));
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   410
        }
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   411
        $this->assertNotEmpty($outputValuesStr, "we must found values to test http://purl.org/dc/terms/created");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   412
        $this->assertCount(1, $outputValuesStr, "We should have one value");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   413
        $soundCreated = $soundNode->get("<http://purl.org/dc/terms/created>");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   414
        $this->assertEquals($outputValuesStr[0], strval($soundCreated), "We must same value than in sound");
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   415
4ab820b387da Correct the handling of created date. Should correct #0025744
ymh <ymh.work@gmail.com>
parents: 152
diff changeset
   416
    }
116
e60c55988ed4 put right, access and licence info on webresource
ymh <ymh.work@gmail.com>
parents: 115
diff changeset
   417
114
8af5ed0521a2 Correct modified value for SOUND when merging. This comes not from TEXT
ymh <ymh.work@gmail.com>
parents:
diff changeset
   418
}