6 * |
6 * |
7 */ |
7 */ |
8 class DocumentTest extends TestCase { |
8 class DocumentTest extends TestCase { |
9 |
9 |
10 const TEST_DOC = <<<EOT |
10 const TEST_DOC = <<<EOT |
11 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> . |
11 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
12 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Document> . |
12 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
13 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/description> "Extrait des enqu\u00EAtes dialectologiques en vue de constituer un atlas linguistique de l'Alsace."@fr . |
13 @prefix sesame: <http://www.openrdf.org/schema/sesame#> . |
14 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/format> "audio/x-wav"^^<http://purl.org/dc/terms/IMT> . |
14 @prefix owl: <http://www.w3.org/2002/07/owl#> . |
15 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> <http://purl.org/dc/dcmitype/Sound> . |
15 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
16 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/type> "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> . |
16 @prefix fn: <http://www.w3.org/2005/xpath-functions#> . |
17 <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> . |
17 |
18 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/gsw> . |
18 <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608> <http://purl.org/dc/elements/1.1/description> "Extrait des enquêtes dialectologiques en vue de constituer un atlas linguistique de l'Alsace."@fr ; |
19 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/subject> "lexicography"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> . |
19 <http://purl.org/dc/elements/1.1/format> "audio/x-wav"^^<http://purl.org/dc/terms/IMT> ; |
20 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/subject> "phonetics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> . |
20 <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> ; |
21 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/subject> "anthropological_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> . |
21 <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/gsw> , "lexicography"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "phonetics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , "anthropological_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> ; |
22 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/gsw> . |
22 <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/gsw> ; |
23 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/contributor> <http://viaf.org/viaf/9122216> . |
23 <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/9122216> ; |
24 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/contributor> _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid1 . |
24 <http://purl.org/dc/elements/1.1/publisher> "Atlas linguistiques, cultures et parlers régionaux de France" ; |
25 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/contributor> _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid2 . |
25 <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ; |
26 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/publisher> "Atlas linguistiques, cultures et parlers r\u00E9gionaux de France" . |
26 <http://purl.org/dc/elements/1.1/title> "Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608"@fr ; |
27 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/rights> "Copyright (c) D\u00E9partement de dialectologie alsacienne et mosellane de l'Universit\u00E9 de Strasbourg" . |
27 <http://www.language-archives.org/OLAC/1.1/interviewer> "Bothorel-Witz, Arlette" , "Huck, Dominique" ; |
28 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/elements/1.1/title> "Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608"@fr . |
28 <http://purl.org/dc/terms/isFormatOf> <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> , <http://cocoon.huma-num.fr/data/ala/ALA_608.mp3> ; |
29 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" . |
29 <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ; |
30 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> . |
30 <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> ; |
31 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ALA_CL> . |
31 <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_ALA_CL> , <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE> ; |
32 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE> . |
32 <http://purl.org/dc/terms/extent> "PT02H04M16S" ; |
33 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/extent> "PT02H04M16S" . |
33 <http://purl.org/dc/terms/created> "start=1980; end=1989; name=années 80"^^<http://purl.org/dc/terms/Period> ; |
34 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/created> "start=1980; end=1989; name=ann\u00E9es 80"^^<http://purl.org/dc/terms/Period> . |
34 <http://purl.org/dc/terms/spatial> "France, Alsace"@fr , "FR"^^<http://purl.org/dc/terms/ISO3166> ; |
35 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/spatial> "France, Alsace"@fr . |
35 <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/ala/masters/ALA_608.wav> ; |
36 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/spatial> "FR"^^<http://purl.org/dc/terms/ISO3166> . |
36 <http://purl.org/dc/terms/available> "2004-07-03"^^<http://purl.org/dc/terms/W3CDTF> ; |
37 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/isFormatOf> <http://cocoon.huma-num.fr/data/ala/ALA_608.mp3> . |
37 <http://purl.org/dc/terms/issued> "2014-11-04T16:25:54+01:00"^^<http://purl.org/dc/terms/W3CDTF> . |
38 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/isFormatOf> <http://cocoon.huma-num.fr/data/ala/masters/ALA_608.wav> . |
38 |
39 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/available> "2004-07-03"^^<http://purl.org/dc/terms/W3CDTF> . |
39 <http://lexvo.org/id/iso639-3/gsw> rdfs:label "Alsacien"@fr . |
40 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://purl.org/dc/terms/issued> "2014-11-04T16:25:54+01:00"^^<http://purl.org/dc/terms/W3CDTF> . |
40 |
41 <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> <http://www.openrdf.org/schema/sesame#directType> <http://xmlns.com/foaf/0.1/Document> . |
41 <http://viaf.org/viaf/9122216> rdfs:label "Huck, Dominique" ; |
42 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> . |
42 <http://xmlns.com/foaf/0.1/status> "depositor"^^<http://www.language-archives.org/OLAC/1.1/role> . |
43 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . |
|
44 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid1 <http://xmlns.com/foaf/0.1/name> "Bothorel-Witz, Arlette" . |
|
45 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid1 <http://xmlns.com/foaf/0.1/status> "interviewer"^^<http://www.language-archives.org/OLAC/1.1/role> . |
|
46 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid1 <http://www.openrdf.org/schema/sesame#directType> <http://xmlns.com/foaf/0.1/Agent> . |
|
47 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> . |
|
48 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . |
|
49 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid2 <http://xmlns.com/foaf/0.1/name> "Huck, Dominique" . |
|
50 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid2 <http://xmlns.com/foaf/0.1/status> "interviewer"^^<http://www.language-archives.org/OLAC/1.1/role> . |
|
51 _:genid2d6c3879d9d2484bd98bb0bcb9dd0364fc2dgenid2 <http://www.openrdf.org/schema/sesame#directType> <http://xmlns.com/foaf/0.1/Agent> . |
|
52 <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608> <http://xmlns.com/foaf/0.1/primaryTopic> <http://cocoon.huma-num.fr/data/ala/ALA_608_22km.wav> . |
|
53 EOT; |
43 EOT; |
54 |
44 |
55 private $testGraph; |
|
56 |
45 |
57 public function setUp() { |
46 public function setUp() { |
58 |
47 |
59 parent::setup(); |
48 parent::setup(); |
60 $this->graph = new \EasyRdf_Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC); |
49 $this->graph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC); |
61 |
50 |
62 } |
51 } |
63 |
52 |
64 public function testConstructor() { |
53 public function testConstructor() { |
65 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
54 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
73 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
62 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
74 |
63 |
75 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
64 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
76 |
65 |
77 $this->assertEquals("Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608",$doc->getTitle(),'Must have correct title'); |
66 $this->assertEquals("Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608",$doc->getTitle(),'Must have correct title'); |
78 $this->assertInstanceOf(\EasyRdf_Literal::class, $doc->getTitle(), "Title must be a literal"); |
67 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getTitle(), "Title must be a literal"); |
79 $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr"); |
68 $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr"); |
80 } |
69 } |
81 |
70 |
82 public function testPublisher() { |
71 public function testPublisher() { |
83 |
72 |
84 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
73 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
85 |
74 |
86 $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1'); |
75 $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1'); |
87 $this->assertEquals(new \EasyRdf_Literal("Atlas linguistiques, cultures et parlers régionaux de France",null,null), $doc->getPublishers()[0], "Must contains correct publisher"); |
76 $this->assertEquals(new EasyRdf\Literal("Atlas linguistiques, cultures et parlers régionaux de France",null,null), $doc->getPublishers()[0], "Must contains correct publisher"); |
88 |
77 |
89 } |
78 } |
90 |
79 |
91 public function testMediaArray() { |
80 public function testMediaArray() { |
92 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
81 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
122 |
111 |
123 foreach($doc->getTypes() as $type) { |
112 foreach($doc->getTypes() as $type) { |
124 $this->assertThat( |
113 $this->assertThat( |
125 $type, |
114 $type, |
126 $this->logicalXor( |
115 $this->logicalXor( |
127 $this->isInstanceOf(\EasyRdf_Literal::class), |
116 $this->isInstanceOf(EasyRdf\Literal::class), |
128 $this->isInstanceOf(\EasyRdf_Resource::class) |
117 $this->isInstanceOf(EasyRdf\Resource::class) |
129 ) |
118 ) |
130 ); |
119 ); |
131 } |
120 } |
132 } |
121 } |
133 |
122 |
134 public function testGetDiscourseTypes() { |
123 public function testGetDiscourseTypes() { |
135 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
124 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
136 |
125 |
137 $this->assertCount(1, $doc->getDiscourseTypes(), "types array must be of size 1"); |
126 $this->assertCount(1, $doc->getDiscourseTypes(), "types array must be of size 1"); |
138 |
127 |
139 $this->assertContainsOnlyInstancesOf("EasyRdf_Literal", $doc->getDiscourseTypes(), "Result contains only literals"); |
128 $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $doc->getDiscourseTypes(), "Result contains only literals"); |
140 $type = $doc->getDiscourseTypes()[0]; |
129 $type = $doc->getDiscourseTypes()[0]; |
141 $this->assertEquals("dialogue", $type, "discourse type is dialogue"); |
130 $this->assertEquals("dialogue", $type, "discourse type is dialogue"); |
142 $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url"); |
131 $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url"); |
143 } |
132 } |
144 |
133 |
148 $doc2 = clone $doc; |
137 $doc2 = clone $doc; |
149 |
138 |
150 $this->assertNotSame($doc, $doc2, "documents must not be the same"); |
139 $this->assertNotSame($doc, $doc2, "documents must not be the same"); |
151 $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same"); |
140 $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same"); |
152 |
141 |
153 $this->assertTrue(\EasyRdf_Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic"); |
142 $this->assertTrue(EasyRdf\Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic"); |
154 } |
143 } |
155 |
144 |
156 public function testIsIsomorphic() { |
145 public function testIsIsomorphic() { |
157 $doc1 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
146 $doc1 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
158 $doc2 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", new \EasyRdf_Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC)); |
147 $doc2 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC)); |
159 |
148 |
160 $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic"); |
149 $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic"); |
161 |
150 |
162 $doc2->addLiteral('dc11:type', new \EasyRdf_Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri'])); |
151 $doc2->addLiteral('dc11:type', new EasyRdf\Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri'])); |
163 |
152 |
164 $this->assertFalse($doc1->isIsomorphic($doc2),"document must not be isomorphic"); |
153 $this->assertFalse($doc1->isIsomorphic($doc2),"document must not be isomorphic"); |
165 } |
154 } |
166 |
155 |
167 public function testUpdateDiscourseTypes() { |
156 public function testUpdateDiscourseTypes() { |
180 $this->assertContains($dt, $discourseTypes, "all discourse types must be in result list"); |
169 $this->assertContains($dt, $discourseTypes, "all discourse types must be in result list"); |
181 } |
170 } |
182 |
171 |
183 } |
172 } |
184 |
173 |
|
174 public function testUpdateDiscourseTypesDelta() { |
|
175 |
|
176 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
|
177 |
|
178 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
|
179 |
|
180 $doc->updateDiscourseTypes($newDiscourseTypes); |
|
181 |
|
182 $this->assertTrue($doc->isDirty()); |
|
183 |
|
184 $this->assertEquals(1, $doc->deltaCount(), "There is one delta"); |
|
185 |
|
186 $delta = $doc->getDeltaList()[0]; |
|
187 |
|
188 $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $delta->getDeletedGraph()->getUri(), "uri of deleted graph must be ok"); |
|
189 $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $delta->getAddedGraph()->getUri(), "uri of added graph must be ok"); |
|
190 |
|
191 $this->assertEquals(1, $delta->getDeletedGraph()->countTriples(), "deleted graph must have only one triple"); |
|
192 $this->assertEquals(3, $delta->getAddedGraph()->countTriples(), "deleted graph must have only one triple"); |
|
193 |
|
194 $resQueryDiscourseType = $delta->getAddedGraph()->allLiterals('http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608', 'dc11:type'); |
|
195 foreach($resQueryDiscourseType as $dt) { |
|
196 $this->assertInstanceOf(EasyRdf\Literal::class, $dt, "This must be a litteral"); |
|
197 $this->assertEquals('http://www.language-archives.org/OLAC/1.1/discourse-type', $dt->getDatatypeUri(), "The type of the Litteral must be correct"); |
|
198 } |
|
199 foreach($newDiscourseTypes as $dt) { |
|
200 $this->assertContains($dt, $resQueryDiscourseType, "all discourse types must be in result list"); |
|
201 } |
|
202 |
|
203 } |
|
204 |
185 public function testUpdateDiscourseTypesIsomorphic() { |
205 public function testUpdateDiscourseTypesIsomorphic() { |
186 |
206 |
187 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
207 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
188 |
208 |
189 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
209 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
190 $doc->updateDiscourseTypes($newDiscourseTypes); |
210 $doc->updateDiscourseTypes($newDiscourseTypes); |
191 |
211 |
192 $doc2 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", new \EasyRdf_Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC)); |
212 $doc2 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC)); |
193 |
213 |
194 $this->assertFalse($doc->isIsomorphic($doc2),"document must not be isomorphic after adding discourse type"); |
214 $this->assertFalse($doc->isIsomorphic($doc2),"document must not be isomorphic after adding discourse type"); |
195 } |
215 } |
196 } |
216 } |