def _map_omeka_item_element_dc_date_created(self, object_builder, text): earliest_date = self._parse_date(text) object_builder.dates.append( Date.builder() .setEarliestDate(earliest_date) .setLatestDate(earliest_date) .setType(DateType.CREATION) .build() )
def __init__( self, endpoint_url, logger, object_id, omeka_item ): self._object_builder = \ Object.builder()\ .setCollectionId(object_id.getCollectionId())\ .setInstitutionId(object_id.getInstitutionId()) self.__logger = logger self.__object_id = object_id self.__omeka_item = omeka_item self.agents = [] self.categories = [] self.cultural_contexts = [] self.dc_date_builder = Date.builder().setType(DateType.CREATION) self.dc_date_certainty = None self.dates = [] self.descriptions = [] self.identifiers = [] self.images = [] self.inscriptions = [] self.locations = [] self.materials = [] self.measurements = [] self.relation_builders = [] self.subjects = [] self.techniques = [] self.textrefs = [] self.titles = [] self.work_types = [] self.textrefs.append( Textref.builder() .setName( TextrefName.builder() .setText("Omeka item URL") .setType(TextrefNameType.ELECTRONIC) .build() ) .setRefid( TextrefRefid.builder() .setHref(Url.parse(str(endpoint_url) + 'items/show/' + str(omeka_item.id))) .setText(str(endpoint_url) + 'items/show/' + str(omeka_item.id)) .setType(TextrefRefidType.URI) .build() ) .build() )