Commit 43a2297c authored by PTSEFTON's avatar PTSEFTON
Browse files

Updated README, a few updates to sample data set

parent d8d65e99
...@@ -14,23 +14,34 @@ via automatically generated spreadsheets and for creating static HTML repositori ...@@ -14,23 +14,34 @@ via automatically generated spreadsheets and for creating static HTML repositori
Calcyte targets the [Draft DataCrate Packaging format v0.2](https://github.com/UTS-eResearch/datacrate/blob/new_draft/0.2/spec/0.2/data_crate_specification_v0.2.md). Calcyte targets the [Draft DataCrate Packaging format v0.2](https://github.com/UTS-eResearch/datacrate/blob/new_draft/0.2/spec/0.2/data_crate_specification_v0.2.md).
At this stage Calcyte does not Bag content, it jsut creates *Working DataCrates*. At this stage Calcyte does not Bag content, it jsut creates *Working DataCrates*.
## Installation ## Installation (untested)
(TODO)
- Install [node.js](https://nodejs.org/en/)
- Install Siegfreid using the [instructions](https://github.com/richardlehane/siegfried/wiki/Getting-started). - Install Siegfreid using the [instructions](https://github.com/richardlehane/siegfried/wiki/Getting-started).
- Get the code:
git clone https://code.research.uts.edu.au/eresearch/CalcyteJS.git
- Install the node pacakge:
npm install -g
## Usage / instructions ## Usage / instructions
To run calcyte on a group of directories pass it a list of directories This version Calcyte doesn't have any options or proper argument handling or help.
To run Calcyte on a group of directories pass it a list of directories
One:
``` ```
./calcyte test_data/sample calcyte test_data/sample
``` ```
More:
``` ```
./calcyte test_data/* calcyte test_data/*
``` ```
......
...@@ -97,8 +97,8 @@ module.exports = function(){ ...@@ -97,8 +97,8 @@ module.exports = function(){
var index_maker = new Index(); var index_maker = new Index();
index_maker.make_index_html(this.json_ld); index_maker.make_index_html(this.json_ld);
citer = new Datacite(); citer = new Datacite();
text_citation = citer.make_citation("./" + path.join(this.dir, "CATALOG.json"), path.join(this.dir, "index.html")); text_citation = citer.make_citation(this.json_ld, path.join(this.dir, "index.html"));
index_maker.write_html("defaults/catalog_template.html", path.join(this.dir, "index.html"), text_citation); index_maker.write_html(path.join(__dirname, "defaults/catalog_template.html"), path.join(this.dir, "index.html"), text_citation);
}, },
to_json : function to_json(graph) { to_json : function to_json(graph) {
......
...@@ -5,7 +5,7 @@ module.exports = function(){ ...@@ -5,7 +5,7 @@ module.exports = function(){
return( return(
{ {
make_citation : function make_citation(json_path, out_path) { make_citation : function make_citation(crate_data, out_path) {
/* Return a datacite citation in XML format """ /* Return a datacite citation in XML format """
# Check we have the metadata we need as per DataCrate spec # Check we have the metadata we need as per DataCrate spec
...@@ -20,7 +20,9 @@ module.exports = function(){ ...@@ -20,7 +20,9 @@ module.exports = function(){
""" """
*/ */
//console.log(Object.keys(this.json_by_url)); //console.log(Object.keys(this.json_by_url));
var crate_data = require(json_path); if (!crate_data['@graph']) {
crate_data = require(crate_data);
}
this.json_by_id = {}; this.json_by_id = {};
this.json_by_url = {}; this.json_by_url = {};
this.json_by_type = {}; this.json_by_type = {};
......
...@@ -66,28 +66,28 @@ ...@@ -66,28 +66,28 @@
}, },
"@graph": [ "@graph": [
{ {
"@id": "1c48a4cd-c67b-4b91-9612-17ee1dd86cb0", "@id": "07ad1e37-2eda-4f87-9007-d74f0be0af89",
"@type": "GeoCoordinates", "@type": "GeoCoordinates",
"latitude": "-35.623592", "latitude": "-35.623592",
"longitude": "148.683836" "longitude": "148.683836"
}, },
{ {
"@id": "28289002-71e1-45eb-b5fb-997ab5dccf63", "@id": "353df8b0-a2fc-4fd1-a19d-24c034f60186",
"@type": "Place",
"description": "Located in the Snowy Mountains Region of NSW, nearest town Tumut 2720",
"geo": {
"@id": "1c48a4cd-c67b-4b91-9612-17ee1dd86cb0"
},
"name": "Glop Pot"
},
{
"@id": "7e447e85-8177-4760-9093-6635a82f9887",
"@type": "Format", "@type": "Format",
"eXTENSION:": ".svx", "eXTENSION:": ".svx",
"description": "Survex is a multi-platform open-source cave surveying package.", "description": "Survex is a multi-platform open-source cave surveying package.",
"name": "Survex file", "name": "Survex file",
"mIME:": "text/plain" "mIME:": "text/plain"
}, },
{
"@id": "63ef54a9-e87b-4b9d-9a2f-0f89449f8686",
"@type": "Place",
"description": "Located in the Snowy Mountains Region of NSW, nearest town Tumut 2720",
"geo": {
"@id": "07ad1e37-2eda-4f87-9007-d74f0be0af89"
},
"name": "Glop Pot"
},
{ {
"@id": "Keir Vaughan-Taylor", "@id": "Keir Vaughan-Taylor",
"@type": "Person", "@type": "Person",
...@@ -132,21 +132,10 @@ ...@@ -132,21 +132,10 @@
}, },
{ {
"@id": "asf/CATALOG_asf.xlsx" "@id": "asf/CATALOG_asf.xlsx"
},
{
"@id": "asf/.DS_Store"
} }
], ],
"identifier": "asf" "identifier": "asf"
}, },
{
"@id": "asf/.DS_Store",
"@type": "File",
"contentSize": "6148",
"path": "asf/.DS_Store",
"encodingFormat": "DS_store file (MAC)",
"fileFormat": "http://www.nationalarchives.gov.uk/PRONOM/fmt/394"
},
{ {
"@id": "asf/CATALOG_asf.xlsx", "@id": "asf/CATALOG_asf.xlsx",
"@type": "File", "@type": "File",
...@@ -316,7 +305,7 @@ ...@@ -316,7 +305,7 @@
"@id": "http://orcid.org/0000-0003-4953-0830" "@id": "http://orcid.org/0000-0003-4953-0830"
}, },
"contentLocation": { "contentLocation": {
"@id": "28289002-71e1-45eb-b5fb-997ab5dccf63" "@id": "63ef54a9-e87b-4b9d-9a2f-0f89449f8686"
}, },
"path": "./", "path": "./",
"creator": { "creator": {
......
...@@ -71,7 +71,7 @@ A machine-readable version of this page is available: ...@@ -71,7 +71,7 @@ A machine-readable version of this page is available:
<tr> <tr>
<th>ContentLocation</th> <th>ContentLocation</th>
<td> <td>
<a href="#28289002-71e1-45eb-b5fb-997ab5dccf63">Glop Pot</a> <a href="#f9f92aa6-4076-4c13-9785-8bb3d1e9d422">Glop Pot</a>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -118,8 +118,8 @@ A machine-readable version of this page is available: ...@@ -118,8 +118,8 @@ A machine-readable version of this page is available:
<th>Name</th> <th>Name</th>
<th>MIME:</th> <th>MIME:</th>
</tr> </tr>
<tr id="7e447e85-8177-4760-9093-6635a82f9887"> <tr id="d6180d81-cf9a-4a04-9c08-9f2056ea4942">
<td>7e447e85-8177-4760-9093-6635a82f9887</td> <td>d6180d81-cf9a-4a04-9c08-9f2056ea4942</td>
<td>.svx</td> <td>.svx</td>
<td>Survex is a multi-platform open-source cave surveying package.</td> <td>Survex is a multi-platform open-source cave surveying package.</td>
<td>Survex file</td> <td>Survex file</td>
...@@ -133,8 +133,8 @@ A machine-readable version of this page is available: ...@@ -133,8 +133,8 @@ A machine-readable version of this page is available:
<th>Latitude</th> <th>Latitude</th>
<th>Longitude</th> <th>Longitude</th>
</tr> </tr>
<tr id="1c48a4cd-c67b-4b91-9612-17ee1dd86cb0"> <tr id="bf2d0b8a-989a-4895-ba6a-497bb6ca99cc">
<td>1c48a4cd-c67b-4b91-9612-17ee1dd86cb0</td> <td>bf2d0b8a-989a-4895-ba6a-497bb6ca99cc</td>
<td>-35.623592</td> <td>-35.623592</td>
<td>148.683836</td> <td>148.683836</td>
</tr> </tr>
...@@ -202,14 +202,14 @@ A machine-readable version of this page is available: ...@@ -202,14 +202,14 @@ A machine-readable version of this page is available:
<th>Geo</th> <th>Geo</th>
<th>Name</th> <th>Name</th>
</tr> </tr>
<tr id="28289002-71e1-45eb-b5fb-997ab5dccf63"> <tr id="f9f92aa6-4076-4c13-9785-8bb3d1e9d422">
<td>28289002-71e1-45eb-b5fb-997ab5dccf63</td> <td>f9f92aa6-4076-4c13-9785-8bb3d1e9d422</td>
<td>Located in the Snowy Mountains Region of NSW, nearest town Tumut 2720</td> <td>Located in the Snowy Mountains Region of NSW, nearest town Tumut 2720</td>
<td> <td>
<table id="1c48a4cd-c67b-4b91-9612-17ee1dd86cb0"> <table id="bf2d0b8a-989a-4895-ba6a-497bb6ca99cc">
<tr> <tr>
<th>@id</th> <th>@id</th>
<td>1c48a4cd-c67b-4b91-9612-17ee1dd86cb0</td> <td>bf2d0b8a-989a-4895-ba6a-497bb6ca99cc</td>
</tr> </tr>
<tr> <tr>
<th>@type</th> <th>@type</th>
......
<html>
<head>
<meta charset='utf-8'/>
<style>
table {
background-color: lightgray;
width: 90%;
text-align: left;
vertical-align: top;
margin-bottom: 2em;
}
body {
background-color: white;
}
h1 {
color: maroon;
}
div.collection {
margin-left: +1em;
}
</style>
<link rel="stylesheet" type="text/css" media="screen" href="CATALOG.css" />
</head>
<body><h1>Data Set</h1><ul><li><a href='#lots_of_little_files'>lots_of_little_files</a>
</li><li><a href='#pics'>pics</a>
</li>
</ul>
<div><h2 >Directory: .</h2>
<p><a href='.'>.</a></p><div>Collection metadata:
<div><div typeof='http://schema.org/Dataset' about='./.'><table><tr><th>Title</th><td><div property='http://schema.org/name'>Sample dataset for DataCrate v.01</div>
</td> </tr>
<tr><th>Description</th><td><div property='http://schema.org/description'>This is a simple dataset for demonstration purposes it contains just one image.</div>
</td> </tr>
<tr><th>DatePublished</th><td><div property='http://schema.org/datePublished'>2017-07-26 00:00:00</div>
</td> </tr>
<tr><th>Contact</th><td><div href='#Peter%20Sefton' property='http://schema.org/accountablePerson'><a href='#Peter%20Sefton'>Peter Sefton</a></div>
</td> </tr>
<tr><th>Creator</th><td><div href='#Peter%20Sefton' property='http://schema.org/creator'><a href='#Peter%20Sefton'>Peter Sefton</a></div>
</td> </tr>
<tr><th>ContentLocation</th><td><div href='http://www.geonames.org/8152662/catalina-park.html' property='http://schema.org/contentLocation'><a href='#http://www.geonames.org/8152662/catalina-park.html'>Catalina Park</a></div>
</td> </tr>
<tr><th>RelatedLink</th><td><div><a href='#http://dx.doi.org/10.1000/654321'>Sample dataset for DataCrate v.01</a></div></td> </tr>
<tr><th>ID</th><td><div property='http://schema.org/identifier'><a href='http://dx.doi.org/10.1000/654321'>http://dx.doi.org/10.1000/654321</a></div>
</td> </tr>
<tr><th>Publisher</th><td><div href='http://uts.edu.au' property='http://schema.org/publisher'><a href='#http://uts.edu.au'>University of Technology Sydney</a></div>
</td> </tr>
</table><h2>Files</h2><table>
<tr>
<th>Filename</th>
<th>Description</th>
<th>Creator</th>
<th>License</th>
</tr>
</table>
<h2>People</h2><table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Given Name</th>
<th>Family Name</th>
<th>Email</th>
<th>Phone</th>
<th>Affiliation</th>
<th>TYPE:</th>
</tr>
<tr href='#Peter%20Sefton' id='Peter%20Sefton' typeof='schema:CreativeWork http://schema.org/Person' property='schema:hasPart'><td><div property='http://schema.org/identifier'></div>
</td>
<td><div property='http://schema.org/name'>Peter Sefton</div>
</td>
<td><div>Peter</div></td>
<td><div>Sefton</div></td>
<td><div property='http://schema.org/email'>pt@ptsefton.com</div>
</td>
<td><div property='http://schema.org/telephone'></div>
</td>
<td><div href='http://uts.edu.au' property='http://schema.org/affiliation'><a href='#http://uts.edu.au'>University of Technology Sydney</a></div>
</td>
<td><div>Person</div></td>
</tr>
</table>
<h2>Equipment</h2><table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Description</th>
<th>URL</th>
<th>TYPE</th>
</tr>
<tr href='#EPL1' id='EPL1' typeof='schema:CreativeWork' property='schema:hasPart'><td><div property='http://schema.org/identifier'>EPL1</div>
</td>
<td><div property='http://schema.org/name'>EPL1 Camera</div>
</td>
<td><div property='http://schema.org/description'>Olympus camera with Panasonic 20mm lens</div>
</td>
<td><div><a href='https://en.wikipedia.org/wiki/Olympus_PEN_E-PL1'>https://en.wikipedia.org/wiki/Olympus_PEN_E-PL1</a></div></td>
<td><div>Equipment</div></td>
</tr>
</table>
<h2>Places</h2><table>
<tr>
<th>ID</th>
<th>URL</th>
<th>Name</th>
<th>Description</th>
<th>TYPE:</th>
<th>Address</th>
<th>geo&gt;GeoCoordinates</th>
</tr>
<tr href='http://www.geonames.org/8152662/catalina-park.html' id='http://www.geonames.org/8152662/catalina-park.html' typeof='schema:CreativeWork http://schema.org/Place' property='schema:hasPart'><td><div property='http://schema.org/identifier'><a href='http://www.geonames.org/8152662/catalina-park.html'>http://www.geonames.org/8152662/catalina-park.html</a></div>
</td>
<td><div><a href='https://en.wikipedia.org/wiki/Catalina_Park'>https://en.wikipedia.org/wiki/Catalina_Park</a></div></td>
<td><div property='http://schema.org/name'>Catalina Park</div>
</td>
<td><div property='http://schema.org/description'>Catalina Park is a disused motor racing venue, located at Katoomba, in the Blue Mountains, New South Wales, Australia, and is recognised as an Aboriginal Place due to the long association of the local Gundungarra and Darug clans to the area.</div>
</td>
<td><div>Place</div></td>
<td><div>Katoomba, NSQ</div></td>
<td><div property='http://schema.org/geo' typeof='http://schema.org/GeoCoordinates' ><div>Latitude: <span property='http://schema.org/latitude'>-33.7152</span></div><div>Longitude: <span property='http://schema.org/longitude'>150.30119</span></div></div>
</td>
</tr>
</table>
<h2>Organisations</h2><table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Description</th>
<th>Address</th>
<th>REL:Location</th>
<th>TYPE:</th>
</tr>
<tr href='http://uts.edu.au' id='http://uts.edu.au' typeof='schema:CreativeWork' property='schema:hasPart'><td><div property='http://schema.org/identifier'><a href='http://uts.edu.au'>http://uts.edu.au</a></div>
</td>
<td><div property='http://schema.org/name'>University of Technology Sydney</div>
</td>
<td><div property='http://schema.org/description'></div>
</td>
<td><div>Broadway, 2007, NSW Australia</div></td>
<td><div></div></td>
<td><div>Organisation</div></td>
</tr>
</table>
<h2>Licenses</h2><table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr href='https://creativecommons.org/licenses/by-nc-sa/3.0/au/' id='https://creativecommons.org/licenses/by-nc-sa/3.0/au/' typeof='schema:CreativeWork' property='schema:hasPart'><td><div property='http://schema.org/identifier'><a href='https://creativecommons.org/licenses/by-nc-sa/3.0/au/'>https://creativecommons.org/licenses/by-nc-sa/3.0/au/</a></div>
</td>
<td><div property='http://schema.org/name'>CC BY-NC-SA 3.0 AU</div>
</td>
<td><div property='http://schema.org/description'>Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0 AU)
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
Non-Commercial — You may not use the material for commercial purposes.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.</div>
</td>
</tr>
</table>
<h2>Publications</h2><table>
<tr>
<th>ID</th>
<th>Title</th>
<th>DC:CREATOR</th>
<th>TYPE:</th>
</tr>
<tr href='#10.1000/123456' id='10.1000/123456' typeof='schema:CreativeWork' property='schema:hasPart'><td><div property='http://schema.org/identifier'>10.1000/123456</div>
</td>
<td><div property='http://schema.org/name'>This is an example publication with a dodgy DOI</div>
</td>
<td><div>Peter Sefton</div></td>
<td><div>ScholarlyWork</div></td>
</tr>
</table>
</div></div></div></div>
<div><h2 >Directory: lots_of_little_files</h2>
<p><a href='lots_of_little_files'>lots_of_little_files</a></p><div>Collection metadata:
<div><div typeof='http://schema.org/CreativeWork' about='./lots_of_little_files'><table><span rev='schema:hasPart' href='./.'></span><tr><th>Title</th><td><div property='http://schema.org/name'>Too many files</div>
</td> </tr>
<tr><th>Description</th><td><div property='http://schema.org/description'>This directory contains many small files, that we’re not going to describe in detail.</div>
</td> </tr>
</table></div></div></div></div>
<div><h2 >Directory: pics</h2>
<p><a href='pics'>pics</a></p><div>Collection metadata:
<div><div typeof='http://schema.org/CreativeWork' about='./pics'><table><span rev='schema:hasPart' href='./.'></span><tr><th>Title</th><td><div property='http://schema.org/name'>Pictures</div>
</td> </tr>
<tr><th>Description</th><td><div property='http://schema.org/description'>This directory contains the images for the research project</div>
</td> </tr>
<tr><th>ContactPoint</th><td><div></div></td> </tr>
</table><h2>Files</h2><table>
<tr>
<th>Filename</th>
<th>Description</th>
<th>Creator</th>
<th>License</th>
<th>Relation:Contributor</th>
</tr>
<tr href='./pics/19093074_10155469333581584_5707039334816454031_o.jpg' id='pics/19093074_10155469333581584_5707039334816454031_o.jpg' typeof='schema:CreativeWork schema:MediaObject' property='schema:hasPart'><td> <a href='pics/19093074_10155469333581584_5707039334816454031_o.jpg'>19093074_10155469333581584_5707039334816454031_o.jpg</a>
<details><table><tr>
<th>File format</th>
<td property='http://schema.org/encodingFormat'>JPEG File Interchange Format</td>
</tr>
<tr>
<th>Format version</th>
<td property='http://schema.org/encodingFormat'><a href='http://www.nationalarchives.gov.uk/PRONOM/fmt/44'>JFIF 1.02</a><span property='http://schema.org/fileFormat' href='http://www.nationalarchives.gov.uk/PRONOM/fmt/44' /></td>
</tr>
<tr>
<th>Mime</th>
<td property='http://schema.org/fileFormat'>image/jpeg</td>
</tr>
<tr>
<th>Size</th>
<td property='http://schema.org/contentSize'>132765</td>
</tr>
</table></details>
</td>
<td><div property='http://schema.org/description'>This is a photo of a dog, and a fence.</div>
</td>
<td><div href='#Peter%20Sefton' property='http://schema.org/creator'><a href='#Peter%20Sefton'>Peter Sefton</a></div>
</td>
<td><div href='https://creativecommons.org/licenses/by-nc-sa/3.0/au/' property='http://schema.org/license'><a href='#https://creativecommons.org/licenses/by-nc-sa/3.0/au/'>CC BY-NC-SA 3.0 AU</a></div>
</td>
<td><div>EPL1</div></td>
</tr>
</table>
</div></div></div></div>
<p>This file was made with
<span href='./CATALOG.html' typeof='CreativeWork'>
<span href='./' rev='http://schema.org/description' />
<span href='https://codeine.research.uts.edu.au/eresearch/calcyte' property='http://schema.org/creator' typeof="SoftwareApplication">
Calcyte on 2017.07.26 at 07:35:17 P.
</span>
</span>
</p>
</body>
</html>
...@@ -66,29 +66,39 @@ ...@@ -66,29 +66,39 @@
}, },
"@graph": [ "@graph": [
{ {
"@id": "4b5bdd52-0c3f-4a65-a79e-f9a739e8d415", "@id": "EPL1",
"@type": "Equipment",
"description": "Olympus camera with Panasonic 20mm lens",
"identifier": "EPL1",
"name": "EPL1 Camera"
},
{
"@id": "e36c39ef-cc40-4489-a2a6-3aff855a2434",
"@type": "GeoCoordinates", "@type": "GeoCoordinates",
"latitude": "-33.7152", "latitude": "-33.7152",
"longitude": "150.30119" "longitude": "150.30119"
}, },
{ {
"@id": "EPL1", "@id": "http://ands.org.au",
"description": "Olympus camera with Panasonic 20mm lens", "@type": "Organization",
"identifier": "EPL1", "description": "The core purpose iof the Australian National Data Service (ANDS) is to make Australia’s research data assets more valuable for researchers, research institutions and the nation.",
"name": "EPL1 Camera" "identifier": "http://ands.org.au",
"name": "Australian National Data Service"
}, },
{ {
"@id": "http://dx.doi.org/10.1000/123456", "@id": "http://dx.doi.org/10.1000/123456",
"@type": "ScholarlyWork", "@type": "ScholarlyArticle",
"dC:CREATOR": "Peter Sefton", "creator": {
"identifier": "http://dx.doi.org/10.1000/123456" "@id": "http://orcid.org/0000-0002-3545-944X"
},
"datePublished": "2018",
"identifier": "http://dx.doi.org/10.1000/123456",
"name": "This is an example publication with a dodgy DOI"
}, },
{ {
"@id": "http://dx.doi.org/10.5281/zenodo.1009240", "@id": "http://dx.doi.org/10.5281/zenodo.1009240",
"@type": "Dataset", "@type": "Dataset",
"outputOf": { "outputOf": "DataCrate",
"@id": "https://github.com/UTS-eResearch/datacrate"
},
"contact": { "contact": {
"@id": "http://orcid.org/0000-0002-3545-944X" "@id": "http://orcid.org/0000-0002-3545-944X"
}, },
...@@ -117,6 +127,21 @@ ...@@ -117,6 +127,21 @@
}, },
"temporalCoverage": "2017" "temporalCoverage": "2017"
}, },