@access.user
    @loadmodel(map={'itemId': 'item'}, model='item',
               level=AccessType.WRITE)
    def createGeojsonDataset(self, item, params):
        user = self.getCurrentUser()
        folder = findDatasetFolder(user, user, create=True)
        if folder is None:
            raise RestException('User has no Minerva Dataset folder.')
        if folder['_id'] != item['folderId']:
            raise RestException("Items need to be in user's Minerva Dataset " +
                                "folder.")
        minerva_metadata = {
            'original_type': 'geojson',
            'dataset_type': 'geojson',
        }
        # Use the first geojson or json file found as the dataset.
        for file in self.model('item').childFiles(item=item, limit=0):
            if 'geojson' in file['exts'] or 'json' in file['exts']:
                minerva_metadata['original_files'] = [{
                    'name': file['name'], '_id': file['_id']}]
                minerva_metadata['geojson_file'] = {
                    'name': file['name'], '_id': file['_id']}
                break
        if 'geojson_file' not in minerva_metadata:
            raise RestException('Item contains no geojson file.')
        updateMinervaMetadata(item, minerva_metadata)
        return item
dataset/ETHPy150Open Kitware/minerva/server/rest/geojson_dataset.py/GeojsonDataset.createGeojsonDataset/original