--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Mappers/CocoonCollectionRdfMapperTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,237 @@
+<?php
+
+use CorpusParole\Libraries\Mappers\CocoonCollectionRdfMapper;
+use CorpusParole\Libraries\CocoonUtils;
+
+use EasyRdf\Graph;
+use EasyRdf\Resource;
+use EasyRdf\Literal;
+
+use Illuminate\Foundation\Testing\WithoutMiddleware;
+use Illuminate\Foundation\Testing\DatabaseMigrations;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
+
+class CocoonCollectionRdfMapperTest extends TestCase
+{
+
+ const TEST_INPUT_DOCS = [
+ 'BASE' => <<<EOT
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
+ @prefix v: <http://rdf.data-vocabulary.org/#> .
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
+ <http://purl.org/dc/elements/1.1/description> "Corpus de Français Parlé Parisien des années 2000."@fr , "Le Corpus de Français Parlé Parisien (CFPP2000) est composé d'un ensemble d'interviews non directives sur les quartiers de Paris et de la proche banlieue. Les entretiens, transcrits en orthographe et alignés au tour de parole, sont disponibles sur le net ; ils sont librement employables en échange de la mention dans la bibliographie des travaux qui en seraient tirés d'une part de l'adresse du site: http://cfpp2000.univ-paris3.fr/ et d'autre part du document de présentation suivant : Branca-Rosoff S., Fleury S., Lefeuvre F., Pires M., 2012, \"Discours sur la ville. Présentation du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)\". En février 2013, ce corpus comprenait environ 550 000 mots. Un certain nombre d'outils en ligne, notamment un concordancier et des outils textométriques permettent de mener des requêtes lexicales et grammaticales. CFPP2000 est particulièrement destiné à des analyses sur le français oral. Le projet sous-jacent au corpus est par ailleurs l'étude des modifications et des variations qui interviennent dans ce qu'on peut considérer comme un parisien véhiculaire en tension entre le pôle du standard et le pôle du vernaculaire. Par ailleurs, il comporte des activités linguistiques diversifiées (description de quartier, anecdotes, argumentationâ¦) et on peut par conséquent travailler sur la syntaxe propre à ces différentes utilisations du langage. Il permet enfin d'opposer dialogues (entre enquêteur et enquêtés) et multilogues (où la présence de plusieurs enquêtés favorise le passage à un registre familier). CFPP2000 est constitué d'interviews longues (d'une heure en moyenne) intégralement transcrites. Il est donc utilisable pour examiner les singularités qui reviennent à l'idiolecte propre à une personne donnée, par opposition aux variantes diffusées dans des groupes plus larges (quartiers, groupes socio-culturels, classe d'âge, etc.). Le corpus constitue enfin un ensemble de témoignages intéressants sur les représentations de Paris et de sa proche banlieue qui est susceptible d'intéresser des analystes du discours, des sociologues, ou tout simplement des curieux de la ville."@fr ;
+ <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Collection> ;
+ <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/fra> ;
+ <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/gsw> ;
+ <http://purl.org/dc/terms/created> "start=1988; end=1989"^^<http://purl.org/dc/terms/Period> ;
+ <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ;
+ <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/93752300> ;
+ <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/142432638> , "Fédération CLESTHIA" , <http://viaf.org/viaf/154862993> ;
+ <http://purl.org/dc/elements/1.1/title> "Corpus de Français Parlé Parisien des années 2000 (CFPP)"@fr ;
+ <http://www.language-archives.org/OLAC/1.1/interviewer> "Branca-Rosoff, Sonia" , "Lefeuvre, Florence" , "Pires, Mat" ;
+ <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ;
+ <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ <http://purl.org/dc/terms/spatial> "FR"^^<http://purl.org/dc/terms/ISO3166> , "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr , <http://vocab.getty.edu/tgn/7008038> ;
+ <http://purl.org/dc/terms/available> "2013-04-12"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/issued> "2013-04-12T22:20:23+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/modified> "2014-05-10T20:16:27+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://www.language-archives.org/OLAC/1.1/transcriber> "Branca-Rosoff, Sonia" , "Lefeuvre, Florence" , "Pires, Mat" ;
+ <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.3333"^^xsd:float ;
+ <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "48.8667"^^xsd:float ;
+ <http://www.language-archives.org/OLAC/1.1/compiler> "Branca-Rosoff, Sonia" , "Fleury, Serge" , "Lefeuvre, Florence" , "Pires, Mat" ;
+ <http://www.language-archives.org/OLAC/1.1/data_inputter> "Branca-Rosoff, Sonia" , "Lefeuvre, Florence" , "Pires, Mat" ;
+ <http://www.language-archives.org/OLAC/1.1/researcher> "Branca-Rosoff, Sonia" , "Fleury, Serge" , "Lefeuvre, Florence" , "Pires, Mat" ;
+ <http://www.language-archives.org/OLAC/1.1/sponsor> "Ville de Paris " , "Délégation générale à la langue française et aux langues de France " ;
+ <http://www.language-archives.org/OLAC/1.1/developer> "Fleury, Serge" ;
+ <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ALA> .
+EOT
+ ];
+
+ const TEST_INPUT_ID = "crdo-COLLECTION_CFPP2000";
+
+ private $inputGraphes = [];
+ private $resGraphes = [];
+ private $mappers = [];
+
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ public function setUp() {
+ parent::setUp();
+
+ $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonCollectionRdfMapperTest::TEST_INPUT_ID;
+
+ foreach(CocoonCollectionRdfMapperTest::TEST_INPUT_DOCS as $key => $inputDoc) {
+ $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000", $inputDoc);
+ $this->mappers[$key] = new CocoonCollectionRdfMapper($this->inputGraphes[$key]);
+ $this->mappers[$key]->mapGraph();
+ $this->resGraphes[$key] = $this->mappers[$key]->getOutputGraphes()[$this->inputGraphes[$key]->getUri()];
+ }
+ }
+
+ public function tearDown() {
+ parent::tearDown();
+ }
+
+ /**
+ * Just test that the construct and setup are ok
+ *
+ * @return void
+ */
+ public function testInit()
+ {
+ $this->assertTrue(true);
+ }
+
+ /**
+ * Test that the returned graph has the same uri that the original.
+ *
+ * @return void
+ */
+ public function testUri() {
+
+ //echo $this->resGraphes['BASE']->serialise('turtle');
+ //echo var_export($this->resGraphes['BASE']->toRdfPhp());
+
+ $this->assertNotNull($this->resGraphes['BASE']);
+ $this->assertEquals($this->testGraphUri, $this->resGraphes['BASE']->getUri(), "URIS must be translated");
+ }
+
+ /**
+ * Test that the return graph has one edm:Collection resource
+ *
+ * @return void
+ */
+ public function testAggregationResource() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:Collection');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type edm:Collection");
+ $this->assertEquals($this->testGraphUri,$resources[0]);
+ }
+
+ /**
+ * Test one to one mapping spatial info
+ *
+ * @return void
+ */
+ public function testSpatial() {
+
+ $coll = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($coll);
+ $this->assertNotNull($sourceNode);
+
+ $spatials = $coll->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/spatial'));
+
+ $this->assertCount(1, $spatials, "Must have only one spatial node");
+ $spatial = $spatials[0];
+ $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
+ $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
+
+ $lats = $spatial->all('geo:lat');
+ $this->assertCount(1, $lats, "One latitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
+ $this->assertEquals(Literal::create("48.8667", null, 'xsd:float'), $lats[0], "lat must be '48.8667'^^xsd:float");
+
+ $longs = $spatial->all('geo:long');
+ $this->assertCount(1, $longs, "One longitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
+ $this->assertEquals(Literal::create("2.3333", null, 'xsd:float'), $longs[0], "long must be '1.90'^^xsd:float");
+
+ $notes = $spatial->all('skos:note');
+ $this->assertCount(2, $notes, "2 notes");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
+ $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
+ $this->assertEquals(Literal::create("France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier", "fr", null), $notes[1], "notes contains 'France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier'@fr");
+
+ $sameas = $spatial->all('owl:sameAs');
+ $this->assertCount(1, $sameas, "1 same as");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
+ $this->assertEquals('http://vocab.getty.edu/tgn/7008038', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008038");
+ }
+
+ /**
+ * Test one to one mapping
+ *
+ * @return void
+ */
+ public function testOneToOnePropsIdentity() {
+
+ $properties = [
+ 'http://purl.org/dc/elements/1.1/description',
+ 'http://purl.org/dc/elements/1.1/language',
+ 'http://purl.org/dc/elements/1.1/publisher',
+ 'http://purl.org/dc/elements/1.1/rights',
+ 'http://purl.org/dc/terms/license',
+ 'http://purl.org/dc/elements/1.1/subject',
+ 'http://purl.org/dc/elements/1.1/title',
+ 'http://purl.org/dc/terms/available',
+ 'http://purl.org/dc/terms/created',
+ 'http://purl.org/dc/terms/issued',
+ 'http://purl.org/dc/elements/1.1/type',
+ 'http://purl.org/dc/elements/1.1/language',
+ 'http://purl.org/dc/terms/modified',
+ ];
+
+ $coll = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($coll);
+ $this->assertNotNull($sourceNode);
+
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($coll->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+
+ }
+
+ public function testLinkToCocoonCollection() {
+ $coll = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($coll);
+ $this->assertNotNull($sourceNode);
+
+ $versionOfRes = $coll->all("<http://purl.org/dc/terms/isVersionOf>");
+ $this->assertCount(1, $versionOfRes, "Must have only on isVersionOf");
+ $versionOfRes = $versionOfRes[0];
+ $this->assertInstanceOf("EasyRdf\Resource", $versionOfRes, "version Res must be a resource");
+ $this->assertEquals($sourceNode->getUri(), $versionOfRes->getUri(), "versionof res uri must be sams than source");
+
+ }
+
+ /**
+ * Test mapping for isPartOf
+ *
+ * @return void
+ */
+ public function testOneToOneCollectionIsPartOf() {
+ $collection = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($collection);
+ $this->assertNotNull($sourceNode);
+
+ $ispartOf = $collection->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>');
+ $this->assertCount(1, $ispartOf, "Must have one collection node");
+
+ $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ALA", strval($collection->get('<http://www.europeana.eu/schemas/edm/isGatheredInto>')), "the isPartOf mus equals ".config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ALA");
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Mappers/CocoonSoundRdfMapperTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,581 @@
+<?php
+
+use CorpusParole\Libraries\Mappers\CocoonSoundRdfMapper;
+use CorpusParole\Libraries\CocoonUtils;
+
+use EasyRdf\Graph;
+use EasyRdf\Resource;
+use EasyRdf\Literal;
+
+use Illuminate\Foundation\Testing\WithoutMiddleware;
+use Illuminate\Foundation\Testing\DatabaseMigrations;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
+
+class CocoonSoundRdfMapperTest extends TestCase
+{
+
+ const TEST_INPUT_DOCS = [
+ 'BASE' => <<<EOT
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
+ @prefix v: <http://rdf.data-vocabulary.org/#> .
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
+ <http://purl.org/dc/elements/1.1/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 ;
+ <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Sound> , "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
+ <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/fra> , "text_and_corpus_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb135052099> , <http://ark.bnf.fr/ark:/12148/cb11943508j> , <http://ark.bnf.fr/ark:/12148/cb11934124q> , <http://ark.bnf.fr/ark:/12148/cb11931498c> , <http://ark.bnf.fr/ark:/12148/cb11935508t> , <http://ark.bnf.fr/ark:/12148/cb11934132b> , <http://ark.bnf.fr/ark:/12148/cb11939893p> , <http://ark.bnf.fr/ark:/12148/cb11933091b> ;
+ <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/fra> ;
+ <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/181558906> ;
+ <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/181558906> ;
+ <http://purl.org/dc/elements/1.1/rights> "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ <http://purl.org/dc/elements/1.1/title> "ESLO1: entretien 019"@fr ;
+ <http://purl.org/dc/terms/alternative> "ESLO1: entretien 019 alt"@fr ;
+ <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> ;
+ <http://purl.org/dc/terms/accessRights> " Freely available for non-commercial use" ;
+ <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ <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> ;
+ <http://purl.org/dc/terms/extent> "PT0H47M16S" ;
+ <http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <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 ;
+ <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav> ;
+ <http://purl.org/dc/terms/available> "2014-11-06"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/modified> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://www.language-archives.org/OLAC/1.1/speaker> "JK" , "UG393" ;
+ <http://purl.org/dc/elements/1.1/source> <http://archivesetmanuscrits.bnf.fr/ead.html?id=FRBNFEAD000095934&c=FRBNFEAD000095934_a19844296> ;
+ <http://www.w3.org/2003/01/geo/wgs84_pos#long> "1.90"^^xsd:float ;
+ <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "47.90"^^xsd:float ;
+ <http://purl.org/dc/terms/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 ;
+ <http://purl.org/dc/terms/isRequiredBy> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_C> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_A> ;
+ <http://www.language-archives.org/OLAC/1.1/editor> <http://viaf.org/viaf/39685504> , <http://viaf.org/viaf/200058210> ;
+ <http://purl.org/dc/terms/abstract> " Identifiant du témoin : UG 393 Femme, 72 ans (né en 1897, à Orléans ) ; comptable en retraite Enregistré par Jack Kay, le 11 avril 1969, au domicile du témoin. Questionnaires enregistrés : questionnaire sociolinguistique; questionnaire ouvert(questions 01 ; 03-04 ; T1-T5 ; L1-L3 ; E1-E6 ; P1 ; P4 ; P9-P10 ; P6-P8 ; P5 ; P11-P12 ; omelette). Classe politique du témoin : Centre Remarques sur le témoignage : réponses concises. Intérêt pédagogique : conditions de travail avant la guerre de 1940 ; classes sociales. Acoustique : bonne qualité d'enregistrement."@fr ;
+ <http://www.language-archives.org/OLAC/1.1/researcher> "Kay, Jack" ;
+ <http://purl.org/dc/elements/1.1/relation> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENTCONT_233> ;
+ <http://purl.org/dc/terms/medium> "1 bande magnétique audio"@fr ;
+ <http://purl.org/dc/terms/bibliographicCitation> "A.-M. VURPAS (1988), Autrefois dans les monts du Beaujolais, Action graphique.";
+ <http://purl.org/dc/elements/1.1/identifier> "Cote producteur: 001_3"@fr ;
+ <http://purl.org/dc/elements/1.1/reference> <http://panini.u-paris10.fr> ;
+ <http://purl.org/dc/elements/1.1/coverage> "Quartier concerné : 3e"@fr ;
+ <http://purl.org/dc/elements/1.1/creator> "Blanc, Michel" , "Biggs, Patricia" .
+EOT
+ ,
+ 'NO-FORMAT' => <<<EOT
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
+ @prefix v: <http://rdf.data-vocabulary.org/#> .
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
+ <http://purl.org/dc/elements/1.1/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 ;
+ <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Sound> , "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
+ <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/fra> , "text_and_corpus_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb135052099> , <http://ark.bnf.fr/ark:/12148/cb11943508j> , <http://ark.bnf.fr/ark:/12148/cb11934124q> , <http://ark.bnf.fr/ark:/12148/cb11931498c> , <http://ark.bnf.fr/ark:/12148/cb11935508t> , <http://ark.bnf.fr/ark:/12148/cb11934132b> , <http://ark.bnf.fr/ark:/12148/cb11939893p> , <http://ark.bnf.fr/ark:/12148/cb11933091b> ;
+ <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/fra> ;
+ <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/181558906> ;
+ <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/181558906> ;
+ <http://purl.org/dc/elements/1.1/rights> "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ <http://purl.org/dc/elements/1.1/title> "ESLO1: entretien 019"@fr ;
+ <http://purl.org/dc/terms/alternative> "ESLO1: entretien 019 alt"@fr ;
+ <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> ;
+ <http://purl.org/dc/terms/accessRights> " Freely available for non-commercial use" ;
+ <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ <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/dc/terms/extent> "PT0H47M16S" ;
+ <http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <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 ;
+ <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav> ;
+ <http://purl.org/dc/terms/available> "2014-11-06"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/modified> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://www.language-archives.org/OLAC/1.1/speaker> "JK" , "UG393" ;
+ <http://purl.org/dc/elements/1.1/source> <http://archivesetmanuscrits.bnf.fr/ead.html?id=FRBNFEAD000095934&c=FRBNFEAD000095934_a19844296> ;
+ <http://www.w3.org/2003/01/geo/wgs84_pos#long> "1.90"^^xsd:float ;
+ <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "47.90"^^xsd:float ;
+ <http://purl.org/dc/terms/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 ;
+ <http://purl.org/dc/terms/isRequiredBy> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_C> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_A> ;
+ <http://www.language-archives.org/OLAC/1.1/editor> <http://viaf.org/viaf/39685504> , <http://viaf.org/viaf/200058210> ;
+ <http://purl.org/dc/terms/abstract> " Identifiant du témoin : UG 393 Femme, 72 ans (né en 1897, à Orléans ) ; comptable en retraite Enregistré par Jack Kay, le 11 avril 1969, au domicile du témoin. Questionnaires enregistrés : questionnaire sociolinguistique; questionnaire ouvert(questions 01 ; 03-04 ; T1-T5 ; L1-L3 ; E1-E6 ; P1 ; P4 ; P9-P10 ; P6-P8 ; P5 ; P11-P12 ; omelette). Classe politique du témoin : Centre Remarques sur le témoignage : réponses concises. Intérêt pédagogique : conditions de travail avant la guerre de 1940 ; classes sociales. Acoustique : bonne qualité d'enregistrement."@fr ;
+ <http://www.language-archives.org/OLAC/1.1/researcher> "Kay, Jack" ;
+ <http://purl.org/dc/elements/1.1/relation> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENTCONT_233> ;
+ <http://purl.org/dc/terms/medium> "1 bande magnétique audio"@fr ;
+ <http://purl.org/dc/terms/bibliographicCitation> "A.-M. VURPAS (1988), Autrefois dans les monts du Beaujolais, Action graphique.";
+ <http://purl.org/dc/elements/1.1/identifier> "Cote producteur: 001_3"@fr ;
+ <http://purl.org/dc/elements/1.1/reference> <http://panini.u-paris10.fr> ;
+ <http://purl.org/dc/elements/1.1/creator> "Blanc, Michel" , "Biggs, Patricia" .
+
+EOT
+ ];
+
+ const TEST_INPUT_ID = "crdo-ESLO1_ENT_019";
+ const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019";
+
+
+ private $inputGraphes = [];
+ private $resGraphes = [];
+ private $mappers = [];
+
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ public function setUp() {
+ parent::setUp();
+
+ $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonSoundRdfMapperTest::TEST_INPUT_ID;
+
+ foreach(CocoonSoundRdfMapperTest::TEST_INPUT_DOCS as $key => $inputDoc) {
+ $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019", $inputDoc);
+ $this->mappers[$key] = new CocoonSoundRdfMapper($this->inputGraphes[$key]);
+ $this->mappers[$key]->mapGraph();
+ $this->resGraphes[$key] = $this->mappers[$key]->getOutputGraphes()[$this->inputGraphes[$key]->getUri()];
+ }
+ }
+
+ public function tearDown() {
+ parent::tearDown();
+ }
+
+ /**
+ * Just test that the construct and setup are ok
+ *
+ * @return void
+ */
+ public function testInit()
+ {
+ $this->assertTrue(true);
+ }
+
+ /**
+ * Test that the returned graph has the same uri that the original.
+ *
+ * @return void
+ */
+ public function testUri() {
+
+ //echo $this->resGraphes['BASE']->serialise('turtle');
+ //echo var_export($this->resGraphes['BASE']->toRdfPhp());
+
+ $this->assertNotNull($this->resGraphes['BASE']);
+ $this->assertEquals($this->testGraphUri, $this->resGraphes['BASE']->getUri(), "URIS must be translated");
+ }
+
+ /**
+ * Test that the return graph has one ore:Aggregation resource
+ *
+ * @return void
+ */
+ public function testAggregationResource() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('ore:Aggregation');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type ore:Aggregation");
+ $this->assertEquals($this->testGraphUri,$resources[0]);
+ }
+
+ /**
+ * test that there one (and only one) edm:dateProvider and edm:provider property
+ *
+ * @return void
+ */
+ public function testProviders() {
+
+ $providers = $this->resGraphes['BASE']->all($this->testGraphUri,'edm:provider');
+
+ $this->assertCount(1,$providers, "one and only one edm provider");
+ $this->assertTrue($providers[0] instanceof Literal);
+ $this->assertEquals('Corpus de la Parole', $providers[0]->getValue(), 'provider must be Corpus de la Parole');
+ $this->assertEquals('fr', $providers[0]->getLang(), 'provider must be in french');
+
+ $dataProviders = $this->resGraphes['BASE']->all($this->testGraphUri,'edm:dataProvider');
+
+ $this->assertCount(1,$dataProviders, "one and only one edm data provider");
+ //TODO: to change after viaf resolution
+ $this->assertTrue($dataProviders[0] instanceof Resource);
+ $this->assertEquals('http://viaf.org/viaf/181558906', $dataProviders[0]->getUri(), 'dataProvider uri must be http://viaf.org/viaf/181558906');
+ }
+
+
+ /**
+ * test isShownAt and isShownBy
+ *
+ * @return void
+ */
+ public function testIsShown() {
+
+ $isShownAts = $this->resGraphes['BASE']->all($this->testGraphUri, 'edm:isShownAt');
+
+ $this->assertCount(1, $isShownAts, "One edm:isShownAt");
+ $this->assertInstanceOf("EasyRdf\Resource", $isShownAts[0]);
+ $this->assertEquals("http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-ESLO1_ENT_019", $isShownAts[0]);
+
+ $isShownBys = $this->resGraphes['BASE']->all($this->testGraphUri, 'edm:isShownBy');
+
+ $this->assertCount(1, $isShownBys, "One edm:isShownBy");
+ $this->assertInstanceOf("EasyRdf\Resource", $isShownBys[0]);
+ $this->assertEquals("http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav", $isShownBys[0]);
+
+ }
+
+ /**
+ * test rights
+ *
+ * @return void
+ */
+ public function testRights() {
+ $rightsNodes = $this->resGraphes['BASE']->all($this->testGraphUri, 'edm:rights');
+
+ $this->assertCount(1, $rightsNodes, "One edm:right");
+
+ $rights = $rightsNodes[0];
+
+ $this->assertTrue($rights instanceof Resource);
+
+ $this->assertEquals("http://creativecommons.org/licenses/by-nc-sa/4.0/", $rights->getUri(), "right must be CC-BY-NC");
+ }
+
+ /**
+ * Test that the return graph has one ore:Aggregation resource
+ *
+ * @return void
+ */
+ public function testProvidedCHO() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type edm:aggregatedCHO");
+ $this->assertEquals(CocoonSoundRdfMapperTest::TEST_CHO_URI,$resources[0]);
+ }
+
+ /**
+ * Test providedCHO identifier.
+ *
+ * @return void
+ */
+ public function testProvidedChoId() {
+ $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
+ $providedCHO = $resources[0];
+
+ $identifier = $providedCHO->getLiteral('<http://purl.org/dc/elements/1.1/identifier>');
+
+ $this->assertInstanceOf('EasyRdf\Literal', $identifier, "identifier value must be a literal");
+ $this->assertEquals(config('corpusparole.corpus_id_scheme') . CocoonSoundRdfMapperTest::TEST_INPUT_ID, $identifier->getValue(), "Value must be equals to ".config('corpusparole.corpus_id_scheme').CocoonSoundRdfMapperTest::TEST_INPUT_ID);
+
+ }
+
+
+ public function testRightsWebResourceIdentity() {
+ $properties = [
+ "http://purl.org/dc/elements/1.1/rights",
+ 'http://purl.org/dc/terms/license',
+ ];
+
+ $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ foreach ($webResourceList as $webResource) {
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+ }
+ }
+
+ public function testRightsWebResourceTrim() {
+ $properties = [
+ 'http://purl.org/dc/terms/accessRights',
+ ];
+
+ $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ foreach ($webResourceList as $webResource) {
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(trim(strval($value)), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+ }
+ }
+
+ /**
+ * Test one to one mapping
+ *
+ * @return void
+ */
+ public function testOneToOneProvidedCHOIdentity() {
+
+ $properties = [
+ 'http://purl.org/dc/terms/tableOfContents',
+ 'http://purl.org/dc/elements/1.1/description',
+ 'http://purl.org/dc/elements/1.1/language',
+ 'http://purl.org/dc/elements/1.1/publisher',
+ 'http://purl.org/dc/elements/1.1/rights',
+ 'http://purl.org/dc/terms/license',
+ 'http://purl.org/dc/elements/1.1/subject',
+ 'http://purl.org/dc/elements/1.1/title',
+ 'http://purl.org/dc/terms/available',
+ 'http://purl.org/dc/terms/created',
+ 'http://purl.org/dc/terms/issued',
+ 'http://purl.org/dc/terms/extent',
+ 'http://purl.org/dc/elements/1.1/type',
+ 'http://purl.org/dc/elements/1.1/language',
+ 'http://purl.org/dc/terms/medium',
+ 'http://purl.org/dc/elements/1.1/source',
+ 'http://purl.org/dc/terms/alternative',
+ 'http://purl.org/dc/terms/modified',
+ 'http://purl.org/dc/terms/abstract',
+ 'http://purl.org/dc/terms/bibliographicCitation',
+ 'http://purl.org/dc/elements/1.1/identifier',
+ 'http://purl.org/dc/terms/references',
+ 'http://purl.org/dc/elements/1.1/coverage',
+ 'http://purl.org/dc/elements/1.1/relation',
+ 'http://purl.org/dc/elements/1.1/creator',
+ ];
+
+ $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+ $this->assertNotNull($sourceNode);
+
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($providedCHO->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+
+ }
+
+ /**
+ * Test mapping for isPartOf
+ *
+ * @return void
+ */
+ public function testOneToOneProvidedCHOIsPartOf() {
+ $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+ $this->assertNotNull($sourceNode);
+
+ $isGatheredInto = $providedCHO->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>');
+ $this->assertCount(2, $isGatheredInto, "Must have two collection node");
+
+ $ispartOf = $providedCHO->all('<http://purl.org/dc/terms/isPartOf>');
+ $this->assertCount(1, $ispartOf, "Must have one collection node");
+
+ $outputValuesStr = [];
+ foreach($providedCHO->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>') as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test isGatheredInto");
+
+ $this->assertContains(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_LANGUESDEFRANCE", $outputValuesStr, config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_LANGUESDEFRANCE not found in output graph");
+ $this->assertContains(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ESLO1", $outputValuesStr, config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ESLO1 not found in output graph");
+
+ $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-ESLO1_ENT_010", strval($providedCHO->get('<http://purl.org/dc/terms/isPartOf>')), "the isPartOf mus equals ".config('corpusparole.corpus_doc_id_base_uri')."crdo-ESLO1_ENT_010");
+ }
+
+ /**
+ * Test one to one mapping spatial info
+ *
+ * @return void
+ */
+ public function testOneToOneProvidedCHOSpatial() {
+ $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+ $this->assertNotNull($sourceNode);
+
+ $spatials = $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/spatial'));
+
+ $this->assertCount(1, $spatials, "Must have only one spatial node");
+ $spatial = $spatials[0];
+ $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
+ $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
+
+ $lats = $spatial->all('geo:lat');
+ $this->assertCount(1, $lats, "One latitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
+ $this->assertEquals(Literal::create("47.90", null, 'xsd:float'), $lats[0], "lat must be '47.90'^^xsd:float");
+
+ $longs = $spatial->all('geo:long');
+ $this->assertCount(1, $longs, "One longitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
+ $this->assertEquals(Literal::create("1.90", null, 'xsd:float'), $longs[0], "long must be '1.90'^^xsd:float");
+
+ $notes = $spatial->all('skos:note');
+ $this->assertCount(2, $notes, "2 notes");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
+ $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
+ $this->assertEquals(Literal::create("France, Centre, Loiret, Orléans", "fr", null), $notes[1], "notes contains 'France, Centre, Loiret, Orléans'@fr");
+
+ $sameas = $spatial->all('owl:sameAs');
+ $this->assertCount(1, $sameas, "1 same as");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
+ $this->assertEquals('http://vocab.getty.edu/tgn/7008337', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008337");
+ }
+
+ /**
+ * Test one to one mapping trim values
+ *
+ * @return void
+ */
+ public function testOneToOneProvidedCHOTrim() {
+
+ $properties = [
+ 'http://purl.org/dc/terms/accessRights',
+ ];
+
+ $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+ $this->assertNotNull($sourceNode);
+
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($providedCHO->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, 'we must found some values to test');
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(trim(strval($value)), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+ }
+
+ /**
+ * Test one to one mapping trim values
+ *
+ * @return void
+ */
+ public function testOneToOneProvidedCHOReference() {
+
+ $providedCHO = $this->resGraphes['NO-FORMAT']->get('edm:ProvidedCHO', '^rdf:type');
+ $sourceNode = $this->inputGraphes['NO-FORMAT']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+ $this->assertNotNull($sourceNode);
+
+ $outputValuesStr = [];
+ foreach($providedCHO->all($this->resGraphes['NO-FORMAT']->resource('http://purl.org/dc/terms/references')) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, 'we must found some values to test for http://purl.org/dc/elements/1.1/reference');
+ foreach ($sourceNode->all($this->inputGraphes['NO-FORMAT']->resource('http://purl.org/dc/elements/1.1/reference')) as $value) {
+ $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/references not found in output graph");
+ }
+ }
+
+
+ /**
+ * Test that the web resources
+ *
+ * @return void
+ */
+ public function testWebResources() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
+
+ $this->assertCount(3, $resources, "Must found three webresource");
+
+ $aggregation = $this->resGraphes['BASE']->resource($this->testGraphUri);
+
+ foreach ($resources as $wres) {
+ $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
+ $this->assertCount(1, $mimetypes, "Must find one mimetype.");
+ $mimetype = $mimetypes[0];
+ $this->assertInstanceOf("EasyRdf\Literal", $mimetype, "mimetype must be literal");
+ $this->assertEquals("dc:IMT",$mimetype->getDatatype());
+
+ $extends = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/extent'));
+ $this->assertCount(1, $extends, "Must find one extent.");
+ $extent = $extends[0];
+ $this->assertInstanceOf("EasyRdf\Literal", $extent, "extent must be literal");
+ $this->assertStringStartsWith("PT", $extent->getValue(), "value mus start with PT");
+
+ if($wres->hasProperty('edm:isDerivativeOf')) {
+ $derivative = $wres->get('edm:isDerivativeOf');
+ $this->assertInstanceOf("EasyRdf\Resource", $derivative, "Derivative must be a resource");
+ $this->assertEquals("http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav", $derivative->getUri(), "derivative uri must be http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav");
+ $this->assertTrue($aggregation->hasProperty('edm:hasView', $wres));
+ }
+ else {
+ $this->assertTrue($aggregation->hasProperty('edm:isShownBy', $wres));
+ }
+
+ }
+ }
+
+ /**
+ * Test that the web resources
+ *
+ * @return void
+ */
+ public function testWebResourcesDate() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
+
+ foreach ($resources as $wres) {
+ $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/available"),"web resource must not have http://purl.org/dc/terms/available");
+ $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/modified"),"web resource must not have http://purl.org/dc/terms/modified");
+ $this->assertTrue($wres->hasProperty("http://purl.org/dc/terms/issued"), "Must have http://purl.org/dc/terms/issued");
+ $this->assertTrue($wres->hasProperty("http://purl.org/dc/terms/created"), "Must have http://purl.org/dc/terms/created");
+
+ $issued = $wres->getLiteral('dc:issued');
+ //<http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ $this->assertInstanceOf('EasyRdf\Literal', $issued, "issued value must be a literal");
+ $this->assertEquals('http://purl.org/dc/terms/W3CDTF', $issued->getDatatypeUri(), "issued datatype uri must be a http://purl.org/dc/terms/W3CDTF");
+ $this->assertEquals('2014-12-05T15:00:19+01:00', $issued->getValue(), "Value must be 2014-12-05T15:00:19+01:00");
+
+ $created = $wres->getLiteral('dc:created');
+ //<http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
+ $this->assertInstanceOf('EasyRdf\Literal', $created, "created value must be a literal");
+ $this->assertEquals('http://purl.org/dc/terms/W3CDTF', $created->getDatatypeUri(), "created datatype uri must be a http://purl.org/dc/terms/W3CDTF");
+ $this->assertEquals('1969-04-11', $created->getValue(), "Value must be 1969-04-11");
+
+ }
+
+ }
+
+ /**
+ * Test collection graph creation
+ * @return void
+ */
+ public function testCollectionGraph() {
+ $outputs = $this->mappers['BASE']->getOutputGraphes();
+ $this->assertCount(3, $outputs, "Must have 3 graphes as output");
+ foreach($outputs as $url => $outputGraph) {
+ if($outputGraph->getUri() == config('corpusparole.corpus_doc_id_base_uri').'crdo-ESLO1_ENT_019') {
+ continue;
+ }
+ $this->assertContains($outputGraph->getUri(), [config('corpusparole.corpus_doc_id_base_uri').'crdo-COLLECTION_LANGUESDEFRANCE', config('corpusparole.corpus_doc_id_base_uri').'crdo-COLLECTION_ESLO1']);
+ $this->assertEquals($outputGraph->resource($outputGraph->getUri())->type(), 'edm:Collection');
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Mappers/CocoonTextRdfMapperTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,291 @@
+<?php
+
+use CorpusParole\Libraries\Mappers\CocoonTextRdfMapper;
+use CorpusParole\Libraries\CocoonUtils;
+
+use EasyRdf\Graph;
+use EasyRdf\Resource;
+use EasyRdf\Literal;
+
+use Illuminate\Foundation\Testing\WithoutMiddleware;
+use Illuminate\Foundation\Testing\DatabaseMigrations;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
+
+class CocoonTextRdfMapperTest extends TestCase
+{
+
+ const TEST_INPUT_DOCS = [
+ 'BASE' => <<<EOT
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
+ @prefix v: <http://rdf.data-vocabulary.org/#> .
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
+ <http://purl.org/dc/elements/1.1/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 ;
+ <http://purl.org/dc/elements/1.1/format> "text/xml"^^<http://purl.org/dc/terms/IMT> ;
+ <http://purl.org/dc/elements/1.1/type> "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , <http://purl.org/dc/dcmitype/Text> , "narrative"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
+ <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/uve> ;
+ <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/uve> ;
+ <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/56614135> ;
+ <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/154919513> ;
+ <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Moyse-Faurie, Claire" ;
+ <http://purl.org/dc/elements/1.1/title> "The two hermit crabs and the coconut crab"@en ;
+ <http://purl.org/dc/terms/isFormatOf> <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> ;
+ <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ;
+ <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
+ <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_LACITO> ;
+ <http://purl.org/dc/terms/spatial> "NC"^^<http://purl.org/dc/terms/ISO3166> , "New Caledonia, Ohnyat (Ouvéa)" ;
+ <http://purl.org/dc/terms/available> "2011-02-05"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/issued> "2011-02-05T23:22:23+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://www.language-archives.org/OLAC/1.1/speaker> "Idakote, Félicien" ;
+ <http://purl.org/dc/terms/requires> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
+ <http://purl.org/dc/terms/alternative> "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
+ <http://www.language-archives.org/OLAC/1.1/researcher> "Moyse-Faurie, Claire" ;
+ <http://purl.org/dc/terms/modified> "2002-02-20"^^<http://purl.org/dc/terms/W3CDTF> ;
+ <http://purl.org/dc/terms/conformsTo> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive> .
+EOT
+ ];
+
+ const TEST_INPUT_ID = "crdo-UVE_MOCIKA_SOUND";
+ const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND";
+
+
+ private $inputGraphes = [];
+ private $resGraphes = [];
+ private $mappers = [];
+
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ public function setUp() {
+ parent::setUp();
+
+ $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonTextRdfMapperTest::TEST_INPUT_ID;
+ foreach(CocoonTextRdfMapperTest::TEST_INPUT_DOCS as $key => $inputDoc) {
+ $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA", $inputDoc);
+ $this->mappers[$key] = new CocoonTextRdfMapper($this->inputGraphes[$key]);
+ $this->mappers[$key]->mapGraph();
+ $this->resGraphes[$key] = $this->mappers[$key]->getOutputGraphes()["http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND"];
+ }
+ }
+
+ public function tearDown() {
+ parent::tearDown();
+ }
+
+ /**
+ * Just test that the construct and setup are ok
+ *
+ * @return void
+ */
+ public function testInit()
+ {
+ $this->assertTrue(true);
+ }
+
+
+ /**
+ * Test that the returned graph has the same uri that the original.
+ *
+ * @return void
+ */
+ public function testUri() {
+
+ //echo $this->resGraphes['BASE']->serialise('turtle');
+ //echo var_export($this->resGraphes['BASE']->toRdfPhp());
+
+ $this->assertNotNull($this->resGraphes['BASE']);
+ $this->assertEquals($this->testGraphUri, $this->resGraphes['BASE']->getUri(), "URIS must be translated");
+ }
+
+ /**
+ * Test that the return graph has one ore:Aggregation resource
+ *
+ * @return void
+ */
+ public function testAggregationResource() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('ore:Aggregation');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type ore:Aggregation");
+ $this->assertEquals($this->testGraphUri,$resources[0]->getUri());
+ }
+
+ /**
+ * Test providedCHO identifier.
+ *
+ * @return void
+ */
+ public function testProvidedChoId() {
+ $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
+ $providedCHO = $resources[0];
+
+ $identifier = $providedCHO->getLiteral('<http://purl.org/dc/elements/1.1/identifier>');
+
+ $this->assertInstanceOf('EasyRdf\Literal', $identifier, "identifier value must be a literal");
+ $this->assertEquals(config('corpusparole.corpus_id_scheme') . CocoonTextRdfMapperTest::TEST_INPUT_ID, $identifier->getValue(), "Value must be equals to ".config('corpusparole.corpus_id_scheme').CocoonTextRdfMapperTest::TEST_INPUT_ID);
+
+ }
+
+ public function testRightsWebResourceIdentity() {
+ $properties = [
+ "http://purl.org/dc/elements/1.1/rights",
+ 'http://purl.org/dc/terms/license',
+ ];
+
+ $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ foreach ($webResourceList as $webResource) {
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+ }
+ }
+
+ public function testRightsWebResourceTrim() {
+ $properties = [
+ 'http://purl.org/dc/terms/accessRights',
+ ];
+
+ $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
+ $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+ foreach ($webResourceList as $webResource) {
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(trim(strval($value)), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Test providedCHO uri.
+ *
+ * @return void
+ */
+ public function testProvidedChoURI() {
+ $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
+
+ $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
+ $this->assertEquals(CocoonTextRdfMapperTest::TEST_CHO_URI,$resources[0]->getUri());
+ }
+
+
+
+ /**
+ * Test that the returned graph does not have a http://purl.org/dc/dcmitype/Sound type
+ *
+ * @return void
+ */
+ public function testType() {
+ //"primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , <http://purl.org/dc/dcmitype/Text> , "narrative"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
+ $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+
+ $this->assertcount(3, $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/type')), 'but should find 2 literals');
+
+ $dcTypeList = $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/type'));
+ foreach ($dcTypeList as $dcType) {
+ $this->assertThat(
+ $dcType,
+ $this->logicalXor(
+ $this->isInstanceOf(EasyRdf\Literal::class),
+ $this->isInstanceOf(EasyRdf\Resource::class)
+ )
+ );
+ }
+ }
+
+ /**
+ * Test that the web resources
+ *
+ * @return void
+ */
+ public function testWebResources() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
+
+ $this->assertCount(2, $resources, "Must found three webresource");
+
+ $aggregation = $this->resGraphes['BASE']->resource($this->testGraphUri);
+
+ foreach ($resources as $wres) {
+ $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
+ $this->assertCount(1, $mimetypes, "Must find one mimetype.");
+ $mimetype = $mimetypes[0];
+ $this->assertInstanceOf("EasyRdf\Literal", $mimetype, "mimetype must be literal");
+ $this->assertEquals("dc:IMT",$mimetype->getDatatype());
+ }
+ }
+
+ /**
+ * Test that the web resources has good date
+ *
+ * @return void
+ */
+ public function testWebResourcesDate() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
+
+ foreach ($resources as $wres) {
+ $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/available"),"web resource must not have http://purl.org/dc/terms/available");
+ $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/modified"),"web resource must not have http://purl.org/dc/terms/modified");
+ $this->assertTrue($wres->hasProperty("http://purl.org/dc/terms/issued"), "Must have http://purl.org/dc/terms/issued");
+
+ $issued = $wres->getLiteral('dc:issued');
+ //<http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
+ $this->assertInstanceOf('EasyRdf\Literal', $issued, "issued value must be a literal");
+ $this->assertEquals('http://purl.org/dc/terms/W3CDTF', $issued->getDatatypeUri(), "issued datatype uri must be a http://purl.org/dc/terms/W3CDTF");
+ $this->assertEquals('2011-02-05T23:22:23+01:00', $issued->getValue(), "Value must be 2014-12-05T15:00:19+01:00");
+
+ }
+
+ }
+
+
+ /**
+ * Test that the web resources as conformsTo property
+ *
+ * @return void
+ */
+ public function testWebResourcesConformsTo() {
+
+ $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
+ foreach ($resources as $wres) {
+
+ $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
+ $mimetype = $mimetypes[0]->getValue();
+ if($mimetype !== 'application/xml') {
+ continue;
+ }
+ $conformsTo = $wres->get('<http://purl.org/dc/terms/conformsTo>');
+ $this->assertNotNull($conformsTo, "Must have a conformsTo node");
+ $this->assertInstanceOf('EasyRdf\Resource', $conformsTo, "Must be a resource");
+ $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive", $conformsTo->getUri(), "Must be http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive");
+ }
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Mergers/CocoonCollectionRdfMergerTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,234 @@
+<?php
+
+use CorpusParole\Libraries\Mergers\CocoonCollectionRdfMerger;
+use CorpusParole\Libraries\CocoonUtils;
+
+use EasyRdf\Graph;
+use EasyRdf\Resource;
+use EasyRdf\Literal;
+
+use Illuminate\Foundation\Testing\WithoutMiddleware;
+use Illuminate\Foundation\Testing\DatabaseMigrations;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
+
+class CocoonCollectionRdfMergerTest extends TestCase
+{
+
+ const TEST_INPUT_DOCS = [
+ 'BASE' => <<<EOT
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
+ @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+ <%1\$scrdo-COLLECTION_CFPP2000>
+ a edm:Collection ;
+ dc:isVersionOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
+ dc11:description "Corpus de Français Parlé Parisien des années 2000."@fr, "Le Corpus de Français Parlé Parisien (CFPP2000) est composé d'un ensemble d'interviews non directives sur les quartiers de Paris et de la proche banlieue. Les entretiens, transcrits en orthographe et alignés au tour de parole, sont disponibles sur le net ; ils sont librement employables en échange de la mention dans la bibliographie des travaux qui en seraient tirés d'une part de l'adresse du site: http://cfpp2000.univ-paris3.fr/ et d'autre part du document de présentation suivant : Branca-Rosoff S., Fleury S., Lefeuvre F., Pires M., 2012, \"Discours sur la ville. Présentation du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)\". En février 2013, ce corpus comprenait environ 550 000 mots. Un certain nombre d'outils en ligne, notamment un concordancier et des outils textométriques permettent de mener des requêtes lexicales et grammaticales. CFPP2000 est particulièrement destiné à des analyses sur le français oral. Le projet sous-jacent au corpus est par ailleurs l'étude des modifications et des variations qui interviennent dans ce qu'on peut considérer comme un parisien véhiculaire en tension entre le pôle du standard et le pôle du vernaculaire. Par ailleurs, il comporte des activités linguistiques diversifiées (description de quartier, anecdotes, argumentationâ¦) et on peut par conséquent travailler sur la syntaxe propre à ces différentes utilisations du langage. Il permet enfin d'opposer dialogues (entre enquêteur et enquêtés) et multilogues (où la présence de plusieurs enquêtés favorise le passage à un registre familier). CFPP2000 est constitué d'interviews longues (d'une heure en moyenne) intégralement transcrites. Il est donc utilisable pour examiner les singularités qui reviennent à l'idiolecte propre à une personne donnée, par opposition aux variantes diffusées dans des groupes plus larges (quartiers, groupes socio-culturels, classe d'âge, etc.). Le corpus constitue enfin un ensemble de témoignages intéressants sur les représentations de Paris et de sa proche banlieue qui est susceptible d'intéresser des analystes du discours, des sociologues, ou tout simplement des curieux de la ville."@fr ;
+ dc11:language <http://lexvo.org/id/iso639-3/gsw> ;
+ dc11:publisher <http://viaf.org/viaf/142432638>, "Fédération CLESTHIA", <http://viaf.org/viaf/154862993> ;
+ dc11:rights "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ;
+ dc11:type <http://purl.org/dc/dcmitype/Collection> ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc11:subject <http://lexvo.org/id/iso639-3/fra> ;
+ dc11:title "Corpus de Français Parlé Parisien des années 2000 (CFPP)"@fr ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ALA> ;
+ olac:compiler "Branca-Rosoff, Sonia", "Fleury, Serge", "Lefeuvre, Florence", "Pires, Mat" ;
+ dc11:contributor "Branca-Rosoff, Sonia", "Fleury, Serge", "Lefeuvre, Florence", "Pires, Mat", <http://viaf.org/viaf/93752300>, "Ville de Paris ", "Délégation générale à la langue française et aux langues de France " ;
+ olac:data_inputter "Branca-Rosoff, Sonia", "Lefeuvre, Florence", "Pires, Mat" ;
+ olac:depositor <http://viaf.org/viaf/93752300> ;
+ olac:developer "Fleury, Serge" ;
+ olac:interviewer "Branca-Rosoff, Sonia", "Lefeuvre, Florence", "Pires, Mat" ;
+ olac:researcher "Branca-Rosoff, Sonia", "Fleury, Serge", "Lefeuvre, Florence", "Pires, Mat" ;
+ olac:sponsor "Ville de Paris ", "Délégation générale à la langue française et aux langues de France " ;
+ olac:transcriber "Branca-Rosoff, Sonia", "Lefeuvre, Florence", "Pires, Mat" ;
+ dc:available "2013-04-12"^^dc:W3CDTF ;
+ dc:created "start=1988; end=1989"^^dc:Period ;
+ dc:issued "2013-04-12T22:20:23+02:00"^^dc:W3CDTF ;
+ dc:modified "2014-05-10T20:16:27+02:00"^^dc:W3CDTF ;
+ dc:spatial [
+ a edm:Place ;
+ geo:lat "48.8667"^^xsd:float ;
+ geo:long "2.3333"^^xsd:float ;
+ skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr ;
+ owl:sameAs <http://vocab.getty.edu/tgn/7008038>
+ ] .
+EOT
+ ,
+ 'SOURCE' => <<<EOT
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+ <%1\$scrdo-COLLECTION_CFPP2000>
+ a edm:Collection ;
+ dc:isVersionOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
+ dc11:title "Other title"@fr ;
+ dc:created "start=1988; end=1989"^^dc:Period ;
+ dc:issued "2013-04-12T22:20:23+02:00"^^dc:W3CDTF ;
+ dc:modified "2014-05-10T20:16:27+02:00"^^dc:W3CDTF ;
+ dc11:language <http://lexvo.org/id/iso639-3/gsw>, <http://lexvo.org/id/iso639-3/fra> ;
+ dc:spatial [
+ a edm:Place ;
+ geo:lat "89.8667"^^xsd:float ;
+ geo:long "55.3333"^^xsd:float ;
+ skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr, "Other place very important"@fr ;
+ owl:sameAs <http://vocab.getty.edu/tgn/1234567890>
+ ] .
+EOT
+ ];
+
+ const TEST_INPUT_ID = "crdo-COLLECTION_CFPP2000";
+ const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000";
+
+
+ private $inputGraphes = [];
+ private $resGraph;
+ private $merger;
+
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ public function setUp() {
+ parent::setUp();
+
+ $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonCollectionRdfMergerTest::TEST_INPUT_ID;
+ foreach(CocoonCollectionRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
+ $this->inputGraphes[$key] = new Graph(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000", sprintf($inputDoc, config('corpusparole.corpus_doc_id_base_uri')));
+ }
+
+ $this->merger = new CocoonCollectionRdfMerger();
+ $this->resGraph = $this->merger->mergeGraph($this->inputGraphes['BASE'], $this->inputGraphes['SOURCE']);
+ }
+
+ 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 the result graph.
+ *
+ * @return void
+ */
+ public function testResGraph() {
+ $this->assertNotNull($this->resGraph, "Res graph must not be null");
+ $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000", $this->resGraph->getUri(), "graph uri must be equals to ".config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND");
+ }
+
+
+
+ /**
+ * test the merged Aggregation
+ *
+ * @return void
+ */
+ public function testCollectionResource() {
+ $collectionResList = $this->resGraph->allOfType('http://www.europeana.eu/schemas/edm/Collection');
+ $this->assertCount(1, $collectionResList, "Only one Collection node");
+ $collectionRes = $collectionResList[0];
+
+ $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000",$collectionRes->getUri(),"Collection node uri must be ".config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000");
+
+ $singleValuesRes = [
+ 'http://purl.org/dc/elements/1.1/title' => ['size'=>1, 'val' => new Literal("Corpus de Français Parlé Parisien des années 2000 (CFPP)", "fr", null)],
+ 'http://purl.org/dc/terms/available' => ['size'=>1, 'val' => new Literal("2013-04-12", null, "dc:W3CDTF")],
+ 'http://purl.org/dc/terms/created' => ['size'=>1, 'val' => new Literal("start=1988; end=1989", null, "dc:Period")],
+ 'http://purl.org/dc/terms/issued' => ['size'=>1, 'val' => new Literal("2013-04-12T22:20:23+02:00", null, "dc:W3CDTF")],
+ 'http://purl.org/dc/terms/modified' => ['size'=>1, 'val' => new Literal("2014-05-10T20:16:27+02:00", null, "dc:W3CDTF")],
+ 'http://purl.org/dc/elements/1.1/language' => ['size' => 2, 'val' => [
+ $this->resGraph->resource("http://lexvo.org/id/iso639-3/gsw"),
+ $this->resGraph->resource("http://lexvo.org/id/iso639-3/fra"),
+ ]]
+ ];
+
+ foreach($singleValuesRes as $property => $resVal) {
+ $resList = $collectionRes->all($this->inputGraphes['BASE']->resource($property));
+ $this->assertCount($resVal['size'], $resList, "$property list size $resVal[size]");
+ if($resVal['size'] == 1) {
+ $this->assertEquals($resVal['val'], $resList[0], "$property size one not equals");
+ }
+ else {
+ $this->assertEquals($resVal['val'], $resList, "$property size more than one not equals");
+ }
+ }
+
+ }
+
+ /**
+ * Test one to one mapping spatial info
+ *
+ * @return void
+ */
+ public function testProvidedCHOSpatial() {
+ $collection = $this->resGraph->get('edm:Collection', '^rdf:type');
+
+ $this->assertNotNull($collection);
+
+ $spatials = $collection->all($this->resGraph->resource('http://purl.org/dc/terms/spatial'));
+
+ $this->assertCount(1, $spatials, "Must have only one spatial node");
+ $spatial = $spatials[0];
+ $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
+ $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
+
+ $lats = $spatial->all('geo:lat');
+ $this->assertCount(1, $lats, "One latitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
+ $this->assertEquals(Literal::create("48.8667", null, 'xsd:float'), $lats[0], "lat must be '48.8667'^^xsd:float");
+
+ $longs = $spatial->all('geo:long');
+ $this->assertCount(1, $longs, "One longitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
+ $this->assertEquals(Literal::create("2.3333", null, 'xsd:float'), $longs[0], "long must be '2.3333'^^xsd:float");
+
+ $notes = $spatial->all('skos:note');
+ $this->assertCount(3, $notes, "3 notes");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
+ $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
+ $this->assertEquals(Literal::create("France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier", "fr", null), $notes[1], "notes contains 'France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier'@fr");
+ $this->assertEquals(Literal::create("Other place very important", "fr", null), $notes[2], "notes contains 'Other place very important'@fr");
+
+ $sameas = $spatial->all('owl:sameAs');
+ $this->assertCount(1, $sameas, "1 same as");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
+ $this->assertEquals('http://vocab.getty.edu/tgn/7008038', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008038");
+ }
+
+ public function testLinkToCocoonCollection() {
+ $coll = $this->resGraph->get('edm:Collection', '^rdf:type');
+
+ $this->assertNotNull($coll);
+
+ $versionOfRes = $coll->all("<http://purl.org/dc/terms/isVersionOf>");
+ $this->assertCount(1, $versionOfRes, "Must have only on isVersionOf");
+ $versionOfRes = $versionOfRes[0];
+ $this->assertInstanceOf("EasyRdf\Resource", $versionOfRes, "version Res must be a resource");
+ $this->assertEquals(CocoonCollectionRdfMergerTest::TEST_CHO_URI, $versionOfRes->getUri(), "versionof res uri must be sams than source");
+
+ }
+
+
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Mergers/CocoonSoundRdfMergerTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,378 @@
+<?php
+
+use CorpusParole\Libraries\Mergers\CocoonSoundRdfMerger;
+use CorpusParole\Libraries\CocoonUtils;
+
+use EasyRdf\Graph;
+use EasyRdf\Resource;
+use EasyRdf\Literal;
+
+use Illuminate\Foundation\Testing\WithoutMiddleware;
+use Illuminate\Foundation\Testing\DatabaseMigrations;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
+
+class CocoonSoundRdfMergerTest extends TestCase
+{
+
+ const TEST_INPUT_DOCS = [
+ 'BASE' => <<<EOT
+ @prefix ore: <http://www.openarchives.org/ore/terms/> .
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+ <http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND>
+ a ore:Aggregation ;
+ edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ;
+ edm:provider "Corpus de la Parole"@fr ;
+ edm:dataProvider <http://viaf.org/viaf/142432638> ;
+ edm:isShownAt <http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND> ;
+ edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
+ edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
+ edm:hasView <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav>, <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3> .
+
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND>
+ a edm:ProvidedCHO ;
+ dc11:identifier "crdo-CFPP2000_35_SOUND" ;
+ dc11:description "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr, "Enregistrement: Caractéristiques de l'enregistrement; Identifiant : CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e; Langue : français; Editeur : Université Paris III â Syled ; Date : 17.11.2010; Lieu de l'enregistrement : au domicile de lâenquêté Ãzgur KILIà ; Enquêteur : Sonia BRANCA-ROSOFF; Quartier(s) concerné(s) : Paris 3e, et 20e (pour lââge adulte); Transcription : Noalig TANGUY; Anonymisation : Noalig TANGUY; Durée : 0h46â; "@fr, "Enquêteur: Etat civil; Prénom et NOM : Sonia BRANCA-ROSOFF; Sexe : féminin; Lieu de naissance : New-York (USA); Lieu la petite enfance : Bretagne, puis région parisienne, puis de 8 à 16 ans Nice; Date de naissance : 16.12.1947; Situation familiale : mariée, deux enfants; Mobilité géographique : Paris 1967-1971, Aix-en-Provence 1971-1996, Paris 1996-2012; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : Doctorat dâÃtat (sciences du langage) 1987; Travail; Activité actuelle : Enseignante-chercheuse (linguistique française), Université de la Sorbonne Nouvelle-Paris III, Paris; Activités passées : ; Langues; Langue première : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : née en 1916 à Nice (France), interprète de conférences ; licence dâanglais; Père : né en 1913 à Mananjary (Madagascar), ingénieur.; "@fr, "Enquêté 1: Etat civil; Prénom et NOM fictifs : Ãzgur KILIà ; Sexe : masculin; Lieu de naissance: Paris 11e, France; Lieu la petite enfance : Paris 11e, France; Date de naissance : 07.02.1979; Age au moment de lâenregistrement : 32 ans; Situation familiale : pacsé, deux enfants; Mobilité géographique : 3e, 18e, 20e arrondissements; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : amis; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire st Merri 75003 ; Secondaire : Victor Hugo, Turgot 75003, Jean Lurçat 75013 général bac ES Supérieur. Puis St Denis université (cinéma); Travail; Activité actuelle : ingénieur du son pour l'audiovisuel; Activités passées : restauration, assistant son pour l'audiovisuel ; Langues; Langues pratiquées : français, anglais, turc; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : psychothérapeute, né a Houilles région parisienne France; Père : professeur d'université, né a Istanbul en Turquie. ; "@fr, "Enquêté 2: Etat civil; Prénom et NOM fictifs : Michel CHEVRIER; Sexe : masculin; Lieu de naissance : naissance à Boulogne-Billancourt (92); Lieu la petite enfance : rue du Temple, 3e arrondissement, Paris; Date de naissance : 01.06.1979; Age au moment de lâenregistrement : 31 ans; Situation familiale : concubinage; Mobilité géographique : 3e, puis 20e (entre 2005 et 2009) puis Romainville (depuis 2009); Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Réseau par lequel contacté : ; Adresse (si connue) : ; Téléphone (si connu) : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ãcole à aire ouverte rue St Merri 75003 ; Secondaire (Collège Victor Hugo 75003) puis Lycée Autogéré de Paris (75015) Bac Littéraire. Deux années au CIM (école de jazz) dans le 75018, puis 3 ans au conservatoire du 9eme; Travail; Activité actuelle : Musicien, Compositeur, Professeur de piano jazz ; Activités passées : Musicien; Langues; Langues pratiquées : français, anglais; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : ancienne médecin généraliste pneumologue, puis sociologue, née en France; Père : enseignant en sciences de l'éducation à Paris 8 né en Belgique; "@fr, "Enquêté 3: Etat civil; Prénom et NOM fictifs : Benoît DU BREUIL-DE-PONT-EN-AUGE; Sexe : masculin; Lieu de naissance : Paris 14e; Lieu la petite enfance : Paris 3e; Date de naissance : 28.11.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : concubinage avéré, avec papier de la mairie tamponné et signé!; Mobilité géographique : à 2 ans vit dans le 9°, puis déménage pour le 3°, est resté dans la même rue pendant 20 ans tout en changeant d'immeuble. Ensuite le 19° pendant 4 ans, puis Pantin 6 mois puis Les Lilas. ; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : voir Scolarité, Précisions; Prénom et NOM réels : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [ ] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : CAP; Précisions : Primaire école à aire ouverte (St Merri) dans le 4° avec Augustin, Ãzgur, Michel. Secondaire : collège Victor-Hugo dans le 3° avec Ãzgur ; puis CAP ; Travail; Activité actuelle : ; Activités passées : ébéniste agenceur puis ébéniste restaurateur et enfin constructeur décors (ainsi que de nombreux petits jobs ayant duré moins d'un an); Langues; Langues pratiquées : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : à la retraite ; secrétaire de rédaction dans un grand journal, baccalauréat ; née à Montrouge; Père : conseiller à travail à pole emploi, né à Boulogne Billancourt, baccalauréat présenté 3 ou 4 fois, puis obtenu par équivalence. ; "@fr, "Enquêté 4: Etat civil; Enquêté 4; Prénom et NOM fictifs : ; Sexe : féminin / masculin; Lieu de naissance : Paris 14e; Lieu de la petite enfance : Paris 4e et 3e ; Date de naissance : 06.12.1976; Age au moment de lâenregistrement : 34 ans; Situation familiale : ; Mobilité géographique : Rue la Bruyère 75009 (1976-1978), Rambuteau 75004 (1978-1987/88) & 75003 (chgt de côté de rue 1988-1998), a quitté Paris de 1998 à 2005 ; Rue Rambuteau 75003 (2006-2010), rue Gossec 75012 (2011); Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec Enquêté 2 : ami; Relation (parenté, ami, etc) avec Enquêté NOM : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole St Merri 75003. Secondaire : Collège François Couperin 75004, Institut St Pierre Fourier 75012 ; Cours Charlemagne 75014 ; Travail; Activité actuelle : Superviseur Centre d'appels ; Activités passées : Animateur Club Enfant, Réceptionniste ; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : retraitée, Paris, bac + 1/2 (?) ; Père : Conseiller Pôle Emploi, Paris, bac. ; "@fr, "Enquêté 5: Etat civil; Prénom et NOM fictifs : Ãtienne SALVEGAS; Sexe : masculin; Lieu de naissance : Paris 12e; Lieu de la petite enfance : Paris 3e Le Marais; Date de naissance : 16.06.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : marié 1 enfant, 12 ans de vie commune ; Mobilité géographique : 3e (1978-1999) 19e (1999-2002) 9e (2002-2011) ; Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté 2 : ami ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Scolarité; Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole Vertus, rue des Vertus 3ème. Secondaire Collège Montgolfier / Lycée Turgot 3ème. Supérieur Droit Univ. Paris Panthéon Sorbonne ; Travail; Activité actuelle : évènementiel; Activités passées : stagiaire journaliste sportif / relations publiques, accueil, agent de sécurité, remplacement gardien, réceptionniste hôtellerie.; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : né à Paris, lycée ; Père : né à Oloron (64), lycée ; "@fr ;
+ dc11:language <http://lexvo.org/id/iso639-3/fra> ;
+ dc11:publisher <http://viaf.org/viaf/142432638> ;
+ dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, "report"^^olac:discourse-type, "unintelligible_speech"^^olac:discourse-type ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc11:subject "lexicography"^^olac:linguistic-field, "phonetics"^^olac:linguistic-field, "anthropological_linguistics"^^olac:linguistic-field, "general_linguistics"^^olac:linguistic-field, <http://lexvo.org/id/iso639-3/fra>, "text_and_corpus_linguistics"^^olac:linguistic-field, "phonology"^^olac:linguistic-field, "semantics"^^olac:linguistic-field, "sociolinguistics"^^olac:linguistic-field, "syntax"^^olac:linguistic-field, "typology"^^olac:linguistic-field, "discourse_analysis"^^olac:linguistic-field, "historical_linguistics"^^olac:linguistic-field, "language_documentation"^^olac:linguistic-field, "mathematical_linguistics"^^olac:linguistic-field ;
+ dc11:title "CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2"@fr ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc:extent "PT48M26S" ;
+ dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
+ dc11:source "CFPP2000"@fr ;
+ dc11:coverage "Quartier concerné : 3e"@fr ;
+ olac:depositor <http://viaf.org/viaf/93752300> ;
+ dc11:contributor <http://viaf.org/viaf/93752300>, "Branca-Rosoff, Sonia", "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne", "Tanguy Noalig" ;
+ olac:interviewer "Branca-Rosoff, Sonia" ;
+ olac:responder "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne" ;
+ olac:transcriber "Tanguy Noalig" ;
+ dc:available "2013-10-12"^^dc:W3CDTF ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
+ dc:spatial [
+ a edm:Place ;
+ geo:lat "48.83975"^^xsd:float ;
+ geo:long "2.3542"^^xsd:float ;
+ skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr ;
+ owl:sameAs <http://vocab.getty.edu/tgn/7008038>
+ ] .
+
+ <http://cocoon.huma-num.fr/data/archi/masters/372593.wav>
+ a edm:WebResource ;
+ dc:extent "PT48M26S" ;
+ dc11:format "audio/x-wav"^^dc:IMT ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF .
+
+ <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav>
+ a edm:WebResource ;
+ dc:extent "PT48M26S" ;
+ dc11:format "audio/x-wav"^^dc:IMT ;
+ edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+
+ <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3>
+ a edm:WebResource ;
+ dc:extent "PT48M26S" ;
+ dc11:format "audio/mpeg"^^dc:IMT ;
+ edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+EOT
+ ,
+ 'SOURCE' => <<<EOT
+ @prefix ore: <http://www.openarchives.org/ore/terms/> .
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+ <http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND>
+ a ore:Aggregation ;
+ edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ;
+ edm:provider "Corpus de la Parole"@fr ;
+ edm:dataProvider <http://viaf.org/viaf/142432638> ;
+ edm:isShownAt <http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND> ;
+ edm:isShownBy <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml> ;
+ edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
+ edm:hasView <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml>, <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml>, <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav> .
+
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND>
+ a edm:ProvidedCHO ;
+ dc11:identifier "crdo-CFPP2000_35_SOUNDsource" ;
+ dc11:description "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr, "Enregistrement: Caractéristiques de l'enregistrement; Identifiant : CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e; Langue : français; Editeur : Université Paris III â Syled ; Date : 17.11.2010; Lieu de l'enregistrement : au domicile de lâenquêté Ãzgur KILIà ; Enquêteur : Sonia BRANCA-ROSOFF; Quartier(s) concerné(s) : Paris 3e, et 20e (pour lââge adulte); Transcription : Noalig TANGUY; Anonymisation : Noalig TANGUY; Durée : 0h46â; "@fr, "Enquêteur: Etat civil; Prénom et NOM : Sonia BRANCA-ROSOFF; Sexe : féminin; Lieu de naissance : New-York (USA); Lieu la petite enfance : Bretagne, puis région parisienne, puis de 8 à 16 ans Nice; Date de naissance : 16.12.1947; Situation familiale : mariée, deux enfants; Mobilité géographique : Paris 1967-1971, Aix-en-Provence 1971-1996, Paris 1996-2012; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : Doctorat dâÃtat (sciences du langage) 1987; Travail; Activité actuelle : Enseignante-chercheuse (linguistique française), Université de la Sorbonne Nouvelle-Paris III, Paris; Activités passées : ; Langues; Langue première : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : née en 1916 à Nice (France), interprète de conférences ; licence dâanglais; Père : né en 1913 à Mananjary (Madagascar), ingénieur.; "@fr, "Enquêté 1: Etat civil; Prénom et NOM fictifs : Ãzgur KILIà ; Sexe : masculin; Lieu de naissance: Paris 11e, France; Lieu la petite enfance : Paris 11e, France; Date de naissance : 07.02.1979; Age au moment de lâenregistrement : 32 ans; Situation familiale : pacsé, deux enfants; Mobilité géographique : 3e, 18e, 20e arrondissements; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : amis; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire st Merri 75003 ; Secondaire : Victor Hugo, Turgot 75003, Jean Lurçat 75013 général bac ES Supérieur. Puis St Denis université (cinéma); Travail; Activité actuelle : ingénieur du son pour l'audiovisuel; Activités passées : restauration, assistant son pour l'audiovisuel ; Langues; Langues pratiquées : français, anglais, turc; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : psychothérapeute, né a Houilles région parisienne France; Père : professeur d'université, né a Istanbul en Turquie. ; "@fr, "Enquêté 2: Etat civil; Prénom et NOM fictifs : Michel CHEVRIER; Sexe : masculin; Lieu de naissance : naissance à Boulogne-Billancourt (92); Lieu la petite enfance : rue du Temple, 3e arrondissement, Paris; Date de naissance : 01.06.1979; Age au moment de lâenregistrement : 31 ans; Situation familiale : concubinage; Mobilité géographique : 3e, puis 20e (entre 2005 et 2009) puis Romainville (depuis 2009); Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Réseau par lequel contacté : ; Adresse (si connue) : ; Téléphone (si connu) : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ãcole à aire ouverte rue St Merri 75003 ; Secondaire (Collège Victor Hugo 75003) puis Lycée Autogéré de Paris (75015) Bac Littéraire. Deux années au CIM (école de jazz) dans le 75018, puis 3 ans au conservatoire du 9eme; Travail; Activité actuelle : Musicien, Compositeur, Professeur de piano jazz ; Activités passées : Musicien; Langues; Langues pratiquées : français, anglais; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : ancienne médecin généraliste pneumologue, puis sociologue, née en France; Père : enseignant en sciences de l'éducation à Paris 8 né en Belgique; "@fr, "Enquêté 3: Etat civil; Prénom et NOM fictifs : Benoît DU BREUIL-DE-PONT-EN-AUGE; Sexe : masculin; Lieu de naissance : Paris 14e; Lieu la petite enfance : Paris 3e; Date de naissance : 28.11.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : concubinage avéré, avec papier de la mairie tamponné et signé!; Mobilité géographique : à 2 ans vit dans le 9°, puis déménage pour le 3°, est resté dans la même rue pendant 20 ans tout en changeant d'immeuble. Ensuite le 19° pendant 4 ans, puis Pantin 6 mois puis Les Lilas. ; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : voir Scolarité, Précisions; Prénom et NOM réels : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [ ] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : CAP; Précisions : Primaire école à aire ouverte (St Merri) dans le 4° avec Augustin, Ãzgur, Michel. Secondaire : collège Victor-Hugo dans le 3° avec Ãzgur ; puis CAP ; Travail; Activité actuelle : ; Activités passées : ébéniste agenceur puis ébéniste restaurateur et enfin constructeur décors (ainsi que de nombreux petits jobs ayant duré moins d'un an); Langues; Langues pratiquées : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : à la retraite ; secrétaire de rédaction dans un grand journal, baccalauréat ; née à Montrouge; Père : conseiller à travail à pole emploi, né à Boulogne Billancourt, baccalauréat présenté 3 ou 4 fois, puis obtenu par équivalence. ; "@fr, "Enquêté 4: Etat civil; Enquêté 4; Prénom et NOM fictifs : ; Sexe : féminin / masculin; Lieu de naissance : Paris 14e; Lieu de la petite enfance : Paris 4e et 3e ; Date de naissance : 06.12.1976; Age au moment de lâenregistrement : 34 ans; Situation familiale : ; Mobilité géographique : Rue la Bruyère 75009 (1976-1978), Rambuteau 75004 (1978-1987/88) & 75003 (chgt de côté de rue 1988-1998), a quitté Paris de 1998 à 2005 ; Rue Rambuteau 75003 (2006-2010), rue Gossec 75012 (2011); Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec Enquêté 2 : ami; Relation (parenté, ami, etc) avec Enquêté NOM : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole St Merri 75003. Secondaire : Collège François Couperin 75004, Institut St Pierre Fourier 75012 ; Cours Charlemagne 75014 ; Travail; Activité actuelle : Superviseur Centre d'appels ; Activités passées : Animateur Club Enfant, Réceptionniste ; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : retraitée, Paris, bac + 1/2 (?) ; Père : Conseiller Pôle Emploi, Paris, bac. ; "@fr, "Enquêté 5: Etat civil; Prénom et NOM fictifs : Ãtienne SALVEGAS; Sexe : masculin; Lieu de naissance : Paris 12e; Lieu de la petite enfance : Paris 3e Le Marais; Date de naissance : 16.06.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : marié 1 enfant, 12 ans de vie commune ; Mobilité géographique : 3e (1978-1999) 19e (1999-2002) 9e (2002-2011) ; Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté 2 : ami ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Scolarité; Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole Vertus, rue des Vertus 3ème. Secondaire Collège Montgolfier / Lycée Turgot 3ème. Supérieur Droit Univ. Paris Panthéon Sorbonne ; Travail; Activité actuelle : évènementiel; Activités passées : stagiaire journaliste sportif / relations publiques, accueil, agent de sécurité, remplacement gardien, réceptionniste hôtellerie.; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : né à Paris, lycée ; Père : né à Oloron (64), lycée ; "@fr ;
+ dc11:language <http://lexvo.org/id/iso639-3/fra> ;
+ dc11:publisher <http://viaf.org/viaf/142432638> ;
+ dc11:type "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, "report"^^olac:discourse-type, "unintelligible_speech"^^olac:discourse-type ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc11:subject "lexicography"^^olac:linguistic-field, "phonetics"^^olac:linguistic-field, "anthropological_linguistics"^^olac:linguistic-field, "general_linguistics"^^olac:linguistic-field, <http://lexvo.org/id/iso639-3/fra>, "text_and_corpus_linguistics"^^olac:linguistic-field, "phonology"^^olac:linguistic-field, "semantics"^^olac:linguistic-field, "sociolinguistics"^^olac:linguistic-field, "syntax"^^olac:linguistic-field, "typology"^^olac:linguistic-field, "discourse_analysis"^^olac:linguistic-field, "historical_linguistics"^^olac:linguistic-field, "language_documentation"^^olac:linguistic-field, "mathematical_linguistics"^^olac:linguistic-field ;
+ dc11:title "CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2 (annotations)"@fr ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
+ dc11:source "CFPP2000"@fr ;
+ dc11:coverage "Quartier concerné : 3e"@fr ;
+ olac:depositor <http://viaf.org/viaf/93752300> ;
+ dc11:contributor <http://viaf.org/viaf/93752300>, "Branca-Rosoff, Sonia", "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne", "Tanguy Noalig" ;
+ olac:interviewer "Branca-Rosoff, Sonia" ;
+ olac:responder "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne" ;
+ olac:transcriber "Tanguy Noalig" ;
+ dc:available "2013-11-04"^^dc:W3CDTF ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF ;
+ dc:spatial [
+ a edm:Place ;
+ geo:lat "99.83975"^^xsd:float ;
+ geo:long "25.3542"^^xsd:float ;
+ skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr, "Other place very important"@fr ;
+ owl:sameAs <http://vocab.getty.edu/tgn/1234567890>
+ ] .
+
+ <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml>
+ a edm:WebResource ;
+ dc11:format "application/xml"^^dc:IMT ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+ <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml>
+ a edm:WebResource ;
+ dc11:format "application/xhtml+xml"^^dc:IMT ;
+ dc:created "2010-11-17"^^dc:W3CDTF ;
+ dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+EOT
+ ];
+
+ const TEST_INPUT_ID = "crdo-ESLO1_ENT_019";
+ const TEST_GRAPH_URI = "http://corpusdelaparole.huma-num.fr/corpus/res/crdo-ESLO1_ENT_019";
+ const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019";
+
+
+ private $inputGraphes = [];
+ private $resGraph;
+ private $merger;
+
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ public function setUp() {
+ parent::setUp();
+
+ foreach(CocoonSoundRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
+ $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", $inputDoc);
+ }
+
+ $this->merger = new CocoonSoundRdfMerger();
+ $this->resGraph = $this->merger->mergeGraph($this->inputGraphes['BASE'], $this->inputGraphes['SOURCE']);
+ }
+
+ 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 the result graph.
+ *
+ * @return void
+ */
+ public function testResGraph() {
+ $this->assertNotNull($this->resGraph, "Res graph must not be null");
+ $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", $this->resGraph->getUri(), "graph uri must be equals to http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND");
+ }
+
+ /**
+ * test the merged Aggregation
+ *
+ * @return void
+ */
+ public function testAggregationResource() {
+ $aggregationResList = $this->resGraph->allOfType('http://www.openarchives.org/ore/terms/Aggregation');
+ $this->assertCount(1, $aggregationResList, "Only one Aggregation node");
+ $aggregationRes = $aggregationResList[0];
+
+ $this->assertEquals("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND",$aggregationRes->getUri(),"Aggregation node uri must be http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND");
+
+ $singleValuesRes = [
+ 'http://www.europeana.eu/schemas/edm/aggregatedCHO' => ['size'=>1, 'val' => $this->resGraph->resource("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND")],
+ 'http://www.europeana.eu/schemas/edm/provider' => ['size'=>1, 'val' => new Literal("Corpus de la Parole", "fr", null)],
+ 'http://www.europeana.eu/schemas/edm/dataProvider' => ['size'=>1, 'val' => $this->resGraph->resource("http://viaf.org/viaf/142432638")],
+ 'http://www.europeana.eu/schemas/edm/isShownAt' => ['size'=>1, 'val' => $this->resGraph->resource("http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND")],
+ 'http://www.europeana.eu/schemas/edm/isShownBy' => ['size'=>1, 'val' => $this->resGraph->resource("http://cocoon.huma-num.fr/data/archi/masters/372593.wav")],
+ 'http://www.europeana.eu/schemas/edm/rights' => ['size'=>1, 'val' => $this->resGraph->resource("http://creativecommons.org/licenses/by-nc-sa/4.0/")],
+ 'http://www.europeana.eu/schemas/edm/hasView' => ['size' => 4, 'val' => [
+ $this->resGraph->resource("http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav"),
+ $this->resGraph->resource("http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3"),
+ $this->resGraph->resource("http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml"),
+ $this->resGraph->resource("http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml")
+ ]]
+ ];
+
+ foreach($singleValuesRes as $property => $resVal) {
+ $resList = $aggregationRes->all($this->inputGraphes['BASE']->resource($property));
+ $this->assertCount($resVal['size'], $resList, "$property list size $resVal[size]");
+ if($resVal['size'] == 1) {
+ $this->assertEquals($resVal['val'], $resList[0], "$property size one not equals");
+ }
+ else {
+ $this->assertEquals($resVal['val'], $resList, "$property size more than one not equals");
+ }
+ }
+
+ }
+
+ /**
+ * test web resources
+ *
+ * @return void
+ */
+ public function testWebResources() {
+ $webResList = $this->resGraph->allOfType('http://www.europeana.eu/schemas/edm/WebResource');
+
+ $this->assertCount(5, $webResList, "Must have 5 webResource");
+ }
+
+
+ /**
+ * Test one to one mapping spatial info
+ *
+ * @return void
+ */
+ public function testProvidedCHOSpatial() {
+ $providedCHO = $this->resGraph->get('edm:ProvidedCHO', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+
+ $spatials = $providedCHO->all($this->resGraph->resource('http://purl.org/dc/terms/spatial'));
+
+ $this->assertCount(1, $spatials, "Must have only one spatial node");
+ $spatial = $spatials[0];
+ $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
+ $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
+
+ $lats = $spatial->all('geo:lat');
+ $this->assertCount(1, $lats, "One latitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
+ $this->assertEquals(Literal::create("48.83975", null, 'xsd:float'), $lats[0], "lat must be '48.83975'^^xsd:float");
+
+ $longs = $spatial->all('geo:long');
+ $this->assertCount(1, $longs, "One longitude");
+ $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
+ $this->assertEquals(Literal::create("2.3542", null, 'xsd:float'), $longs[0], "long must be '2.3542'^^xsd:float");
+
+ $notes = $spatial->all('skos:note');
+ $this->assertCount(3, $notes, "3 notes");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
+ $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
+ $this->assertEquals(Literal::create("France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier", "fr", null), $notes[1], "notes contains 'France, Centre, Loiret, Orléans'@fr");
+ $this->assertEquals(Literal::create("Other place very important", "fr", null), $notes[2], "notes contains 'Other place very important'@fr");
+
+ $sameas = $spatial->all('owl:sameAs');
+ $this->assertCount(1, $sameas, "1 same as");
+ $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
+ $this->assertEquals('http://vocab.getty.edu/tgn/7008038', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008038");
+ }
+
+
+ /**
+ * Test one to one mapping
+ *
+ * @return void
+ */
+ public function testProvidedCHOSingleproperty() {
+
+ $properties = [
+ "http://purl.org/dc/elements/1.1/title",
+ "http://purl.org/dc/elements/1.1/identifier",
+ "http://purl.org/dc/terms/extent",
+ "http://purl.org/dc/terms/available",
+ "http://purl.org/dc/terms/created",
+ "http://purl.org/dc/terms/issued"
+ ];
+
+ $providedCHO = $this->resGraph->get('edm:ProvidedCHO', '^rdf:type');
+ $baseNode = $this->inputGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
+
+ $this->assertNotNull($providedCHO);
+ $this->assertNotNull($baseNode);
+
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($providedCHO->all($this->resGraph->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ foreach ($baseNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
+ $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
+ }
+ }
+
+ }
+
+ public function testRightsWebResource() {
+ $properties = [
+ "http://purl.org/dc/elements/1.1/rights",
+ 'http://purl.org/dc/terms/license',
+ 'http://purl.org/dc/terms/accessRights',
+ ];
+
+ $webResourceList = $this->resGraph->all('edm:WebResource', '^rdf:type');
+
+ //just check that they have all these resources.
+ //TODO: check that the same rights are kept (difficult)
+ foreach ($webResourceList as $webResource) {
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($webResource->all($this->resGraph->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ }
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Mergers/CocoonTextRdfMergerTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,452 @@
+<?php
+
+use CorpusParole\Libraries\Mergers\CocoonSoundRdfMerger;
+use CorpusParole\Libraries\Mergers\CocoonTextRdfMerger;
+use CorpusParole\Libraries\CocoonUtils;
+
+use EasyRdf\Graph;
+use EasyRdf\Resource;
+use EasyRdf\Literal;
+
+use Illuminate\Foundation\Testing\WithoutMiddleware;
+use Illuminate\Foundation\Testing\DatabaseMigrations;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
+
+class CocoonTextRdfMergerTest extends TestCase
+{
+
+ const TEST_INPUT_DOCS = [
+ 'SOUND' => <<<EOT
+ @prefix ore: <http://www.openarchives.org/ore/terms/> .
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+ <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
+ a ore:Aggregation ;
+ edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
+ edm:provider "Corpus de la Parole"@fr ;
+ edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
+ edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
+ edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
+ edm:rights <http://creativecommons.org/licenses/by-nc-nd/4.0/> ;
+ 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> .
+
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
+ a edm:ProvidedCHO ;
+ dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
+ 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 <http://lexvo.org/id/iso639-3/uve> ;
+ dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ;
+ dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
+ dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
+ dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
+ dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
+ dc11:title "The two hermit crabs and the coconut crab"@en ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ dc:extent "PT2M35S" ;
+ edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
+ olac:depositor <http://viaf.org/viaf/56614135> ;
+ dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
+ olac:researcher <http://viaf.org/viaf/56614135> ;
+ 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 <http://sws.geonames.org/2139490/>
+ ] .
+
+ <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
+ a edm:WebResource ;
+ 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 ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+
+ <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
+ a edm:WebResource ;
+ dc:extent "PT2M35S" ;
+ dc11:format "audio/x-wav"^^dc:IMT ;
+ edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
+ dc:created "1997-08-29"^^dc:W3CDTF ;
+ dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+
+ <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
+ a edm:WebResource ;
+ dc:extent "PT2M35S" ;
+ dc11:format "audio/mpeg"^^dc:IMT ;
+ edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
+ dc:created "1997-08-29"^^dc:W3CDTF ;
+ dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+EOT
+ ,
+ 'SOUND_NO_MOD' => <<<EOT
+ @prefix ore: <http://www.openarchives.org/ore/terms/> .
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+ <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
+ a ore:Aggregation ;
+ edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
+ edm:provider "Corpus de la Parole"@fr ;
+ edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
+ edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
+ edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
+ edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
+ 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> .
+
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
+ a edm:ProvidedCHO ;
+ dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
+ 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 <http://lexvo.org/id/iso639-3/uve> ;
+ dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ;
+ dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
+ dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
+ dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
+ dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
+ dc11:title "The two hermit crabs and the coconut crab"@en ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ dc:extent "PT2M35S" ;
+ edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
+ olac:depositor <http://viaf.org/viaf/56614135> ;
+ dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
+ olac:researcher <http://viaf.org/viaf/56614135> ;
+ 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 <http://sws.geonames.org/2139490/>
+ ] .
+
+ <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
+ a edm:WebResource ;
+ 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 ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+
+ <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
+ a edm:WebResource ;
+ dc:extent "PT2M35S" ;
+ dc11:format "audio/x-wav"^^dc:IMT ;
+ edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
+ dc:created "1997-08-29"^^dc:W3CDTF ;
+ dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+
+ <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
+ a edm:WebResource ;
+ dc:extent "PT2M35S" ;
+ dc11:format "audio/mpeg"^^dc:IMT ;
+ edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
+ dc:created "1997-08-29"^^dc:W3CDTF ;
+ dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+EOT
+ ,
+ 'TEXT' => <<<EOT
+ @prefix ore: <http://www.openarchives.org/ore/terms/> .
+ @prefix edm: <http://www.europeana.eu/schemas/edm/> .
+ @prefix dc11: <http://purl.org/dc/elements/1.1/> .
+ @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
+ @prefix dc: <http://purl.org/dc/terms/> .
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
+
+ <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
+ a ore:Aggregation ;
+ edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
+ edm:provider "Corpus de la Parole"@fr ;
+ edm:dataProvider <http://viaf.org/viaf/154919513> ;
+ edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
+ edm:isShownBy <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml> ;
+ edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
+ 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> .
+
+ <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
+ a edm:ProvidedCHO ;
+ dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
+ 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 <http://lexvo.org/id/iso639-3/uve> ;
+ dc11:publisher <http://viaf.org/viaf/154919513> ;
+ dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
+ dc11:type "primary_text"^^olac:linguistic-type, <http://purl.org/dc/dcmitype/Text>, "narrative"^^olac:discourse-type ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
+ dc11:subject <http://lexvo.org/id/iso639-3/uve> ;
+ dc11:title "The two hermit crabs and the coconut crab"@en ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
+ edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
+ dc:alternative "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
+ olac:depositor <http://viaf.org/viaf/56614135> ;
+ dc11:contributor <http://viaf.org/viaf/56614135>, "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)"
+ ] .
+
+ <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml>
+ a edm:WebResource ;
+ dc11:format "application/xml"^^dc:IMT ;
+ dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+
+ <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xhtml>
+ a edm:WebResource ;
+ dc11:format "application/xhtml+xml"^^dc:IMT ;
+ dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
+ dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
+ dc:accessRights "Freely available for non-commercial use" ;
+ dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
+
+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");
+ }
+
+ }
+
+
+ public function testRightsWebResource() {
+ $properties = [
+ "http://purl.org/dc/elements/1.1/rights",
+ 'http://purl.org/dc/terms/license',
+ 'http://purl.org/dc/terms/accessRights',
+ ];
+
+ $resGraph = $this->resGraph["SOUND_TEXT"];
+ $webResourceList = $resGraph->all('edm:WebResource', '^rdf:type');
+
+ //just check that they have all these resources.
+ //TODO: check that the same rights are kept (difficult)
+ foreach ($webResourceList as $webResource) {
+ foreach ($properties as $prop) {
+ $outputValuesStr = [];
+ foreach($webResource->all($resGraph->resource($prop)) as $outputValue) {
+ array_push($outputValuesStr, strval($outputValue));
+ }
+ $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
+ }
+ }
+ }
+
+ public function testRightDifferent() {
+ $resGraph = $this->resGraph["SOUND_TEXT"];
+
+ $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
+
+ $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
+
+ $this->assertNotNull($license, "The licence must not be null");
+ $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
+ $this->assertEquals(config('corpusparole.corpus_doc_default_cc_rights'), $license->getUri(), "License must be default licence");
+ }
+
+ public function testRightSame() {
+ $resGraph = $this->resGraph["SOUND_NO_MOD_TEXT"];
+
+ $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
+
+ $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
+
+ $this->assertNotNull($license, "The licence must not be null");
+ $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
+ $this->assertEquals('http://creativecommons.org/licenses/by-nc-sa/4.0/', $license->getUri(), "License must be default licence");
+ }
+
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/Sparql/SparqlClientTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,224 @@
+<?php
+
+use CorpusParole\Libraries\Sparql\SparqlClient;
+use CorpusParole\Libraries\CorpusParoleException;
+use CorpusParole\Models\Document;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\Handler\MockHandler;
+use GuzzleHttp\HandlerStack;
+use GuzzleHttp\Psr7\Response;
+use GuzzleHttp\Middleware;
+
+use Mockery as m;
+
+class SparqlClientTest extends TestCase {
+
+ const TEST_DOC_ADD = <<<EOT
+<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .
+<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "drama"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .
+EOT;
+
+ const TEST_DOC_DELETE = <<<EOT
+<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .
+EOT;
+
+
+ private $container;
+ private $sparqlClients;
+ private $transactionUrl;
+
+ private $responsesArray;
+
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ private function getSparqlClient($responses, &$container, $sparqlClient) {
+ $mock = new MockHandler($responses);
+ $handler = HandlerStack::create($mock);
+ $history = Middleware::history($container);
+ $handler->push($history);
+ $httpClient = new Client(['handler' => $handler, 'http_errors' => false]);
+
+ return new SparqlClient($httpClient, $sparqlClient);
+ }
+
+ public function setUp() {
+ parent::setUp();
+ $this->sesameRepository = config('corpusparole.sesame_repository');
+ $this->transactionUrl = config('corpusparole.sesame_query_url').'/transactions/64a5937f-c112-d014-a044-f0123b93';
+
+ $this->addGraph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", SparqlClientTest::TEST_DOC_ADD);
+ $this->deleteGraph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", SparqlClientTest::TEST_DOC_DELETE);
+
+ }
+
+ public function tearDown() {
+ m::close();
+ parent::tearDown();
+ }
+
+ public function testCreateTransaction() {
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+
+ $this->assertEquals($this->transactionUrl, $documentRepository->getCurrentTransactionUrl(), 'Must have correct transaction url');
+ }
+
+ public function testCreateTransactionHistory() {
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+
+ $this->assertCount(1, $container, 'One request');
+ $req = $container[0]['request'];
+ $this->assertEquals("$this->sesameRepository/transactions?isolation-level=http%3A%2F%2Fwww.openrdf.org%2Fschema%2Fsesame%23SNAPSHOT_READ", (string)$req->getUri(), "url must be ok");
+ $this->assertEquals('POST', $container[0]['request']->getMethod(), "methos is POST");
+ }
+
+ public function testRollbackTransaction() {
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ new Response(204)
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+ $documentRepository->rollback();
+
+ $this->assertCount(2, $container, '2 requests');
+
+ $this->assertNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be null");
+
+ $req = $container[1]['request'];
+
+ $this->assertEquals($this->transactionUrl, (string)$req->getUri(), "uri must be the transaction url");
+ $this->assertEquals('DELETE', $req->getMethod(), "Method must be DELETE");
+
+ }
+
+ public function testCommitTransaction() {
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ new Response(200)
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+ $documentRepository->commit();
+
+
+ $this->assertCount(2, $container, '2 requests');
+
+ $this->assertNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be null");
+
+ $req = $container[1]['request'];
+
+ $this->assertEquals($this->transactionUrl."?action=COMMIT", (string)$req->getUri(), "uri must be the transaction url");
+ $this->assertEquals('PUT', $req->getMethod(), "Method must be PUT");
+
+ }
+
+ /**
+ * @expectedException CorpusParole\Libraries\CorpusParoleException
+ */
+ public function testCommitTransactionFail() {
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ new Response(404, [], "Not found")
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+ $documentRepository->commit();
+
+ }
+
+
+ public function testAdd() {
+
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ new Response(204)
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+ $documentRepository->add($this->addGraph);
+
+ $this->assertCount(2, $container, '2 requests');
+
+ $this->assertNotNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be not null");
+
+ $req = $container[1]['request'];
+
+ $this->assertEquals($this->transactionUrl."?action=UPDATE", (string)$req->getUri(), "uri must be the transaction url");
+ $this->assertEquals('PUT', $req->getMethod(), "Method must be PUT");
+ $this->assertEquals(['application/sparql-update; charset=utf-8'], $req->getHeader('Content-type'), "content type must be form urlencoded");
+
+ $body = (string)$req->getBody();
+
+ $this->assertContains('INSERT DATA {', $body, 'update parameter must contain INSERT');
+ $this->assertContains('GRAPH <'.$this->addGraph->getUri().'> {', $body, 'update parameter must contain GRAPH id');
+ $this->assertContains('<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type>', $body, 'update parameter must contain dialogue');
+ $this->assertContains('<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "drama"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .', $body, 'update parameter must contain drama');
+ }
+
+ public function testDelete() {
+ $responses = [
+ new Response(201, ['Location' => "$this->transactionUrl"]),
+ new Response(204)
+ ];
+ $container = [];
+ $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
+
+ $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
+
+ $documentRepository->startTransaction();
+ $documentRepository->delete($this->deleteGraph);
+
+ $this->assertCount(2, $container, '2 requests');
+
+ $this->assertNotNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be not null");
+
+ $req = $container[1]['request'];
+
+ $this->assertEquals($this->transactionUrl."?action=UPDATE", (string)$req->getUri(), "uri must be the transaction url");
+ $this->assertEquals('PUT', $req->getMethod(), "Method must be PUT");
+ $this->assertEquals(['application/sparql-update; charset=utf-8'], $req->getHeader('Content-type'), "content type must be form urlencoded");
+
+ $body = (string)$req->getBody();
+
+ $this->assertContains('DELETE DATA {', $body, 'update parameter must contain DELETE');
+ $this->assertContains('GRAPH <'.$this->addGraph->getUri().'> {', $body, 'update parameter must contain GRAPH id');
+ $this->assertContains('<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type>', $body, 'update parameter must contain GRAPH id');
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/tests/Libraries/UtilsTest.php Wed Apr 13 13:38:40 2016 +0200
@@ -0,0 +1,34 @@
+<?php
+
+use CorpusParole\Libraries\Utils;
+
+class UtilsTest extends TestCase {
+ function __construct(string $name = null) {
+ parent::__construct($name);
+ }
+
+ public function setup() {
+ }
+
+ public function tearDown() {
+ }
+
+ public function testDateIntervalToMillis() {
+ $di = new \DateInterval("P1Y1M1DT1H1M1S");
+
+ $ms = Utils::dateIntervalToMillis($di);
+
+ $this->assertEquals(34277461000, $ms, "duration must be 3427746100");
+ }
+
+ public function testiso8601IntervalToMillis() {
+ $ms = Utils::iso8601IntervalToMillis("P1Y1M1DT1H1M1S");
+ $this->assertEquals(34277461000, $ms, "duration must be 3427746100");
+ }
+
+ public function testiso8601IntervalToMillisNull() {
+ $ms = Utils::iso8601IntervalToMillis(null);
+ $this->assertNull($ms, "duration must be null");
+ }
+
+}
--- a/server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Mappers\CocoonCollectionRdfMapper;
-use CorpusParole\Libraries\CocoonUtils;
-
-use EasyRdf\Graph;
-use EasyRdf\Resource;
-use EasyRdf\Literal;
-
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-
-class CocoonCollectionRdfMapperTest extends TestCase
-{
-
- const TEST_INPUT_DOCS = [
- 'BASE' => <<<EOT
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
- @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
- @prefix v: <http://rdf.data-vocabulary.org/#> .
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
- <http://purl.org/dc/elements/1.1/description> "Corpus de Français Parlé Parisien des années 2000."@fr , "Le Corpus de Français Parlé Parisien (CFPP2000) est composé d'un ensemble d'interviews non directives sur les quartiers de Paris et de la proche banlieue. Les entretiens, transcrits en orthographe et alignés au tour de parole, sont disponibles sur le net ; ils sont librement employables en échange de la mention dans la bibliographie des travaux qui en seraient tirés d'une part de l'adresse du site: http://cfpp2000.univ-paris3.fr/ et d'autre part du document de présentation suivant : Branca-Rosoff S., Fleury S., Lefeuvre F., Pires M., 2012, \"Discours sur la ville. Présentation du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)\". En février 2013, ce corpus comprenait environ 550 000 mots. Un certain nombre d'outils en ligne, notamment un concordancier et des outils textométriques permettent de mener des requêtes lexicales et grammaticales. CFPP2000 est particulièrement destiné à des analyses sur le français oral. Le projet sous-jacent au corpus est par ailleurs l'étude des modifications et des variations qui interviennent dans ce qu'on peut considérer comme un parisien véhiculaire en tension entre le pôle du standard et le pôle du vernaculaire. Par ailleurs, il comporte des activités linguistiques diversifiées (description de quartier, anecdotes, argumentationâ¦) et on peut par conséquent travailler sur la syntaxe propre à ces différentes utilisations du langage. Il permet enfin d'opposer dialogues (entre enquêteur et enquêtés) et multilogues (où la présence de plusieurs enquêtés favorise le passage à un registre familier). CFPP2000 est constitué d'interviews longues (d'une heure en moyenne) intégralement transcrites. Il est donc utilisable pour examiner les singularités qui reviennent à l'idiolecte propre à une personne donnée, par opposition aux variantes diffusées dans des groupes plus larges (quartiers, groupes socio-culturels, classe d'âge, etc.). Le corpus constitue enfin un ensemble de témoignages intéressants sur les représentations de Paris et de sa proche banlieue qui est susceptible d'intéresser des analystes du discours, des sociologues, ou tout simplement des curieux de la ville."@fr ;
- <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Collection> ;
- <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/fra> ;
- <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/gsw> ;
- <http://purl.org/dc/terms/created> "start=1988; end=1989"^^<http://purl.org/dc/terms/Period> ;
- <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ;
- <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/93752300> ;
- <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/142432638> , "Fédération CLESTHIA" , <http://viaf.org/viaf/154862993> ;
- <http://purl.org/dc/elements/1.1/title> "Corpus de Français Parlé Parisien des années 2000 (CFPP)"@fr ;
- <http://www.language-archives.org/OLAC/1.1/interviewer> "Branca-Rosoff, Sonia" , "Lefeuvre, Florence" , "Pires, Mat" ;
- <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ;
- <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- <http://purl.org/dc/terms/spatial> "FR"^^<http://purl.org/dc/terms/ISO3166> , "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr , <http://vocab.getty.edu/tgn/7008038> ;
- <http://purl.org/dc/terms/available> "2013-04-12"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/issued> "2013-04-12T22:20:23+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/modified> "2014-05-10T20:16:27+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://www.language-archives.org/OLAC/1.1/transcriber> "Branca-Rosoff, Sonia" , "Lefeuvre, Florence" , "Pires, Mat" ;
- <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.3333"^^xsd:float ;
- <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "48.8667"^^xsd:float ;
- <http://www.language-archives.org/OLAC/1.1/compiler> "Branca-Rosoff, Sonia" , "Fleury, Serge" , "Lefeuvre, Florence" , "Pires, Mat" ;
- <http://www.language-archives.org/OLAC/1.1/data_inputter> "Branca-Rosoff, Sonia" , "Lefeuvre, Florence" , "Pires, Mat" ;
- <http://www.language-archives.org/OLAC/1.1/researcher> "Branca-Rosoff, Sonia" , "Fleury, Serge" , "Lefeuvre, Florence" , "Pires, Mat" ;
- <http://www.language-archives.org/OLAC/1.1/sponsor> "Ville de Paris " , "Délégation générale à la langue française et aux langues de France " ;
- <http://www.language-archives.org/OLAC/1.1/developer> "Fleury, Serge" ;
- <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ALA> .
-EOT
- ];
-
- const TEST_INPUT_ID = "crdo-COLLECTION_CFPP2000";
-
- private $inputGraphes = [];
- private $resGraphes = [];
- private $mappers = [];
-
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- public function setUp() {
- parent::setUp();
-
- $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonCollectionRdfMapperTest::TEST_INPUT_ID;
-
- foreach(CocoonCollectionRdfMapperTest::TEST_INPUT_DOCS as $key => $inputDoc) {
- $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000", $inputDoc);
- $this->mappers[$key] = new CocoonCollectionRdfMapper($this->inputGraphes[$key]);
- $this->mappers[$key]->mapGraph();
- $this->resGraphes[$key] = $this->mappers[$key]->getOutputGraphes()[$this->inputGraphes[$key]->getUri()];
- }
- }
-
- public function tearDown() {
- parent::tearDown();
- }
-
- /**
- * Just test that the construct and setup are ok
- *
- * @return void
- */
- public function testInit()
- {
- $this->assertTrue(true);
- }
-
- /**
- * Test that the returned graph has the same uri that the original.
- *
- * @return void
- */
- public function testUri() {
-
- //echo $this->resGraphes['BASE']->serialise('turtle');
- //echo var_export($this->resGraphes['BASE']->toRdfPhp());
-
- $this->assertNotNull($this->resGraphes['BASE']);
- $this->assertEquals($this->testGraphUri, $this->resGraphes['BASE']->getUri(), "URIS must be translated");
- }
-
- /**
- * Test that the return graph has one edm:Collection resource
- *
- * @return void
- */
- public function testAggregationResource() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:Collection');
-
- $this->assertCount(1, $resources, "Must found only one resources of type edm:Collection");
- $this->assertEquals($this->testGraphUri,$resources[0]);
- }
-
- /**
- * Test one to one mapping spatial info
- *
- * @return void
- */
- public function testSpatial() {
-
- $coll = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($coll);
- $this->assertNotNull($sourceNode);
-
- $spatials = $coll->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/spatial'));
-
- $this->assertCount(1, $spatials, "Must have only one spatial node");
- $spatial = $spatials[0];
- $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
- $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
-
- $lats = $spatial->all('geo:lat');
- $this->assertCount(1, $lats, "One latitude");
- $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
- $this->assertEquals(Literal::create("48.8667", null, 'xsd:float'), $lats[0], "lat must be '48.8667'^^xsd:float");
-
- $longs = $spatial->all('geo:long');
- $this->assertCount(1, $longs, "One longitude");
- $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
- $this->assertEquals(Literal::create("2.3333", null, 'xsd:float'), $longs[0], "long must be '1.90'^^xsd:float");
-
- $notes = $spatial->all('skos:note');
- $this->assertCount(2, $notes, "2 notes");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
- $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
- $this->assertEquals(Literal::create("France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier", "fr", null), $notes[1], "notes contains 'France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier'@fr");
-
- $sameas = $spatial->all('owl:sameAs');
- $this->assertCount(1, $sameas, "1 same as");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
- $this->assertEquals('http://vocab.getty.edu/tgn/7008038', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008038");
- }
-
- /**
- * Test one to one mapping
- *
- * @return void
- */
- public function testOneToOnePropsIdentity() {
-
- $properties = [
- 'http://purl.org/dc/elements/1.1/description',
- 'http://purl.org/dc/elements/1.1/language',
- 'http://purl.org/dc/elements/1.1/publisher',
- 'http://purl.org/dc/elements/1.1/rights',
- 'http://purl.org/dc/terms/license',
- 'http://purl.org/dc/elements/1.1/subject',
- 'http://purl.org/dc/elements/1.1/title',
- 'http://purl.org/dc/terms/available',
- 'http://purl.org/dc/terms/created',
- 'http://purl.org/dc/terms/issued',
- 'http://purl.org/dc/elements/1.1/type',
- 'http://purl.org/dc/elements/1.1/language',
- 'http://purl.org/dc/terms/modified',
- ];
-
- $coll = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($coll);
- $this->assertNotNull($sourceNode);
-
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($coll->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
- }
- }
-
- }
-
- public function testLinkToCocoonCollection() {
- $coll = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($coll);
- $this->assertNotNull($sourceNode);
-
- $versionOfRes = $coll->all("<http://purl.org/dc/terms/isVersionOf>");
- $this->assertCount(1, $versionOfRes, "Must have only on isVersionOf");
- $versionOfRes = $versionOfRes[0];
- $this->assertInstanceOf("EasyRdf\Resource", $versionOfRes, "version Res must be a resource");
- $this->assertEquals($sourceNode->getUri(), $versionOfRes->getUri(), "versionof res uri must be sams than source");
-
- }
-
- /**
- * Test mapping for isPartOf
- *
- * @return void
- */
- public function testOneToOneCollectionIsPartOf() {
- $collection = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($collection);
- $this->assertNotNull($sourceNode);
-
- $ispartOf = $collection->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>');
- $this->assertCount(1, $ispartOf, "Must have one collection node");
-
- $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ALA", strval($collection->get('<http://www.europeana.eu/schemas/edm/isGatheredInto>')), "the isPartOf mus equals ".config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ALA");
- }
-
-
-}
--- a/server/src/tests/libraries/Mappers/CocoonSoundRdfMapperTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,581 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Mappers\CocoonSoundRdfMapper;
-use CorpusParole\Libraries\CocoonUtils;
-
-use EasyRdf\Graph;
-use EasyRdf\Resource;
-use EasyRdf\Literal;
-
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-
-class CocoonSoundRdfMapperTest extends TestCase
-{
-
- const TEST_INPUT_DOCS = [
- 'BASE' => <<<EOT
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
- @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
- @prefix v: <http://rdf.data-vocabulary.org/#> .
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
- <http://purl.org/dc/elements/1.1/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 ;
- <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Sound> , "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
- <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/fra> , "text_and_corpus_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb135052099> , <http://ark.bnf.fr/ark:/12148/cb11943508j> , <http://ark.bnf.fr/ark:/12148/cb11934124q> , <http://ark.bnf.fr/ark:/12148/cb11931498c> , <http://ark.bnf.fr/ark:/12148/cb11935508t> , <http://ark.bnf.fr/ark:/12148/cb11934132b> , <http://ark.bnf.fr/ark:/12148/cb11939893p> , <http://ark.bnf.fr/ark:/12148/cb11933091b> ;
- <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/fra> ;
- <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/181558906> ;
- <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/181558906> ;
- <http://purl.org/dc/elements/1.1/rights> "Copyright (c) 2012 Université d'Orléans/LLL" ;
- <http://purl.org/dc/elements/1.1/title> "ESLO1: entretien 019"@fr ;
- <http://purl.org/dc/terms/alternative> "ESLO1: entretien 019 alt"@fr ;
- <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> ;
- <http://purl.org/dc/terms/accessRights> " Freely available for non-commercial use" ;
- <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- <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> ;
- <http://purl.org/dc/terms/extent> "PT0H47M16S" ;
- <http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
- <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 ;
- <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav> ;
- <http://purl.org/dc/terms/available> "2014-11-06"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/modified> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://www.language-archives.org/OLAC/1.1/speaker> "JK" , "UG393" ;
- <http://purl.org/dc/elements/1.1/source> <http://archivesetmanuscrits.bnf.fr/ead.html?id=FRBNFEAD000095934&c=FRBNFEAD000095934_a19844296> ;
- <http://www.w3.org/2003/01/geo/wgs84_pos#long> "1.90"^^xsd:float ;
- <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "47.90"^^xsd:float ;
- <http://purl.org/dc/terms/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 ;
- <http://purl.org/dc/terms/isRequiredBy> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_C> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_A> ;
- <http://www.language-archives.org/OLAC/1.1/editor> <http://viaf.org/viaf/39685504> , <http://viaf.org/viaf/200058210> ;
- <http://purl.org/dc/terms/abstract> " Identifiant du témoin : UG 393 Femme, 72 ans (né en 1897, à Orléans ) ; comptable en retraite Enregistré par Jack Kay, le 11 avril 1969, au domicile du témoin. Questionnaires enregistrés : questionnaire sociolinguistique; questionnaire ouvert(questions 01 ; 03-04 ; T1-T5 ; L1-L3 ; E1-E6 ; P1 ; P4 ; P9-P10 ; P6-P8 ; P5 ; P11-P12 ; omelette). Classe politique du témoin : Centre Remarques sur le témoignage : réponses concises. Intérêt pédagogique : conditions de travail avant la guerre de 1940 ; classes sociales. Acoustique : bonne qualité d'enregistrement."@fr ;
- <http://www.language-archives.org/OLAC/1.1/researcher> "Kay, Jack" ;
- <http://purl.org/dc/elements/1.1/relation> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENTCONT_233> ;
- <http://purl.org/dc/terms/medium> "1 bande magnétique audio"@fr ;
- <http://purl.org/dc/terms/bibliographicCitation> "A.-M. VURPAS (1988), Autrefois dans les monts du Beaujolais, Action graphique.";
- <http://purl.org/dc/elements/1.1/identifier> "Cote producteur: 001_3"@fr ;
- <http://purl.org/dc/elements/1.1/reference> <http://panini.u-paris10.fr> ;
- <http://purl.org/dc/elements/1.1/coverage> "Quartier concerné : 3e"@fr ;
- <http://purl.org/dc/elements/1.1/creator> "Blanc, Michel" , "Biggs, Patricia" .
-EOT
- ,
- 'NO-FORMAT' => <<<EOT
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
- @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
- @prefix v: <http://rdf.data-vocabulary.org/#> .
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
- <http://purl.org/dc/elements/1.1/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 ;
- <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Sound> , "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
- <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/fra> , "text_and_corpus_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb135052099> , <http://ark.bnf.fr/ark:/12148/cb11943508j> , <http://ark.bnf.fr/ark:/12148/cb11934124q> , <http://ark.bnf.fr/ark:/12148/cb11931498c> , <http://ark.bnf.fr/ark:/12148/cb11935508t> , <http://ark.bnf.fr/ark:/12148/cb11934132b> , <http://ark.bnf.fr/ark:/12148/cb11939893p> , <http://ark.bnf.fr/ark:/12148/cb11933091b> ;
- <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/fra> ;
- <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/181558906> ;
- <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/181558906> ;
- <http://purl.org/dc/elements/1.1/rights> "Copyright (c) 2012 Université d'Orléans/LLL" ;
- <http://purl.org/dc/elements/1.1/title> "ESLO1: entretien 019"@fr ;
- <http://purl.org/dc/terms/alternative> "ESLO1: entretien 019 alt"@fr ;
- <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> ;
- <http://purl.org/dc/terms/accessRights> " Freely available for non-commercial use" ;
- <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- <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/dc/terms/extent> "PT0H47M16S" ;
- <http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
- <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 ;
- <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav> ;
- <http://purl.org/dc/terms/available> "2014-11-06"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/modified> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://www.language-archives.org/OLAC/1.1/speaker> "JK" , "UG393" ;
- <http://purl.org/dc/elements/1.1/source> <http://archivesetmanuscrits.bnf.fr/ead.html?id=FRBNFEAD000095934&c=FRBNFEAD000095934_a19844296> ;
- <http://www.w3.org/2003/01/geo/wgs84_pos#long> "1.90"^^xsd:float ;
- <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "47.90"^^xsd:float ;
- <http://purl.org/dc/terms/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 ;
- <http://purl.org/dc/terms/isRequiredBy> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_C> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019_A> ;
- <http://www.language-archives.org/OLAC/1.1/editor> <http://viaf.org/viaf/39685504> , <http://viaf.org/viaf/200058210> ;
- <http://purl.org/dc/terms/abstract> " Identifiant du témoin : UG 393 Femme, 72 ans (né en 1897, à Orléans ) ; comptable en retraite Enregistré par Jack Kay, le 11 avril 1969, au domicile du témoin. Questionnaires enregistrés : questionnaire sociolinguistique; questionnaire ouvert(questions 01 ; 03-04 ; T1-T5 ; L1-L3 ; E1-E6 ; P1 ; P4 ; P9-P10 ; P6-P8 ; P5 ; P11-P12 ; omelette). Classe politique du témoin : Centre Remarques sur le témoignage : réponses concises. Intérêt pédagogique : conditions de travail avant la guerre de 1940 ; classes sociales. Acoustique : bonne qualité d'enregistrement."@fr ;
- <http://www.language-archives.org/OLAC/1.1/researcher> "Kay, Jack" ;
- <http://purl.org/dc/elements/1.1/relation> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENTCONT_233> ;
- <http://purl.org/dc/terms/medium> "1 bande magnétique audio"@fr ;
- <http://purl.org/dc/terms/bibliographicCitation> "A.-M. VURPAS (1988), Autrefois dans les monts du Beaujolais, Action graphique.";
- <http://purl.org/dc/elements/1.1/identifier> "Cote producteur: 001_3"@fr ;
- <http://purl.org/dc/elements/1.1/reference> <http://panini.u-paris10.fr> ;
- <http://purl.org/dc/elements/1.1/creator> "Blanc, Michel" , "Biggs, Patricia" .
-
-EOT
- ];
-
- const TEST_INPUT_ID = "crdo-ESLO1_ENT_019";
- const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019";
-
-
- private $inputGraphes = [];
- private $resGraphes = [];
- private $mappers = [];
-
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- public function setUp() {
- parent::setUp();
-
- $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonSoundRdfMapperTest::TEST_INPUT_ID;
-
- foreach(CocoonSoundRdfMapperTest::TEST_INPUT_DOCS as $key => $inputDoc) {
- $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019", $inputDoc);
- $this->mappers[$key] = new CocoonSoundRdfMapper($this->inputGraphes[$key]);
- $this->mappers[$key]->mapGraph();
- $this->resGraphes[$key] = $this->mappers[$key]->getOutputGraphes()[$this->inputGraphes[$key]->getUri()];
- }
- }
-
- public function tearDown() {
- parent::tearDown();
- }
-
- /**
- * Just test that the construct and setup are ok
- *
- * @return void
- */
- public function testInit()
- {
- $this->assertTrue(true);
- }
-
- /**
- * Test that the returned graph has the same uri that the original.
- *
- * @return void
- */
- public function testUri() {
-
- //echo $this->resGraphes['BASE']->serialise('turtle');
- //echo var_export($this->resGraphes['BASE']->toRdfPhp());
-
- $this->assertNotNull($this->resGraphes['BASE']);
- $this->assertEquals($this->testGraphUri, $this->resGraphes['BASE']->getUri(), "URIS must be translated");
- }
-
- /**
- * Test that the return graph has one ore:Aggregation resource
- *
- * @return void
- */
- public function testAggregationResource() {
-
- $resources = $this->resGraphes['BASE']->allOfType('ore:Aggregation');
-
- $this->assertCount(1, $resources, "Must found only one resources of type ore:Aggregation");
- $this->assertEquals($this->testGraphUri,$resources[0]);
- }
-
- /**
- * test that there one (and only one) edm:dateProvider and edm:provider property
- *
- * @return void
- */
- public function testProviders() {
-
- $providers = $this->resGraphes['BASE']->all($this->testGraphUri,'edm:provider');
-
- $this->assertCount(1,$providers, "one and only one edm provider");
- $this->assertTrue($providers[0] instanceof Literal);
- $this->assertEquals('Corpus de la Parole', $providers[0]->getValue(), 'provider must be Corpus de la Parole');
- $this->assertEquals('fr', $providers[0]->getLang(), 'provider must be in french');
-
- $dataProviders = $this->resGraphes['BASE']->all($this->testGraphUri,'edm:dataProvider');
-
- $this->assertCount(1,$dataProviders, "one and only one edm data provider");
- //TODO: to change after viaf resolution
- $this->assertTrue($dataProviders[0] instanceof Resource);
- $this->assertEquals('http://viaf.org/viaf/181558906', $dataProviders[0]->getUri(), 'dataProvider uri must be http://viaf.org/viaf/181558906');
- }
-
-
- /**
- * test isShownAt and isShownBy
- *
- * @return void
- */
- public function testIsShown() {
-
- $isShownAts = $this->resGraphes['BASE']->all($this->testGraphUri, 'edm:isShownAt');
-
- $this->assertCount(1, $isShownAts, "One edm:isShownAt");
- $this->assertInstanceOf("EasyRdf\Resource", $isShownAts[0]);
- $this->assertEquals("http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-ESLO1_ENT_019", $isShownAts[0]);
-
- $isShownBys = $this->resGraphes['BASE']->all($this->testGraphUri, 'edm:isShownBy');
-
- $this->assertCount(1, $isShownBys, "One edm:isShownBy");
- $this->assertInstanceOf("EasyRdf\Resource", $isShownBys[0]);
- $this->assertEquals("http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav", $isShownBys[0]);
-
- }
-
- /**
- * test rights
- *
- * @return void
- */
- public function testRights() {
- $rightsNodes = $this->resGraphes['BASE']->all($this->testGraphUri, 'edm:rights');
-
- $this->assertCount(1, $rightsNodes, "One edm:right");
-
- $rights = $rightsNodes[0];
-
- $this->assertTrue($rights instanceof Resource);
-
- $this->assertEquals("http://creativecommons.org/licenses/by-nc-sa/4.0/", $rights->getUri(), "right must be CC-BY-NC");
- }
-
- /**
- * Test that the return graph has one ore:Aggregation resource
- *
- * @return void
- */
- public function testProvidedCHO() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
-
- $this->assertCount(1, $resources, "Must found only one resources of type edm:aggregatedCHO");
- $this->assertEquals(CocoonSoundRdfMapperTest::TEST_CHO_URI,$resources[0]);
- }
-
- /**
- * Test providedCHO identifier.
- *
- * @return void
- */
- public function testProvidedChoId() {
- $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
-
- $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
- $providedCHO = $resources[0];
-
- $identifier = $providedCHO->getLiteral('<http://purl.org/dc/elements/1.1/identifier>');
-
- $this->assertInstanceOf('EasyRdf\Literal', $identifier, "identifier value must be a literal");
- $this->assertEquals(config('corpusparole.corpus_id_scheme') . CocoonSoundRdfMapperTest::TEST_INPUT_ID, $identifier->getValue(), "Value must be equals to ".config('corpusparole.corpus_id_scheme').CocoonSoundRdfMapperTest::TEST_INPUT_ID);
-
- }
-
-
- public function testRightsWebResourceIdentity() {
- $properties = [
- "http://purl.org/dc/elements/1.1/rights",
- 'http://purl.org/dc/terms/license',
- ];
-
- $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- foreach ($webResourceList as $webResource) {
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
- }
- }
- }
- }
-
- public function testRightsWebResourceTrim() {
- $properties = [
- 'http://purl.org/dc/terms/accessRights',
- ];
-
- $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- foreach ($webResourceList as $webResource) {
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(trim(strval($value)), $outputValuesStr, "$prop not found in output graph");
- }
- }
- }
- }
-
- /**
- * Test one to one mapping
- *
- * @return void
- */
- public function testOneToOneProvidedCHOIdentity() {
-
- $properties = [
- 'http://purl.org/dc/terms/tableOfContents',
- 'http://purl.org/dc/elements/1.1/description',
- 'http://purl.org/dc/elements/1.1/language',
- 'http://purl.org/dc/elements/1.1/publisher',
- 'http://purl.org/dc/elements/1.1/rights',
- 'http://purl.org/dc/terms/license',
- 'http://purl.org/dc/elements/1.1/subject',
- 'http://purl.org/dc/elements/1.1/title',
- 'http://purl.org/dc/terms/available',
- 'http://purl.org/dc/terms/created',
- 'http://purl.org/dc/terms/issued',
- 'http://purl.org/dc/terms/extent',
- 'http://purl.org/dc/elements/1.1/type',
- 'http://purl.org/dc/elements/1.1/language',
- 'http://purl.org/dc/terms/medium',
- 'http://purl.org/dc/elements/1.1/source',
- 'http://purl.org/dc/terms/alternative',
- 'http://purl.org/dc/terms/modified',
- 'http://purl.org/dc/terms/abstract',
- 'http://purl.org/dc/terms/bibliographicCitation',
- 'http://purl.org/dc/elements/1.1/identifier',
- 'http://purl.org/dc/terms/references',
- 'http://purl.org/dc/elements/1.1/coverage',
- 'http://purl.org/dc/elements/1.1/relation',
- 'http://purl.org/dc/elements/1.1/creator',
- ];
-
- $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
- $this->assertNotNull($sourceNode);
-
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($providedCHO->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
- }
- }
-
- }
-
- /**
- * Test mapping for isPartOf
- *
- * @return void
- */
- public function testOneToOneProvidedCHOIsPartOf() {
- $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
- $this->assertNotNull($sourceNode);
-
- $isGatheredInto = $providedCHO->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>');
- $this->assertCount(2, $isGatheredInto, "Must have two collection node");
-
- $ispartOf = $providedCHO->all('<http://purl.org/dc/terms/isPartOf>');
- $this->assertCount(1, $ispartOf, "Must have one collection node");
-
- $outputValuesStr = [];
- foreach($providedCHO->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>') as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test isGatheredInto");
-
- $this->assertContains(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_LANGUESDEFRANCE", $outputValuesStr, config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_LANGUESDEFRANCE not found in output graph");
- $this->assertContains(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ESLO1", $outputValuesStr, config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ESLO1 not found in output graph");
-
- $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-ESLO1_ENT_010", strval($providedCHO->get('<http://purl.org/dc/terms/isPartOf>')), "the isPartOf mus equals ".config('corpusparole.corpus_doc_id_base_uri')."crdo-ESLO1_ENT_010");
- }
-
- /**
- * Test one to one mapping spatial info
- *
- * @return void
- */
- public function testOneToOneProvidedCHOSpatial() {
- $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
- $this->assertNotNull($sourceNode);
-
- $spatials = $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/spatial'));
-
- $this->assertCount(1, $spatials, "Must have only one spatial node");
- $spatial = $spatials[0];
- $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
- $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
-
- $lats = $spatial->all('geo:lat');
- $this->assertCount(1, $lats, "One latitude");
- $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
- $this->assertEquals(Literal::create("47.90", null, 'xsd:float'), $lats[0], "lat must be '47.90'^^xsd:float");
-
- $longs = $spatial->all('geo:long');
- $this->assertCount(1, $longs, "One longitude");
- $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
- $this->assertEquals(Literal::create("1.90", null, 'xsd:float'), $longs[0], "long must be '1.90'^^xsd:float");
-
- $notes = $spatial->all('skos:note');
- $this->assertCount(2, $notes, "2 notes");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
- $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
- $this->assertEquals(Literal::create("France, Centre, Loiret, Orléans", "fr", null), $notes[1], "notes contains 'France, Centre, Loiret, Orléans'@fr");
-
- $sameas = $spatial->all('owl:sameAs');
- $this->assertCount(1, $sameas, "1 same as");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
- $this->assertEquals('http://vocab.getty.edu/tgn/7008337', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008337");
- }
-
- /**
- * Test one to one mapping trim values
- *
- * @return void
- */
- public function testOneToOneProvidedCHOTrim() {
-
- $properties = [
- 'http://purl.org/dc/terms/accessRights',
- ];
-
- $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
- $this->assertNotNull($sourceNode);
-
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($providedCHO->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, 'we must found some values to test');
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(trim(strval($value)), $outputValuesStr, "$prop not found in output graph");
- }
- }
- }
-
- /**
- * Test one to one mapping trim values
- *
- * @return void
- */
- public function testOneToOneProvidedCHOReference() {
-
- $providedCHO = $this->resGraphes['NO-FORMAT']->get('edm:ProvidedCHO', '^rdf:type');
- $sourceNode = $this->inputGraphes['NO-FORMAT']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
- $this->assertNotNull($sourceNode);
-
- $outputValuesStr = [];
- foreach($providedCHO->all($this->resGraphes['NO-FORMAT']->resource('http://purl.org/dc/terms/references')) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, 'we must found some values to test for http://purl.org/dc/elements/1.1/reference');
- foreach ($sourceNode->all($this->inputGraphes['NO-FORMAT']->resource('http://purl.org/dc/elements/1.1/reference')) as $value) {
- $this->assertContains(strval($value), $outputValuesStr, "http://purl.org/dc/terms/references not found in output graph");
- }
- }
-
-
- /**
- * Test that the web resources
- *
- * @return void
- */
- public function testWebResources() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
-
- $this->assertCount(3, $resources, "Must found three webresource");
-
- $aggregation = $this->resGraphes['BASE']->resource($this->testGraphUri);
-
- foreach ($resources as $wres) {
- $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
- $this->assertCount(1, $mimetypes, "Must find one mimetype.");
- $mimetype = $mimetypes[0];
- $this->assertInstanceOf("EasyRdf\Literal", $mimetype, "mimetype must be literal");
- $this->assertEquals("dc:IMT",$mimetype->getDatatype());
-
- $extends = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/terms/extent'));
- $this->assertCount(1, $extends, "Must find one extent.");
- $extent = $extends[0];
- $this->assertInstanceOf("EasyRdf\Literal", $extent, "extent must be literal");
- $this->assertStringStartsWith("PT", $extent->getValue(), "value mus start with PT");
-
- if($wres->hasProperty('edm:isDerivativeOf')) {
- $derivative = $wres->get('edm:isDerivativeOf');
- $this->assertInstanceOf("EasyRdf\Resource", $derivative, "Derivative must be a resource");
- $this->assertEquals("http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav", $derivative->getUri(), "derivative uri must be http://cocoon.huma-num.fr/data/eslo/masters/ESLO1_ENT_019.wav");
- $this->assertTrue($aggregation->hasProperty('edm:hasView', $wres));
- }
- else {
- $this->assertTrue($aggregation->hasProperty('edm:isShownBy', $wres));
- }
-
- }
- }
-
- /**
- * Test that the web resources
- *
- * @return void
- */
- public function testWebResourcesDate() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
-
- foreach ($resources as $wres) {
- $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/available"),"web resource must not have http://purl.org/dc/terms/available");
- $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/modified"),"web resource must not have http://purl.org/dc/terms/modified");
- $this->assertTrue($wres->hasProperty("http://purl.org/dc/terms/issued"), "Must have http://purl.org/dc/terms/issued");
- $this->assertTrue($wres->hasProperty("http://purl.org/dc/terms/created"), "Must have http://purl.org/dc/terms/created");
-
- $issued = $wres->getLiteral('dc:issued');
- //<http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- $this->assertInstanceOf('EasyRdf\Literal', $issued, "issued value must be a literal");
- $this->assertEquals('http://purl.org/dc/terms/W3CDTF', $issued->getDatatypeUri(), "issued datatype uri must be a http://purl.org/dc/terms/W3CDTF");
- $this->assertEquals('2014-12-05T15:00:19+01:00', $issued->getValue(), "Value must be 2014-12-05T15:00:19+01:00");
-
- $created = $wres->getLiteral('dc:created');
- //<http://purl.org/dc/terms/created> "1969-04-11"^^<http://purl.org/dc/terms/W3CDTF> ;
- $this->assertInstanceOf('EasyRdf\Literal', $created, "created value must be a literal");
- $this->assertEquals('http://purl.org/dc/terms/W3CDTF', $created->getDatatypeUri(), "created datatype uri must be a http://purl.org/dc/terms/W3CDTF");
- $this->assertEquals('1969-04-11', $created->getValue(), "Value must be 1969-04-11");
-
- }
-
- }
-
- /**
- * Test collection graph creation
- * @return void
- */
- public function testCollectionGraph() {
- $outputs = $this->mappers['BASE']->getOutputGraphes();
- $this->assertCount(3, $outputs, "Must have 3 graphes as output");
- foreach($outputs as $url => $outputGraph) {
- if($outputGraph->getUri() == config('corpusparole.corpus_doc_id_base_uri').'crdo-ESLO1_ENT_019') {
- continue;
- }
- $this->assertContains($outputGraph->getUri(), [config('corpusparole.corpus_doc_id_base_uri').'crdo-COLLECTION_LANGUESDEFRANCE', config('corpusparole.corpus_doc_id_base_uri').'crdo-COLLECTION_ESLO1']);
- $this->assertEquals($outputGraph->resource($outputGraph->getUri())->type(), 'edm:Collection');
- }
- }
-
-}
--- a/server/src/tests/libraries/Mappers/CocoonTextRdfMapperTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Mappers\CocoonTextRdfMapper;
-use CorpusParole\Libraries\CocoonUtils;
-
-use EasyRdf\Graph;
-use EasyRdf\Resource;
-use EasyRdf\Literal;
-
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-
-class CocoonTextRdfMapperTest extends TestCase
-{
-
- const TEST_INPUT_DOCS = [
- 'BASE' => <<<EOT
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
- @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
- @prefix v: <http://rdf.data-vocabulary.org/#> .
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA> a <http://crdo.risc.cnrs.fr/schemas/Resource> ;
- <http://purl.org/dc/elements/1.1/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 ;
- <http://purl.org/dc/elements/1.1/format> "text/xml"^^<http://purl.org/dc/terms/IMT> ;
- <http://purl.org/dc/elements/1.1/type> "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , <http://purl.org/dc/dcmitype/Text> , "narrative"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
- <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/uve> ;
- <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/uve> ;
- <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/56614135> ;
- <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/154919513> ;
- <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Moyse-Faurie, Claire" ;
- <http://purl.org/dc/elements/1.1/title> "The two hermit crabs and the coconut crab"@en ;
- <http://purl.org/dc/terms/isFormatOf> <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> ;
- <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ;
- <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
- <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_LACITO> ;
- <http://purl.org/dc/terms/spatial> "NC"^^<http://purl.org/dc/terms/ISO3166> , "New Caledonia, Ohnyat (Ouvéa)" ;
- <http://purl.org/dc/terms/available> "2011-02-05"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/issued> "2011-02-05T23:22:23+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://www.language-archives.org/OLAC/1.1/speaker> "Idakote, Félicien" ;
- <http://purl.org/dc/terms/requires> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
- <http://purl.org/dc/terms/alternative> "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
- <http://www.language-archives.org/OLAC/1.1/researcher> "Moyse-Faurie, Claire" ;
- <http://purl.org/dc/terms/modified> "2002-02-20"^^<http://purl.org/dc/terms/W3CDTF> ;
- <http://purl.org/dc/terms/conformsTo> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive> .
-EOT
- ];
-
- const TEST_INPUT_ID = "crdo-UVE_MOCIKA_SOUND";
- const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND";
-
-
- private $inputGraphes = [];
- private $resGraphes = [];
- private $mappers = [];
-
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- public function setUp() {
- parent::setUp();
-
- $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonTextRdfMapperTest::TEST_INPUT_ID;
- foreach(CocoonTextRdfMapperTest::TEST_INPUT_DOCS as $key => $inputDoc) {
- $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA", $inputDoc);
- $this->mappers[$key] = new CocoonTextRdfMapper($this->inputGraphes[$key]);
- $this->mappers[$key]->mapGraph();
- $this->resGraphes[$key] = $this->mappers[$key]->getOutputGraphes()["http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND"];
- }
- }
-
- public function tearDown() {
- parent::tearDown();
- }
-
- /**
- * Just test that the construct and setup are ok
- *
- * @return void
- */
- public function testInit()
- {
- $this->assertTrue(true);
- }
-
-
- /**
- * Test that the returned graph has the same uri that the original.
- *
- * @return void
- */
- public function testUri() {
-
- //echo $this->resGraphes['BASE']->serialise('turtle');
- //echo var_export($this->resGraphes['BASE']->toRdfPhp());
-
- $this->assertNotNull($this->resGraphes['BASE']);
- $this->assertEquals($this->testGraphUri, $this->resGraphes['BASE']->getUri(), "URIS must be translated");
- }
-
- /**
- * Test that the return graph has one ore:Aggregation resource
- *
- * @return void
- */
- public function testAggregationResource() {
-
- $resources = $this->resGraphes['BASE']->allOfType('ore:Aggregation');
-
- $this->assertCount(1, $resources, "Must found only one resources of type ore:Aggregation");
- $this->assertEquals($this->testGraphUri,$resources[0]->getUri());
- }
-
- /**
- * Test providedCHO identifier.
- *
- * @return void
- */
- public function testProvidedChoId() {
- $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
-
- $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
- $providedCHO = $resources[0];
-
- $identifier = $providedCHO->getLiteral('<http://purl.org/dc/elements/1.1/identifier>');
-
- $this->assertInstanceOf('EasyRdf\Literal', $identifier, "identifier value must be a literal");
- $this->assertEquals(config('corpusparole.corpus_id_scheme') . CocoonTextRdfMapperTest::TEST_INPUT_ID, $identifier->getValue(), "Value must be equals to ".config('corpusparole.corpus_id_scheme').CocoonTextRdfMapperTest::TEST_INPUT_ID);
-
- }
-
- public function testRightsWebResourceIdentity() {
- $properties = [
- "http://purl.org/dc/elements/1.1/rights",
- 'http://purl.org/dc/terms/license',
- ];
-
- $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- foreach ($webResourceList as $webResource) {
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
- }
- }
- }
- }
-
- public function testRightsWebResourceTrim() {
- $properties = [
- 'http://purl.org/dc/terms/accessRights',
- ];
-
- $webResourceList = $this->resGraphes['BASE']->all('edm:WebResource', '^rdf:type');
- $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
-
- foreach ($webResourceList as $webResource) {
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($webResource->all($this->resGraphes['BASE']->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($sourceNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(trim(strval($value)), $outputValuesStr, "$prop not found in output graph");
- }
- }
- }
- }
-
-
- /**
- * Test providedCHO uri.
- *
- * @return void
- */
- public function testProvidedChoURI() {
- $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
-
- $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
- $this->assertEquals(CocoonTextRdfMapperTest::TEST_CHO_URI,$resources[0]->getUri());
- }
-
-
-
- /**
- * Test that the returned graph does not have a http://purl.org/dc/dcmitype/Sound type
- *
- * @return void
- */
- public function testType() {
- //"primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , <http://purl.org/dc/dcmitype/Text> , "narrative"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ;
- $providedCHO = $this->resGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
-
- $this->assertcount(3, $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/type')), 'but should find 2 literals');
-
- $dcTypeList = $providedCHO->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/type'));
- foreach ($dcTypeList as $dcType) {
- $this->assertThat(
- $dcType,
- $this->logicalXor(
- $this->isInstanceOf(EasyRdf\Literal::class),
- $this->isInstanceOf(EasyRdf\Resource::class)
- )
- );
- }
- }
-
- /**
- * Test that the web resources
- *
- * @return void
- */
- public function testWebResources() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
-
- $this->assertCount(2, $resources, "Must found three webresource");
-
- $aggregation = $this->resGraphes['BASE']->resource($this->testGraphUri);
-
- foreach ($resources as $wres) {
- $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
- $this->assertCount(1, $mimetypes, "Must find one mimetype.");
- $mimetype = $mimetypes[0];
- $this->assertInstanceOf("EasyRdf\Literal", $mimetype, "mimetype must be literal");
- $this->assertEquals("dc:IMT",$mimetype->getDatatype());
- }
- }
-
- /**
- * Test that the web resources has good date
- *
- * @return void
- */
- public function testWebResourcesDate() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
-
- foreach ($resources as $wres) {
- $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/available"),"web resource must not have http://purl.org/dc/terms/available");
- $this->assertFalse($wres->hasProperty("http://purl.org/dc/terms/modified"),"web resource must not have http://purl.org/dc/terms/modified");
- $this->assertTrue($wres->hasProperty("http://purl.org/dc/terms/issued"), "Must have http://purl.org/dc/terms/issued");
-
- $issued = $wres->getLiteral('dc:issued');
- //<http://purl.org/dc/terms/issued> "2014-12-05T15:00:19+01:00"^^<http://purl.org/dc/terms/W3CDTF> ;
- $this->assertInstanceOf('EasyRdf\Literal', $issued, "issued value must be a literal");
- $this->assertEquals('http://purl.org/dc/terms/W3CDTF', $issued->getDatatypeUri(), "issued datatype uri must be a http://purl.org/dc/terms/W3CDTF");
- $this->assertEquals('2011-02-05T23:22:23+01:00', $issued->getValue(), "Value must be 2014-12-05T15:00:19+01:00");
-
- }
-
- }
-
-
- /**
- * Test that the web resources as conformsTo property
- *
- * @return void
- */
- public function testWebResourcesConformsTo() {
-
- $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
- foreach ($resources as $wres) {
-
- $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
- $mimetype = $mimetypes[0]->getValue();
- if($mimetype !== 'application/xml') {
- continue;
- }
- $conformsTo = $wres->get('<http://purl.org/dc/terms/conformsTo>');
- $this->assertNotNull($conformsTo, "Must have a conformsTo node");
- $this->assertInstanceOf('EasyRdf\Resource', $conformsTo, "Must be a resource");
- $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive", $conformsTo->getUri(), "Must be http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive");
- }
- }
-
-
-}
--- a/server/src/tests/libraries/Mergers/CocoonCollectionRdfMergerTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Mergers\CocoonCollectionRdfMerger;
-use CorpusParole\Libraries\CocoonUtils;
-
-use EasyRdf\Graph;
-use EasyRdf\Resource;
-use EasyRdf\Literal;
-
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-
-class CocoonCollectionRdfMergerTest extends TestCase
-{
-
- const TEST_INPUT_DOCS = [
- 'BASE' => <<<EOT
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
- @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
-
- <%1\$scrdo-COLLECTION_CFPP2000>
- a edm:Collection ;
- dc:isVersionOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
- dc11:description "Corpus de Français Parlé Parisien des années 2000."@fr, "Le Corpus de Français Parlé Parisien (CFPP2000) est composé d'un ensemble d'interviews non directives sur les quartiers de Paris et de la proche banlieue. Les entretiens, transcrits en orthographe et alignés au tour de parole, sont disponibles sur le net ; ils sont librement employables en échange de la mention dans la bibliographie des travaux qui en seraient tirés d'une part de l'adresse du site: http://cfpp2000.univ-paris3.fr/ et d'autre part du document de présentation suivant : Branca-Rosoff S., Fleury S., Lefeuvre F., Pires M., 2012, \"Discours sur la ville. Présentation du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)\". En février 2013, ce corpus comprenait environ 550 000 mots. Un certain nombre d'outils en ligne, notamment un concordancier et des outils textométriques permettent de mener des requêtes lexicales et grammaticales. CFPP2000 est particulièrement destiné à des analyses sur le français oral. Le projet sous-jacent au corpus est par ailleurs l'étude des modifications et des variations qui interviennent dans ce qu'on peut considérer comme un parisien véhiculaire en tension entre le pôle du standard et le pôle du vernaculaire. Par ailleurs, il comporte des activités linguistiques diversifiées (description de quartier, anecdotes, argumentationâ¦) et on peut par conséquent travailler sur la syntaxe propre à ces différentes utilisations du langage. Il permet enfin d'opposer dialogues (entre enquêteur et enquêtés) et multilogues (où la présence de plusieurs enquêtés favorise le passage à un registre familier). CFPP2000 est constitué d'interviews longues (d'une heure en moyenne) intégralement transcrites. Il est donc utilisable pour examiner les singularités qui reviennent à l'idiolecte propre à une personne donnée, par opposition aux variantes diffusées dans des groupes plus larges (quartiers, groupes socio-culturels, classe d'âge, etc.). Le corpus constitue enfin un ensemble de témoignages intéressants sur les représentations de Paris et de sa proche banlieue qui est susceptible d'intéresser des analystes du discours, des sociologues, ou tout simplement des curieux de la ville."@fr ;
- dc11:language <http://lexvo.org/id/iso639-3/gsw> ;
- dc11:publisher <http://viaf.org/viaf/142432638>, "Fédération CLESTHIA", <http://viaf.org/viaf/154862993> ;
- dc11:rights "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ;
- dc11:type <http://purl.org/dc/dcmitype/Collection> ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc11:subject <http://lexvo.org/id/iso639-3/fra> ;
- dc11:title "Corpus de Français Parlé Parisien des années 2000 (CFPP)"@fr ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ALA> ;
- olac:compiler "Branca-Rosoff, Sonia", "Fleury, Serge", "Lefeuvre, Florence", "Pires, Mat" ;
- dc11:contributor "Branca-Rosoff, Sonia", "Fleury, Serge", "Lefeuvre, Florence", "Pires, Mat", <http://viaf.org/viaf/93752300>, "Ville de Paris ", "Délégation générale à la langue française et aux langues de France " ;
- olac:data_inputter "Branca-Rosoff, Sonia", "Lefeuvre, Florence", "Pires, Mat" ;
- olac:depositor <http://viaf.org/viaf/93752300> ;
- olac:developer "Fleury, Serge" ;
- olac:interviewer "Branca-Rosoff, Sonia", "Lefeuvre, Florence", "Pires, Mat" ;
- olac:researcher "Branca-Rosoff, Sonia", "Fleury, Serge", "Lefeuvre, Florence", "Pires, Mat" ;
- olac:sponsor "Ville de Paris ", "Délégation générale à la langue française et aux langues de France " ;
- olac:transcriber "Branca-Rosoff, Sonia", "Lefeuvre, Florence", "Pires, Mat" ;
- dc:available "2013-04-12"^^dc:W3CDTF ;
- dc:created "start=1988; end=1989"^^dc:Period ;
- dc:issued "2013-04-12T22:20:23+02:00"^^dc:W3CDTF ;
- dc:modified "2014-05-10T20:16:27+02:00"^^dc:W3CDTF ;
- dc:spatial [
- a edm:Place ;
- geo:lat "48.8667"^^xsd:float ;
- geo:long "2.3333"^^xsd:float ;
- skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr ;
- owl:sameAs <http://vocab.getty.edu/tgn/7008038>
- ] .
-EOT
- ,
- 'SOURCE' => <<<EOT
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
-
- <%1\$scrdo-COLLECTION_CFPP2000>
- a edm:Collection ;
- dc:isVersionOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
- dc11:title "Other title"@fr ;
- dc:created "start=1988; end=1989"^^dc:Period ;
- dc:issued "2013-04-12T22:20:23+02:00"^^dc:W3CDTF ;
- dc:modified "2014-05-10T20:16:27+02:00"^^dc:W3CDTF ;
- dc11:language <http://lexvo.org/id/iso639-3/gsw>, <http://lexvo.org/id/iso639-3/fra> ;
- dc:spatial [
- a edm:Place ;
- geo:lat "89.8667"^^xsd:float ;
- geo:long "55.3333"^^xsd:float ;
- skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr, "Other place very important"@fr ;
- owl:sameAs <http://vocab.getty.edu/tgn/1234567890>
- ] .
-EOT
- ];
-
- const TEST_INPUT_ID = "crdo-COLLECTION_CFPP2000";
- const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000";
-
-
- private $inputGraphes = [];
- private $resGraph;
- private $merger;
-
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- public function setUp() {
- parent::setUp();
-
- $this->testGraphUri = config('corpusparole.corpus_doc_id_base_uri').CocoonCollectionRdfMergerTest::TEST_INPUT_ID;
- foreach(CocoonCollectionRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
- $this->inputGraphes[$key] = new Graph(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000", sprintf($inputDoc, config('corpusparole.corpus_doc_id_base_uri')));
- }
-
- $this->merger = new CocoonCollectionRdfMerger();
- $this->resGraph = $this->merger->mergeGraph($this->inputGraphes['BASE'], $this->inputGraphes['SOURCE']);
- }
-
- 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 the result graph.
- *
- * @return void
- */
- public function testResGraph() {
- $this->assertNotNull($this->resGraph, "Res graph must not be null");
- $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000", $this->resGraph->getUri(), "graph uri must be equals to ".config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND");
- }
-
-
-
- /**
- * test the merged Aggregation
- *
- * @return void
- */
- public function testCollectionResource() {
- $collectionResList = $this->resGraph->allOfType('http://www.europeana.eu/schemas/edm/Collection');
- $this->assertCount(1, $collectionResList, "Only one Collection node");
- $collectionRes = $collectionResList[0];
-
- $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000",$collectionRes->getUri(),"Collection node uri must be ".config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_CFPP2000");
-
- $singleValuesRes = [
- 'http://purl.org/dc/elements/1.1/title' => ['size'=>1, 'val' => new Literal("Corpus de Français Parlé Parisien des années 2000 (CFPP)", "fr", null)],
- 'http://purl.org/dc/terms/available' => ['size'=>1, 'val' => new Literal("2013-04-12", null, "dc:W3CDTF")],
- 'http://purl.org/dc/terms/created' => ['size'=>1, 'val' => new Literal("start=1988; end=1989", null, "dc:Period")],
- 'http://purl.org/dc/terms/issued' => ['size'=>1, 'val' => new Literal("2013-04-12T22:20:23+02:00", null, "dc:W3CDTF")],
- 'http://purl.org/dc/terms/modified' => ['size'=>1, 'val' => new Literal("2014-05-10T20:16:27+02:00", null, "dc:W3CDTF")],
- 'http://purl.org/dc/elements/1.1/language' => ['size' => 2, 'val' => [
- $this->resGraph->resource("http://lexvo.org/id/iso639-3/gsw"),
- $this->resGraph->resource("http://lexvo.org/id/iso639-3/fra"),
- ]]
- ];
-
- foreach($singleValuesRes as $property => $resVal) {
- $resList = $collectionRes->all($this->inputGraphes['BASE']->resource($property));
- $this->assertCount($resVal['size'], $resList, "$property list size $resVal[size]");
- if($resVal['size'] == 1) {
- $this->assertEquals($resVal['val'], $resList[0], "$property size one not equals");
- }
- else {
- $this->assertEquals($resVal['val'], $resList, "$property size more than one not equals");
- }
- }
-
- }
-
- /**
- * Test one to one mapping spatial info
- *
- * @return void
- */
- public function testProvidedCHOSpatial() {
- $collection = $this->resGraph->get('edm:Collection', '^rdf:type');
-
- $this->assertNotNull($collection);
-
- $spatials = $collection->all($this->resGraph->resource('http://purl.org/dc/terms/spatial'));
-
- $this->assertCount(1, $spatials, "Must have only one spatial node");
- $spatial = $spatials[0];
- $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
- $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
-
- $lats = $spatial->all('geo:lat');
- $this->assertCount(1, $lats, "One latitude");
- $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
- $this->assertEquals(Literal::create("48.8667", null, 'xsd:float'), $lats[0], "lat must be '48.8667'^^xsd:float");
-
- $longs = $spatial->all('geo:long');
- $this->assertCount(1, $longs, "One longitude");
- $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
- $this->assertEquals(Literal::create("2.3333", null, 'xsd:float'), $longs[0], "long must be '2.3333'^^xsd:float");
-
- $notes = $spatial->all('skos:note');
- $this->assertCount(3, $notes, "3 notes");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
- $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
- $this->assertEquals(Literal::create("France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier", "fr", null), $notes[1], "notes contains 'France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier'@fr");
- $this->assertEquals(Literal::create("Other place very important", "fr", null), $notes[2], "notes contains 'Other place very important'@fr");
-
- $sameas = $spatial->all('owl:sameAs');
- $this->assertCount(1, $sameas, "1 same as");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
- $this->assertEquals('http://vocab.getty.edu/tgn/7008038', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008038");
- }
-
- public function testLinkToCocoonCollection() {
- $coll = $this->resGraph->get('edm:Collection', '^rdf:type');
-
- $this->assertNotNull($coll);
-
- $versionOfRes = $coll->all("<http://purl.org/dc/terms/isVersionOf>");
- $this->assertCount(1, $versionOfRes, "Must have only on isVersionOf");
- $versionOfRes = $versionOfRes[0];
- $this->assertInstanceOf("EasyRdf\Resource", $versionOfRes, "version Res must be a resource");
- $this->assertEquals(CocoonCollectionRdfMergerTest::TEST_CHO_URI, $versionOfRes->getUri(), "versionof res uri must be sams than source");
-
- }
-
-
-
-
-}
--- a/server/src/tests/libraries/Mergers/CocoonSoundRdfMergerTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,378 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Mergers\CocoonSoundRdfMerger;
-use CorpusParole\Libraries\CocoonUtils;
-
-use EasyRdf\Graph;
-use EasyRdf\Resource;
-use EasyRdf\Literal;
-
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-
-class CocoonSoundRdfMergerTest extends TestCase
-{
-
- const TEST_INPUT_DOCS = [
- 'BASE' => <<<EOT
- @prefix ore: <http://www.openarchives.org/ore/terms/> .
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
-
- <http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND>
- a ore:Aggregation ;
- edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ;
- edm:provider "Corpus de la Parole"@fr ;
- edm:dataProvider <http://viaf.org/viaf/142432638> ;
- edm:isShownAt <http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND> ;
- edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
- edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
- edm:hasView <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav>, <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3> .
-
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND>
- a edm:ProvidedCHO ;
- dc11:identifier "crdo-CFPP2000_35_SOUND" ;
- dc11:description "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr, "Enregistrement: Caractéristiques de l'enregistrement; Identifiant : CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e; Langue : français; Editeur : Université Paris III â Syled ; Date : 17.11.2010; Lieu de l'enregistrement : au domicile de lâenquêté Ãzgur KILIà ; Enquêteur : Sonia BRANCA-ROSOFF; Quartier(s) concerné(s) : Paris 3e, et 20e (pour lââge adulte); Transcription : Noalig TANGUY; Anonymisation : Noalig TANGUY; Durée : 0h46â; "@fr, "Enquêteur: Etat civil; Prénom et NOM : Sonia BRANCA-ROSOFF; Sexe : féminin; Lieu de naissance : New-York (USA); Lieu la petite enfance : Bretagne, puis région parisienne, puis de 8 à 16 ans Nice; Date de naissance : 16.12.1947; Situation familiale : mariée, deux enfants; Mobilité géographique : Paris 1967-1971, Aix-en-Provence 1971-1996, Paris 1996-2012; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : Doctorat dâÃtat (sciences du langage) 1987; Travail; Activité actuelle : Enseignante-chercheuse (linguistique française), Université de la Sorbonne Nouvelle-Paris III, Paris; Activités passées : ; Langues; Langue première : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : née en 1916 à Nice (France), interprète de conférences ; licence dâanglais; Père : né en 1913 à Mananjary (Madagascar), ingénieur.; "@fr, "Enquêté 1: Etat civil; Prénom et NOM fictifs : Ãzgur KILIà ; Sexe : masculin; Lieu de naissance: Paris 11e, France; Lieu la petite enfance : Paris 11e, France; Date de naissance : 07.02.1979; Age au moment de lâenregistrement : 32 ans; Situation familiale : pacsé, deux enfants; Mobilité géographique : 3e, 18e, 20e arrondissements; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : amis; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire st Merri 75003 ; Secondaire : Victor Hugo, Turgot 75003, Jean Lurçat 75013 général bac ES Supérieur. Puis St Denis université (cinéma); Travail; Activité actuelle : ingénieur du son pour l'audiovisuel; Activités passées : restauration, assistant son pour l'audiovisuel ; Langues; Langues pratiquées : français, anglais, turc; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : psychothérapeute, né a Houilles région parisienne France; Père : professeur d'université, né a Istanbul en Turquie. ; "@fr, "Enquêté 2: Etat civil; Prénom et NOM fictifs : Michel CHEVRIER; Sexe : masculin; Lieu de naissance : naissance à Boulogne-Billancourt (92); Lieu la petite enfance : rue du Temple, 3e arrondissement, Paris; Date de naissance : 01.06.1979; Age au moment de lâenregistrement : 31 ans; Situation familiale : concubinage; Mobilité géographique : 3e, puis 20e (entre 2005 et 2009) puis Romainville (depuis 2009); Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Réseau par lequel contacté : ; Adresse (si connue) : ; Téléphone (si connu) : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ãcole à aire ouverte rue St Merri 75003 ; Secondaire (Collège Victor Hugo 75003) puis Lycée Autogéré de Paris (75015) Bac Littéraire. Deux années au CIM (école de jazz) dans le 75018, puis 3 ans au conservatoire du 9eme; Travail; Activité actuelle : Musicien, Compositeur, Professeur de piano jazz ; Activités passées : Musicien; Langues; Langues pratiquées : français, anglais; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : ancienne médecin généraliste pneumologue, puis sociologue, née en France; Père : enseignant en sciences de l'éducation à Paris 8 né en Belgique; "@fr, "Enquêté 3: Etat civil; Prénom et NOM fictifs : Benoît DU BREUIL-DE-PONT-EN-AUGE; Sexe : masculin; Lieu de naissance : Paris 14e; Lieu la petite enfance : Paris 3e; Date de naissance : 28.11.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : concubinage avéré, avec papier de la mairie tamponné et signé!; Mobilité géographique : à 2 ans vit dans le 9°, puis déménage pour le 3°, est resté dans la même rue pendant 20 ans tout en changeant d'immeuble. Ensuite le 19° pendant 4 ans, puis Pantin 6 mois puis Les Lilas. ; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : voir Scolarité, Précisions; Prénom et NOM réels : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [ ] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : CAP; Précisions : Primaire école à aire ouverte (St Merri) dans le 4° avec Augustin, Ãzgur, Michel. Secondaire : collège Victor-Hugo dans le 3° avec Ãzgur ; puis CAP ; Travail; Activité actuelle : ; Activités passées : ébéniste agenceur puis ébéniste restaurateur et enfin constructeur décors (ainsi que de nombreux petits jobs ayant duré moins d'un an); Langues; Langues pratiquées : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : à la retraite ; secrétaire de rédaction dans un grand journal, baccalauréat ; née à Montrouge; Père : conseiller à travail à pole emploi, né à Boulogne Billancourt, baccalauréat présenté 3 ou 4 fois, puis obtenu par équivalence. ; "@fr, "Enquêté 4: Etat civil; Enquêté 4; Prénom et NOM fictifs : ; Sexe : féminin / masculin; Lieu de naissance : Paris 14e; Lieu de la petite enfance : Paris 4e et 3e ; Date de naissance : 06.12.1976; Age au moment de lâenregistrement : 34 ans; Situation familiale : ; Mobilité géographique : Rue la Bruyère 75009 (1976-1978), Rambuteau 75004 (1978-1987/88) & 75003 (chgt de côté de rue 1988-1998), a quitté Paris de 1998 à 2005 ; Rue Rambuteau 75003 (2006-2010), rue Gossec 75012 (2011); Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec Enquêté 2 : ami; Relation (parenté, ami, etc) avec Enquêté NOM : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole St Merri 75003. Secondaire : Collège François Couperin 75004, Institut St Pierre Fourier 75012 ; Cours Charlemagne 75014 ; Travail; Activité actuelle : Superviseur Centre d'appels ; Activités passées : Animateur Club Enfant, Réceptionniste ; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : retraitée, Paris, bac + 1/2 (?) ; Père : Conseiller Pôle Emploi, Paris, bac. ; "@fr, "Enquêté 5: Etat civil; Prénom et NOM fictifs : Ãtienne SALVEGAS; Sexe : masculin; Lieu de naissance : Paris 12e; Lieu de la petite enfance : Paris 3e Le Marais; Date de naissance : 16.06.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : marié 1 enfant, 12 ans de vie commune ; Mobilité géographique : 3e (1978-1999) 19e (1999-2002) 9e (2002-2011) ; Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté 2 : ami ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Scolarité; Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole Vertus, rue des Vertus 3ème. Secondaire Collège Montgolfier / Lycée Turgot 3ème. Supérieur Droit Univ. Paris Panthéon Sorbonne ; Travail; Activité actuelle : évènementiel; Activités passées : stagiaire journaliste sportif / relations publiques, accueil, agent de sécurité, remplacement gardien, réceptionniste hôtellerie.; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : né à Paris, lycée ; Père : né à Oloron (64), lycée ; "@fr ;
- dc11:language <http://lexvo.org/id/iso639-3/fra> ;
- dc11:publisher <http://viaf.org/viaf/142432638> ;
- dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, "report"^^olac:discourse-type, "unintelligible_speech"^^olac:discourse-type ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc11:subject "lexicography"^^olac:linguistic-field, "phonetics"^^olac:linguistic-field, "anthropological_linguistics"^^olac:linguistic-field, "general_linguistics"^^olac:linguistic-field, <http://lexvo.org/id/iso639-3/fra>, "text_and_corpus_linguistics"^^olac:linguistic-field, "phonology"^^olac:linguistic-field, "semantics"^^olac:linguistic-field, "sociolinguistics"^^olac:linguistic-field, "syntax"^^olac:linguistic-field, "typology"^^olac:linguistic-field, "discourse_analysis"^^olac:linguistic-field, "historical_linguistics"^^olac:linguistic-field, "language_documentation"^^olac:linguistic-field, "mathematical_linguistics"^^olac:linguistic-field ;
- dc11:title "CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2"@fr ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc:extent "PT48M26S" ;
- dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
- dc11:source "CFPP2000"@fr ;
- dc11:coverage "Quartier concerné : 3e"@fr ;
- olac:depositor <http://viaf.org/viaf/93752300> ;
- dc11:contributor <http://viaf.org/viaf/93752300>, "Branca-Rosoff, Sonia", "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne", "Tanguy Noalig" ;
- olac:interviewer "Branca-Rosoff, Sonia" ;
- olac:responder "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne" ;
- olac:transcriber "Tanguy Noalig" ;
- dc:available "2013-10-12"^^dc:W3CDTF ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
- dc:spatial [
- a edm:Place ;
- geo:lat "48.83975"^^xsd:float ;
- geo:long "2.3542"^^xsd:float ;
- skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr ;
- owl:sameAs <http://vocab.getty.edu/tgn/7008038>
- ] .
-
- <http://cocoon.huma-num.fr/data/archi/masters/372593.wav>
- a edm:WebResource ;
- dc:extent "PT48M26S" ;
- dc11:format "audio/x-wav"^^dc:IMT ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
- dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF .
-
- <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav>
- a edm:WebResource ;
- dc:extent "PT48M26S" ;
- dc11:format "audio/x-wav"^^dc:IMT ;
- edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-
- <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3>
- a edm:WebResource ;
- dc:extent "PT48M26S" ;
- dc11:format "audio/mpeg"^^dc:IMT ;
- edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-EOT
- ,
- 'SOURCE' => <<<EOT
- @prefix ore: <http://www.openarchives.org/ore/terms/> .
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
-
- <http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND>
- a ore:Aggregation ;
- edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ;
- edm:provider "Corpus de la Parole"@fr ;
- edm:dataProvider <http://viaf.org/viaf/142432638> ;
- edm:isShownAt <http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND> ;
- edm:isShownBy <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml> ;
- edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
- edm:hasView <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml>, <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml>, <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav> .
-
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND>
- a edm:ProvidedCHO ;
- dc11:identifier "crdo-CFPP2000_35_SOUNDsource" ;
- dc11:description "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr, "Enregistrement: Caractéristiques de l'enregistrement; Identifiant : CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e; Langue : français; Editeur : Université Paris III â Syled ; Date : 17.11.2010; Lieu de l'enregistrement : au domicile de lâenquêté Ãzgur KILIà ; Enquêteur : Sonia BRANCA-ROSOFF; Quartier(s) concerné(s) : Paris 3e, et 20e (pour lââge adulte); Transcription : Noalig TANGUY; Anonymisation : Noalig TANGUY; Durée : 0h46â; "@fr, "Enquêteur: Etat civil; Prénom et NOM : Sonia BRANCA-ROSOFF; Sexe : féminin; Lieu de naissance : New-York (USA); Lieu la petite enfance : Bretagne, puis région parisienne, puis de 8 à 16 ans Nice; Date de naissance : 16.12.1947; Situation familiale : mariée, deux enfants; Mobilité géographique : Paris 1967-1971, Aix-en-Provence 1971-1996, Paris 1996-2012; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : Doctorat dâÃtat (sciences du langage) 1987; Travail; Activité actuelle : Enseignante-chercheuse (linguistique française), Université de la Sorbonne Nouvelle-Paris III, Paris; Activités passées : ; Langues; Langue première : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : née en 1916 à Nice (France), interprète de conférences ; licence dâanglais; Père : né en 1913 à Mananjary (Madagascar), ingénieur.; "@fr, "Enquêté 1: Etat civil; Prénom et NOM fictifs : Ãzgur KILIà ; Sexe : masculin; Lieu de naissance: Paris 11e, France; Lieu la petite enfance : Paris 11e, France; Date de naissance : 07.02.1979; Age au moment de lâenregistrement : 32 ans; Situation familiale : pacsé, deux enfants; Mobilité géographique : 3e, 18e, 20e arrondissements; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : amis; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire st Merri 75003 ; Secondaire : Victor Hugo, Turgot 75003, Jean Lurçat 75013 général bac ES Supérieur. Puis St Denis université (cinéma); Travail; Activité actuelle : ingénieur du son pour l'audiovisuel; Activités passées : restauration, assistant son pour l'audiovisuel ; Langues; Langues pratiquées : français, anglais, turc; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : psychothérapeute, né a Houilles région parisienne France; Père : professeur d'université, né a Istanbul en Turquie. ; "@fr, "Enquêté 2: Etat civil; Prénom et NOM fictifs : Michel CHEVRIER; Sexe : masculin; Lieu de naissance : naissance à Boulogne-Billancourt (92); Lieu la petite enfance : rue du Temple, 3e arrondissement, Paris; Date de naissance : 01.06.1979; Age au moment de lâenregistrement : 31 ans; Situation familiale : concubinage; Mobilité géographique : 3e, puis 20e (entre 2005 et 2009) puis Romainville (depuis 2009); Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Réseau par lequel contacté : ; Adresse (si connue) : ; Téléphone (si connu) : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ãcole à aire ouverte rue St Merri 75003 ; Secondaire (Collège Victor Hugo 75003) puis Lycée Autogéré de Paris (75015) Bac Littéraire. Deux années au CIM (école de jazz) dans le 75018, puis 3 ans au conservatoire du 9eme; Travail; Activité actuelle : Musicien, Compositeur, Professeur de piano jazz ; Activités passées : Musicien; Langues; Langues pratiquées : français, anglais; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : ancienne médecin généraliste pneumologue, puis sociologue, née en France; Père : enseignant en sciences de l'éducation à Paris 8 né en Belgique; "@fr, "Enquêté 3: Etat civil; Prénom et NOM fictifs : Benoît DU BREUIL-DE-PONT-EN-AUGE; Sexe : masculin; Lieu de naissance : Paris 14e; Lieu la petite enfance : Paris 3e; Date de naissance : 28.11.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : concubinage avéré, avec papier de la mairie tamponné et signé!; Mobilité géographique : à 2 ans vit dans le 9°, puis déménage pour le 3°, est resté dans la même rue pendant 20 ans tout en changeant d'immeuble. Ensuite le 19° pendant 4 ans, puis Pantin 6 mois puis Les Lilas. ; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : voir Scolarité, Précisions; Prénom et NOM réels : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [ ] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : CAP; Précisions : Primaire école à aire ouverte (St Merri) dans le 4° avec Augustin, Ãzgur, Michel. Secondaire : collège Victor-Hugo dans le 3° avec Ãzgur ; puis CAP ; Travail; Activité actuelle : ; Activités passées : ébéniste agenceur puis ébéniste restaurateur et enfin constructeur décors (ainsi que de nombreux petits jobs ayant duré moins d'un an); Langues; Langues pratiquées : français; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : à la retraite ; secrétaire de rédaction dans un grand journal, baccalauréat ; née à Montrouge; Père : conseiller à travail à pole emploi, né à Boulogne Billancourt, baccalauréat présenté 3 ou 4 fois, puis obtenu par équivalence. ; "@fr, "Enquêté 4: Etat civil; Enquêté 4; Prénom et NOM fictifs : ; Sexe : féminin / masculin; Lieu de naissance : Paris 14e; Lieu de la petite enfance : Paris 4e et 3e ; Date de naissance : 06.12.1976; Age au moment de lâenregistrement : 34 ans; Situation familiale : ; Mobilité géographique : Rue la Bruyère 75009 (1976-1978), Rambuteau 75004 (1978-1987/88) & 75003 (chgt de côté de rue 1988-1998), a quitté Paris de 1998 à 2005 ; Rue Rambuteau 75003 (2006-2010), rue Gossec 75012 (2011); Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec Enquêté 2 : ami; Relation (parenté, ami, etc) avec Enquêté NOM : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole St Merri 75003. Secondaire : Collège François Couperin 75004, Institut St Pierre Fourier 75012 ; Cours Charlemagne 75014 ; Travail; Activité actuelle : Superviseur Centre d'appels ; Activités passées : Animateur Club Enfant, Réceptionniste ; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : retraitée, Paris, bac + 1/2 (?) ; Père : Conseiller Pôle Emploi, Paris, bac. ; "@fr, "Enquêté 5: Etat civil; Prénom et NOM fictifs : Ãtienne SALVEGAS; Sexe : masculin; Lieu de naissance : Paris 12e; Lieu de la petite enfance : Paris 3e Le Marais; Date de naissance : 16.06.1978; Age au moment de lâenregistrement : 32 ans; Situation familiale : marié 1 enfant, 12 ans de vie commune ; Mobilité géographique : 3e (1978-1999) 19e (1999-2002) 9e (2002-2011) ; Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté 2 : ami ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Scolarité; Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [ ] ; Dernier diplôme, avec année dâobtention : ; Précisions : Primaire : Ecole Vertus, rue des Vertus 3ème. Secondaire Collège Montgolfier / Lycée Turgot 3ème. Supérieur Droit Univ. Paris Panthéon Sorbonne ; Travail; Activité actuelle : évènementiel; Activités passées : stagiaire journaliste sportif / relations publiques, accueil, agent de sécurité, remplacement gardien, réceptionniste hôtellerie.; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolaritéâ¦); Mère : né à Paris, lycée ; Père : né à Oloron (64), lycée ; "@fr ;
- dc11:language <http://lexvo.org/id/iso639-3/fra> ;
- dc11:publisher <http://viaf.org/viaf/142432638> ;
- dc11:type "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, "report"^^olac:discourse-type, "unintelligible_speech"^^olac:discourse-type ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc11:subject "lexicography"^^olac:linguistic-field, "phonetics"^^olac:linguistic-field, "anthropological_linguistics"^^olac:linguistic-field, "general_linguistics"^^olac:linguistic-field, <http://lexvo.org/id/iso639-3/fra>, "text_and_corpus_linguistics"^^olac:linguistic-field, "phonology"^^olac:linguistic-field, "semantics"^^olac:linguistic-field, "sociolinguistics"^^olac:linguistic-field, "syntax"^^olac:linguistic-field, "typology"^^olac:linguistic-field, "discourse_analysis"^^olac:linguistic-field, "historical_linguistics"^^olac:linguistic-field, "language_documentation"^^olac:linguistic-field, "mathematical_linguistics"^^olac:linguistic-field ;
- dc11:title "CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2 (annotations)"@fr ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
- dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
- dc11:source "CFPP2000"@fr ;
- dc11:coverage "Quartier concerné : 3e"@fr ;
- olac:depositor <http://viaf.org/viaf/93752300> ;
- dc11:contributor <http://viaf.org/viaf/93752300>, "Branca-Rosoff, Sonia", "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne", "Tanguy Noalig" ;
- olac:interviewer "Branca-Rosoff, Sonia" ;
- olac:responder "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne" ;
- olac:transcriber "Tanguy Noalig" ;
- dc:available "2013-11-04"^^dc:W3CDTF ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF ;
- dc:spatial [
- a edm:Place ;
- geo:lat "99.83975"^^xsd:float ;
- geo:long "25.3542"^^xsd:float ;
- skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr, "Other place very important"@fr ;
- owl:sameAs <http://vocab.getty.edu/tgn/1234567890>
- ] .
-
- <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml>
- a edm:WebResource ;
- dc11:format "application/xml"^^dc:IMT ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
- <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml>
- a edm:WebResource ;
- dc11:format "application/xhtml+xml"^^dc:IMT ;
- dc:created "2010-11-17"^^dc:W3CDTF ;
- dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-EOT
- ];
-
- const TEST_INPUT_ID = "crdo-ESLO1_ENT_019";
- const TEST_GRAPH_URI = "http://corpusdelaparole.huma-num.fr/corpus/res/crdo-ESLO1_ENT_019";
- const TEST_CHO_URI = "http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ESLO1_ENT_019";
-
-
- private $inputGraphes = [];
- private $resGraph;
- private $merger;
-
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- public function setUp() {
- parent::setUp();
-
- foreach(CocoonSoundRdfMergerTest::TEST_INPUT_DOCS as $key => $inputDoc) {
- $this->inputGraphes[$key] = new Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", $inputDoc);
- }
-
- $this->merger = new CocoonSoundRdfMerger();
- $this->resGraph = $this->merger->mergeGraph($this->inputGraphes['BASE'], $this->inputGraphes['SOURCE']);
- }
-
- 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 the result graph.
- *
- * @return void
- */
- public function testResGraph() {
- $this->assertNotNull($this->resGraph, "Res graph must not be null");
- $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND", $this->resGraph->getUri(), "graph uri must be equals to http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND");
- }
-
- /**
- * test the merged Aggregation
- *
- * @return void
- */
- public function testAggregationResource() {
- $aggregationResList = $this->resGraph->allOfType('http://www.openarchives.org/ore/terms/Aggregation');
- $this->assertCount(1, $aggregationResList, "Only one Aggregation node");
- $aggregationRes = $aggregationResList[0];
-
- $this->assertEquals("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND",$aggregationRes->getUri(),"Aggregation node uri must be http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND");
-
- $singleValuesRes = [
- 'http://www.europeana.eu/schemas/edm/aggregatedCHO' => ['size'=>1, 'val' => $this->resGraph->resource("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND")],
- 'http://www.europeana.eu/schemas/edm/provider' => ['size'=>1, 'val' => new Literal("Corpus de la Parole", "fr", null)],
- 'http://www.europeana.eu/schemas/edm/dataProvider' => ['size'=>1, 'val' => $this->resGraph->resource("http://viaf.org/viaf/142432638")],
- 'http://www.europeana.eu/schemas/edm/isShownAt' => ['size'=>1, 'val' => $this->resGraph->resource("http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND")],
- 'http://www.europeana.eu/schemas/edm/isShownBy' => ['size'=>1, 'val' => $this->resGraph->resource("http://cocoon.huma-num.fr/data/archi/masters/372593.wav")],
- 'http://www.europeana.eu/schemas/edm/rights' => ['size'=>1, 'val' => $this->resGraph->resource("http://creativecommons.org/licenses/by-nc-sa/4.0/")],
- 'http://www.europeana.eu/schemas/edm/hasView' => ['size' => 4, 'val' => [
- $this->resGraph->resource("http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav"),
- $this->resGraph->resource("http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3"),
- $this->resGraph->resource("http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml"),
- $this->resGraph->resource("http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml")
- ]]
- ];
-
- foreach($singleValuesRes as $property => $resVal) {
- $resList = $aggregationRes->all($this->inputGraphes['BASE']->resource($property));
- $this->assertCount($resVal['size'], $resList, "$property list size $resVal[size]");
- if($resVal['size'] == 1) {
- $this->assertEquals($resVal['val'], $resList[0], "$property size one not equals");
- }
- else {
- $this->assertEquals($resVal['val'], $resList, "$property size more than one not equals");
- }
- }
-
- }
-
- /**
- * test web resources
- *
- * @return void
- */
- public function testWebResources() {
- $webResList = $this->resGraph->allOfType('http://www.europeana.eu/schemas/edm/WebResource');
-
- $this->assertCount(5, $webResList, "Must have 5 webResource");
- }
-
-
- /**
- * Test one to one mapping spatial info
- *
- * @return void
- */
- public function testProvidedCHOSpatial() {
- $providedCHO = $this->resGraph->get('edm:ProvidedCHO', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
-
- $spatials = $providedCHO->all($this->resGraph->resource('http://purl.org/dc/terms/spatial'));
-
- $this->assertCount(1, $spatials, "Must have only one spatial node");
- $spatial = $spatials[0];
- $this->assertTrue($spatial->isBNode(),"spatial node must be blank");
- $this->assertEquals("edm:Place", $spatial->type(), "spatial node type must be edm:Place");
-
- $lats = $spatial->all('geo:lat');
- $this->assertCount(1, $lats, "One latitude");
- $this->assertInstanceOf("EasyRdf\Literal", $lats[0], "Latitude must be a litteral");
- $this->assertEquals(Literal::create("48.83975", null, 'xsd:float'), $lats[0], "lat must be '48.83975'^^xsd:float");
-
- $longs = $spatial->all('geo:long');
- $this->assertCount(1, $longs, "One longitude");
- $this->assertInstanceOf("EasyRdf\Literal", $longs[0], "Longitude must be a litteral");
- $this->assertEquals(Literal::create("2.3542", null, 'xsd:float'), $longs[0], "long must be '2.3542'^^xsd:float");
-
- $notes = $spatial->all('skos:note');
- $this->assertCount(3, $notes, "3 notes");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $notes, "Notes mus be only literals");
- $this->assertEquals(Literal::create("FR", null, "dc:ISO3166"), $notes[0], "notes contains 'FR'^^dc:ISO3166");
- $this->assertEquals(Literal::create("France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier", "fr", null), $notes[1], "notes contains 'France, Centre, Loiret, Orléans'@fr");
- $this->assertEquals(Literal::create("Other place very important", "fr", null), $notes[2], "notes contains 'Other place very important'@fr");
-
- $sameas = $spatial->all('owl:sameAs');
- $this->assertCount(1, $sameas, "1 same as");
- $this->assertContainsOnlyInstancesOf("EasyRdf\Resource", $sameas, "Notes mus be only resources");
- $this->assertEquals('http://vocab.getty.edu/tgn/7008038', $sameas[0]->getUri(), "uri must be http://vocab.getty.edu/tgn/7008038");
- }
-
-
- /**
- * Test one to one mapping
- *
- * @return void
- */
- public function testProvidedCHOSingleproperty() {
-
- $properties = [
- "http://purl.org/dc/elements/1.1/title",
- "http://purl.org/dc/elements/1.1/identifier",
- "http://purl.org/dc/terms/extent",
- "http://purl.org/dc/terms/available",
- "http://purl.org/dc/terms/created",
- "http://purl.org/dc/terms/issued"
- ];
-
- $providedCHO = $this->resGraph->get('edm:ProvidedCHO', '^rdf:type');
- $baseNode = $this->inputGraphes['BASE']->get('edm:ProvidedCHO', '^rdf:type');
-
- $this->assertNotNull($providedCHO);
- $this->assertNotNull($baseNode);
-
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($providedCHO->all($this->resGraph->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- foreach ($baseNode->all($this->inputGraphes['BASE']->resource($prop)) as $value) {
- $this->assertContains(strval($value), $outputValuesStr, "$prop not found in output graph");
- }
- }
-
- }
-
- public function testRightsWebResource() {
- $properties = [
- "http://purl.org/dc/elements/1.1/rights",
- 'http://purl.org/dc/terms/license',
- 'http://purl.org/dc/terms/accessRights',
- ];
-
- $webResourceList = $this->resGraph->all('edm:WebResource', '^rdf:type');
-
- //just check that they have all these resources.
- //TODO: check that the same rights are kept (difficult)
- foreach ($webResourceList as $webResource) {
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($webResource->all($this->resGraph->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- }
- }
- }
-
-}
--- a/server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,452 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Mergers\CocoonSoundRdfMerger;
-use CorpusParole\Libraries\Mergers\CocoonTextRdfMerger;
-use CorpusParole\Libraries\CocoonUtils;
-
-use EasyRdf\Graph;
-use EasyRdf\Resource;
-use EasyRdf\Literal;
-
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-
-class CocoonTextRdfMergerTest extends TestCase
-{
-
- const TEST_INPUT_DOCS = [
- 'SOUND' => <<<EOT
- @prefix ore: <http://www.openarchives.org/ore/terms/> .
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
-
- <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
- a ore:Aggregation ;
- edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
- edm:provider "Corpus de la Parole"@fr ;
- edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
- edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
- edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
- edm:rights <http://creativecommons.org/licenses/by-nc-nd/4.0/> ;
- 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> .
-
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
- a edm:ProvidedCHO ;
- dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
- 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 <http://lexvo.org/id/iso639-3/uve> ;
- dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ;
- dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
- dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
- dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
- dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
- dc11:title "The two hermit crabs and the coconut crab"@en ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
- dc:extent "PT2M35S" ;
- edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
- olac:depositor <http://viaf.org/viaf/56614135> ;
- dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
- olac:researcher <http://viaf.org/viaf/56614135> ;
- 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 <http://sws.geonames.org/2139490/>
- ] .
-
- <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
- a edm:WebResource ;
- 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 ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-
- <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
- a edm:WebResource ;
- dc:extent "PT2M35S" ;
- dc11:format "audio/x-wav"^^dc:IMT ;
- edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
- dc:created "1997-08-29"^^dc:W3CDTF ;
- dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-
- <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
- a edm:WebResource ;
- dc:extent "PT2M35S" ;
- dc11:format "audio/mpeg"^^dc:IMT ;
- edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
- dc:created "1997-08-29"^^dc:W3CDTF ;
- dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-EOT
- ,
- 'SOUND_NO_MOD' => <<<EOT
- @prefix ore: <http://www.openarchives.org/ore/terms/> .
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
-
- <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
- a ore:Aggregation ;
- edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
- edm:provider "Corpus de la Parole"@fr ;
- edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
- edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
- edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
- edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
- 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> .
-
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
- a edm:ProvidedCHO ;
- dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
- 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 <http://lexvo.org/id/iso639-3/uve> ;
- dc11:publisher "Laboratoire de langues et civilisations à tradition orale" ;
- dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
- dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, <http://ark.bnf.fr/ark:/12148/cb11937212q> ;
- dc:license <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
- dc11:subject <http://ark.bnf.fr/ark:/12148/cb11958119h>, <http://lexvo.org/id/iso639-3/uve>, <http://ark.bnf.fr/ark:/12148/cb11953067w> ;
- dc11:title "The two hermit crabs and the coconut crab"@en ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
- dc:extent "PT2M35S" ;
- edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
- olac:depositor <http://viaf.org/viaf/56614135> ;
- dc11:contributor <http://viaf.org/viaf/56614135>, "Idakote, Félicien" ;
- olac:researcher <http://viaf.org/viaf/56614135> ;
- 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 <http://sws.geonames.org/2139490/>
- ] .
-
- <http://cocoon.huma-num.fr/data/archi/masters/144187.wav>
- a edm:WebResource ;
- 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 ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-
- <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>
- a edm:WebResource ;
- dc:extent "PT2M35S" ;
- dc11:format "audio/x-wav"^^dc:IMT ;
- edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
- dc:created "1997-08-29"^^dc:W3CDTF ;
- dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-
- <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3>
- a edm:WebResource ;
- dc:extent "PT2M35S" ;
- dc11:format "audio/mpeg"^^dc:IMT ;
- edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
- dc:created "1997-08-29"^^dc:W3CDTF ;
- dc:issued "2010-10-23T00:08:27+02:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-EOT
- ,
- 'TEXT' => <<<EOT
- @prefix ore: <http://www.openarchives.org/ore/terms/> .
- @prefix edm: <http://www.europeana.eu/schemas/edm/> .
- @prefix dc11: <http://purl.org/dc/elements/1.1/> .
- @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
- @prefix dc: <http://purl.org/dc/terms/> .
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
-
- <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-UVE_MOCIKA_SOUND>
- a ore:Aggregation ;
- edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND> ;
- edm:provider "Corpus de la Parole"@fr ;
- edm:dataProvider <http://viaf.org/viaf/154919513> ;
- edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
- edm:isShownBy <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml> ;
- edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
- 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> .
-
- <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
- a edm:ProvidedCHO ;
- dc:identifier "crdo-UVE_MOCIKA_SOUND" ;
- 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 <http://lexvo.org/id/iso639-3/uve> ;
- dc11:publisher <http://viaf.org/viaf/154919513> ;
- dc11:rights "Copyright (c) Moyse-Faurie, Claire" ;
- dc11:type "primary_text"^^olac:linguistic-type, <http://purl.org/dc/dcmitype/Text>, "narrative"^^olac:discourse-type ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/2.5/> ;
- dc11:subject <http://lexvo.org/id/iso639-3/uve> ;
- dc11:title "The two hermit crabs and the coconut crab"@en ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" ;
- edm:isGatheredInto <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LACITO> ;
- dc:alternative "Les deux bernard-l'hermite et le crabe de cocotier"@fr ;
- olac:depositor <http://viaf.org/viaf/56614135> ;
- dc11:contributor <http://viaf.org/viaf/56614135>, "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)"
- ] .
-
- <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xml>
- a edm:WebResource ;
- dc11:format "application/xml"^^dc:IMT ;
- dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-
- <http://cocoon.huma-num.fr/exist/crdo/moyse-faurie/uve/crdo-UVE_MOCIKA.xhtml>
- a edm:WebResource ;
- dc11:format "application/xhtml+xml"^^dc:IMT ;
- dc:issued "2011-02-05T23:22:23+01:00"^^dc:W3CDTF ;
- dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
- dc:accessRights "Freely available for non-commercial use" ;
- dc11:rights "Copyright (c) 2012 Université d'Orléans/LLL" .
-
-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");
- }
-
- }
-
-
- public function testRightsWebResource() {
- $properties = [
- "http://purl.org/dc/elements/1.1/rights",
- 'http://purl.org/dc/terms/license',
- 'http://purl.org/dc/terms/accessRights',
- ];
-
- $resGraph = $this->resGraph["SOUND_TEXT"];
- $webResourceList = $resGraph->all('edm:WebResource', '^rdf:type');
-
- //just check that they have all these resources.
- //TODO: check that the same rights are kept (difficult)
- foreach ($webResourceList as $webResource) {
- foreach ($properties as $prop) {
- $outputValuesStr = [];
- foreach($webResource->all($resGraph->resource($prop)) as $outputValue) {
- array_push($outputValuesStr, strval($outputValue));
- }
- $this->assertNotEmpty($outputValuesStr, "we must found some values to test $prop");
- }
- }
- }
-
- public function testRightDifferent() {
- $resGraph = $this->resGraph["SOUND_TEXT"];
-
- $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
-
- $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
-
- $this->assertNotNull($license, "The licence must not be null");
- $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
- $this->assertEquals(config('corpusparole.corpus_doc_default_cc_rights'), $license->getUri(), "License must be default licence");
- }
-
- public function testRightSame() {
- $resGraph = $this->resGraph["SOUND_NO_MOD_TEXT"];
-
- $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
-
- $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
-
- $this->assertNotNull($license, "The licence must not be null");
- $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
- $this->assertEquals('http://creativecommons.org/licenses/by-nc-sa/4.0/', $license->getUri(), "License must be default licence");
- }
-
-
-
-}
--- a/server/src/tests/libraries/Sparql/SparqlClientTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Sparql\SparqlClient;
-use CorpusParole\Libraries\CorpusParoleException;
-use CorpusParole\Models\Document;
-
-use GuzzleHttp\Client;
-use GuzzleHttp\Handler\MockHandler;
-use GuzzleHttp\HandlerStack;
-use GuzzleHttp\Psr7\Response;
-use GuzzleHttp\Middleware;
-
-use Mockery as m;
-
-class SparqlClientTest extends TestCase {
-
- const TEST_DOC_ADD = <<<EOT
-<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .
-<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "drama"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .
-EOT;
-
- const TEST_DOC_DELETE = <<<EOT
-<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .
-EOT;
-
-
- private $container;
- private $sparqlClients;
- private $transactionUrl;
-
- private $responsesArray;
-
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- private function getSparqlClient($responses, &$container, $sparqlClient) {
- $mock = new MockHandler($responses);
- $handler = HandlerStack::create($mock);
- $history = Middleware::history($container);
- $handler->push($history);
- $httpClient = new Client(['handler' => $handler, 'http_errors' => false]);
-
- return new SparqlClient($httpClient, $sparqlClient);
- }
-
- public function setUp() {
- parent::setUp();
- $this->sesameRepository = config('corpusparole.sesame_repository');
- $this->transactionUrl = config('corpusparole.sesame_query_url').'/transactions/64a5937f-c112-d014-a044-f0123b93';
-
- $this->addGraph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", SparqlClientTest::TEST_DOC_ADD);
- $this->deleteGraph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", SparqlClientTest::TEST_DOC_DELETE);
-
- }
-
- public function tearDown() {
- m::close();
- parent::tearDown();
- }
-
- public function testCreateTransaction() {
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
-
- $this->assertEquals($this->transactionUrl, $documentRepository->getCurrentTransactionUrl(), 'Must have correct transaction url');
- }
-
- public function testCreateTransactionHistory() {
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
-
- $this->assertCount(1, $container, 'One request');
- $req = $container[0]['request'];
- $this->assertEquals("$this->sesameRepository/transactions?isolation-level=http%3A%2F%2Fwww.openrdf.org%2Fschema%2Fsesame%23SNAPSHOT_READ", (string)$req->getUri(), "url must be ok");
- $this->assertEquals('POST', $container[0]['request']->getMethod(), "methos is POST");
- }
-
- public function testRollbackTransaction() {
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- new Response(204)
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
- $documentRepository->rollback();
-
- $this->assertCount(2, $container, '2 requests');
-
- $this->assertNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be null");
-
- $req = $container[1]['request'];
-
- $this->assertEquals($this->transactionUrl, (string)$req->getUri(), "uri must be the transaction url");
- $this->assertEquals('DELETE', $req->getMethod(), "Method must be DELETE");
-
- }
-
- public function testCommitTransaction() {
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- new Response(200)
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
- $documentRepository->commit();
-
-
- $this->assertCount(2, $container, '2 requests');
-
- $this->assertNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be null");
-
- $req = $container[1]['request'];
-
- $this->assertEquals($this->transactionUrl."?action=COMMIT", (string)$req->getUri(), "uri must be the transaction url");
- $this->assertEquals('PUT', $req->getMethod(), "Method must be PUT");
-
- }
-
- /**
- * @expectedException CorpusParole\Libraries\CorpusParoleException
- */
- public function testCommitTransactionFail() {
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- new Response(404, [], "Not found")
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
- $documentRepository->commit();
-
- }
-
-
- public function testAdd() {
-
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- new Response(204)
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
- $documentRepository->add($this->addGraph);
-
- $this->assertCount(2, $container, '2 requests');
-
- $this->assertNotNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be not null");
-
- $req = $container[1]['request'];
-
- $this->assertEquals($this->transactionUrl."?action=UPDATE", (string)$req->getUri(), "uri must be the transaction url");
- $this->assertEquals('PUT', $req->getMethod(), "Method must be PUT");
- $this->assertEquals(['application/sparql-update; charset=utf-8'], $req->getHeader('Content-type'), "content type must be form urlencoded");
-
- $body = (string)$req->getBody();
-
- $this->assertContains('INSERT DATA {', $body, 'update parameter must contain INSERT');
- $this->assertContains('GRAPH <'.$this->addGraph->getUri().'> {', $body, 'update parameter must contain GRAPH id');
- $this->assertContains('<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type>', $body, 'update parameter must contain dialogue');
- $this->assertContains('<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "drama"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> .', $body, 'update parameter must contain drama');
- }
-
- public function testDelete() {
- $responses = [
- new Response(201, ['Location' => "$this->transactionUrl"]),
- new Response(204)
- ];
- $container = [];
- $sparqlClientMock = m::mock('EasyRdf\Sparql\Client');
-
- $documentRepository = $this->getSparqlClient($responses, $container, $sparqlClientMock);
-
- $documentRepository->startTransaction();
- $documentRepository->delete($this->deleteGraph);
-
- $this->assertCount(2, $container, '2 requests');
-
- $this->assertNotNull($documentRepository->getCurrentTransactionUrl(), "Current Transaction url must be not null");
-
- $req = $container[1]['request'];
-
- $this->assertEquals($this->transactionUrl."?action=UPDATE", (string)$req->getUri(), "uri must be the transaction url");
- $this->assertEquals('PUT', $req->getMethod(), "Method must be PUT");
- $this->assertEquals(['application/sparql-update; charset=utf-8'], $req->getHeader('Content-type'), "content type must be form urlencoded");
-
- $body = (string)$req->getBody();
-
- $this->assertContains('DELETE DATA {', $body, 'update parameter must contain DELETE');
- $this->assertContains('GRAPH <'.$this->addGraph->getUri().'> {', $body, 'update parameter must contain GRAPH id');
- $this->assertContains('<http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type>', $body, 'update parameter must contain GRAPH id');
-
- }
-
-}
--- a/server/src/tests/libraries/UtilsTest.php Tue Apr 12 13:42:04 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<?php
-
-use CorpusParole\Libraries\Utils;
-
-class UtilsTest extends TestCase {
- function __construct(string $name = null) {
- parent::__construct($name);
- }
-
- public function setup() {
- }
-
- public function tearDown() {
- }
-
- public function testDateIntervalToMillis() {
- $di = new \DateInterval("P1Y1M1DT1H1M1S");
-
- $ms = Utils::dateIntervalToMillis($di);
-
- $this->assertEquals(34277461000, $ms, "duration must be 3427746100");
- }
-
- public function testiso8601IntervalToMillis() {
- $ms = Utils::iso8601IntervalToMillis("P1Y1M1DT1H1M1S");
- $this->assertEquals(34277461000, $ms, "duration must be 3427746100");
- }
-
- public function testiso8601IntervalToMillisNull() {
- $ms = Utils::iso8601IntervalToMillis(null);
- $this->assertNull($ms, "duration must be null");
- }
-
-}