def _map_omeka_item_element_dc_creator(self, object_builder, text): object_builder.agents.append( Agent.builder() .setName(AgentName.builder().setText(text).setType(AgentNameType.OTHER).build()) .setRole( AgentRole.builder() .setText('creator') .setVocabRef( VocabRef.builder().setVocab(Vocab.DC).build() ) .build() ) .build() )
def _parse_work_type(self, text): text = text.strip().replace(' ', '') if text in DCMI_TYPES: if text in ('Image', 'PhysicalObject', 'StillImage'): return \ WorkType.builder()\ .setText(text)\ .setVocabRef( VocabRef.builder() .setRefid(text)\ .setVocab(Vocab.DCMI_TYPE)\ .setUri(Uri.parse(DCMI_TYPES_BASE_URL + text))\ .build() )\ .build()
def _map_omeka_item_element_itm_color(self, object_builder, text, type_): text = text.lower() builder = \ Color.builder()\ .setText(text)\ .setType(type_) # if text in COSTUME_CORE_CONTROLLED_VOCABULARIES['Main Color']: builder.setVocabRef( VocabRef.builder() .setRefid(text) .setVocab(Vocab.QUILT_INDEX) .build() ) # else: # self._logger.warn("color '%s' is not in Quilt Index list", text) object_builder.colors.append(builder.build()) self._update_vocabulary_used('Item Type Metadata', 'Color', text)