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 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
11 @prefix ore: <http://www.openarchives.org/ore/terms/> . |
12 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
12 @prefix edm: <http://www.europeana.eu/schemas/edm/> . |
13 @prefix sesame: <http://www.openrdf.org/schema/sesame#> . |
13 @prefix dc11: <http://purl.org/dc/elements/1.1/> . |
|
14 @prefix olac: <http://www.language-archives.org/OLAC/1.1/> . |
|
15 @prefix dc: <http://purl.org/dc/terms/> . |
|
16 @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . |
|
17 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
|
18 @prefix skos: <http://www.w3.org/2004/02/skos/core#> . |
14 @prefix owl: <http://www.w3.org/2002/07/owl#> . |
19 @prefix owl: <http://www.w3.org/2002/07/owl#> . |
15 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
20 |
16 @prefix fn: <http://www.w3.org/2005/xpath-functions#> . |
21 <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND> |
17 |
22 a ore:Aggregation ; |
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 ; |
23 edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ; |
19 <http://purl.org/dc/elements/1.1/format> "audio/x-wav"^^<http://purl.org/dc/terms/IMT> ; |
24 edm:provider "Corpus de la Parole"@fr ; |
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> ; |
25 edm:dataProvider <http://viaf.org/viaf/142432638> ; |
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> ; |
26 edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-CFPP2000_35_SOUND> ; |
22 <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/gsw> ; |
27 edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ; |
23 <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/9122216> ; |
28 edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ; |
24 <http://purl.org/dc/elements/1.1/publisher> "Atlas linguistiques, cultures et parlers régionaux de France" ; |
29 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://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>. |
25 <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ; |
30 |
26 <http://purl.org/dc/elements/1.1/title> "Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608"@fr ; |
31 <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> |
27 <http://www.language-archives.org/OLAC/1.1/interviewer> "Bothorel-Witz, Arlette" , "Huck, Dominique" ; |
32 a edm:ProvidedCHO ; |
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> ; |
33 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 ; |
29 <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ; |
34 dc11:language <http://lexvo.org/id/iso639-3/fra> ; |
30 <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> ; |
35 dc11:publisher <http://viaf.org/viaf/142432638> ; |
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> ; |
36 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 ; |
32 <http://purl.org/dc/terms/extent> "PT02H04M16S" ; |
37 dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ; |
33 <http://purl.org/dc/terms/created> "start=1980; end=1989; name=années 80"^^<http://purl.org/dc/terms/Period> ; |
38 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 ; |
34 <http://purl.org/dc/terms/spatial> "France, Alsace"@fr , "FR"^^<http://purl.org/dc/terms/ISO3166> ; |
39 dc11:title "CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2"@fr ; |
35 <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/ala/masters/ALA_608.wav> ; |
40 dc:accessRights "Freely available for non-commercial use" ; |
36 <http://purl.org/dc/terms/available> "2004-07-03"^^<http://purl.org/dc/terms/W3CDTF> ; |
41 dc:extent "PT48M26S" ; |
37 <http://purl.org/dc/terms/issued> "2014-11-04T16:25:54+01:00"^^<http://purl.org/dc/terms/W3CDTF> . |
42 dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ; |
38 |
43 dc11:source "CFPP2000"@fr ; |
39 <http://lexvo.org/id/iso639-3/gsw> rdfs:label "Alsacien"@fr . |
44 dc11:coverage "Quartier concerné : 3e"@fr ; |
40 |
45 olac:depositor <http://viaf.org/viaf/93752300> ; |
41 <http://viaf.org/viaf/9122216> rdfs:label "Huck, Dominique" ; |
46 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" ; |
42 <http://xmlns.com/foaf/0.1/status> "depositor"^^<http://www.language-archives.org/OLAC/1.1/role> . |
47 olac:interviewer "Branca-Rosoff, Sonia" ; |
|
48 olac:responder "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne" ; |
|
49 olac:transcriber "Tanguy Noalig" ; |
|
50 dc:available "2013-10-12"^^dc:W3CDTF ; |
|
51 dc:created "2010-11-17"^^dc:W3CDTF ; |
|
52 dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ; |
|
53 dc:spatial [ |
|
54 a edm:Place ; |
|
55 geo:lat "48.83975"^^xsd:float ; |
|
56 geo:long "2.3542"^^xsd:float ; |
|
57 skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr ; |
|
58 owl:sameAs <http://vocab.getty.edu/tgn/7008038> |
|
59 ] . |
|
60 |
|
61 <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> |
|
62 a edm:WebResources ; |
|
63 dc:extent "PT48M26S" ; |
|
64 dc11:format "audio/x-wav"^^dc:IMT ; |
|
65 dc:created "2010-11-17"^^dc:W3CDTF ; |
|
66 dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF . |
|
67 |
|
68 <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav> |
|
69 a edm:WebResources ; |
|
70 dc:extent "PT48M26S" ; |
|
71 dc11:format "audio/x-wav"^^dc:IMT ; |
|
72 edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ; |
|
73 dc:created "2010-11-17"^^dc:W3CDTF ; |
|
74 dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF . |
|
75 |
|
76 <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3> |
|
77 a edm:WebResources ; |
|
78 dc:extent "PT48M26S" ; |
|
79 dc11:format "audio/mpeg"^^dc:IMT ; |
|
80 edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ; |
|
81 dc:created "2010-11-17"^^dc:W3CDTF ; |
|
82 dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF . |
|
83 |
|
84 <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml> |
|
85 a edm:WebResources ; |
|
86 dc11:format "application/xml"^^dc:IMT ; |
|
87 dc:created "2010-11-17"^^dc:W3CDTF ; |
|
88 dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF . |
|
89 |
|
90 <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml> |
|
91 a edm:WebResources ; |
|
92 dc11:format "application/xhtml+xml"^^dc:IMT ; |
|
93 dc:created "2010-11-17"^^dc:W3CDTF ; |
|
94 dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF . |
43 EOT; |
95 EOT; |
44 |
96 |
45 |
97 |
46 public function setUp() { |
98 public function setUp() { |
47 |
99 |
48 parent::setup(); |
100 parent::setup(); |
49 $this->graph = new EasyRdf\Graph("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", DocumentTest::TEST_DOC); |
101 $this->graph = new EasyRdf\Graph("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC); |
50 |
102 |
51 } |
103 } |
52 |
104 |
53 public function testConstructor() { |
105 public function testConstructor() { |
54 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
106 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
55 |
107 |
56 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
108 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
57 |
109 |
58 $this->assertEquals('crdo-ALA_608',$doc->getId(),'Must have the correct id'); |
110 $this->assertEquals('crdo-CFPP2000_35_SOUND',$doc->getId(),'Must have the correct id'); |
59 } |
111 } |
60 |
112 |
61 public function testTitle() { |
113 public function testTitle() { |
62 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
114 $this->assertNotNull($this->graph, 'Graph shoud not be null'); |
63 |
115 |
64 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
116 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
65 |
117 |
66 $this->assertEquals("Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_608",$doc->getTitle(),'Must have correct title'); |
118 $this->assertEquals("CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2",$doc->getTitle(),'Must have correct title'); |
67 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getTitle(), "Title must be a literal"); |
119 $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getTitle(), "Title must be a literal"); |
68 $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr"); |
120 $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr"); |
69 } |
121 } |
70 |
122 |
71 public function testPublisher() { |
123 public function testPublisher() { |
72 |
124 |
73 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
125 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
74 |
126 |
75 $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1'); |
127 $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1'); |
76 $this->assertEquals(new EasyRdf\Literal("Atlas linguistiques, cultures et parlers régionaux de France",null,null), $doc->getPublishers()[0], "Must contains correct publisher"); |
128 $this->assertInstanceOf('EasyRdf\Resource', $doc->getPublishers()[0], 'publisher is a resource'); |
77 |
129 $this->assertEquals("http://viaf.org/viaf/142432638", $doc->getPublishers()[0]->getUri(),""); |
78 } |
130 } |
79 |
131 |
80 public function testMediaArray() { |
132 public function testMediaArray() { |
81 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
133 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
82 |
134 |
83 $this->assertCount(3, $doc->getMediaArray(), "Media array must be of size 3"); |
135 $this->assertCount(5, $doc->getMediaArray(), "Media array must be of size 5"); |
84 foreach($doc->getMediaArray() as $media) { |
136 foreach($doc->getMediaArray() as $url => $media) { |
85 $this->assertCount(2, $media, "media is a 2 element array"); |
137 $this->assertCount(5, $media, "media is a 5 element array"); |
86 $this->assertArrayHasKey('format', $media, "media has 'format key'"); |
138 $this->assertArrayHasKey('format', $media, "media has 'format key'"); |
87 $this->assertArrayHasKey('url', $media, "media has url"); |
139 $this->assertArrayHasKey('url', $media, "media has url"); |
|
140 $this->assertArrayHasKey('extent', $media, "media has extent"); |
|
141 $this->assertArrayHasKey('extent_ms', $media, "media has extent_ms"); |
|
142 $this->assertArrayHasKey('master', $media, "media has master"); |
|
143 |
|
144 $this->assertEquals($media['url'], $url); |
|
145 |
|
146 $this->assertContains( |
|
147 $media['url'], |
|
148 [ "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav", |
|
149 "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3", |
|
150 "http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml", |
|
151 "http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml", |
|
152 "http://cocoon.huma-num.fr/data/archi/masters/372593.wav" |
|
153 ] |
|
154 ); |
|
155 if($url === "http://cocoon.huma-num.fr/data/archi/masters/372593.wav") { |
|
156 $this->assertEquals('audio/x-wav', $media['format']); |
|
157 $this->assertTrue($media['master'] === true, "should be master"); |
|
158 } |
|
159 else { |
|
160 $this->assertTrue($media['master'] === false, "should not be master"); |
|
161 } |
|
162 |
|
163 if( $url === "http://cocoon.huma-num.fr/data/archi/masters/372593.wav" || |
|
164 $url === "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3" || |
|
165 $url === "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav" ) { |
|
166 $this->assertEquals("PT48M26S", $media['extent'], "extent is PT48M26S"); |
|
167 $this->assertGreaterThan(0, $media['extent_ms'], "extent_ms must be > 0"); |
|
168 $this->assertStringStartsWith('audio/', $media['format']); |
|
169 } |
|
170 else { |
|
171 $this->assertNull($media['extent'], "no media extent"); |
|
172 $this->assertSame(0, $media['extent_ms'], "extend in ms is 0"); |
|
173 $this->assertStringStartsWith('application/', $media['format']); |
|
174 } |
|
175 |
88 } |
176 } |
89 } |
177 } |
90 |
178 |
91 public function testGetTypes() { |
179 public function testGetTypes() { |
92 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
180 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
93 |
181 |
94 $this->assertCount(3, $doc->getTypes(), "types array must be of size 3"); |
182 $this->assertCount(5, $doc->getTypes(), "types array must be of size 5"); |
95 |
183 |
96 foreach($doc->getTypes() as $type) { |
184 foreach($doc->getTypes() as $type) { |
97 $this->assertThat( |
185 $this->assertThat( |
98 $type, |
186 $type, |
99 $this->logicalXor( |
187 $this->logicalXor( |
119 ); |
207 ); |
120 } |
208 } |
121 } |
209 } |
122 |
210 |
123 public function testGetDiscourseTypes() { |
211 public function testGetDiscourseTypes() { |
124 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
212 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
125 |
213 |
126 $this->assertCount(1, $doc->getDiscourseTypes(), "types array must be of size 1"); |
214 $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3"); |
127 |
215 |
128 $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $doc->getDiscourseTypes(), "Result contains only literals"); |
216 $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $doc->getDiscourseTypes(), "Result contains only literals"); |
129 $type = $doc->getDiscourseTypes()[0]; |
217 $type = $doc->getDiscourseTypes()[0]; |
130 $this->assertEquals("dialogue", $type, "discourse type is dialogue"); |
218 $this->assertEquals("narrative", $type->getValue(), "discourse type is narrative"); |
131 $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url"); |
219 $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url"); |
132 } |
220 } |
133 |
221 |
134 public function testCloneDocument() { |
222 public function testCloneDocument() { |
135 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
223 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
136 |
224 |
137 $doc2 = clone $doc; |
225 $doc2 = clone $doc; |
138 |
226 |
139 $this->assertNotSame($doc, $doc2, "documents must not be the same"); |
227 $this->assertNotSame($doc, $doc2, "documents must not be the same"); |
140 $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same"); |
228 $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same"); |
141 |
229 |
142 $this->assertTrue(EasyRdf\Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic"); |
230 $this->assertTrue(EasyRdf\Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic"); |
143 } |
231 } |
144 |
232 |
145 public function testIsIsomorphic() { |
233 public function testIsIsomorphic() { |
146 $doc1 = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
234 $doc1 = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
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)); |
235 $doc2 = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", new EasyRdf\Graph("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC)); |
148 |
236 |
149 $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic"); |
237 $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic"); |
150 |
238 |
151 $doc2->addLiteral('dc11:type', new EasyRdf\Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri'])); |
239 $doc2->addLiteral('dc11:type', new EasyRdf\Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri'])); |
152 |
240 |
153 $this->assertFalse($doc1->isIsomorphic($doc2),"document must not be isomorphic"); |
241 $this->assertFalse($doc1->isIsomorphic($doc2),"document must not be isomorphic"); |
154 } |
242 } |
155 |
243 |
156 public function testUpdateDiscourseTypes() { |
244 public function testUpdateDiscourseTypes() { |
157 |
245 |
158 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
246 $newDiscourseTypes = ['oratory','dialogue','narrative', 'formulaic', 'ludic']; |
159 |
247 |
160 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
248 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
161 $this->assertCount(1, $doc->getDiscourseTypes(), "types array must be of size 1"); |
249 $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3"); |
162 |
250 |
163 $doc->updateDiscourseTypes($newDiscourseTypes); |
251 $doc->updateDiscourseTypes($newDiscourseTypes); |
164 |
252 |
165 $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3"); |
253 $this->assertCount(5, $doc->getDiscourseTypes(), "types array must be of size 5"); |
166 |
254 |
167 $discourseTypes = $doc->getDiscourseTypes(); |
255 $discourseTypes = $doc->getDiscourseTypes(); |
168 foreach($newDiscourseTypes as $dt) { |
256 foreach($newDiscourseTypes as $dt) { |
169 $this->assertContains($dt, $discourseTypes, "all discourse types must be in result list"); |
257 $this->assertContains($dt, $discourseTypes, "all discourse types must be in result list"); |
170 } |
258 } |
171 |
259 |
172 } |
260 } |
173 |
261 |
174 public function testUpdateDiscourseTypesDelta() { |
262 public function testUpdateDiscourseTypesDelta() { |
175 |
263 |
176 $newDiscourseTypes = ['oratory','dialogue','narrative']; |
264 $newDiscourseTypes = ['oratory','dialogue','narrative', 'formulaic', 'ludic']; |
177 |
265 |
178 $doc = new Document("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $this->graph); |
266 $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph); |
179 |
267 |
180 $doc->updateDiscourseTypes($newDiscourseTypes); |
268 $doc->updateDiscourseTypes($newDiscourseTypes); |
181 |
269 |
182 $this->assertTrue($doc->isDirty()); |
270 $this->assertTrue($doc->isDirty()); |
183 |
271 |
184 $this->assertEquals(1, $doc->deltaCount(), "There is one delta"); |
272 $this->assertEquals(1, $doc->deltaCount(), "There is one delta"); |
185 |
273 |
186 $delta = $doc->getDeltaList()[0]; |
274 $delta = $doc->getDeltaList()[0]; |
187 |
275 |
188 $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608", $delta->getDeletedGraph()->getUri(), "uri of deleted graph must be ok"); |
276 $this->assertEquals("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $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"); |
277 $this->assertEquals("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $delta->getAddedGraph()->getUri(), "uri of added graph must be ok"); |
190 |
278 |
191 $this->assertEquals(1, $delta->getDeletedGraph()->countTriples(), "deleted graph must have only one triple"); |
279 $this->assertEquals(3, $delta->getDeletedGraph()->countTriples(), "deleted graph must have only 3 triples"); |
192 $this->assertEquals(3, $delta->getAddedGraph()->countTriples(), "deleted graph must have only one triple"); |
280 $this->assertEquals(5, $delta->getAddedGraph()->countTriples(), "deleted graph must have only 5 triples"); |
193 |
281 |
194 $resQueryDiscourseType = $delta->getAddedGraph()->allLiterals('http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_608', 'dc11:type'); |
282 $resQueryDiscourseType = $delta->getAddedGraph()->allLiterals($doc->getProvidedCHO(), 'dc11:type'); |
195 foreach($resQueryDiscourseType as $dt) { |
283 foreach($resQueryDiscourseType as $dt) { |
196 $this->assertInstanceOf(EasyRdf\Literal::class, $dt, "This must be a litteral"); |
284 $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"); |
285 $this->assertEquals('http://www.language-archives.org/OLAC/1.1/discourse-type', $dt->getDatatypeUri(), "The type of the Litteral must be correct"); |
198 } |
286 } |
199 foreach($newDiscourseTypes as $dt) { |
287 foreach($newDiscourseTypes as $dt) { |