Skip to content

Instantly share code, notes, and snippets.

View elf-pavlik's full-sized avatar

elf Pavlik elf-pavlik

View GitHub Profile
@elf-pavlik
elf-pavlik / cfapi-jsonld-macro.json
Last active November 16, 2015 02:51
experimental CFAPI JSON-LD Macro (Code for All)
{
"http://codeforamerica.org/api/projects/*": {
"$": {
"@context": { "@vocab": "http://schema.org/" },
"@type": "Code",
"@id": {"f:valueof": "api_url"},
"@transform": {
"url": { "f:valueof": "code_url" },
"forksCount": [
{ "f:valueof": "github_details" },
@prefix : <http://ns.whocontrolsit.com/#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://ns.whocontrolsit.com> a owl:Ontology;
rdfs:comment "A vocabulary for representing beneficial ownership"@en .
:Entity a owl:Class;
{
"@context": {
"@vocab": "http://schema.org/",
"mm": "http://ns.metamaps.cc/#",
"mmc": "http://metamaps.cc/metacodes/",
"permission": { "@type": "@id", "@id": "mm:permission"},
"featured": "mm:featured",
"arranged": "mm:arranged"
},
"@id": "http://metamaps.cc/maps/1207",
{
"@context": {
"@vocab": "http://schema.org/",
"mm": "http://ns.metamaps.cc/#",
"mmc": "http://metamaps.cc/metacodes/",
"permission": {
"@type": "@id",
"@id": "mm:permission"
},
"featured": "mm:featured",
{
"@context": {
"@vocab": "http://schema.org/",
"cco": "http://purl.org/ontology/cco/core#",
"id":"@id",
"type": "@type",
"interest": "cco:interest"
}
}
@elf-pavlik
elf-pavlik / sameAs+me.html
Last active August 29, 2015 14:16
using rel="me" with rel="sameAs"
<div vocab="http://schema.org/">
<div about="https://wwelves.org/perpetual-tripper" typeof="Person">
<span property="name">elf Pavlik</span>
<ul>
<li>
<a rel="me" property="sameAs" href="https://twitter.com/elfpavlik">Twitter</a>.
</li>
</ul>
</div>
</div>
{
"@context": "https://w3id.org/credentials/v1",
"id": "https://example.com/identities/bob",
"type": ["Identity", "Person"],
"name": "Bob Bobman",
"birthdate": "1985-12-14",
"email": "[email protected]",
"emailSha512": "ph9dC0z3uy3pfHe2QADhuoFc6Zm9N0wIDmwH0lSs06ZXdsgvueIWK3ZXyZXawxGtkfayU+tFVZDc42J1+w+3FQ==",
"achievement": ["https://bigunivertsity.edu/degrees/BA"],
"credential": [{
{
"@id": "https://graph.wwelves.org/6cc66661-9e7a-4ffa-b24d-7443d5bb1716",
"@type": ["verb:Read", "as:IntendedActivity"],
"rdfs:comment": "read about XMLNS",
"as:actor": {
"@id": "https://wwelves.org/perpetual-tripper",
"@type": ["Elf", "foaf:Person"],
"name": "elf Pavlik",
"foaf:account": "mailto:[email protected]"
},
{
"@context": "https://w3id.org/kosmos/v1",
"@graph": [
{
"@id": "irc://irc.freenode.net/#kosmos",
"@type": "ChatChannel",
"name": "Kosmos dev chat",
"title": "code now Open Source!",
"parent_of": [
"https://kosmos.org/irc/freenode/kosmos/2015/06/01",
var Promise = require('promise');
var concat = require('concat-stream');
module.exports = function(fdb) {
this.read = function(key){
return new Promise(function(resolve, reject){
var headsCS = concat(function(hashes) {
var readCS = concat(function(buffer){
resolve(JSON.parse(buffer.toString()));