diff -r ac3dc090e987 -r f2a40bbc27f6 server/src/app/Libraries/Mappers/CocoonCollectionRdfMapper.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/app/Libraries/Mappers/CocoonCollectionRdfMapper.php Tue Nov 17 13:11:55 2015 +0100 @@ -0,0 +1,138 @@ + a ; +// """Cette série d'entretiens semi-dirigés avait comme objectif de susciter un discours +// sur les pratiques linguistiques des locuteurs. Les locuteurs se sont exprimés dans la langue de leur choix. +// Le questionnaire servant de trame à l'entretien comportait les volets suivants : +// # la biographie sociolinguistique +// # la délimitation de l'espace de vie et de l'espace linguistique d'appartenance +// # l'auto-évaluation des compétences linguistiques en alsacien, en français et en allemand +// # les normes linguistiques des trois variétés +// # les variations (alsacien, français, allemand) +// # les pratiques linguistiques et langagières +// # l'idéologie linguistique (rapport langue / identité, dialecte / école …)."""@fr ; +// "primary_text"^^ , "dialogue"^^ , , "lexicon"^^ ; +// ; +// ; +// ; +// "Atlas linguistiques, cultures et parlers régionaux de France" ; +// "Copyright (c) Département de dialectologie alsacienne et mosellane de l'Université de Strasbourg" ; +// "Atlas Linguistique et ethnographique de l'Alsace: Enquêtes sur la conscience linguistique"@fr ; +// "Freely available for non-commercial use" ; +// ; +// ; +// "start=1988; end=1989"^^ ; +// "France, Alsace"@fr , "FR"^^ ; +// "2014-04-18"^^ ; +// "2015-07-09T09:40:21 02:00"^^ ; +// "Huck, Dominique" ; +// "Bothorel-Witz, Arlette" . + +// 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/elements/1.1/subject +// http://purl.org/dc/elements/1.1/title +// http://purl.org/dc/elements/1.1/type +// http://purl.org/dc/terms/accessRights +// http://purl.org/dc/terms/available +// http://purl.org/dc/terms/created +// http://purl.org/dc/terms/issued +// http://purl.org/dc/terms/license +// http://purl.org/dc/terms/spatial +// http://www.language-archives.org/OLAC/1.1/depositor +// http://www.language-archives.org/OLAC/1.1/researcher +// http://www.language-archives.org/OLAC/1.1/transcriber +// http://purl.org/dc/terms/isPartOf +// http://www.language-archives.org/OLAC/1.1/compiler +// http://www.language-archives.org/OLAC/1.1/data_inputter +// http://www.language-archives.org/OLAC/1.1/developer +// http://www.language-archives.org/OLAC/1.1/interviewer +// http://www.language-archives.org/OLAC/1.1/sponsor +// http://www.w3.org/2003/01/geo/wgs84_pos#lat +// http://www.w3.org/2003/01/geo/wgs84_pos#long + +class CocoonCollectionRdfMapper extends CocoonAbstractRdfMapper { + + protected function getResourceBaseId($res=null) { + + if(is_null($res)) { + $res = $this->inputGraph->resource($this->uri); + } + return $res->getUri(); + } + + /** + * Build the main outputgraph + * @return the new empty graph + */ + protected function buildOutputGraph() { + + $outputGraph = new Graph($this->uri); + $this->outputGraphes[$this->getResourceBaseId()] = $outputGraph; + + return $outputGraph; + } + + + protected function mapResource($res, $outputGraph) { + $resUri = $res->getUri(); + + $collNode = $outputGraph->resource($resUri, 'edm:Collection'); + + $this->addSimpleProperties($collNode, $res); + $this->addDateProperties($collNode, $res, $outputGraph); + $this->addSpatialProperties($collNode, $res, $outputGraph); + + $this->mapCollections($res); + } + + + protected function addSimpleProperties($targetRes, $sourceRes) { + $this->applyPropertiesToRes($sourceRes, $targetRes, [ + ['http://purl.org/dc/elements/1.1/description', null], + ['http://purl.org/dc/elements/1.1/language', null], + ['http://purl.org/dc/elements/1.1/publisher', null], + ['http://purl.org/dc/elements/1.1/rights', null], + ['http://purl.org/dc/elements/1.1/type', null], + ['http://purl.org/dc/terms/license', null], + ['http://purl.org/dc/elements/1.1/subject', null], + ['http://purl.org/dc/elements/1.1/title', null], + ['http://purl.org/dc/elements/1.1/language', null], + ['http://purl.org/dc/terms/accessRights', 'propertyTrimMap'], + ['http://purl.org/dc/terms/extent', null], + ['http://purl.org/dc/terms/isPartOf', null], + ['http://www.language-archives.org/OLAC/1.1/annotator', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/author', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/compiler', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/consultant', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/data_inputter', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/depositor', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/developer', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/editor', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/illustrator', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/interpreter', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/interviewer', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/participant', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/performer', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/photographer', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/recorder', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/researcher', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/research_participant', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/responder', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/signer', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/singer', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/speaker', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/sponsor', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/transcriber', 'propertyOlacRoleMap'], + ['http://www.language-archives.org/OLAC/1.1/translator', 'propertyOlacRoleMap'], + ]); + } + + + +}