-
Notifications
You must be signed in to change notification settings - Fork 3
Home
https://wiki.lyrasis.org/display/ARKs/ARK+Identifiers+FAQ
https://github.com/Daniel-KM/Noid4Php
https://github.com/AkioUnity/Noid4Php
- Please install the ARK Services Playbook at https://github.com/digitalutsc/ark-services-playbook#installation.
- Follow this guide to install the LAMP stack to your server. Please note:
- In STEP 4, follow this step exactly replacing your_domain with ark-services
- Then, open the terminal and change the current directory by running
cd /var/www
, - Then download the source code by running
git clone https://github.com/digitalutsc/ark-services.git
- Follow this guide to install phpMyAdmin on your server.
- Use phpMyAdmin to create an user, a database. Then, assign that user to the database with the privileges as in the screenshot below:
-
Create the config directory,
mkdir -p /var/www/ark-services/config
-
In your terminal, run
sudo nano /var/www/ark-services/config/MysqlArkConf.php
, and paste the following code. Set the name of variables you created in the previous step, then save it.
<?php
namespace Noid\Config;
class MysqlArkConf
{
static public $mysql_host = ''; // host of your server
static public $mysql_user = ''; // your MYSQL username
static public $mysql_passwd = ''; // your MYSQL password
static public $mysql_dbname = ''; // please enter the name of database which you have just created.
static public $mysql_port = 3306;
// backup
static public $backup_method = 2; // can be 1 -> php or 2-> mysqldump
static public $path_db_backup = "/var/www/ark-services/db/backup/"; // backup directory for database snapshot
static public $mysqldump = ""; // path to mysqldump for database backup
}
- After you have installed the code in the server, visit: https://yoursite/admin (Note that the first time you visit this url, it will redirect to https://yoursite/admin/install.php).
- Fill out your Organization information.
- Enter your System Administrator login credentials (The Password you enter will be encrypted and saved in the MYSQL database).
-
IMPORTANT: Make sure the directory in arks-service/admin/db exists and permission is 777, if not, run:
mkdir -p /your-path/arks-service/admin/db
- then,
chmod -R 777 /your-path/arks-service/admin/db
,
- Access the ARK database in PHPMyAdmin, and drop only two tables:
“system” and “user”, then refresh the webpage to visit
https://yoursite/admin/admin.php. The installation step above
will be repeated.
- Note: the minted ARK IDs won’t be effected
- You can visit https://arks.org/about/getting-started-implementing-arks/ for more information to request a NAAN,
- There is a form https://docs.google.com/forms/d/e/1FAIpQLSfd1CX6idwLB47g8OGKUG654auV8IU8yI7DAs61cXGOoFDn0g/viewform?c=0&w=1 to fill in.
- Visit: https://yoursite/admin/admin.php
- Fill out the “Create Database” form, then click Create.
- Note: To ensure the sufficient of the Ark ID lookup for redirection, the prefix must be unique (already enforced) among multiple databases.
- For more information of the fields (ie NAAN, NAA, Terms ....), visit the documentation of Noid library: https://metacpan.org/dist/Noid/view/noid
- .rddd: to mint random 3-digit numbers, stopping after 1000th
- .sdddddd: to mint sequential 6-digit numbers, stopping after millionth
- .zd: sequential numbers without limit, adding new digits as needed
- bc.rdddd: random 4-digit numbers with constant prefix bc
- 8rf.sdd: sequential 2-digit numbers with constant prefix 8rf
- .se: sequential extended-digits (from 0123456789bcdfghjkmnpqrstvwxz)
- h9.reee: random 3-extended-digit numbers with constant prefix h9
- .zeee: unlimited sequential numbers with at least 3 extended-digits
- .rdedeedd : random 7-char numbers, extended-digits at chars 2, 4, and 5
- .zededede: unlimited mixed digits, adding new extended-digits as needed
- sdd.sdede : sequential 4-mixed-digit numbers with constant prefix sdd
- .rdedk : random 3 mixed digits plus final (4th) computed check character
- .sdeeedk : 5 sequential mixed digits plus final extended-digit check char
- .zdeek : sequential digits plus check char, new digits added as needed
- 63q.redek : prefix plus random 4 mixed digits, one of them a check char
https://wiki.lyrasis.org/display/ARKs/ARK+Identifiers+FAQ
-
- Click the dropdown menu on top of the Bound Arks Table and select either the Binding an Ark option
- Paste the Ark you would like to bind into the Ark ID field and then type in the metadata field and value you want bind to it
-
- Click the “Unbinding” button on top of the Established ARK IDs Table
Workflow:
- Mint ARK ID(s)
- Download template.csv(https://yoursite/admin/template.csv), place the above minted ARK IDs (if binding new ARKs) or an existing list of ARK IDs (if changing metadata bound to ARKs) into the ARK_ID column.
- There no limitation of data field(s) to be bound with an ARK ID.
For UTSC only, highly recommend to have the below essential
columns which are already included in the template CSVs above and
add more column(s) if needed for other metadata.
- ARK_ID: MANDATORY for binding.
- URL: MANDATORY will be redirected to after ARK ID’s URL Resolver.
- LOCAL_ID: Object’s unique ID in the repository.
- PID: persistent Identifiers
- COLLECTION (Optional): to assist on searching in the table.
- Check "Replace existing metadata for each Arks" box if the metadata being bound is meant to wholecloth replace any field that are already bound to the ARK IDs.
- Upload the CSV to start the process.
Structure: https://yoursite/admin/rest.php?db=DB_NAME&op=OP_NAME (optional: &ark_ID={{Ark ID}})
Example:
- GET all minted ARK IDs: https://yoursite/admin/rest.php?db=dsu_ark&op=minted
- GET all fields bound to an ARK ID https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc1&op=fields
- GET Prefix of a collection: https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc1&op=firstpart
- GET all bound ARK objects: https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc1&op=bound
- GET PID of an ARK object: https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc1&op=pid
- GET MODS Url: https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc10&op=url
- GET NAA of a collection: https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc10&op=naa
- GET basic info of a collection: https://yoursite/admin/rest.php?db=dsu_ark&ark_id=61220/utsc10&op=dbinfo
- POST for Bulk Bind:
$.post("https://yoursite/admin/rest.php?db=DB_NAME&op=bulkbind&stage=upload", {data: pdata, security: password})
.done(function (data) {
var result = JSON.parse(data);
if (result.success == 401) {
// add a UI handle when REST return unauthorized (code:401), it happens when System Admin's password above are not matched
}
else {
// add a UI handle when REST return success (code: 1)
}
})
.fail(function () {
// add a UI handle when POST request failed
});
Workflow:
- Step 1. Catch coming traffic and detect ARK URL. In .htaccess at the root directory, obtain ARK ID information and redirect to resolver.php:
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} ^/ark:/.*$
RewriteRule ^(.*)$ /resolver.php?q=$1 [L]
- Step 2. Captured ARK ID from URL. ie. https://yoursite/ark:/61220/utsc6 (which is 61220/utsc6)
- Step 3, Get prefix (‘utsc’ from example above), from this prefix, identify which database to lookup the object bound to this ARK ID (This is why the prefix need to be unique)
- Step 4. Look for field URL first, if URL is valid, redirect to that URL
- Step 5. If field URL is not available, use PID instead, establishing the URL by combine https + NAA + PID (coded exclusively for UTSC-DSU usage)
Code can be found at resolver.php: (https://github.com/digitalutsc/ark-services/blob/master/resolver.php)
Each time of mining, (bulk) binding ARK ID (s), the system will automatically take a snapshot of the database and store it under the directory /var/www/ark-services/db/backup which can be preset or changed to the $path_db_backup in MyslqArkConf.php file:
<?php
class MysqlArkConf{
static public $mysql_host = '';
static public $mysql_user = '';
static public $mysql_passwd = '';
static public $mysql_dbname = '';
static public $mysql_port = 3306;
static public $path_db_backup = "/var/www/ark-services/db/backup";
}