Esempio n. 1
0
 def load_vocabulary(self, id_, entry, delay=True):
     """Load a single vocabulary."""
     pid_type = entry['pid-type']
     # Create the vocabulary type
     current_service.create_type(self._identity, id_, pid_type)
     # Load the data file
     self.load_datafile(id_, entry["data-file"], delay=delay)
Esempio n. 2
0
 def load_vocabulary(self, id_, entry):
     """Load a single vocabulary."""
     pid_type = entry['pid-type']
     # Create the vocabulary type
     current_service.create_type(self._identity, id_, pid_type)
     # Load the data file
     data_file_path = entry.get('data-file')
     if data_file_path:  # Creates pid_type, no data yet
         data_file = self._search_path.path(data_file_path)
         self.load_datafile(id_, data_file)
 def create_vocabulary_type(self, id_, entry):
     """Create the vocabulary type."""
     pid_type = entry['pid-type']
     current_service.create_type(self._identity, id_, pid_type)
Esempio n. 4
0
def resource_type_type(app):
    """Resource type vocabulary type."""
    return vocabulary_service.create_type(system_identity, "resource_types",
                                          "rsrct")
Esempio n. 5
0
def languages_type(app):
    """Language vocabulary type."""
    return vocabulary_service.create_type(system_identity, "languages", "lng")
Esempio n. 6
0
def relation_type(app):
    """Relation type vocabulary type."""
    return vocabulary_service.create_type(system_identity, "relationtypes",
                                          "rlt")
Esempio n. 7
0
def contributors_role_type(app):
    """Contributor role vocabulary type."""
    return vocabulary_service.create_type(system_identity, "contributorsroles",
                                          "cor")
Esempio n. 8
0
def date_type(app):
    """Date vocabulary type."""
    return vocabulary_service.create_type(system_identity, "datetypes", "dat")
Esempio n. 9
0
def subject_type(app):
    """Subject vocabulary type."""
    return vocabulary_service.create_type(system_identity, "subjects", "sub")
Esempio n. 10
0
def description_type(app):
    """title vocabulary type."""
    return vocabulary_service.create_type(system_identity, "descriptiontypes",
                                          "dty")
Esempio n. 11
0
def title_type(app):
    """title vocabulary type."""
    return vocabulary_service.create_type(system_identity, "titletypes",
                                          "ttyp")
Esempio n. 12
0
def licenses(app):
    """Licenses vocabulary type."""
    return vocabulary_service.create_type(system_identity, "licenses", "lic")
Esempio n. 13
0
 def pre_load(self, identity, ignore):
     """Actions taken before iteratively creating records."""
     if self._id not in ignore:
         pid_type = self._entry['pid-type']
         current_service.create_type(identity, self._id, pid_type)