Skip to content

Instantly share code, notes, and snippets.

View msporny's full-sized avatar

Manu Sporny msporny

View GitHub Profile
@msporny
msporny / gist:6308591
Created August 22, 2013 15:20
Fixed publisher name issue with markup.
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>Basic Koha bib record</title>
</head>
<body>
<div class="record" vocab="http://schema.org/" typeof="CreativeWork Product" resource="#record">
<h1 class="title" property="name">Songs of the 60's : piano, vocal, guitar. </h1>
<div class="results_summary series">
@msporny
msporny / gist:6308659
Created August 22, 2013 15:24
Corrected publisher using only RDFa Lite
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>Basic Koha bib record</title>
</head>
<body>
<div class="record" vocab="http://schema.org/" typeof="CreativeWork Product" resource="#record">
<h1 class="title" property="name">Songs of the 60's : piano, vocal, guitar. </h1>
<div class="results_summary series">
{
"@context":"http://api.lobid.org/context/lobid-organisations.json",
"@id":"http://lobid.org/organisation/DE-605",
"@type":"http://xmlns.com/foaf/0.1/Organization",
"contactqr":"http://lobid.org/media/DE-605_contactqr.png",
"fundertype":{
"@id":"http://purl.org/lobid/fundertype#n02",
"@type":"http://www.w3.org/2004/02/skos/core#Concept",
"prefLabel":{
"de":"Land",
@msporny
msporny / gist:9063806
Created February 18, 2014 02:50
Example of Actions for Linked Data objects
{
id: 'https://example.com/i/manu',
name: 'Manu Sporny'
assertions: [ ... ]
actions: {
patch: {
url: 'https://example.com/i/manu?action=patch',
verb: 'POST',
format: 'json-patch'
},
@msporny
msporny / gist:d0e1709ebaa229bd9573
Created November 3, 2014 14:18
Example of http-problem in JSON-LD
{
"@context": ["https://ietf.org/contexts/http-problem/v1", "https://example.com/contexts/my-extension/v1"],
"type": ["HttpProblem", "OutOfCredit"],
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50.",
"instance": "http://example.net/account/12345/msgs/abc",
"balance": 30,
"accounts": ["http://example.net/account/12345", "http://example.net/account/67890"]
}
@msporny
msporny / shell.sh
Created November 26, 2015 01:20
Script to install nodejs 0.10.40
curl -sL https://deb.nodesource.com/setup_0.10 | bash -
apt-get install -y nodejs=0.10.40-*
@msporny
msporny / ldsig-vs-jwt.md
Last active April 26, 2016 20:07
Example of similar JSON data being signed using Linked Data Signatures and JSON Web Tokens

Assume that we want to sign this bit of JSON-LD:

{
  "@context": "https://w3id.org/identity/v1",
  "title": "Hello World!"
}

This is what the Linked Data Signature looks like:

@msporny
msporny / credential-transmission.jsonld
Last active May 4, 2016 02:58
Example of credential transmission with proof of posession
{
"@context":"https://w3id.org/identity/v1",
"id":"did:90096afc-c232-4b96-b48c-dcdba19b7ead",
"type":"Identity",
"credential":[
{
"@graph":{
"@context":"https://w3id.org/identity/v1",
"id":"https://travel.state.gov/credentials/6fc0f6d2c68a",
"type":[
@msporny
msporny / w3c-ccg-spec-template.html
Created May 23, 2018 19:03
A ReSpec Template for W3C CCG Specifications
<!DOCTYPE html>
<html>
<head>
<title>A Template for W3C Credentials Community Group Specifications</title>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<!--
=== NOTA BENE ===
For the three scripts below, if your spec resides on dev.w3 you can check them
out in the same tree and use relative links so that they'll work offline,
-->
PROPOSAL: Existing documentation in the DID Core specification should be refined to point out that Verification Relationships are arcs in a graph of information and Verification Methods are nodes in a graph of information. That is, they provide different types of information. The first (Verification Relationship) is the expression of a relationship between a DID Subject and cryptographic information used for the purposes of verifying a proof. The second (Verification Method) is the expression of cryptographic material. An image should be provided depicting the explanation.
PROPOSAL: Mark all verification methods with a warning stating that there is an ongoing discussion around the naming of verification methods that may impact the final names used in the specification.
PROPOSAL: The DID WG urges the W3C CCG to write documentation in the Linked Data Security specifications that clarifies how public / private key terminology has been used in the past, why it is vague and leads to security issues (like key reu