-
Notifications
You must be signed in to change notification settings - Fork 22
Importing items from command line
The import command uses Simple Archive Format (SAF) and is registered as a DSpace script (bin/dspace import). The command syntax in v7 is unchanged from earlier versions.
bin/dspace import -a -e USER_EMAIL -c COLLECTION_HANDLE -s /path/to/import -m /path/to/mapfile
-
-a/--add— add items to DSpace -
-e/--eperson— email of the eperson performing the import (required) -
-c/--collection— destination collection Handle or database ID -
-s/--source— directory with SAF structure (see below) -
-m/--mapfile— output mapfile that will be created (required)
Other useful flags: -r (replace), -d (delete), -z (import from zip file), -w (send through workflow), -v (validate / test run without importing).
When running inside a Docker-based deployment, execute the command inside the dspace container:
docker compose exec dspace /dspace/bin/dspace import -a -e USER_EMAIL -c COLLECTION_HANDLE -s /path/to/import -m /path/to/mapfile
The import directory uses Simple Archive Format (SAF), which is fully supported in DSpace v7. Create the structure by hand or explore the SAF Packager tool.
$ ls -R /path/to/import/
/path/to/import/:
1
/path/to/import/1:
contents license.txt metadata_local.xml
dublin_core.xml Makefile moses.ini
The format for dublin_core.xml and other schemas is the same, only difference is in the file name. For any other schema then dc you create metadata_SCHEMA.xml file. So if you are filling in the "local" SCHEMA you create metadata_local.xml.
head dublin_core.xml
<dublin_core>
<dcvalue element="date" qualifier="issued">2014-11</dcvalue>
<dcvalue element="language" qualifier="iso">eng</dcvalue>
<dcvalue element="language">English</dcvalue>
head metadata_local.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<dublin_core schema="local">
<dcvalue element="has" qualifier="files" language="*">yes</dcvalue>
<dcvalue element="branding" qualifier="none" language="">LRT + Open Submissions</dcvalue>
- for licensing to work put
dc.rights.uri,dc.rightsanddc.rights.labelin yourdublin_core.xml- these should match license uri, license name and license label of a defined license
- you'll want
dc.titleanddc.type
For programmatic imports, CLARIN-DSpace v7 also provides a REST API at /api/clarin/import/*. This API exposes endpoints for importing items, workspace items, workflow items, bitstreams, licenses, handles, and other entities. See the ClarinItemImportController source for available endpoints.
Real-world examples:
-
dspace-migrate — a CLARIN-developed Python tool for bulk migration and import using the CLARIN-DSpace REST API. It demonstrates how to programmatically drive the
/api/clarin/import/*endpoints to migrate entire collections between repositories. - lindat-repository-imports — an example project that uses the Simple Archive Format (SAF) for batch importing items into LINDAT/CLARIN repositories. It provides scripts and SAF-structured data as a reference for large-scale ingest workflows.
- NFA Imports - describes steps needed to import NFA(Národní Filmový Archiv) collection, by using lindat-repository-imports project.
Getting Started
Features
- All Features — full categorised list
- CLARIN Licenses
- PIDs & Handles
- Featured Services / Refbox
- Field-Level Permissions
- File Previews
- Sharing a Submission
- Personal Access Tokens
- DOI Configuration per Community
- ROR Authority
Operations
- Kubernetes Deployment
- Samples (.env, Nginx)
- Nginx + Shibboleth
- Handle Server · Setup (v7)
- Shibboleth · DiscoJuice
- Shibboleth Accounts
- S3 Storage · CESNET S3
- Google Analytics
- Matomo
- Solr
- Logging
- Custom Namespace
- Health Report
For Users
Development
Reference
- Authorizations
- Metadata Info
- Citations (proposal)
- Repository Checklist
- Search, Browse & Filters
- Localization
- Importing Items (CLI)
- NFA Import - Steps
- OpenAIRE
- DOI Registration
- Inclusion in OLAC
- Unit Testing
- Deploy Checks
- Troubleshooting
- Versioning Theory
- Dynamic Resource Versioning
- Metashare Import · Schema
- Web Server Overview
- LINDAT Common Theme
- Workshop 2016 Results
- WebLicht Integration
- Google Dataset Search
Archive (v5 / stale)
- Old Home (v5)
- Installation (v5)
- Prerequisites (v5)
- Connecting Tomcat with Apache
- Using Apache
- Building Shibboleth FastCGI
- Shibboleth Install (v5)
- EUDAT Replication
- Backup (v5)
- Spring Social / Google Drive (v5)
- Clarin (→ Repository Checklist)
- Control Panel (v5)
- Overlays (v5)
- Configuration (v5)
- Speeding Up Downloads
- Debugging (v5)
- Selenium (v5)
- Code Contributions (v5)
- Best Practices (v5)
- Testing Hudson
- Working on Windows
- Prerequisites Checklist (v5)
- Migration to DSpace 7.2.1
- Upgrade From Lindat
- Piwik (→ Matomo) · Piwik Cleaning