server/src/tests/Libraries/Mergers/CocoonTextRdfMergerTest.php
changeset 504 4ab820b387da
parent 152 dd6b3adde73b
child 520 d6adc4047ede
equal deleted inserted replaced
503:bd2701bd8142 504:4ab820b387da
    12 use Illuminate\Foundation\Testing\DatabaseMigrations;
    12 use Illuminate\Foundation\Testing\DatabaseMigrations;
    13 use Illuminate\Foundation\Testing\DatabaseTransactions;
    13 use Illuminate\Foundation\Testing\DatabaseTransactions;
    14 
    14 
    15 class CocoonTextRdfMergerTest extends TestCase
    15 class CocoonTextRdfMergerTest extends TestCase
    16 {
    16 {
    17 
       
    18     const TEST_INPUT_DOCS = [
    17     const TEST_INPUT_DOCS = [
    19         'SOUND' => <<<EOT
    18         'SOUND' => __DIR__.'/files/CocoonTextRdfMergerTest/sound.ttl',
    20         @prefix ore: <http://www.openarchives.org/ore/terms/> .
    19         'SOUND_NO_MOD' => __DIR__.'/files/CocoonTextRdfMergerTest/sound_no_mod.ttl',
    21         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
    20         'SOUND_NO_CREATED' => __DIR__.'/files/CocoonTextRdfMergerTest/sound_no_created.ttl',
    22         @prefix dc11: <http://purl.org/dc/elements/1.1/> .
    21         'TEXT' => __DIR__.'/files/CocoonTextRdfMergerTest/text.ttl',
    23         @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
    22         'TEXT_CREATED' => __DIR__.'/files/CocoonTextRdfMergerTest/text_created.ttl'
    24         @prefix dc: <http://purl.org/dc/terms/> .
       
    25         @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
       
    26         @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
       
    27         @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
       
    28         @prefix owl: <http://www.w3.org/2002/07/owl#> .
       
    29 
       
    30         <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
       
    31           a ore:Aggregation ;
       
    32           edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
       
    33           edm:provider "Corpus de la Parole"@fr ;
       
    34           edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
       
    35           edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
       
    36           edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
       
    37           edm:rights <http://creativecommons.org/licenses/by-nc-nd/4.0/> ;
       
    38           edm:hasView <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>, <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3> .
       
    39 
       
    40         <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
       
    41           a edm:ProvidedCHO ;
       
    42           dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
       
    43           dc11:description "Voilà pourquoi le bernard-l'hermite, aujourd'hui, se cache dans les coquilles vides qu'il trouve, alors que le crabe de cocotier n'a pas honte de se promener tout nu."@fr ;
       
    44           dc11:language <http://lexvo.org/id/iso639-3/uve> ;
       
    45           dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ;
       
    46           dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
       
    47           dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
       
    48           dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
       
    49           dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
       
    50           dc11:title "The two hermit crabs and the coconut crab"@en ;
       
    51           dc:accessRights "Freely available for non-commercial use" ;
       
    52           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
       
    53           dc:extent "PT2M35S" ;
       
    54           edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
       
    55           olac:depositor <http://viaf.org/viaf/56614135> ;
       
    56           dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
       
    57           olac:researcher <http://viaf.org/viaf/56614135> ;
       
    58           olac:speaker "Idakote, Félicien" ;
       
    59           dc:available "2010-10-23"^^dc:W3CDTF ;
       
    60           dc:created "1997-08-29"^^dc:W3CDTF ;
       
    61           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
    62           dc:modified "2012-03-25"^^dc:W3CDTF ;
       
    63           dc:spatial [
       
    64             a edm:Place ;
       
    65             geo:lat "-20.46667"^^xsd:float ;
       
    66             geo:long "166.65"^^xsd:float ;
       
    67             skos:note "NC"^^dc:ISO3166, "New Caledonia, Ohnyat (Ouvéa)" ;
       
    68             owl:sameAs <http://sws.geonames.org/2139490/>
       
    69           ] .
       
    70 
       
    71         <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
       
    72           a edm:WebResource ;
       
    73           dc:extent "PT2M35S" ;
       
    74           dc11:format "audio/x-wav"^^dc:IMT ;
       
    75           dc:created "1997-08-29"^^dc:W3CDTF ;
       
    76           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
    77           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
    78           dc:accessRights "Freely available for non-commercial use" ;
       
    79           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
    80 
       
    81 
       
    82         <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
       
    83           a edm:WebResource ;
       
    84           dc:extent "PT2M35S" ;
       
    85           dc11:format "audio/x-wav"^^dc:IMT ;
       
    86           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
       
    87           dc:created "1997-08-29"^^dc:W3CDTF ;
       
    88           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
    89           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
    90           dc:accessRights "Freely available for non-commercial use" ;
       
    91           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
    92 
       
    93 
       
    94         <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
       
    95           a edm:WebResource ;
       
    96           dc:extent "PT2M35S" ;
       
    97           dc11:format "audio/mpeg"^^dc:IMT ;
       
    98           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
       
    99           dc:created "1997-08-29"^^dc:W3CDTF ;
       
   100           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
   101           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
   102           dc:accessRights "Freely available for non-commercial use" ;
       
   103           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
   104 
       
   105 EOT
       
   106         ,
       
   107         'SOUND_NO_MOD' => <<<EOT
       
   108         @prefix ore: <http://www.openarchives.org/ore/terms/> .
       
   109         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
       
   110         @prefix dc11: <http://purl.org/dc/elements/1.1/> .
       
   111         @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
       
   112         @prefix dc: <http://purl.org/dc/terms/> .
       
   113         @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
       
   114         @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
       
   115         @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
       
   116         @prefix owl: <http://www.w3.org/2002/07/owl#> .
       
   117 
       
   118         <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
       
   119           a ore:Aggregation ;
       
   120           edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
       
   121           edm:provider "Corpus de la Parole"@fr ;
       
   122           edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
       
   123           edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
       
   124           edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
       
   125           edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
       
   126           edm:hasView <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>, <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3> .
       
   127 
       
   128         <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
       
   129           a edm:ProvidedCHO ;
       
   130           dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
       
   131           dc11:description "Voilà pourquoi le bernard-l'hermite, aujourd'hui, se cache dans les coquilles vides qu'il trouve, alors que le crabe de cocotier n'a pas honte de se promener tout nu."@fr ;
       
   132           dc11:language <http://lexvo.org/id/iso639-3/uve> ;
       
   133           dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ;
       
   134           dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
       
   135           dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
       
   136           dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
       
   137           dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
       
   138           dc11:title "The two hermit crabs and the coconut crab"@en ;
       
   139           dc:accessRights "Freely available for non-commercial use" ;
       
   140           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
       
   141           dc:extent "PT2M35S" ;
       
   142           edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
       
   143           olac:depositor <http://viaf.org/viaf/56614135> ;
       
   144           dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
       
   145           olac:researcher <http://viaf.org/viaf/56614135> ;
       
   146           olac:speaker "Idakote, Félicien" ;
       
   147           dc:available "2010-10-23"^^dc:W3CDTF ;
       
   148           dc:created "1997-08-29"^^dc:W3CDTF ;
       
   149           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
   150           dc:spatial [
       
   151             a edm:Place ;
       
   152             geo:lat "-20.46667"^^xsd:float ;
       
   153             geo:long "166.65"^^xsd:float ;
       
   154             skos:note "NC"^^dc:ISO3166, "New Caledonia, Ohnyat (Ouvéa)" ;
       
   155             owl:sameAs <http://sws.geonames.org/2139490/>
       
   156           ] .
       
   157 
       
   158         <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
       
   159           a edm:WebResource ;
       
   160           dc:extent "PT2M35S" ;
       
   161           dc11:format "audio/x-wav"^^dc:IMT ;
       
   162           dc:created "1997-08-29"^^dc:W3CDTF ;
       
   163           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
   164           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
   165           dc:accessRights "Freely available for non-commercial use" ;
       
   166           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
   167 
       
   168 
       
   169         <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
       
   170           a edm:WebResource ;
       
   171           dc:extent "PT2M35S" ;
       
   172           dc11:format "audio/x-wav"^^dc:IMT ;
       
   173           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
       
   174           dc:created "1997-08-29"^^dc:W3CDTF ;
       
   175           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
   176           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
   177           dc:accessRights "Freely available for non-commercial use" ;
       
   178           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
   179 
       
   180 
       
   181         <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
       
   182           a edm:WebResource ;
       
   183           dc:extent "PT2M35S" ;
       
   184           dc11:format "audio/mpeg"^^dc:IMT ;
       
   185           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
       
   186           dc:created "1997-08-29"^^dc:W3CDTF ;
       
   187           dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
       
   188           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
   189           dc:accessRights "Freely available for non-commercial use" ;
       
   190           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
   191 
       
   192 EOT
       
   193         ,
       
   194         'TEXT' => <<<EOT
       
   195         @prefix ore: <http://www.openarchives.org/ore/terms/> .
       
   196         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
       
   197         @prefix dc11: <http://purl.org/dc/elements/1.1/> .
       
   198         @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
       
   199         @prefix dc: <http://purl.org/dc/terms/> .
       
   200         @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
       
   201 
       
   202         <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
       
   203           a ore:Aggregation ;
       
   204           edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
       
   205           edm:provider "Corpus de la Parole"@fr ;
       
   206           edm:dataProvider <http://viaf.org/viaf/154919513> ;
       
   207           edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
       
   208           edm:isShownBy <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml> ;
       
   209           edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
       
   210           edm:hasView <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml>, <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xhtml> .
       
   211 
       
   212         <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
       
   213           a edm:ProvidedCHO ;
       
   214           dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
       
   215           dc11:description "Voilà pourquoi le bernard-l'hermite, aujourd'hui, se cache dans les coquilles vides qu'il trouve, alors que le crabe de cocotier n'a pas honte de se promener tout nu."@fr ;
       
   216           dc11:language <http://lexvo.org/id/iso639-3/uve> ;
       
   217           dc11:publisher <http://viaf.org/viaf/154919513> ;
       
   218           dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
       
   219           dc11:type "primary_text"^^olac:linguistic-type, <http://purl.org/dc/dcmitype/Text>, "narrative"^^olac:discourse-type ;
       
   220           dc:license <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
       
   221           dc11:subject <http://lexvo.org/id/iso639-3/uve> ;
       
   222           dc11:title "The two hermit crabs and the coconut crab"@en ;
       
   223           dc:accessRights "Freely available for non-commercial use" ;
       
   224           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
       
   225           edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
       
   226           dc:alternative "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
       
   227           olac:depositor <http://viaf.org/viaf/56614135> ;
       
   228           dc11:contributor <http://viaf.org/viaf/56614135>, "Moyse-Faurie, Claire", "Idakote, Félicien" ;
       
   229           olac:researcher "Moyse-Faurie, Claire" ;
       
   230           olac:speaker "Idakote, Félicien" ;
       
   231           dc:available "2011-02-05"^^dc:W3CDTF ;
       
   232           dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
       
   233           dc:modified "2002-02-20"^^dc:W3CDTF ;
       
   234           dc:spatial [
       
   235             a edm:Place ;
       
   236             skos:note "NC"^^dc:ISO3166, "New Caledonia, Ohnyat (Ouvéa)"
       
   237           ] .
       
   238 
       
   239         <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml>
       
   240           a edm:WebResource ;
       
   241           dc11:format "application/xml"^^dc:IMT ;
       
   242           dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
       
   243           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
   244           dc:accessRights "Freely available for non-commercial use" ;
       
   245           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
   246 
       
   247 
       
   248         <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xhtml>
       
   249           a edm:WebResource ;
       
   250           dc11:format "application/xhtml+xml"^^dc:IMT ;
       
   251           dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
       
   252           dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
       
   253           dc:accessRights "Freely available for non-commercial use" ;
       
   254           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
       
   255 
       
   256 EOT
       
   257     ];
    23     ];
   258 
       
   259 
    24 
   260     private $inputGraphes = [];
    25     private $inputGraphes = [];
   261     private $resGraph = [];
    26     private $resGraph = [];
   262 
    27 
   263     function __construct(string $name = null) {
    28     function __construct(string $name = null) {
   266 
    31 
   267     public function setUp() {
    32     public function setUp() {
   268         parent::setUp();
    33         parent::setUp();
   269 
    34 
   270         foreach(CocoonTextRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
    35         foreach(CocoonTextRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
   271             $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", $inputDoc);
    36             $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", file_get_contents($inputDoc));
   272         }
    37         }
   273 
    38 
   274         $merger = new CocoonTextRdfMerger();
    39         $merger = new CocoonTextRdfMerger();
   275         $this->resGraph['SOUND_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT']);
    40         $this->resGraph['SOUND_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT']);
   276         $merger = new CocoonSoundRdfMerger();
    41         $merger = new CocoonSoundRdfMerger();
   277         $this->resGraph['TEXT_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND']);
    42         $this->resGraph['TEXT_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND']);
   278         $merger = new CocoonTextRdfMerger();
    43         $merger = new CocoonTextRdfMerger();
   279         $this->resGraph['SOUND_NO_MOD_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_MOD'], $this->inputGraphes['TEXT']);
    44         $this->resGraph['SOUND_NO_MOD_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_MOD'], $this->inputGraphes['TEXT']);
   280         $merger = new CocoonSoundRdfMerger();
    45         $merger = new CocoonSoundRdfMerger();
   281         $this->resGraph['TEXT_SOUND_NO_MOD'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND_NO_MOD']);
    46         $this->resGraph['TEXT_SOUND_NO_MOD'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND_NO_MOD']);
       
    47 
       
    48         $merger = new CocoonSoundRdfMerger();
       
    49         $this->resGraph['CREATED_TEXT_NO_CREATED_SOUND_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND_NO_CREATED']);
       
    50         $merger = new CocoonSoundRdfMerger();
       
    51         $this->resGraph['CREATED_TEXT_SOUND_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['TEXT_CREATED'], $this->inputGraphes['SOUND_NO_CREATED']);
       
    52         $merger = new CocoonSoundRdfMerger();
       
    53         $this->resGraph['CREATED_TEXT_NO_CREATED_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND']);
       
    54         $merger = new CocoonSoundRdfMerger();
       
    55         $this->resGraph['CREATED_TEXT_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT_CREATED'], $this->inputGraphes['SOUND']);
       
    56 
       
    57         $merger = new CocoonTextRdfMerger();
       
    58         $this->resGraph['CREATED_SOUND_NO_CREATED_TEXT_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_CREATED'], $this->inputGraphes['TEXT']);
       
    59         $merger = new CocoonTextRdfMerger();
       
    60         $this->resGraph['CREATED_SOUND_TEXT_NO_CREATED'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT']);
       
    61         $merger = new CocoonTextRdfMerger();
       
    62         $this->resGraph['CREATED_SOUND_NO_CREATED_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_CREATED'], $this->inputGraphes['TEXT_CREATED']);
       
    63         $merger = new CocoonTextRdfMerger();
       
    64         $this->resGraph['CREATED_SOUND_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT_CREATED']);
       
    65 
   282     }
    66     }
   283 
    67 
   284     public function tearDown() {
    68     public function tearDown() {
   285         parent::tearDown();
    69         parent::tearDown();
   286     }
    70     }
   446         $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
   230         $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
   447         $this->assertEquals('http://creativecommons.org/licenses/by-nc-sa/4.0/', $license->getUri(), "License must be default licence");
   231         $this->assertEquals('http://creativecommons.org/licenses/by-nc-sa/4.0/', $license->getUri(), "License must be default licence");
   448     }
   232     }
   449 
   233 
   450 
   234 
       
   235     /**
       
   236      * Test merge created merge TEXT with no created into SOUND with no created
       
   237      * Should have no values
       
   238      * @return void
       
   239      */
       
   240     public function testCreatedSoundNocreatedTextNoCreated() {
       
   241 
       
   242         $resGraph = $this->resGraph["CREATED_SOUND_NO_CREATED_TEXT_NO_CREATED"];
       
   243 
       
   244         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   245         $this->assertNotNull($providedCHO);
       
   246 
       
   247         $outputValuesStr = [];
       
   248         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   249             array_push($outputValuesStr, strval($outputValue));
       
   250         }
       
   251         $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
       
   252     }
       
   253 
       
   254     /**
       
   255      * Test merge created merge TEXT with created into SOUND with no created
       
   256      * Should have no values
       
   257      * @return void
       
   258      */
       
   259     public function testCreatedSoundNoCreatedTextCreated() {
       
   260 
       
   261         $resGraph = $this->resGraph["CREATED_SOUND_NO_CREATED_TEXT"];
       
   262 
       
   263         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   264         $this->assertNotNull($providedCHO);
       
   265 
       
   266         $outputValuesStr = [];
       
   267         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   268             array_push($outputValuesStr, strval($outputValue));
       
   269         }
       
   270         $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
       
   271 
       
   272     }
       
   273 
       
   274     /**
       
   275      * Test merge created
       
   276      * Merge TEXT with no created into SOUND with created
       
   277      * Should have no values
       
   278      * @return void
       
   279      */
       
   280     public function testCreatedSoundCreatedTextNoCreated() {
       
   281 
       
   282         $resGraph = $this->resGraph["CREATED_SOUND_TEXT_NO_CREATED"];
       
   283 
       
   284         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   285         $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
       
   286         $this->assertNotNull($providedCHO);
       
   287         $this->assertNotNull($baseNode);
       
   288 
       
   289         $outputValuesStr = [];
       
   290         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   291             array_push($outputValuesStr, strval($outputValue));
       
   292         }
       
   293         $this->assertNotEmpty($outputValuesStr, "we must foundvalues to test http://purl.org/dc/terms/created");
       
   294         $this->assertCount(1, $outputValuesStr, "We should have one value");
       
   295         $baseCreated = $baseNode->get("<http://purl.org/dc/terms/created>");
       
   296         $this->assertEquals($outputValuesStr[0], strval($baseCreated), "We must same value than in sound");
       
   297 
       
   298     }
       
   299 
       
   300     /**
       
   301      * Test merge created
       
   302      * Merge TEXT with created into SOUND with created
       
   303      * Should have no values
       
   304      * @return void
       
   305      */
       
   306     public function testCreatedSoundCreatedTextCreated() {
       
   307 
       
   308         $resGraph = $this->resGraph["CREATED_SOUND_TEXT"];
       
   309 
       
   310         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   311         $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
       
   312         $this->assertNotNull($providedCHO);
       
   313         $this->assertNotNull($baseNode);
       
   314 
       
   315         $outputValuesStr = [];
       
   316         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   317             array_push($outputValuesStr, strval($outputValue));
       
   318         }
       
   319         $this->assertNotEmpty($outputValuesStr, "we must found values to test http://purl.org/dc/terms/created");
       
   320         $this->assertCount(1, $outputValuesStr, "We should have one value");
       
   321         $baseCreated = $providedCHO->get("<http://purl.org/dc/terms/created>");
       
   322         $this->assertEquals($outputValuesStr[0], strval($baseCreated), "We must same value than in sound");
       
   323 
       
   324     }
       
   325 
       
   326 
       
   327     /**
       
   328      * Test merge created merge SOUND with no created into TEXT with no created
       
   329      * Should have no values
       
   330      * @return void
       
   331      */
       
   332     public function testCreatedTextNocreatedSoundNoCreated() {
       
   333 
       
   334         $resGraph = $this->resGraph["CREATED_TEXT_NO_CREATED_SOUND_NO_CREATED"];
       
   335 
       
   336         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   337         $this->assertNotNull($providedCHO);
       
   338 
       
   339         $outputValuesStr = [];
       
   340         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   341             array_push($outputValuesStr, strval($outputValue));
       
   342         }
       
   343         $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
       
   344     }
       
   345 
       
   346     /**
       
   347      * Test merge created merge SOUND with created into TEXT with no created
       
   348      * Should have one value from sound
       
   349      * @return void
       
   350      */
       
   351     public function testCreatedTextNoCreatedSoundCreated() {
       
   352 
       
   353         $resGraph = $this->resGraph["CREATED_TEXT_NO_CREATED_SOUND"];
       
   354 
       
   355         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   356         $soundNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
       
   357         $this->assertNotNull($providedCHO);
       
   358         $this->assertNotNull($soundNode);
       
   359 
       
   360         $outputValuesStr = [];
       
   361         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   362             array_push($outputValuesStr, strval($outputValue));
       
   363         }
       
   364         $this->assertNotEmpty($outputValuesStr, "we must foundvalues to test http://purl.org/dc/terms/created");
       
   365         $this->assertCount(1, $outputValuesStr, "We should have one value");
       
   366         $soundCreated = $soundNode->get("<http://purl.org/dc/terms/created>");
       
   367         $this->assertEquals($outputValuesStr[0], strval($soundCreated), "We must same value than in sound");
       
   368 
       
   369     }
       
   370 
       
   371     /**
       
   372      * Test merge created
       
   373      * Merge SOUND with no created into TEXT with created
       
   374      * Should have no values
       
   375      * @return void
       
   376      */
       
   377     public function testCreatedTextCreatedSoundNoCreated() {
       
   378 
       
   379         $resGraph = $this->resGraph["CREATED_TEXT_SOUND_NO_CREATED"];
       
   380 
       
   381         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   382         $this->assertNotNull($providedCHO);
       
   383 
       
   384         $outputValuesStr = [];
       
   385         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   386             array_push($outputValuesStr, strval($outputValue));
       
   387         }
       
   388         $this->assertEmpty($outputValuesStr, "we must found no values to test http://purl.org/dc/terms/created");
       
   389 
       
   390     }
       
   391 
       
   392     /**
       
   393      * Test merge created
       
   394      * Merge SOUND with created into TEXT with created
       
   395      * Should have one value
       
   396      * @return void
       
   397      */
       
   398     public function testCreatedTextCreatedSoundCreated() {
       
   399 
       
   400         $resGraph = $this->resGraph["CREATED_TEXT_SOUND"];
       
   401 
       
   402         $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type');
       
   403         $soundNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type');
       
   404         $this->assertNotNull($providedCHO);
       
   405         $this->assertNotNull($soundNode);
       
   406 
       
   407         $outputValuesStr = [];
       
   408         foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/created")) as $outputValue) {
       
   409             array_push($outputValuesStr, strval($outputValue));
       
   410         }
       
   411         $this->assertNotEmpty($outputValuesStr, "we must found values to test http://purl.org/dc/terms/created");
       
   412         $this->assertCount(1, $outputValuesStr, "We should have one value");
       
   413         $soundCreated = $soundNode->get("<http://purl.org/dc/terms/created>");
       
   414         $this->assertEquals($outputValuesStr[0], strval($soundCreated), "We must same value than in sound");
       
   415 
       
   416     }
   451 
   417 
   452 }
   418 }