Skip to content

Instantly share code, notes, and snippets.

Avatar

Anderson Pierre Cardoso andersoncardoso

  • Porto - Portugal
View GitHub Profile
@andersoncardoso
andersoncardoso / credential-schema.json
Created Jun 28, 2016
schema-json example for credentials
View credential-schema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "CredentialRegistry Credential metadata",
"type": "object",
"definitions": {
"cti": {
"properties": {
"@type": {
"enum": [
"cti:Credential"
@andersoncardoso
andersoncardoso / cred_sample_jsonld.json
Created Jul 19, 2016
sample of a credential jsonld parsed from rdf
View cred_sample_jsonld.json
{
"@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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"allOf": [
{
"$ref": "http://localhost:9292/api/schemas/json_ld"
},
{
"$ref": "#/definitions/schemaorg_creative_work"
},
{
View credential_sample.json
{
"@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",
@andersoncardoso
andersoncardoso / downloads.nim
Created Sep 30, 2018
donwload eny files from ub v1
View downloads.nim
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)