# HG changeset patch # User ymh # Date 1454456435 -3600 # Node ID 8af5ed0521a255b5147c7314f8e7970779f84e97 # Parent faff38055a0750ab5f337d55b08d0b0df0506c4d Correct modified value for SOUND when merging. This comes not from TEXT diff -r faff38055a07 -r 8af5ed0521a2 .hgignore --- a/.hgignore Wed Jan 20 20:46:59 2016 +0100 +++ b/.hgignore Wed Feb 03 00:40:35 2016 +0100 @@ -38,6 +38,7 @@ ^cms/app-client/dist ^cms/app-client/tmp ^cms/corpus_module/app-client +^cms/app-client/npm-debug.log ^.*\.DS_Store ^build/\.vagrant ^build/root diff -r faff38055a07 -r 8af5ed0521a2 cms/app-client/package.json --- a/cms/app-client/package.json Wed Jan 20 20:46:59 2016 +0100 +++ b/cms/app-client/package.json Wed Feb 03 00:40:35 2016 +0100 @@ -19,6 +19,7 @@ "author": "", "license": "MIT", "devDependencies": { + "bower": "^1.7.7", "broccoli-asset-rev": "^2.1.2", "ember-cli": "1.13.8", "ember-cli-app-version": "0.5.0", diff -r faff38055a07 -r 8af5ed0521a2 server/src/app/Console/Commands/ImportCocoonRDF.php --- a/server/src/app/Console/Commands/ImportCocoonRDF.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/app/Console/Commands/ImportCocoonRDF.php Wed Feb 03 00:40:35 2016 +0100 @@ -205,7 +205,7 @@ $sourceGraph = $mappedGraph; } elseif ($docType == "http://purl.org/dc/dcmitype/Text") { - $merger = new \CorpusParole\Libraries\Mergers\CocoonSoundRdfMerger(); + $merger = new \CorpusParole\Libraries\Mergers\CocoonTextdRdfMerger(); $baseGraph = $resDocs; $sourceGraph = $mappedGraph; } diff -r faff38055a07 -r 8af5ed0521a2 server/src/app/Libraries/Mergers/CocoonSoundRdfMerger.php --- a/server/src/app/Libraries/Mergers/CocoonSoundRdfMerger.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/app/Libraries/Mergers/CocoonSoundRdfMerger.php Wed Feb 03 00:40:35 2016 +0100 @@ -127,9 +127,23 @@ "http://purl.org/dc/terms/available", "http://purl.org/dc/terms/created", "http://purl.org/dc/terms/issued", - "http://purl.org/dc/terms/modified" ], $targetArray, $baseRes, $srcRes); + // Must handle modified + $isBaseText = false; + foreach ($baseRes->all("dc11:type","resource") as $resType) { + $type = $resType->getUri(); + if($type === 'http://purl.org/dc/dcmitype/Text') { + $isBaseText = true; + break; + } + } + if($isBaseText) { + // The base is Text. In this case for http://purl.org/dc/terms/mofified, + // the sound takes over. So we switch baseRes with srcRes in the arguments + $this->mergeProperties([], ["http://purl.org/dc/terms/mofified"], $targetArray, $srcRes, $baseRes); + } + } protected function mergeEdmWebResources($baseRes, $srcRes, $uri=null) { diff -r faff38055a07 -r 8af5ed0521a2 server/src/app/Libraries/Mergers/CocoonTextRdfMerger.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/app/Libraries/Mergers/CocoonTextRdfMerger.php Wed Feb 03 00:40:35 2016 +0100 @@ -0,0 +1,109 @@ + . +// @prefix edm: . +// @prefix dc: . +// @prefix dc11: . +// @prefix olac: . +// @prefix geo: . +// @prefix xsd: . +// @prefix skos: . +// @prefix owl: . +// +// +// a ore:Aggregation ; +// edm:aggregatedCHO ; +// edm:provider "Corpus de la Parole"@fr ; +// edm:dataProvider ; +// edm:isShownAt ; +// edm:isShownBy ; +// edm:rights ; +// edm:hasView , . +// +// +// a edm:ProvidedCHO ; +// dc:tableOfContents "01 née; famille a toujours habité Orléans03 oui, on y a des amis, relations04 oui, certainementT1 centralisait comptabilité dans une industrieT2 RR passer des écritures, caisse; horaires avant et après loi de 1936T3 aimait travail, rien ne lui déplaisaitT4 n'a jamais pensé à çaT5 actuellement on est forcée quelquefois - assurance sociale - retraite appréciable; autre chose avec enfantL1 concerts, théâtre, réunions, etc...:préfère s'occuperL2 messe, puis a passé la journée avec une amieL3 (quand elle travaillait) au bord de la mer ou voyages organisésE1 n'en sait rienE2 lui semble que ça aide le françaisE3 peut-être chimie, physiqueE4 intelligence, travail, familleE5 dépend de leurs capacitésE6 non : dépend de la vie de l'enfant plus tardP1 oui, à part loyers chersP4 ne comprend pas motifs des étudiants; très calme à OrléansP9 moins qu'avant 1940P10 RR bourgeois = gros rentiers, femmes d'officierss, gros industriels; chaque groupe se recevait mutuellement, formait un clanQ. Orléans une ville renfermée? oui : orléanais assez distant, peut-être moins maintenantP6 il faut avoir la moitié des votesP7 des candidats se retirentP8 droite gaulliste, réservée; gauche avancéeP5 pas grand-chose - attachés à leurs partisP11 oui, maintenant, par l'éducation; famille moins importanteP12 à diminuer : les gens travaillent beaucoup plus et l'argent a changé de mainsOmelette (je casse mes oeufs...)Questionnaire sociolinguistique"@fr ; +// dc11:description "Extrait du corpus d'Orléans, réalisé dans le cadre de l'Enquête SocioLinguistique à Orléans à la fin des années 1960."@fr ; +// dc11:language ; +// dc11:publisher ; +// dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ; +// dc11:type , "primary_text"^^olac:linguistic-type, "dialogue"^^olac:discourse-type ; +// dc:license ; +// dc11:subject , "text_and_corpus_linguistics"^^olac:linguistic-field, , , , , , , , ; +// dc11:title "ESLO1: entretien 019"@fr ; +// dc:accessRights "Freely available for non-commercial use" ; +// dc:extent "PT0H47M16S" ; +// dc:isPartOf , ; +// dc11:source ; +// dc:medium "1 bande magnétique audio"@fr ; +// dc:alternative "ESLO1: entretien 019 alt"@fr ; +// dc:bibliographicCitation "A.-M. VURPAS (1988), Autrefois dans les monts du Beaujolais, Action graphique." ; +// dc11:identifier "Cote producteur: 001_3"@fr ; +// dc:references ; +// dc11:coverage "Quartier concerné : Montreuil"@fr ; +// dc11:relation ; +// dc11:creator "Blanc, Michel", "Biggs, Patricia" ; +// olac:depositor ; +// dc11:contributor , , , "Kay, Jack", "JK", "UG393" ; +// olac:editor , ; +// olac:researcher "Kay, Jack" ; +// olac:speaker "JK", "UG393" ; +// dc:available "2014-11-06"^^dc:W3CDTF ; +// dc:created "1969-04-11"^^dc:W3CDTF ; +// dc:issued "2014-12-05T15:00:19+01:00"^^dc:W3CDTF ; +// dc:modified "2014-12-05T15:00:19+01:00"^^dc:W3CDTF ; +// dc:spatial [ +// a edm:Place ; +// geo:lat "47.90"^^xsd:float ; +// geo:long "1.90"^^xsd:float ; +// skos:note "FR"^^dc:ISO3166, "France, Centre, Loiret, Orléans"@fr ; +// owl:sameAs +// ] . +// +// +// a edm:WebResources ; +// dc:extent "PT0H47M16S" ; +// dc11:format "audio/x-wav"^^dc:IMT ; +// dc:created "1969-04-11"^^dc:W3CDTF ; +// dc:issued "2014-12-05T15:00:19+01:00"^^dc:W3CDTF . +// +// +// a edm:WebResources ; +// dc:extent "PT0H47M16S" ; +// dc11:format "audio/x-wav"^^dc:IMT ; +// edm:isDerivativeOf ; +// dc:created "1969-04-11"^^dc:W3CDTF ; +// dc:issued "2014-12-05T15:00:19+01:00"^^dc:W3CDTF . +// +// +// a edm:WebResources ; +// dc:extent "PT0H47M16S" ; +// dc11:format "audio/mpeg"^^dc:IMT ; +// edm:isDerivativeOf ; +// dc:created "1969-04-11"^^dc:W3CDTF ; +// dc:issued "2014-12-05T15:00:19+01:00"^^dc:W3CDTF . + +class CocoonTextRdfMerger extends CocoonSoundRdfMerger { + + + protected function mergeEdmProvidedCHO($baseRes, $srcRes, $uri=null) { + if(is_null($uri)) { + $uri = $baseRes->getUri(); + } + $targetArray =& $this->mergedArray[$uri]; + + $this->mergeProperties([ + "http://purl.org/dc/terms/spatial" + ], [ + "http://purl.org/dc/elements/1.1/title", + "http://purl.org/dc/terms/extent", + "http://purl.org/dc/terms/available", + "http://purl.org/dc/terms/created", + "http://purl.org/dc/terms/issued", + "http://purl.org/dc/terms/modified", + ], $targetArray, $baseRes, $srcRes); + + } +} diff -r faff38055a07 -r 8af5ed0521a2 server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php --- a/server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php Wed Feb 03 00:40:35 2016 +0100 @@ -95,7 +95,7 @@ */ public function testUri() { - echo $this->resGraphes['BASE']->serialise('turtle'); + //echo $this->resGraphes['BASE']->serialise('turtle'); //echo var_export($this->resGraphes['BASE']->toRdfPhp()); $this->assertNotNull($this->resGraphes['BASE']); diff -r faff38055a07 -r 8af5ed0521a2 server/src/tests/libraries/Mappers/CocoonSoundRdfMapperTest.php --- a/server/src/tests/libraries/Mappers/CocoonSoundRdfMapperTest.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/tests/libraries/Mappers/CocoonSoundRdfMapperTest.php Wed Feb 03 00:40:35 2016 +0100 @@ -155,7 +155,7 @@ */ public function testUri() { - echo $this->resGraphes['BASE']->serialise('turtle'); + //echo $this->resGraphes['BASE']->serialise('turtle'); //echo var_export($this->resGraphes['BASE']->toRdfPhp()); $this->assertNotNull($this->resGraphes['BASE']); diff -r faff38055a07 -r 8af5ed0521a2 server/src/tests/libraries/Mappers/CocoonTextRdfMapperTest.php --- a/server/src/tests/libraries/Mappers/CocoonTextRdfMapperTest.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/tests/libraries/Mappers/CocoonTextRdfMapperTest.php Wed Feb 03 00:40:35 2016 +0100 @@ -94,7 +94,7 @@ */ public function testUri() { - echo $this->resGraphes['BASE']->serialise('turtle'); + //echo $this->resGraphes['BASE']->serialise('turtle'); //echo var_export($this->resGraphes['BASE']->toRdfPhp()); $this->assertNotNull($this->resGraphes['BASE']); diff -r faff38055a07 -r 8af5ed0521a2 server/src/tests/libraries/Mergers/CocoonCollectionRdfMergerTest.php --- a/server/src/tests/libraries/Mergers/CocoonCollectionRdfMergerTest.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/tests/libraries/Mergers/CocoonCollectionRdfMergerTest.php Wed Feb 03 00:40:35 2016 +0100 @@ -121,7 +121,7 @@ public function testInit() { $this->assertTrue(true); - echo $this->resGraph->serialise('turtle'); + //echo $this->resGraph->serialise('turtle'); } /** diff -r faff38055a07 -r 8af5ed0521a2 server/src/tests/libraries/Mergers/CocoonSoundRdfMergerTest.php --- a/server/src/tests/libraries/Mergers/CocoonSoundRdfMergerTest.php Wed Jan 20 20:46:59 2016 +0100 +++ b/server/src/tests/libraries/Mergers/CocoonSoundRdfMergerTest.php Wed Feb 03 00:40:35 2016 +0100 @@ -190,7 +190,7 @@ public function testInit() { $this->assertTrue(true); - echo $this->resGraph->serialise('turtle'); + //echo $this->resGraph->serialise('turtle'); } /** diff -r faff38055a07 -r 8af5ed0521a2 server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php Wed Feb 03 00:40:35 2016 +0100 @@ -0,0 +1,365 @@ + << . + @prefix edm: . + @prefix dc11: . + @prefix olac: . + @prefix dc: . + @prefix geo: . + @prefix xsd: . + @prefix skos: . + @prefix owl: . + + + a ore:Aggregation ; + edm:aggregatedCHO ; + edm:provider "Corpus de la Parole"@fr ; + edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ; + edm:isShownAt ; + edm:isShownBy ; + edm:rights ; + edm:hasView , . + + + a edm:ProvidedCHO ; + 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 ; + dc11:language ; + dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ; + dc11:rights "Copyright (c) Moyse-Faurie, Claire" ; + dc11:type , "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, ; + dc:license ; + dc11:subject , , ; + dc11:title "The two hermit crabs and the coconut crab"@en ; + dc:accessRights "Freely available for non-commercial use" ; + dc:extent "PT2M35S" ; + edm:isGatheredInto , ; + olac:depositor ; + dc11:contributor , "Idakote, Félicien" ; + olac:researcher ; + olac:speaker "Idakote, Félicien" ; + dc:available "2010-10-23"^^dc:W3CDTF ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ; + dc:modified "2012-03-25"^^dc:W3CDTF ; + dc:spatial [ + a edm:Place ; + geo:lat "-20.46667"^^xsd:float ; + geo:long "166.65"^^xsd:float ; + skos:note "NC"^^dc:ISO3166, "New Caledonia, Ohnyat (Ouvéa)" ; + owl:sameAs + ] . + + + a edm:WebResources ; + dc:extent "PT2M35S" ; + dc11:format "audio/x-wav"^^dc:IMT ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF . + + + a edm:WebResources ; + dc:extent "PT2M35S" ; + dc11:format "audio/x-wav"^^dc:IMT ; + edm:isDerivativeOf ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF . + + + a edm:WebResources ; + dc:extent "PT2M35S" ; + dc11:format "audio/mpeg"^^dc:IMT ; + edm:isDerivativeOf ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF . +EOT + , + 'SOUND_NO_MOD' => << . + @prefix edm: . + @prefix dc11: . + @prefix olac: . + @prefix dc: . + @prefix geo: . + @prefix xsd: . + @prefix skos: . + @prefix owl: . + + + a ore:Aggregation ; + edm:aggregatedCHO ; + edm:provider "Corpus de la Parole"@fr ; + edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ; + edm:isShownAt ; + edm:isShownBy ; + edm:rights ; + edm:hasView , . + + + a edm:ProvidedCHO ; + 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 ; + dc11:language ; + dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ; + dc11:rights "Copyright (c) Moyse-Faurie, Claire" ; + dc11:type , "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, ; + dc:license ; + dc11:subject , , ; + dc11:title "The two hermit crabs and the coconut crab"@en ; + dc:accessRights "Freely available for non-commercial use" ; + dc:extent "PT2M35S" ; + edm:isGatheredInto , ; + olac:depositor ; + dc11:contributor , "Idakote, Félicien" ; + olac:researcher ; + olac:speaker "Idakote, Félicien" ; + dc:available "2010-10-23"^^dc:W3CDTF ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ; + dc:spatial [ + a edm:Place ; + geo:lat "-20.46667"^^xsd:float ; + geo:long "166.65"^^xsd:float ; + skos:note "NC"^^dc:ISO3166, "New Caledonia, Ohnyat (Ouvéa)" ; + owl:sameAs + ] . + + + a edm:WebResources ; + dc:extent "PT2M35S" ; + dc11:format "audio/x-wav"^^dc:IMT ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF . + + + a edm:WebResources ; + dc:extent "PT2M35S" ; + dc11:format "audio/x-wav"^^dc:IMT ; + edm:isDerivativeOf ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF . + + + a edm:WebResources ; + dc:extent "PT2M35S" ; + dc11:format "audio/mpeg"^^dc:IMT ; + edm:isDerivativeOf ; + dc:created "1997-08-29"^^dc:W3CDTF ; + dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF . +EOT + , + 'TEXT' => << . + @prefix edm: . + @prefix dc11: . + @prefix olac: . + @prefix dc: . + @prefix skos: . + + + a ore:Aggregation ; + edm:aggregatedCHO ; + edm:provider "Corpus de la Parole"@fr ; + edm:dataProvider ; + edm:isShownAt ; + edm:isShownBy ; + edm:rights ; + edm:hasView , . + + + a edm:ProvidedCHO ; + 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 ; + dc11:language ; + dc11:publisher ; + dc11:rights "Copyright (c) Moyse-Faurie, Claire" ; + dc11:type "primary_text"^^olac:linguistic-type, , "narrative"^^olac:discourse-type ; + dc:license ; + dc11:subject ; + dc11:title "The two hermit crabs and the coconut crab"@en ; + dc:accessRights "Freely available for non-commercial use" ; + edm:isGatheredInto , ; + dc:alternative "Les deux bernard-l'hermite et le crabe de cocotier"@fr ; + olac:depositor ; + dc11:contributor , "Moyse-Faurie, Claire", "Idakote, Félicien" ; + olac:researcher "Moyse-Faurie, Claire" ; + olac:speaker "Idakote, Félicien" ; + dc:available "2011-02-05"^^dc:W3CDTF ; + dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ; + dc:modified "2002-02-20"^^dc:W3CDTF ; + dc:spatial [ + a edm:Place ; + skos:note "NC"^^dc:ISO3166, "New Caledonia, Ohnyat (Ouvéa)" + ] . + + + a edm:WebResources ; + dc11:format "application/xml"^^dc:IMT ; + dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF . + + + a edm:WebResources ; + dc11:format "application/xhtml+xml"^^dc:IMT ; + dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF . +EOT + ]; + + + private $inputGraphes = []; + private $resGraph = []; + + function __construct(string $name = null) { + parent::__construct($name); + } + + public function setUp() { + parent::setUp(); + + foreach(CocoonTextRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) { + $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", $inputDoc); + } + + $merger = new CocoonTextRdfMerger(); + $this->resGraph['SOUND_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND'], $this->inputGraphes['TEXT']); + $merger = new CocoonSoundRdfMerger(); + $this->resGraph['TEXT_SOUND'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND']); + $merger = new CocoonTextRdfMerger(); + $this->resGraph['SOUND_NO_MOD_TEXT'] = $merger->mergeGraph($this->inputGraphes['SOUND_NO_MOD'], $this->inputGraphes['TEXT']); + $merger = new CocoonSoundRdfMerger(); + $this->resGraph['TEXT_SOUND_NO_MOD'] = $merger->mergeGraph($this->inputGraphes['TEXT'], $this->inputGraphes['SOUND_NO_MOD']); + } + + public function tearDown() { + parent::tearDown(); + } + + /** + * Just test that the construct and setup are ok + * + * @return void + */ + public function testInit() + { + $this->assertTrue(true); + //echo $this->resGraph->serialise('turtle'); + } + + /** + * Test merge modified merge TEXT into SOUND + * + * @return void + */ + public function testModifiedSoundText() { + + $resGraph = $this->resGraph["SOUND_TEXT"]; + + $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type'); + $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type'); + $this->assertNotNull($providedCHO); + $this->assertNotNull($baseNode); + + $outputValuesStr = []; + foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) { + array_push($outputValuesStr, strval($outputValue)); + } + $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified"); + foreach ($baseNode->all($this->inputGraphes['SOUND']->resource("http://purl.org/dc/terms/modified")) as $value) { + $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph"); + } + + } + + /** + * Test one to one mapping + * + * @return void + */ + public function testModifiedTextSound() { + + $resGraph = $this->resGraph["TEXT_SOUND"]; + + $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type'); + $baseNode = $this->inputGraphes['SOUND']->get('edm:ProvidedCHO', '^rdf:type'); + $this->assertNotNull($providedCHO); + $this->assertNotNull($baseNode); + + $outputValuesStr = []; + foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) { + array_push($outputValuesStr, strval($outputValue)); + } + $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified"); + foreach ($baseNode->all($this->inputGraphes['SOUND']->resource("http://purl.org/dc/terms/modified")) as $value) { + $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph"); + } + + } + + /** + * Test one to one mapping + * + * @return void + */ + public function testSoundNoModifiedText() { + + $resGraph = $this->resGraph["SOUND_NO_MOD_TEXT"]; + + $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type'); + $baseNode = $this->inputGraphes['TEXT']->get('edm:ProvidedCHO', '^rdf:type'); + $this->assertNotNull($providedCHO); + $this->assertNotNull($baseNode); + + $outputValuesStr = []; + foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) { + array_push($outputValuesStr, strval($outputValue)); + } + $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified"); + // must contain the TEXT modified value (since SOUND has none) + foreach ($baseNode->all($this->inputGraphes['TEXT']->resource("http://purl.org/dc/terms/modified")) as $value) { + $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph"); + } + + } + + + /** + * Test one to one mapping + * + * @return void + */ + public function testTextSoundNoModified() { + + $resGraph = $this->resGraph["TEXT_SOUND_NO_MOD"]; + + $providedCHO = $resGraph->get('edm:ProvidedCHO', '^rdf:type'); + $baseNode = $this->inputGraphes['TEXT']->get('edm:ProvidedCHO', '^rdf:type'); + $this->assertNotNull($providedCHO); + $this->assertNotNull($baseNode); + + $outputValuesStr = []; + foreach($providedCHO->all($resGraph->resource("http://purl.org/dc/terms/modified")) as $outputValue) { + array_push($outputValuesStr, strval($outputValue)); + } + $this->assertNotEmpty($outputValuesStr, "we must found some values to test http://purl.org/dc/terms/modified"); + // must contain the TEXT modified value (since SOUND has none) + foreach ($baseNode->all($this->inputGraphes['TEXT']->resource("http://purl.org/dc/terms/modified")) as $value) { + $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/modified not found in output graph"); + } + + } + + +}