Skip to content

Commit

Permalink
[Android][iOS] Update VC Playground context files (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliano1612 authored Nov 19, 2024
1 parent 3631f95 commit 16ea625
Show file tree
Hide file tree
Showing 14 changed files with 323 additions and 39 deletions.
4 changes: 2 additions & 2 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId = "com.spruceid.mobilesdkexample"
minSdk = 26
targetSdk = 34
versionCode = 14
versionName = "1.1.0"
versionCode = 15
versionName = "1.1.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,6 @@ fun HandleOID4VCIView(
fun getVCPlaygroundOID4VCIContext(ctx: Context): Map<String, String> {
val context = mutableMapOf<String, String>()

context["https://contexts.vcplayground.org/examples/alumni/v1.json"] =
ctx.resources
.openRawResource(R.raw.contexts_vcplayground_org_examples_alumni_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://w3id.org/first-responder/v1"] =
ctx.resources
.openRawResource(R.raw.w3id_org_first_responder_v1)
Expand All @@ -188,60 +181,107 @@ fun getVCPlaygroundOID4VCIContext(ctx: Context): Map<String, String> {
.readLines()
.joinToString("")

context["https://contexts.vcplayground.org/examples/movie-ticket/v1.json"] =
context["https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json"] =
ctx.resources
.openRawResource(R.raw.contexts_vcplayground_org_examples_movie_ticket_v1)
.openRawResource(R.raw.purl_imsglobal_org_spec_ob_v3p0_context_3_0_2)
.bufferedReader()
.readLines()
.joinToString("")

context["https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json"] =
context["https://w3id.org/citizenship/v4rc1"] =
ctx.resources
.openRawResource(R.raw.purl_imsglobal_org_spec_ob_v3p0_context_3_0_2)
.openRawResource(R.raw.w3id_org_citizenship_v4rc1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://contexts.vcplayground.org/examples/food-safety-certification/v1.json"] =
context["https://w3id.org/vc/render-method/v2rc1"] =
ctx.resources
.openRawResource(
R.raw.contexts_vcplayground_org_examples_food_safety_certification_v1
)
.openRawResource(R.raw.w3id_org_vc_render_method_v2rc1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://contexts.vcplayground.org/examples/gs1-8110-coupon/v2.json"] =
context["https://examples.vcplayground.org/contexts/alumni/v2.json"] =
ctx.resources
.openRawResource(R.raw.contexts_vcplayground_org_examples_gs1_8110_coupon_v2)
.openRawResource(R.raw.examples_vcplayground_org_contexts_alumni_v2)
.bufferedReader()
.readLines()
.joinToString("")

context["https://contexts.vcplayground.org/examples/customer-loyalty/v1.json"] =
context["https://examples.vcplayground.org/contexts/first-responder/v1.json"] =
ctx.resources
.openRawResource(R.raw.contexts_vcplayground_org_examples_customer_loyalty_v1)
.openRawResource(R.raw.examples_vcplayground_org_contexts_first_responder_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://w3id.org/citizenship/v4rc1"] =
context["https://examples.vcplayground.org/contexts/shim-render-method-term/v1.json"] =
ctx.resources
.openRawResource(R.raw.w3id_org_citizenship_v4rc1)
.openRawResource(R.raw.examples_vcplayground_org_contexts_shim_render_method_term_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://w3id.org/vc/render-method/v2rc1"] =
context["https://examples.vcplayground.org/contexts/shim-VCv1.1-common-example-terms/v1.json"] =
ctx.resources
.openRawResource(R.raw.w3id_org_vc_render_method_v2rc1)
.openRawResource(R.raw.examples_vcplayground_org_contexts_shim_vcv1_1_common_example_terms_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://examples.vcplayground.org/contexts/utopia-natcert/v1.json"] =
ctx.resources
.openRawResource(R.raw.examples_vcplayground_org_contexts_utopia_natcert_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://www.w3.org/ns/controller/v1"] =
ctx.resources
.openRawResource(R.raw.w3_org_ns_controller_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://examples.vcplayground.org/contexts/movie-ticket/v2.json"] =
ctx.resources
.openRawResource(R.raw.examples_vcplayground_org_contexts_movie_ticket_v2)
.bufferedReader()
.readLines()
.joinToString("")

context["https://examples.vcplayground.org/contexts/food-safety-certification/v1.json"] =
ctx.resources
.openRawResource(R.raw.examples_vcplayground_org_contexts_food_safety_certification_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://examples.vcplayground.org/contexts/academic-course-credential/v1.json"] =
ctx.resources
.openRawResource(R.raw.examples_vcplayground_org_contexts_academic_course_credential_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://examples.vcplayground.org/contexts/gs1-8110-coupon/v2.json"] =
ctx.resources
.openRawResource(R.raw.examples_vcplayground_org_contexts_gs1_8110_coupon_v2)
.bufferedReader()
.readLines()
.joinToString("")

context["https://examples.vcplayground.org/contexts/customer-loyalty/v1.json"] =
ctx.resources
.openRawResource(R.raw.examples_vcplayground_org_contexts_customer_loyalty_v1)
.bufferedReader()
.readLines()
.joinToString("")

context["https://contexts.vcplayground.org/examples/movie-ticket-vcdm-v2/v1.json"] =
context["https://examples.vcplayground.org/contexts/movie-ticket-vcdm-v2/v1.json"] =
ctx.resources
.openRawResource(R.raw.contexts_vcplayground_org_examples_movie_ticket_vcdm_v2_v1)
.openRawResource(R.raw.examples_vcplayground_org_contexts_movie_ticket_vcdm_v2_v1)
.bufferedReader()
.readLines()
.joinToString("")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"@context": {
"@protected": true,
"courseCareer": "https://tln.asu.edu/terms/courseCareer"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"@protected": true,
"alumniOf": "https://schema.org/alumniOf",
"name": "https://schema.org/name",
"description": "https://schema.org/description",
"identifier": "https://schema.org/identifier",
"image": {
"@id": "https://schema.org/image",
"@type": "@id"
},
"AlumniCredential": "https://examples.vcplayground.org/contexts/alumni/vocab#AlumniCredential"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"@context": {
"@version": 1.1,
"@protected": true,
"name": "https://schema.org/name",
"description": "https://schema.org/description",
"image": {
"@id": "https://schema.org/image",
"@type": "@id"
},
"FirstResponderCredential": {
"@id": "https://w3id.org/first-responder#FirstResponderCredential",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"description": "https://schema.org/description",
"name": "https://schema.org/name",
"identifier": "https://schema.org/identifier",
"image": {
"@id": "https://schema.org/image",
"@type": "@id"
}
}
},
"deploymentDaysNumeric": "https://w3id.org/first-responder#deploymentDaysNumeric",
"deploymentStartDate": "https://w3id.org/first-responder#deploymentStartDate",
"deploymentSummary": "https://w3id.org/first-responder#deploymentSummary",
"homeUnit": "https://w3id.org/first-responder#homeUnit",
"jobTitleOrRole": "https://w3id.org/first-responder#jobTitleOrRole",
"jobTitleOrRoleName": "https://w3id.org/first-responder#jobTitleOrRoleName",
"jurisdictionName": "https://w3id.org/first-responder#jurisdictionName",
"organizationAffiliationCategoryCode": "https://w3id.org/first-responder#organizationAffiliationCategoryCode",
"organizationName": "https://w3id.org/first-responder#organizationName",
"ownerInformation": "https://w3id.org/first-responder#ownerInformation",
"FirstResponder": {
"@id": "https://w3id.org/first-responder#FirstResponder",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"badge": "https://w3id.org/first-responder#badge",
"badgeJobTitleText": "https://w3id.org/first-responder#badgeJobTitleText",
"experience": "https://w3id.org/first-responder#experience",
"skill": "https://w3id.org/first-responder#skill",
"training": "https://w3id.org/first-responder#training"
}
},
"agencySymbol": "https://w3id.org/first-responder#agencySymbol",
"cardPicture": "https://w3id.org/first-responder#cardPicture",
"eAssuranceLevelCode": "https://w3id.org/first-responder#eAssuranceLevelCode",
"fips201ConformanceCode": "https://w3id.org/first-responder#fips201ConformanceCode",
"idCategoryCodeAbstract": "https://w3id.org/first-responder#idCategoryCodeAbstract",
"nameOnCardText": "https://w3id.org/first-responder#nameOnCardText",
"personIDCard": "https://w3id.org/first-responder#personIDCard",
"signatureAuthorityName": "https://w3id.org/first-responder#signatureAuthorityName",
"Badge": {
"@id": "https://w3id.org/first-responder#Badge",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"badgeJobTitleText": "https://w3id.org/first-responder#badgeJobTitleText",
"personHumanResource": "https://w3id.org/first-responder#personHumanResource"
}
},
"Skill": {
"@id": "https://w3id.org/first-responder#Skill",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"skillAcquiredCategoryCode": "https://w3id.org/first-responder#skillAcquiredCategoryCode",
"skillDescriptionText": "https://w3id.org/first-responder#skillDescriptionText",
"skillName": "https://w3id.org/first-responder#skillName",
"skillUseHistoryText": "https://w3id.org/first-responder#skillUseHistoryText"
}
},
"Training": {
"@id": "https://w3id.org/first-responder#Training",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"courseLevelText": "https://w3id.org/first-responder#courseLevelText",
"courseText": "https://w3id.org/first-responder#courseText",
"isIssuedCertificationIndicator": "https://w3id.org/first-responder#isIssuedCertificationIndicator",
"trainingDuration": "https://w3id.org/first-responder#trainingDuration"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@
"id": "@id",
"type": "@type",
"FoodSafetyCertificationCredential": "https://contexts.vcplayground.org/examples/food-safety-certification/vocab#FoodSafetyCertificationCredential",

"name": "https://schema.org/name",
"description": "https://schema.org/description",
"image": "https://schema.org/image",
"certification": "https://contexts.vcplayground.org/examples/food-safety-certification/vocab#certification",

"FoodSafetyCertification": {
"@id": "https://contexts.vcplayground.org/examples/food-safety-certification/vocab#FoodSafetyCertification",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",

"certificateId": "https://contexts.vcplayground.org/examples/food-safety-certification/vocab#certificateId",
"examDate": {
"@id": "https://contexts.vcplayground.org/examples/food-safety-certification/vocab#examDate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@
"@protected": true,
"id": "@id",
"type": "@type",

"GS18110CouponCredential": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#GS18110CouponCredential",
"clippedCoupon": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#clippedCoupon",
"name": "https://schema.org/name",
"description": "https://schema.org/description",
"image": "https://schema.org/image",
"url": "https://schema.org/url",

"CouponOffer": {
"@id": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#CouponOffer",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",

"gtin": "https://gs1.org/voc/gtin",

"offerDescription": "https://gs1.org/voc/offerDescription",
"exclusionDescription": "https://gs1.org/voc/exclusionDescription",
"applicationId": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#applicationId",

"gs1CompanyPrefix": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#gs1CompanyPrefix",
"offerCode": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#offerCode",
"saveValue": "https://contexts.vcplayground.org/examples/gs1-8110-coupon/vocab#saveValue",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"seatNumber": "https://schema.org/seatNumber",
"seatRow": "https://schema.org/seatRow",
"seatSection": "https://schema.org/seatSection",
"address": "https://schema.org/PostalAddress",
"address": "https://schema.org/address",
"addressLocality": "https://schema.org/addressLocality",
"addressRegion": "https://schema.org/addressRegion",
"postalCode": "https://schema.org/postalCode",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
"postalCode": "https://schema.org/postalCode",
"streetAddress": "https://schema.org/streetAddress"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": {
"@protected": true,
"renderMethod": {
"@id": "https://www.w3.org/2018/credentials#renderMethod",
"@type": "@id"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"@context": {
"@version": 1.1,
"@protected": true,
"name": "https://schema.org/name",
"description": "https://schema.org/description",
"identifier": "https://schema.org/identifier",
"image": {
"@id": "https://schema.org/image",
"@type": "@id"
},
"renderMethod": {
"@id": "https://www.w3.org/2018/credentials#renderMethod",
"@type": "@id"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"@context": {
"@protected": true,
"confidenceMethod": {
"@id": "https://www.w3.org/2018/credentials#confidenceMethod",
"@type": "@id"
},
"ConfidenceMethod": "https://www.w3.org/2018/credentials#ConfidenceMethod",
"DidAuthnConfidenceMethod": "https://examples.vcplayground.org/contexts/utopia-natcert/vocab#DidAuthnConfidenceMethod"
}
}
Loading

0 comments on commit 16ea625

Please sign in to comment.