14 @prefix sesame: <http://www.openrdf.org/schema/sesame#> . |
14 @prefix sesame: <http://www.openrdf.org/schema/sesame#> . |
15 @prefix owl: <http://www.w3.org/2002/07/owl#> . |
15 @prefix owl: <http://www.w3.org/2002/07/owl#> . |
16 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
16 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
17 @prefix fn: <http://www.w3.org/2005/xpath-functions#> . |
17 @prefix fn: <http://www.w3.org/2005/xpath-functions#> . |
18 |
18 |
19 <http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND> a <http://www.openarchives.org/ore/terms/Aggregation> ; |
19 <%1\$scrdo-CFPP2000_35_SOUND> a <http://www.openarchives.org/ore/terms/Aggregation> ; |
20 <http://www.europeana.eu/schemas/edm/aggregatedCHO> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ; |
20 <http://www.europeana.eu/schemas/edm/aggregatedCHO> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ; |
21 <http://www.europeana.eu/schemas/edm/dataProvider> "Langage et langues : description, théorisation, transmission" ; |
21 <http://www.europeana.eu/schemas/edm/dataProvider> "Langage et langues : description, théorisation, transmission" ; |
22 <http://www.europeana.eu/schemas/edm/hasView> <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml> , <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3> , <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav> ; |
22 <http://www.europeana.eu/schemas/edm/hasView> <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml> , <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3> , <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav> ; |
23 <http://www.europeana.eu/schemas/edm/isShownAt> <http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND> ; |
23 <http://www.europeana.eu/schemas/edm/isShownAt> <http://corpusdelaparole.huma-num.fr/corpus-app#/detail/crdo-CFPP2000_35_SOUND> ; |
24 <http://www.europeana.eu/schemas/edm/isShownBy> <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ; |
24 <http://www.europeana.eu/schemas/edm/isShownBy> <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ; |
31 <http://purl.org/dc/terms/extent> "PT48M26S" ; |
31 <http://purl.org/dc/terms/extent> "PT48M26S" ; |
32 <http://purl.org/dc/terms/issued> "2013-10-12T14:35:57+02:00"^^<http://purl.org/dc/terms/W3CDTF> ; |
32 <http://purl.org/dc/terms/issued> "2013-10-12T14:35:57+02:00"^^<http://purl.org/dc/terms/W3CDTF> ; |
33 <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ; |
33 <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-sa/3.0/> ; |
34 <http://purl.org/dc/elements/1.1/contributor> <http://viaf.org/viaf/93752300> , "Tanguy, Noalig" , "Chevrier, Michel" , "Kiliç, Ozgur" , "Salvegas, Etienne" , "du-Breuil-de-Pont-en-Auge, Augustin" , "du-Breuil-de-Pont-en-Auge, Benoît" ; |
34 <http://purl.org/dc/elements/1.1/contributor> <http://viaf.org/viaf/93752300> , "Tanguy, Noalig" , "Chevrier, Michel" , "Kiliç, Ozgur" , "Salvegas, Etienne" , "du-Breuil-de-Pont-en-Auge, Augustin" , "du-Breuil-de-Pont-en-Auge, Benoît" ; |
35 <http://purl.org/dc/elements/1.1/description> "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr , "Quartier(s) concerné(s) : Paris 3e, et 20e (pour l'âge adulte); Anonymisation : Noalig TANGUY;"@fr ; |
35 <http://purl.org/dc/elements/1.1/description> "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr , "Quartier(s) concerné(s) : Paris 3e, et 20e (pour l'âge adulte); Anonymisation : Noalig TANGUY;"@fr ; |
36 <http://purl.org/dc/elements/1.1/identifier> "ark:/87895/1.17-375004" , "corpusparole:crdo-CFPP2000_35_SOUNDid" , "oai:crdo.vjf.cnrs.fr:crdo-CFPP2000_35" , "Cote producteur: [03-01] Ozgur_Kilic_H_32_alii_3e"@fr , "ark:/87895/1.17-372593" , "oai:crdo.vjf.cnrs.fr:crdo-CFPP2000_35_SOUND" ; |
36 <http://purl.org/dc/elements/1.1/identifier> "ark:/87895/1.17-375004" , "%2\$scrdo-CFPP2000_35_SOUNDid" , "oai:crdo.vjf.cnrs.fr:crdo-CFPP2000_35" , "Cote producteur: [03-01] Ozgur_Kilic_H_32_alii_3e"@fr , "ark:/87895/1.17-372593" , "oai:crdo.vjf.cnrs.fr:crdo-CFPP2000_35_SOUND" ; |
37 <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/fra> ; |
37 <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/fra> ; |
38 <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/142432638>; |
38 <http://purl.org/dc/elements/1.1/publisher> <http://viaf.org/viaf/142432638>; |
39 <http://purl.org/dc/elements/1.1/subject> <http://ark.bnf.fr/ark:/12148/cb13318415c> , "anthropological_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "lexicography"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "phonetics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://lexvo.org/id/iso639-3/fra> , <http://ark.bnf.fr/ark:/12148/cb133188907> , <http://ark.bnf.fr/ark:/12148/cb11932762f> , "general_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb133183660> , "text_and_corpus_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "Français"@fr , <http://ark.bnf.fr/ark:/12148/cb122368540> , "phonology"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "semantics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "sociolinguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "syntax"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "typology"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb119418302> , <http://ark.bnf.fr/ark:/12148/cb135540729> , "discourse_analysis"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "historical_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "language_documentation"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb133192210> , <http://ark.bnf.fr/ark:/12148/cb119377452> , <http://ark.bnf.fr/ark:/12148/cb13320451h> , <http://ark.bnf.fr/ark:/12148/cb13318422n> , <http://ark.bnf.fr/ark:/12148/cb11975823c> , "mathematical_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> ; |
39 <http://purl.org/dc/elements/1.1/subject> <http://ark.bnf.fr/ark:/12148/cb13318415c> , "anthropological_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "lexicography"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "phonetics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://lexvo.org/id/iso639-3/fra> , <http://ark.bnf.fr/ark:/12148/cb133188907> , <http://ark.bnf.fr/ark:/12148/cb11932762f> , "general_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb133183660> , "text_and_corpus_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "Français"@fr , <http://ark.bnf.fr/ark:/12148/cb122368540> , "phonology"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "semantics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "sociolinguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "syntax"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "typology"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb119418302> , <http://ark.bnf.fr/ark:/12148/cb135540729> , "discourse_analysis"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "historical_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "language_documentation"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb133192210> , <http://ark.bnf.fr/ark:/12148/cb119377452> , <http://ark.bnf.fr/ark:/12148/cb13320451h> , <http://ark.bnf.fr/ark:/12148/cb13318422n> , <http://ark.bnf.fr/ark:/12148/cb11975823c> , "mathematical_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> ; |
40 <http://purl.org/dc/elements/1.1/title> "Entretien de Ozgur Kiliç 2"@fr ; |
40 <http://purl.org/dc/elements/1.1/title> "Entretien de Ozgur Kiliç 2"@fr ; |
41 <http://purl.org/dc/elements/1.1/type> <http://ark.bnf.fr/ark:/12148/cb11932135w> , <http://ark.bnf.fr/ark:/12148/cb12481481z> , <http://purl.org/dc/dcmitype/Sound> , "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> , "report"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> , "unintelligible_speech"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ; |
41 <http://purl.org/dc/elements/1.1/type> <http://ark.bnf.fr/ark:/12148/cb11932135w> , <http://ark.bnf.fr/ark:/12148/cb12481481z> , <http://purl.org/dc/dcmitype/Sound> , "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> , "report"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> , "unintelligible_speech"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> ; |
91 |
91 |
92 |
92 |
93 public function setUp() { |
93 public function setUp() { |
94 |
94 |
95 parent::setup(); |
95 parent::setup(); |
96 $this->graph = new EasyRdf\Graph("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC); |
96 $this->graph = new EasyRdf\Graph(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", sprintf(DocumentTest::TEST_DOC, config('corpusparole.corpus_doc_id_base_uri'), config('corpusparole.corpus_id_scheme'))); |
97 |
97 |
98 } |
98 } |
99 |
99 |
100 public function testConstructor() { |
100 public function testConstructor() { |
101 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
101 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
102 |
102 |
103 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
103 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
104 |
104 |
105 $this->assertEquals('corpusparole:crdo-CFPP2000_35_SOUNDid',$doc->getId(),'Must have the correct id'); |
105 $this->assertEquals(config('corpusparole.corpus_id_scheme').'crdo-CFPP2000_35_SOUNDid',$doc->getId(),'Must have the correct id'); |
106 } |
106 } |
107 |
107 |
108 public function testTitle() { |
108 public function testTitle() { |
109 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
109 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
110 |
110 |
111 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
111 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
112 |
112 |
113 $this->assertEquals("Entretien de Ozgur Kiliç 2",$doc->getTitle(),'Must have correct title'); |
113 $this->assertEquals("Entretien de Ozgur Kiliç 2",$doc->getTitle(),'Must have correct title'); |
114 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getTitle(), "Title must be a literal"); |
114 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getTitle(), "Title must be a literal"); |
115 $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr"); |
115 $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr"); |
116 } |
116 } |
117 |
117 |
118 public function testModified() { |
118 public function testModified() { |
119 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
119 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
120 |
120 |
121 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
121 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
122 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal"); |
122 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal"); |
123 $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF"); |
123 $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF"); |
124 $this->assertEquals("2013-10-12T14:35:57+02:00", $doc->getModified(), "modified must be 2013-10-12T14:35:57+02:00"); |
124 $this->assertEquals("2013-10-12T14:35:57+02:00", $doc->getModified(), "modified must be 2013-10-12T14:35:57+02:00"); |
125 |
125 |
126 } |
126 } |
127 |
127 |
128 public function testSetModified() { |
128 public function testSetModified() { |
129 $currentTime = gmdate(DateTime::ATOM); |
129 $currentTime = gmdate(DateTime::ATOM); |
130 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
130 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
131 $doc->setModified($currentTime); |
131 $doc->setModified($currentTime); |
132 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal"); |
132 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal"); |
133 $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF"); |
133 $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF"); |
134 $this->assertEquals(preg_replace('/[\+\-]00(\:?)00$/', 'Z', $currentTime), $doc->getModified()->getValue(), "modified must be $currentTime"); |
134 $this->assertEquals(preg_replace('/[\+\-]00(\:?)00$/', 'Z', $currentTime), $doc->getModified()->getValue(), "modified must be $currentTime"); |
135 } |
135 } |
136 |
136 |
137 public function testSetModifiedNull() { |
137 public function testSetModifiedNull() { |
138 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
138 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
139 $doc->setModified(); |
139 $doc->setModified(); |
140 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal"); |
140 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal"); |
141 $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF"); |
141 $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF"); |
142 $foundDateTime = \DateTime::createFromFormat(\DateTime::ATOM, $doc->getModified()->getValue()); |
142 $foundDateTime = \DateTime::createFromFormat(\DateTime::ATOM, $doc->getModified()->getValue()); |
143 $nowUTC = new \DateTime('now', new \DateTimeZone("UTC")); |
143 $nowUTC = new \DateTime('now', new \DateTimeZone("UTC")); |
144 $this->assertTrue($nowUTC->getTimestamp() - $foundDateTime->getTimestamp() < 2, "must have less than 2 seconds diff"); |
144 $this->assertTrue($nowUTC->getTimestamp() - $foundDateTime->getTimestamp() < 2, "must have less than 2 seconds diff"); |
145 } |
145 } |
146 |
146 |
147 public function testPublisher() { |
147 public function testPublisher() { |
148 |
148 |
149 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
149 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
150 |
150 |
151 $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1'); |
151 $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1'); |
152 $this->assertInstanceOf('EasyRdf\Resource', $doc->getPublishers()[0], 'publisher is a resource'); |
152 $this->assertInstanceOf('EasyRdf\Resource', $doc->getPublishers()[0], 'publisher is a resource'); |
153 $this->assertEquals("http://viaf.org/viaf/142432638", $doc->getPublishers()[0]->getUri(),""); |
153 $this->assertEquals("http://viaf.org/viaf/142432638", $doc->getPublishers()[0]->getUri(),""); |
154 } |
154 } |
155 |
155 |
156 public function testMediaArray() { |
156 public function testMediaArray() { |
157 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
157 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
158 |
158 |
159 $this->assertCount(4, $doc->getMediaArray(), "Media array must be of size 4"); |
159 $this->assertCount(4, $doc->getMediaArray(), "Media array must be of size 4"); |
160 //print_r($doc->getMediaArray()); |
160 //print_r($doc->getMediaArray()); |
161 foreach($doc->getMediaArray() as $url => $media) { |
161 foreach($doc->getMediaArray() as $url => $media) { |
162 $this->assertArrayHasKey('format', $media, "media has 'format key'"); |
162 $this->assertArrayHasKey('format', $media, "media has 'format key'"); |
231 ); |
231 ); |
232 } |
232 } |
233 } |
233 } |
234 |
234 |
235 public function testGetDiscourseTypes() { |
235 public function testGetDiscourseTypes() { |
236 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
236 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
237 |
237 |
238 $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3"); |
238 $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3"); |
239 |
239 |
240 $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $doc->getDiscourseTypes(), "Result contains only literals"); |
240 $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $doc->getDiscourseTypes(), "Result contains only literals"); |
241 $type = $doc->getDiscourseTypes()[0]; |
241 $type = $doc->getDiscourseTypes()[0]; |
242 $this->assertEquals("narrative", $type->getValue(), "discourse type is narrative"); |
242 $this->assertEquals("narrative", $type->getValue(), "discourse type is narrative"); |
243 $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url"); |
243 $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url"); |
244 } |
244 } |
245 |
245 |
246 public function testCloneDocument() { |
246 public function testCloneDocument() { |
247 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
247 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
248 |
248 |
249 $doc2 = clone $doc; |
249 $doc2 = clone $doc; |
250 |
250 |
251 $this->assertNotSame($doc, $doc2, "documents must not be the same"); |
251 $this->assertNotSame($doc, $doc2, "documents must not be the same"); |
252 $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same"); |
252 $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same"); |
253 |
253 |
254 $this->assertTrue(EasyRdf\Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic"); |
254 $this->assertTrue(EasyRdf\Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic"); |
255 } |
255 } |
256 |
256 |
257 public function testIsIsomorphic() { |
257 public function testIsIsomorphic() { |
258 $doc1 = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
258 $doc1 = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
259 $doc2 = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", new EasyRdf\Graph("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC)); |
259 $doc2 = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", new EasyRdf\Graph(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", sprintf(DocumentTest::TEST_DOC, config('corpusparole.corpus_doc_id_base_uri'), config('corpusparole.corpus_id_scheme')))); |
260 |
260 |
261 $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic"); |
261 $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic"); |
262 |
262 |
263 $doc2->addLiteral('dc11:type', new EasyRdf\Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri'])); |
263 $doc2->addLiteral('dc11:type', new EasyRdf\Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri'])); |
264 |
264 |
285 |
285 |
286 public function testUpdateDiscourseTypesDelta() { |
286 public function testUpdateDiscourseTypesDelta() { |
287 |
287 |
288 $newDiscourseTypes = ['oratory','dialogue','narrative', 'formulaic', 'ludic']; |
288 $newDiscourseTypes = ['oratory','dialogue','narrative', 'formulaic', 'ludic']; |
289 |
289 |
290 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
290 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
291 |
291 |
292 $doc->updateDiscourseTypes($newDiscourseTypes); |
292 $doc->updateDiscourseTypes($newDiscourseTypes); |
293 |
293 |
294 $this->assertTrue($doc->isDirty()); |
294 $this->assertTrue($doc->isDirty()); |
295 |
295 |
296 $this->assertEquals(1, $doc->deltaCount(), "There is one delta"); |
296 $this->assertEquals(1, $doc->deltaCount(), "There is one delta"); |
297 |
297 |
298 $delta = $doc->getDeltaList()[0]; |
298 $delta = $doc->getDeltaList()[0]; |
299 |
299 |
300 $this->assertEquals("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $delta->getDeletedGraph()->getUri(), "uri of deleted graph must be ok"); |
300 $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $delta->getDeletedGraph()->getUri(), "uri of deleted graph must be ok"); |
301 $this->assertEquals("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $delta->getAddedGraph()->getUri(), "uri of added graph must be ok"); |
301 $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $delta->getAddedGraph()->getUri(), "uri of added graph must be ok"); |
302 |
302 |
303 $this->assertEquals(3, $delta->getDeletedGraph()->countTriples(), "deleted graph must have only 3 triples"); |
303 $this->assertEquals(3, $delta->getDeletedGraph()->countTriples(), "deleted graph must have only 3 triples"); |
304 $this->assertEquals(5, $delta->getAddedGraph()->countTriples(), "deleted graph must have only 5 triples"); |
304 $this->assertEquals(5, $delta->getAddedGraph()->countTriples(), "deleted graph must have only 5 triples"); |
305 |
305 |
306 $resQueryDiscourseType = $delta->getAddedGraph()->allLiterals($doc->getProvidedCHO(), 'dc11:type'); |
306 $resQueryDiscourseType = $delta->getAddedGraph()->allLiterals($doc->getProvidedCHO(), 'dc11:type'); |
341 |
341 |
342 public function testUpdateDiscourseTypesIsomorphic() { |
342 public function testUpdateDiscourseTypesIsomorphic() { |
343 |
343 |
344 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
344 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
345 |
345 |
346 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
346 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
347 $doc->updateDiscourseTypes($newDiscourseTypes); |
347 $doc->updateDiscourseTypes($newDiscourseTypes); |
348 |
348 |
349 $doc2 = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", new EasyRdf\Graph("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC)); |
349 $doc2 = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", new EasyRdf\Graph(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", sprintf(DocumentTest::TEST_DOC, config('corpusparole.corpus_doc_id_base_uri'), config('corpusparole.corpus_id_scheme')))); |
350 |
350 |
351 $this->assertFalse($doc->isIsomorphic($doc2),"document must not be isomorphic after adding discourse type"); |
351 $this->assertFalse($doc->isIsomorphic($doc2),"document must not be isomorphic after adding discourse type"); |
352 } |
352 } |
353 |
353 |
354 public function testGetContributors() { |
354 public function testGetContributors() { |
355 $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-CFPP2000_35_SOUND", $this->graph); |
355 $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->graph); |
356 |
356 |
357 $contributors = $doc->getContributors(); |
357 $contributors = $doc->getContributors(); |
358 |
358 |
359 $this->assertNotEmpty($contributors, "The contributors array should not be empty"); |
359 $this->assertNotEmpty($contributors, "The contributors array should not be empty"); |
360 $this->assertCount(8, $contributors, "The contributors array should have 8 elements"); |
360 $this->assertCount(8, $contributors, "The contributors array should have 8 elements"); |