server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php
changeset 116 e60c55988ed4
parent 115 34ffc04cef62
child 117 7abc74acf392
equal deleted inserted replaced
115:34ffc04cef62 116:e60c55988ed4
    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> ;
    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/> ;
    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> ;
    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 ;
    50           dc11:title "The two hermit crabs and the coconut crab"@en ;
    51           dc:accessRights "Freely available for non-commercial use" ;
    51           dc:accessRights "Freely available for non-commercial use" ;
       
    52           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
    52           dc:extent "PT2M35S" ;
    53           dc:extent "PT2M35S" ;
    53           edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
    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> ;
    54           olac:depositor <http://viaf.org/viaf/56614135> ;
    55           olac:depositor <http://viaf.org/viaf/56614135> ;
    55           dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
    56           dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
    56           olac:researcher <http://viaf.org/viaf/56614135> ;
    57           olac:researcher <http://viaf.org/viaf/56614135> ;
    70         <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
    71         <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
    71           a edm:WebResources ;
    72           a edm:WebResources ;
    72           dc:extent "PT2M35S" ;
    73           dc:extent "PT2M35S" ;
    73           dc11:format "audio/x-wav"^^dc:IMT ;
    74           dc11:format "audio/x-wav"^^dc:IMT ;
    74           dc:created "1997-08-29"^^dc:W3CDTF ;
    75           dc:created "1997-08-29"^^dc:W3CDTF ;
    75           dc:issued "2010-10-23T00:08:27+02:00"^^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 
    76 
    81 
    77         <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
    82         <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
    78           a edm:WebResources ;
    83           a edm:WebResources ;
    79           dc:extent "PT2M35S" ;
    84           dc:extent "PT2M35S" ;
    80           dc11:format "audio/x-wav"^^dc:IMT ;
    85           dc11:format "audio/x-wav"^^dc:IMT ;
    81           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
    86           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
    82           dc:created "1997-08-29"^^dc:W3CDTF ;
    87           dc:created "1997-08-29"^^dc:W3CDTF ;
    83           dc:issued "2010-10-23T00:08:27+02:00"^^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 
    84 
    93 
    85         <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
    94         <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
    86           a edm:WebResources ;
    95           a edm:WebResources ;
    87           dc:extent "PT2M35S" ;
    96           dc:extent "PT2M35S" ;
    88           dc11:format "audio/mpeg"^^dc:IMT ;
    97           dc11:format "audio/mpeg"^^dc:IMT ;
    89           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
    98           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
    90           dc:created "1997-08-29"^^dc:W3CDTF ;
    99           dc:created "1997-08-29"^^dc:W3CDTF ;
    91           dc:issued "2010-10-23T00:08:27+02:00"^^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 
    92 EOT
   105 EOT
    93         ,
   106         ,
    94         'SOUND_NO_MOD' => <<<EOT
   107         'SOUND_NO_MOD' => <<<EOT
    95         @prefix ore: <http://www.openarchives.org/ore/terms/> .
   108         @prefix ore: <http://www.openarchives.org/ore/terms/> .
    96         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
   109         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
   122           dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
   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> ;
   123           dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
   136           dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
   124           dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
   137           dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
   125           dc11:title "The two hermit crabs and the coconut crab"@en ;
   138           dc11:title "The two hermit crabs and the coconut crab"@en ;
   126           dc:accessRights "Freely available for non-commercial use" ;
   139           dc:accessRights "Freely available for non-commercial use" ;
       
   140           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
   127           dc:extent "PT2M35S" ;
   141           dc:extent "PT2M35S" ;
   128           edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
   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> ;
   129           olac:depositor <http://viaf.org/viaf/56614135> ;
   143           olac:depositor <http://viaf.org/viaf/56614135> ;
   130           dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
   144           dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
   131           olac:researcher <http://viaf.org/viaf/56614135> ;
   145           olac:researcher <http://viaf.org/viaf/56614135> ;
   144         <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
   158         <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
   145           a edm:WebResources ;
   159           a edm:WebResources ;
   146           dc:extent "PT2M35S" ;
   160           dc:extent "PT2M35S" ;
   147           dc11:format "audio/x-wav"^^dc:IMT ;
   161           dc11:format "audio/x-wav"^^dc:IMT ;
   148           dc:created "1997-08-29"^^dc:W3CDTF ;
   162           dc:created "1997-08-29"^^dc:W3CDTF ;
   149           dc:issued "2010-10-23T00:08:27+02:00"^^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 
   150 
   168 
   151         <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
   169         <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
   152           a edm:WebResources ;
   170           a edm:WebResources ;
   153           dc:extent "PT2M35S" ;
   171           dc:extent "PT2M35S" ;
   154           dc11:format "audio/x-wav"^^dc:IMT ;
   172           dc11:format "audio/x-wav"^^dc:IMT ;
   155           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
   173           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
   156           dc:created "1997-08-29"^^dc:W3CDTF ;
   174           dc:created "1997-08-29"^^dc:W3CDTF ;
   157           dc:issued "2010-10-23T00:08:27+02:00"^^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 
   158 
   180 
   159         <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
   181         <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
   160           a edm:WebResources ;
   182           a edm:WebResources ;
   161           dc:extent "PT2M35S" ;
   183           dc:extent "PT2M35S" ;
   162           dc11:format "audio/mpeg"^^dc:IMT ;
   184           dc11:format "audio/mpeg"^^dc:IMT ;
   163           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
   185           edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
   164           dc:created "1997-08-29"^^dc:W3CDTF ;
   186           dc:created "1997-08-29"^^dc:W3CDTF ;
   165           dc:issued "2010-10-23T00:08:27+02:00"^^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 
   166 EOT
   192 EOT
   167         ,
   193         ,
   168         'TEXT' => <<<EOT
   194         'TEXT' => <<<EOT
   169         @prefix ore: <http://www.openarchives.org/ore/terms/> .
   195         @prefix ore: <http://www.openarchives.org/ore/terms/> .
   170         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
   196         @prefix edm: <http://www.europeana.eu/schemas/edm/> .
   193           dc11:type "primary_text"^^olac:linguistic-type, <http://purl.org/dc/dcmitype/Text>, "narrative"^^olac:discourse-type ;
   219           dc11:type "primary_text"^^olac:linguistic-type, <http://purl.org/dc/dcmitype/Text>, "narrative"^^olac:discourse-type ;
   194           dc:license <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
   220           dc:license <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
   195           dc11:subject <http://lexvo.org/id/iso639-3/uve> ;
   221           dc11:subject <http://lexvo.org/id/iso639-3/uve> ;
   196           dc11:title "The two hermit crabs and the coconut crab"@en ;
   222           dc11:title "The two hermit crabs and the coconut crab"@en ;
   197           dc:accessRights "Freely available for non-commercial use" ;
   223           dc:accessRights "Freely available for non-commercial use" ;
       
   224           dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
   198           edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
   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> ;
   199           dc:alternative "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
   226           dc:alternative "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
   200           olac:depositor <http://viaf.org/viaf/56614135> ;
   227           olac:depositor <http://viaf.org/viaf/56614135> ;
   201           dc11:contributor <http://viaf.org/viaf/56614135>, "Moyse-Faurie, Claire", "Idakote, Félicien" ;
   228           dc11:contributor <http://viaf.org/viaf/56614135>, "Moyse-Faurie, Claire", "Idakote, Félicien" ;
   202           olac:researcher "Moyse-Faurie, Claire" ;
   229           olac:researcher "Moyse-Faurie, Claire" ;
   210           ] .
   237           ] .
   211 
   238 
   212         <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml>
   239         <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml>
   213           a edm:WebResources ;
   240           a edm:WebResources ;
   214           dc11:format "application/xml"^^dc:IMT ;
   241           dc11:format "application/xml"^^dc:IMT ;
   215           dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF .
   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 
   216 
   247 
   217         <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xhtml>
   248         <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xhtml>
   218           a edm:WebResources ;
   249           a edm:WebResources ;
   219           dc11:format "application/xhtml+xml"^^dc:IMT ;
   250           dc11:format "application/xhtml+xml"^^dc:IMT ;
   220           dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF .
   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 
   221 EOT
   256 EOT
   222     ];
   257     ];
   223 
   258 
   224 
   259 
   225     private $inputGraphes = [];
   260     private $inputGraphes = [];
   363         }
   398         }
   364 
   399 
   365     }
   400     }
   366 
   401 
   367 
   402 
       
   403     public function testRightsWebResource() {
       
   404         $properties = [
       
   405             "http://purl.org/dc/elements/1.1/rights",
       
   406             'http://purl.org/dc/terms/license',
       
   407             'http://purl.org/dc/terms/accessRights',
       
   408         ];
       
   409 
       
   410         $resGraph = $this->resGraph["SOUND_TEXT"];
       
   411         $webResourceList = $resGraph->all('edm:WebResource', '^rdf:type');
       
   412 
       
   413         //just check that they have all these resources.
       
   414         //TODO: check that the same rights are kept (difficult)
       
   415         foreach ($webResourceList as $webResource) {
       
   416             foreach ($properties as $prop) {
       
   417                 $outputValuesStr = [];
       
   418                 foreach($webResource->all($resGraph->resource($prop)) as $outputValue) {
       
   419                     array_push($outputValuesStr, strval($outputValue));
       
   420                 }
       
   421                 $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
       
   422             }
       
   423         }
       
   424     }
       
   425 
       
   426 
       
   427 
   368 }
   428 }