5. Creating, Managing and Downloading Records¶
Provided the appropriate permissions (level Editor or higher) the creation of a new metadata record can be started by clicking the headers button (drop-down menu "new metadata", 4).
Alternatively the entry form can be attained via the respective button within the Editors Board (5).
In both cases there is a dialog box requesting the data type and the template to be used (6). Additionally there is the opportunity to assign the record to a certain group. This will limit access to the record to those group members.
5.1 Metadate Entry Mask¶
Following the dialog box the records editing view is opened in its simple version (7; for changing to full view see 8).
Using this entry form all relevant and / or known meta information concerning the regarded resource can be entered. The following information is necessary to generate meaningful metadata:
- Title: Unique title of dataset (preferably contains project title and temporal assignment)
- Date: Creation; Revision (if present)
- Abstract
- Resource's point of contact: Name; Organisation; Mail; Role (drop-down menu)
- Keywords: Theme; Place
- Resource constraints: Access (drop-down menu); Use (drop-down menu)
- Topic category (drop-down menu) - multiple answers possible
- Temporal extent: Start; End
- Bounding Box - Must be drawn "manually" by using the mouse
- Data source (if known)
- Metadata point of contact: Name; Organisation; Mail; Role (drop-down menu) This information should be entered during every creation of a new metadata record in order to facilitate retrievability and reusability of the concerned data (cf. -5.2).
Some advanced information can only be entered using the full view of the entry form. To enter advanced information, choose "Full" in the respective drop-down menu in the upper right corner (eye symbol). There you are able to enter the following information:
- Additional date (for example update of data)
- A point of contacts street address
- Supplemental information as free text
5.2 Editing Records¶
Editing of given records is basically made just like their creation (5.1). Given the necessary privileges, you get there by using the pencil symbol either in search results or in the editors board (9 ; 10):
Alternatively you can start editing an existing record by using the header button in the records standard view (11).
5.3 Managing and Editing Privileges¶
Only the Administrator, the Reviewer of the concerned group, and the Author of a record are able to edit its privileges. Starting from editors board the respective dialog box can be reached in two ways: The privileges of a single record can be edited by using the button in the line of the respective record (padlock symbol; cp. 10).
To change the privileges of several selected records at once, the respective records have to be marked in the editors board using their checkboxes. Following this the joint privileges dialog box can be reached by the respective button ("update privileges") in the drop-down menu above the list (12).
The dialog box shows a table of checkboxes, through which specific privileges can be assigned to different groups or circles of users (13). The following privileges (see columns of the table) are selectable here:
- Publish: Ability to view a metadata record
- Interactive Map: Ability to look at associated services (if any) via interactive map viewer
- Download: Ability to download associated resources (if any)
- Edit: Ability to edit metadata records
- Notify: Members of the respective groups get informed if associated resources are downloaded
- All: This group / circle of users has all privileges according to the selected records As a circle of users (see lines of the table) all existing groups as well as the following three categories are selectable:
- Public: All registered and unregistered users get this privilege (selectable exclusively by Administrator or Reviewer)
- Intranet: Only users within the intranet of the UFZ get this privilege (selectable exclusively by Administrator or Reviewer)
- Guest: Viewing access for all unregistered users
5.4 Update Record Status¶
During its life cycle from creation to publication, a metadata may run through various states. Changing a records state is possible via the button "Update record status" located in the drop-down menu "Manage record" within a records standard view (14).
Prior to this step, a Reviewer (or higher role) must enable the workflow. (15). Following this a metadata record is able to be assigned one of the following five status (or alternatively mark the status as "unknown", 16):
- Draft
- Submitted
- Approved
- Rejected
- Retired
After a Reviewer has enabled the workflow a record is automatically classified as "draft". The state of a record is from then on also visible in the editor board (17).
Downloading Associated Resources with Python 3.x¶
Python 3.x Code Snippet Example (for Copy / Paste)
# -*- coding: utf-8 -*-
# Header - adjust to make this work
username = "USERNAME"
password = "PASSWORD"
gn_link = "https://geonetwork.ufz.de/geonetwork"
filename = "tomato_93_pollValue.tif"
file_url =
"http://www.ufz.de/index.php?en=30592&comaapi_loadpage=1&comaapi=getfil
e_36672/directoutput/tomato_93_pollValue.tif"
qsearch = "http://geonetwork.ufz.de/geonetwork/srv/eng/q"
# import modules
import requests
# log in with requests.Session():
with requests.Session() as s:
login_data = {"username": username, "password": password}
s.post(gn_link, login_data)
print(r.text)
# download predefined file using file_url
d = requests.get(file_url)
with open("result", 'wb') as f:
f.write(d.content)
Downloading Associated Resources with R¶
R Code Snippet Example (für Copy / Paste; provided by Dr. M. Beckmann)
#### Header - adjust to make this work
username="XXX" # user credentials for geonetwork.ufz.de
password="XXX"
geonetworklink="https://geonetwork.ufz.de/geonetwork/srv/api/0.1/record
s/XXX" # Links to data can be found under "Download and links" in each
database entry
filename="XXX.zip" # chose target filename, files will be downloaded
into active working directory
####
# install.packages ("geonapi", "curl") # run once
library("geonapi", "curl")
# create logged in session for geonetwork.ufz.de
GN <- GNManager$new(
url = "https://geonetwork.ufz.de/geonetwork", # base URL of the
Geonetwork
version = "3.10.2",
user = username, pwd = password,
logger = "INFO"
)
# create handle for curl
h<- curl::new_handle()
curl::handle_setopt(
handle=h,
httpauth=1,
userpwd = paste(username,(":"),password, sep=""),
verbose=FALSE # set TRUE to show detailed outputs
)
# download
curl_download(url=geonetworklink, filename, handle=h)
# in case of zipped archives are downloaded this way you can use
unzip() to proceed from within R