server/src/tests/libraries/Mappers/CocoonSoundRdfMapperTest.php
changeset 108 be2d3b30b2e0
parent 21 01e7e6a17317
child 111 af85c436048f
equal deleted inserted replaced
107:16e1473a6a99 108:be2d3b30b2e0
    34             <http://purl.org/dc/elements/1.1/title> "ESLO1: entretien 019"@fr ;
    34             <http://purl.org/dc/elements/1.1/title> "ESLO1: entretien 019"@fr ;
    35             <http://purl.org/dc/terms/alternative> "ESLO1: entretien 019 alt"@fr ;
    35             <http://purl.org/dc/terms/alternative> "ESLO1: entretien 019 alt"@fr ;
    36             <http://purl.org/dc/terms/isFormatOf> <http://cocoon.huma-num.fr/data/eslo/ESLO1_ENT_019_22km.wav> , <http://cocoon.huma-num.fr/data/eslo/ESLO1_ENT_019.mp3> ;
    36             <http://purl.org/dc/terms/isFormatOf> <http://cocoon.huma-num.fr/data/eslo/ESLO1_ENT_019_22km.wav> , <http://cocoon.huma-num.fr/data/eslo/ESLO1_ENT_019.mp3> ;
    37             <http://purl.org/dc/terms/accessRights> " Freely available for non-commercial use" ;
    37             <http://purl.org/dc/terms/accessRights> " Freely available for non-commercial use" ;
    38             <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
    38             <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
    39             <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ESLO1> ;
    39             <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ESLO1>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_010> ;
    40             <http://purl.org/dc/terms/extent> "PT0H47M16S" ;
    40             <http://purl.org/dc/terms/extent> "PT0H47M16S" ;
    41             <http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
    41             <http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
    42             <http://purl.org/dc/terms/spatial> "FR"^^<http://purl.org/dc/terms/ISO3166> , <http://vocab.getty.edu/tgn/7008337> , "France, Centre, Loiret, Orléans"@fr ;
    42             <http://purl.org/dc/terms/spatial> "FR"^^<http://purl.org/dc/terms/ISO3166> , <http://vocab.getty.edu/tgn/7008337> , "France, Centre, Loiret, Orléans"@fr ;
    43             <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav> ;
    43             <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav> ;
    44             <http://purl.org/dc/terms/available> "2014-11-06"^^<http://purl.org/dc/terms/W3CDTF> ;
    44             <http://purl.org/dc/terms/available> "2014-11-06"^^<http://purl.org/dc/terms/W3CDTF> ;
   270             'http://purl.org/dc/terms/issued',
   270             'http://purl.org/dc/terms/issued',
   271             'http://purl.org/dc/terms/extent',
   271             'http://purl.org/dc/terms/extent',
   272             'http://purl.org/dc/elements/1.1/type',
   272             'http://purl.org/dc/elements/1.1/type',
   273             'http://purl.org/dc/elements/1.1/language',
   273             'http://purl.org/dc/elements/1.1/language',
   274             'http://purl.org/dc/terms/medium',
   274             'http://purl.org/dc/terms/medium',
   275             'http://purl.org/dc/terms/isPartOf',
       
   276             'http://purl.org/dc/elements/1.1/source',
   275             'http://purl.org/dc/elements/1.1/source',
   277             'http://purl.org/dc/terms/alternative',
   276             'http://purl.org/dc/terms/alternative',
   278             'http://purl.org/dc/terms/modified',
   277             'http://purl.org/dc/terms/modified',
   279             'http://purl.org/dc/terms/abstract',
   278             'http://purl.org/dc/terms/abstract',
   280             'http://purl.org/dc/terms/bibliographicCitation',
   279             'http://purl.org/dc/terms/bibliographicCitation',
   303         }
   302         }
   304 
   303 
   305     }
   304     }
   306 
   305 
   307     /**
   306     /**
   308     * Test one to one mapping spatial info
   307      * Test mapping for isPartOf
   309     *
   308      *
   310     * @return void
   309      * @return void
   311     */
   310      */
       
   311     public function testOneToOneProvidedCHOIsPartOf() {
       
   312         $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
       
   313         $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
       
   314 
       
   315         $this->assertNotNull($providedCHO);
       
   316         $this->assertNotNull($sourceNode);
       
   317 
       
   318         $isGatheredInto = $providedCHO->all($this->resGraphes['BASE']->resource('http://www.europeana.eu/schemas/edm/isGatheredInto'));
       
   319         $this->assertCount(2, $isGatheredInto, "Must have two collection node");
       
   320 
       
   321         $ispartOf = $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/isPartOf'));
       
   322         $this->assertCount(1, $ispartOf, "Must have one collection node");
       
   323 
       
   324         $outputValuesStr = [];
       
   325         foreach($providedCHO->all($this->resGraphes['BASE']->resource('http://www.europeana.eu/schemas/edm/isGatheredInto')) as $outputValue) {
       
   326             array_push($outputValuesStr, strval($outputValue));
       
   327         }
       
   328         $this->assertNotEmpty($outputValuesStr, "we must found some values to test isGatheredInto");
       
   329 
       
   330         $this->assertContains("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE", $outputValuesStr, "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE not found in output graph");
       
   331         $this->assertContains("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ESLO1", $outputValuesStr, "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ESLO1 not found in output graph");
       
   332 
       
   333         $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_010", strval($providedCHO->get($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/isPartOf'))), "the isPartOf mus equals http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_010");
       
   334     }
       
   335 
       
   336     /**
       
   337      * Test one to one mapping spatial info
       
   338      *
       
   339      * @return void
       
   340      */
   312     public function testOneToOneProvidedCHOSpatial() {
   341     public function testOneToOneProvidedCHOSpatial() {
   313         $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
   342         $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
   314         $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
   343         $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
   315 
   344 
   316         $this->assertNotNull($providedCHO);
   345         $this->assertNotNull($providedCHO);
   466 
   495 
   467         }
   496         }
   468 
   497 
   469     }
   498     }
   470 
   499 
   471 
       
   472     /**
   500     /**
   473      * Test collection graph creation
   501      * Test collection graph creation
   474      * @return void
   502      * @return void
   475      */
   503      */
   476     public function testCollectionGraph() {
   504     public function testCollectionGraph() {