View downloads.nim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import db_postgres, os, httpclient, threadpool | |
const BASE = "https://s3.amazonaws.com/unbounded-uploads/attachments/" | |
proc download_and_save(row: Row) = | |
let url = BASE & row[0] & "/" & row[1] | |
let dirname = "tmp/attachments/" & row[0] | |
let filename = dirname & "/" & row[1] | |
createDir(dirname) | |
newHttpClient().downloadFile(url, filename) |
View credential_sample.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { | |
"schema": "http://schema.org/", | |
"dc": "http://purl.org/dc/elements/1.1/", | |
"dct": "http://dublincore.org/terms/", | |
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", | |
"rdfs": "http://www.w3.org/2000/01/rdf-schema#", | |
"ctdl": "[CTI Namespace Not Determined Yet]" | |
}, | |
"@type": "cti:Credential", |
View credential-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"allOf": [ | |
{ | |
"$ref": "http://localhost:9292/api/schemas/json_ld" | |
}, | |
{ | |
"$ref": "#/definitions/schemaorg_creative_work" | |
}, | |
{ |
View cred_sample_jsonld.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { | |
"cti": "http://purl.org/cti/terms/", | |
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", | |
"rdfs": "http://www.w3.org/2000/01/rdf-schema#", | |
"schema": "http://schema.org/", | |
"xsd": "http://www.w3.org/2001/XMLSchema#" | |
}, | |
"@graph": [ | |
{ |
View credential-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"description": "CredentialRegistry Credential metadata", | |
"type": "object", | |
"definitions": { | |
"cti": { | |
"properties": { | |
"@type": { | |
"enum": [ | |
"cti:Credential" |