diff -r f2a40bbc27f6 -r eadaf0b8f02e server/src/tests/Repositories/DocumentRepositoryIntegrationTest.php --- a/server/src/tests/Repositories/DocumentRepositoryIntegrationTest.php Tue Nov 17 13:11:55 2015 +0100 +++ b/server/src/tests/Repositories/DocumentRepositoryIntegrationTest.php Fri Nov 27 17:59:36 2015 +0100 @@ -34,50 +34,70 @@ EOT; const TEST_DOC = << . - . - "Extrait des enqu\u00EAtes dialectologiques en vue de constituer un atlas linguistique de l'Alsace."@fr . - "audio/x-wav"^^ . - . - "primary_text"^^ . - "dialogue"^^ . - . - "lexicography"^^ . - "phonetics"^^ . - "anthropological_linguistics"^^ . - . - . - _:genid2d5831d84541df446694586ac2006f96042dgenid1 . - _:genid2d5831d84541df446694586ac2006f96042dgenid2 . - "Atlas linguistiques, cultures et parlers r\u00E9gionaux de France" . - "Copyright (c) D\u00E9partement de dialectologie alsacienne et mosellane de l'Universit\u00E9 de Strasbourg" . - "Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608"@fr . - "Freely available for non-commercial use" . - . - . - . - "PT02H04M16S" . - "start=1980; end=1989; name=ann\u00E9es 80"^^ . - "France, Alsace"@fr . - "FR"^^ . - . - . - "2004-07-03"^^ . - "2014-11-04T16:25:54+01:00"^^ . - "Alsacien"@fr . - "Huck, Dominique" . - "depositor"^^ . - _:genid2d5831d84541df446694586ac2006f96042dgenid1 . - _:genid2d5831d84541df446694586ac2006f96042dgenid1 "Bothorel-Witz, Arlette" . - _:genid2d5831d84541df446694586ac2006f96042dgenid1 "interviewer"^^ . - _:genid2d5831d84541df446694586ac2006f96042dgenid2 . - _:genid2d5831d84541df446694586ac2006f96042dgenid2 "Huck, Dominique" . - _:genid2d5831d84541df446694586ac2006f96042dgenid2 "interviewer"^^ . + @prefix rdf: . + @prefix rdfs: . + @prefix sesame: . + @prefix owl: . + @prefix xsd: . + @prefix fn: . + + _:genid-2267740936ad4d04a567e6787732f0dd-genid1 a ; + owl:sameAs ; + "northlimit=47.431892250000033; southlimit=49.053971250000046;westlimit=6.846186050000028; eastlimit=8.232571550000074;"^^ , "FR"^^ , "France, Alsace"@fr . + + a ; + ; + "Atlas linguistiques, cultures et parlers régionaux de France" ; + , ; + ; + ; + "Corpus de la Parole"@fr ; + . + + a ; + "audio/mpeg"^^ ; + "1996"^^ ; + "PT01H11M29S" ; + "2014-11-10T14:27:08+01:00"^^ ; + . + + a ; + "audio/x-wav"^^ ; + "1996"^^ ; + "PT01H11M29S" ; + "2014-11-10T14:27:08+01:00"^^ . + + a ; + "audio/x-wav"^^ ; + "1996"^^ ; + "PT01H11M29S" ; + "2014-11-10T14:27:08+01:00"^^ ; + . + + a ; + "1996"^^ ; + "PT01H11M29S" ; + "2014-11-10T14:27:08+01:00"^^ ; + , ; + "Extrait des enquêtes dialectologiques en vue de constituer un atlas linguistique de l'Alsace."@fr ; + ; + "Atlas linguistiques, cultures et parlers régionaux de France" ; + "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ; + , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , "anthropological_linguistics"^^ , "lexicography"^^ , "phonetics"^^ ; + "Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_738"@fr ; + , , , "dialogue"^^ , "primary_text"^^ ; + "Freely available for non-commercial use" ; + "2004-07-03"^^ ; + , ; + ; + _:genid-2267740936ad4d04a567e6787732f0dd-genid1 ; + ; + , . EOT; function __construct(string $name = null) { parent::__construct($name); - $this->graph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentRepositoryIntegrationTest::TEST_DOC); + $this->graph = new EasyRdf\Graph("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-ALA_738", DocumentRepositoryIntegrationTest::TEST_DOC); } public function setUp() { @@ -85,7 +105,7 @@ $this->httpClient = new Client(['base_uri' => config('corpusparole.sesame_base_url')]); $this->sesameRepository = config('corpusparole.sesame_repository'); - $this->cocoonDocIdBaseUri = config('corpusparole.cocoon_doc_id_base_uri'); + $this->corpusDocIdBaseUri = config('corpusparole.corpus_doc_id_base_uri'); $this->documentRepository = $this->app->make('CorpusParole\Repositories\DocumentRepository'); $uniqueid = uniqid('corpusparole', true); @@ -99,7 +119,7 @@ $this->httpClient->put("repositories/$this->sesameRepository/statements", [ 'headers' => ['Content-type' => 'text/turtle;charset=UTF-8'], 'body' => DocumentRepositoryIntegrationTest::TEST_DOC, - 'query' => ['context' => ''], + 'query' => ['context' => ''], ]); } @@ -109,14 +129,14 @@ } public function testAll() { - $expectedId = $this->cocoonDocIdBaseUri.'crdo-ALA_608'; + $expectedId = $this->corpusDocIdBaseUri.'crdo-ALA_738'; $docList = $this->documentRepository->all(); $this->assertCount(1, $docList, "Should have one element"); $resDoc = $docList[0]; $this->assertInstanceOf(Document::class, $resDoc, "Res doc must be a Document"); - $this->assertEquals('crdo-ALA_608', $resDoc->getId(), "id must be crdo..."); + $this->assertEquals('crdo-ALA_738', $resDoc->getId(), "id must be crdo..."); $this->assertEquals($expectedId, $resDoc->getUri(), 'url must be ...'); $this->assertNull($resDoc->getGraph(), 'Graph must be null'); @@ -124,27 +144,27 @@ public function testGet() { - $expectedId = $this->cocoonDocIdBaseUri.'crdo-ALA_608'; + $expectedId = $this->corpusDocIdBaseUri.'crdo-ALA_738'; $returnedGraph = new EasyRdf\Graph($expectedId, DocumentRepositoryIntegrationTest::TEST_DOC); - $res = $this->documentRepository->get('crdo-ALA_608'); + $res = $this->documentRepository->get('crdo-ALA_738'); $this->assertInstanceOf(Document::class, $res, "Result must be of type Document"); - $this->assertEquals('crdo-ALA_608', $res->getId(), 'id should be crdo-ALA_608' ); + $this->assertEquals('crdo-ALA_738', $res->getId(), 'id should be crdo-ALA_738' ); $this->assertNotNull($res->getGraph(), "Graph shoul not be null"); $this->assertTrue(EasyRdf\Isomorphic::isomorphic($res->getGraph(),$returnedGraph)); } public function testSave() { - $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); + $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-ALA_738", $this->graph); $doc->updateDiscourseTypes(['oratory','drama','narrative']); $res = $this->documentRepository->save($doc); $this->assertTrue($res, 'Has started a transaction'); - $res = $this->documentRepository->get('crdo-ALA_608'); + $res = $this->documentRepository->get('crdo-ALA_738'); $discoursesTypes = $res->getDiscourseTypes();