Skip to content

Commit

Permalink
Merge pull request #150 from w3c/2023-11-10-refactor
Browse files Browse the repository at this point in the history
Refactored examples to use inclusion
  • Loading branch information
jandrieu authored Nov 10, 2023
2 parents 1cf8049 + 384ff61 commit 0f7b6f4
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 146 deletions.
147 changes: 147 additions & 0 deletions focal/3_international_travel_with_minor_and_upgrade_examples.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<section>
<h3>Focal Use Case: International Travel with Minor and Upgrade</h3>

<pre class="example nohighlight" title="Malathi's passport (simple model)">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:9f6878c8-73c7-11e8-ab37-23a1a3504fd0",
"type": ["VerifiableCredential", "PassportCredential"],
/* gov't DID */
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2028-01-01T00:00:00Z",
"claim": {
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"givenName": "Malathi",
"familyName": "Hamal",
"citizenship": "US",
/* any other claims made by gov't */
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight" title="Malathi's passport (passport is a document model) ">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:9f6878c8-73c7-11e8-ab37-23a1a3504fd0",
"type": ["VerifiableCredential", "PassportCredential"],
/* gov't DID */
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2028-01-01T00:00:00Z",
"claim": {
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"passport": {
"id": "urn:uuid:79c181dc-73c7-11e8-8c1f-2bb1fd2d268a",
"type": "Passport",
"traveler": {
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"givenName": "Malathi",
"familyName": "Hamal",
"citizenship": "US"
},
/* any other passport fields */
}
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight" title="Anand's passport">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:b306614c-73c7-11e8-b596-47e8c5ce9144",
"type": ["VerifiableCredential", "PassportCredential"],
/* gov't DID */
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2020-01-01T00:00:00Z",
"claim": {
"id": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"givenName": "Anand",
"familyName": "Hamal"
"citizenship": "US",
/* any other claims made by gov't */
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight" title="Anand's birth certificate">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:05a47fe2-73c8-11e8-ac1e-7fe0051a1d75",
"type": ["VerifiableCredential", "BirthCertificate"],
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2020-01-01T00:00:00Z",
"claim": {
"id": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"citizenship": "US",
"birthDate": "2017-10-01T00:00:00Z",
"birthPlace": {
"type": "Hospital",
"address": {
"type": "US address",
"addressLocality": "Denver",
"addressRegion": "CO",
"postalCode": "80209",
"streetAddress": "123 Main St."
}
},
"givenName": "Anand",
"familyName": "Hamal",
"parent": [{
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"type": "Person",
"givenName": "Malathi",
"familyName": "Hamal",
"maidenName": "Holla"
}, {
"id": "did:example:BgXRjB4RPrrsUVoVNaYNwzfznKsWep7AWrZkiyVcorEN",
"type": "Person",
"givenName": "Rajesh",
"familyName": "Hamal"
}]
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight"
title="Permission to travel from Rajesh using schema.org vocab" >
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:58c08196-73c6-11e8-b030-3bd8a829a356",
"type": ["VerifiableCredential", "ChildTravelPass"],
"issuer": "did:example:BgXRjB4RPrrsUVoVNaYNwzfznKsWep7AWrZkiyVcorEN",
"expires": "2018-07-01T00:00:00Z",
"claim": {
"id": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"potentialAction": {
"type": "TravelAction",
"agent": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"participant": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"location": {
"type": "Country",
"address": {
"addressCountry": "CA"
}
}
}
},
"proof": {/* signature by Rajesh proving control of DID */}
}
</pre>
148 changes: 2 additions & 146 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -769,152 +769,8 @@ <h2>Terminology</h2>
</section>
<section class="appendix">
<h2>Example Verifiable Credentials</h2>
<h3>Focal Use Case: International Travel with Minor</h3>

<pre class="example nohighlight" title="Malathi's passport (simple model)">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:9f6878c8-73c7-11e8-ab37-23a1a3504fd0",
"type": ["VerifiableCredential", "PassportCredential"],
/* gov't DID */
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2028-01-01T00:00:00Z",
"claim": {
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"givenName": "Malathi",
"familyName": "Hamal",
"citizenship": "US",
/* any other claims made by gov't */
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight" title="Malathi's passport (passport is a document model) ">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:9f6878c8-73c7-11e8-ab37-23a1a3504fd0",
"type": ["VerifiableCredential", "PassportCredential"],
/* gov't DID */
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2028-01-01T00:00:00Z",
"claim": {
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"passport": {
"id": "urn:uuid:79c181dc-73c7-11e8-8c1f-2bb1fd2d268a",
"type": "Passport",
"traveler": {
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"givenName": "Malathi",
"familyName": "Hamal",
"citizenship": "US"
},
/* any other passport fields */
}
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight" title="Anand's passport">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:b306614c-73c7-11e8-b596-47e8c5ce9144",
"type": ["VerifiableCredential", "PassportCredential"],
/* gov't DID */
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2020-01-01T00:00:00Z",
"claim": {
"id": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"givenName": "Anand",
"familyName": "Hamal"
"citizenship": "US",
/* any other claims made by gov't */
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight" title="Anand's birth certificate">
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:05a47fe2-73c8-11e8-ac1e-7fe0051a1d75",
"type": ["VerifiableCredential", "BirthCertificate"],
"issuer": "did:example:CCnF3zFaXkPN4zB94XaomRdvw2zX3XHPVX3aExcgo6PV",
"expires": "2020-01-01T00:00:00Z",
"claim": {
"id": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"citizenship": "US",
"birthDate": "2017-10-01T00:00:00Z",
"birthPlace": {
"type": "Hospital",
"address": {
"type": "US address",
"addressLocality": "Denver",
"addressRegion": "CO",
"postalCode": "80209",
"streetAddress": "123 Main St."
}
},
"givenName": "Anand",
"familyName": "Hamal",
"parent": [{
"id": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"type": "Person",
"givenName": "Malathi",
"familyName": "Hamal",
"maidenName": "Holla"
}, {
"id": "did:example:BgXRjB4RPrrsUVoVNaYNwzfznKsWep7AWrZkiyVcorEN",
"type": "Person",
"givenName": "Rajesh",
"familyName": "Hamal"
}]
},
"proof": {/* signature by gov't */}
}
</pre>

<pre class="example nohighlight"
title="Permission to travel from Rajesh using schema.org vocab" >
{
"@context": [
"https://w3id.org/credentials/v1",
"https://example.com/travel-vocab/v1"
],
"id": "urn:uuid:58c08196-73c6-11e8-b030-3bd8a829a356",
"type": ["VerifiableCredential", "ChildTravelPass"],
"issuer": "did:example:BgXRjB4RPrrsUVoVNaYNwzfznKsWep7AWrZkiyVcorEN",
"expires": "2018-07-01T00:00:00Z",
"claim": {
"id": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"potentialAction": {
"type": "TravelAction",
"agent": "did:example:8vFBbPrhBUyG6DEzVncBZpzBNsmRrbfsQKXQKPLskBCu",
"participant": "did:example:BcRisGnqV4QPb6bRmDCqEjyuubBarS1Y1nhDwxBMTXY4",
"location": {
"type": "Country",
"address": {
"addressCountry": "CA"
}
}
}
},
"proof": {/* signature by Rajesh proving control of DID */}
}
</pre>
<div data-include="focal/3_international_travel_with_minor_and_upgrade_examples.html"
data-include-replace="true" data-format="html"></div>
</section>

<section class="informative">
Expand Down

0 comments on commit 0f7b6f4

Please sign in to comment.