Skip to content

Commit

Permalink
feat: add support for optional credit class image (#56)
Browse files Browse the repository at this point in the history
* feat: add generic credit-class.jsonld and support for optional class image

* chore: rm tokenization source

* fix: pin docker image to debian:bullseye

* chore: update credit class @type

* fix: repeated schema:URL @type and useless xsd:string

* refactor: mv common credit class shape to main credit-class.ttl

* fix: shacl common.ttl

---------

Co-authored-by: Kyle Lawlor-Bagcal <[email protected]>
  • Loading branch information
blushi and wgwz authored Jul 3, 2023
1 parent 829f330 commit 92462e9
Show file tree
Hide file tree
Showing 15 changed files with 224 additions and 312 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:latest
FROM debian:bullseye
RUN apt-get update -y && apt-get upgrade -yy
RUN apt-get install -yy wget openjdk-11-jre python3
WORKDIR /app
Expand Down
13 changes: 5 additions & 8 deletions jsonld/credit-batches/C01-verified-carbon-standard-batch.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"regen": "https://schema.regen.network#",
"regen:additionalCertifications": {
"@container": "@list"
},
"schema:url": {
"@type": "schema:URL"
}
},
"@type": "regen:C01-CreditBatch",
Expand All @@ -12,17 +15,11 @@
"regen:additionalCertifications": [
{
"schema:name": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
}
"schema:url": ""
},
{
"schema:name": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
}
"schema:url": ""
}
]
}
5 changes: 1 addition & 4 deletions jsonld/credit-batches/C02-batch.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
],
"regen:projectVerifier": {
"schema:name": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
}
"schema:url": ""
}
}
10 changes: 2 additions & 8 deletions jsonld/credit-classes/C01-verified-carbon-standard-class.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
"@type": "regen:CreditClass",
"schema:description": "",
"schema:name": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
},
"schema:url": "",
"regen:sourceRegistry": {
"schema:name": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
}
"schema:url": ""
},
"regen:sectoralScope": [
""
Expand Down
29 changes: 5 additions & 24 deletions jsonld/credit-classes/C02-city-forest-credits-class.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,13 @@
"@type": "regen:C02-CreditClass",
"schema:name": "",
"schema:description": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
},
"schema:url": "",
"regen:sourceRegistry": {
"schema:name": "",
"schema:url": {
"@type": "schema:URL",
"@value": ""
}
"schema:url": ""
},
"regen:sectoralScope": [
{
"@type": "xsd:string",
"@value": ""
}
],
"regen:offsetGenerationMethod": [
{
"@type": "xsd:string",
"@value": ""
}
],
"regen:sectoralScope": [""],
"regen:offsetGenerationMethod": [""],
"regen:approvedMethodologies": {
"@type": "schema:ItemList",
"schema:itemListElement": [
Expand All @@ -74,9 +58,6 @@
""
],
"regen:carbonOffsetStandard": {
"schema:url": {
"@type": "schema:URL",
"@value": ""
}
"schema:url": ""
}
}
62 changes: 62 additions & 0 deletions jsonld/credit-classes/credit-class.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"@context": {
"schema": "http://schema.org/",
"regen": "https://schema.regen.network#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"schema:itemListElement": {
"@container": "@list"
},
"regen:sectoralScope": {
"@container": "@list"
},
"regen:offsetGenerationMethod": {
"@container": "@list"
},
"regen:projectActivities": {
"@container": "@list"
},
"schema:url": {
"@type": "schema:URL"
},
"schema:image": {
"@type": "schema:URL"
}
},
"@type": "regen:CreditClass",
"schema:description": "",
"schema:name": "",
"schema:url": "",
"schema:image": "",
"regen:sourceRegistry": {
"schema:name": "",
"schema:url": ""
},
"regen:sectoralScope": [
""
],
"regen:offsetGenerationMethod": [
""
],
"regen:approvedMethodologies": {
"@type": "schema:ItemList",
"schema:itemListElement": [
{
"schema:name": "",
"schema:url": "",
"schema:identifier": "",
"schema:version": ""
},
{
"schema:name": "",
"schema:url": "",
"schema:identifier": "",
"schema:version": ""
}
],
"schema:url": ""
},
"regen:verificationMethod": "",
"regen:projectActivities": [
""
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,18 @@
"@type": "regen:C01-CreditClass",
"schema:name": "Verified Carbon Standard",
"schema:description": "This credit class provides a vehicle for nature based Verified Carbon Units (VCUs) to enter the blockchain space via issuance on Regen Ledger. It can be used by project developers, credit brokers, and other stakeholders interested in digitizing carbon credits issued by the VCS program to make them available in the emerging world of decentralized finance.",
"schema:url": {
"@type": "schema:URL",
"@value": "https://library.regen.network/v/regen-registry-credit-classes/credits-from-other-registries/verified-carbon-standard-credit-class"
},
"schema:url": "https://library.regen.network/v/regen-registry-credit-classes/credits-from-other-registries/verified-carbon-standard-credit-class",
"regen:sourceRegistry": {
"schema:name": "Verra",
"schema:url": {
"@type": "schema:URL",
"@value": "https://verra.org/"
}
"schema:url": "https://verra.org/"
},
"regen:sectoralScope": [
{
"@type": "xsd:string",
"@value": "Agriculture Forestry and Other Land Use (AFOLU)"
},
{
"@type": "xsd:string",
"@value": "Livestock and Manure Management"
}
"Agriculture Forestry and Other Land Use (AFOLU)",
"Livestock and Manure Management"
],
"regen:offsetGenerationMethod": [
{
"@type": "xsd:string",
"@value": "Emission Reductions"
},
{
"@type": "xsd:string",
"@value": "Carbon Removals"
}
"Emission Reductions",
"Carbon Removals"
],
"regen:approvedMethodologies": {
"@type": "schema:ItemList",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,13 @@
"@type": "regen:C02-CreditClass",
"schema:name": "Urban Forest Carbon Credit Class",
"schema:description": "City Forest Credits is the national standard for greenhouse gas emission reduction and removal for tree projects in cities and towns. Developed by leading scientists, industry, and urban forest professionals, the Standard and Protocols define the set of rules and requirements that tree preservation projects must follow in order to earn third-party verified carbon credits.\n\nCFC has a 40-year and a 100-year Tree Preservation Protocol, modeled after avoided conversion or avoided emissions protocols in forestry. The 40-year Protocol was designed for the voluntary market and the 100-year Protocol for the compliance market in the state of California.",
"schema:url": {
"@type": "schema:URL",
"@value": "https://www.cityforestcredits.org/"
},
"schema:url": "https://www.cityforestcredits.org/",
"regen:sourceRegistry": {
"schema:name": "City Forest Credits",
"schema:url": {
"@type": "schema:URL",
"@value": "https://www.cityforestcredits.org/"
}
"schema:url": "https://www.cityforestcredits.org/"
},
"regen:sectoralScope": [
{
"@type": "xsd:string",
"@value": "Agriculture Forestry and Other Land Use (AFOLU)"
}
],
"regen:offsetGenerationMethod": [
{
"@type": "xsd:string",
"@value": "Avoided Emissions"
}
],
"regen:sectoralScope": ["Agriculture Forestry and Other Land Use (AFOLU)"],
"regen:offsetGenerationMethod": ["Avoided Emissions"],
"regen:approvedMethodologies": {
"@type": "schema:ItemList",
"schema:itemListElement": [
Expand Down Expand Up @@ -75,9 +59,6 @@
],
"regen:carbonOffsetStandard": {
"schema:name": "City Forest Credits Standard",
"schema:url": {
"@type": "schema:URL",
"@value": "https://www.cityforestcredits.org/wp-content/uploads/2022/03/City-Forest-Credits-Standard-V2.pdf"
}
"schema:url": "https://www.cityforestcredits.org/wp-content/uploads/2022/03/City-Forest-Credits-Standard-V2.pdf"
}
}
22 changes: 22 additions & 0 deletions shacl/common.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .

regen:ToucanURIPropertyShape sh:path regen:toucanURI ;
sh:datatype xsd:string ;
Expand Down Expand Up @@ -41,3 +42,24 @@ regen:ProjectActivitiesPropertyShape sh:path regen:projectActivities ;
sh:minCount 1 ;
sh:maxCount 1 ;
.

regen:ApprovedMethodologiesPropertyShape sh:path regen:approvedMethodologies ;
sh:class schema:ItemList ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:property [
sh:path schema:itemListElement ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:property [
sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
sh:node regen:MethodologyVersionShape ;
sh:minCount 1 ;
] ;
] ;
sh:property [
sh:path schema:url ;
sh:maxCount 1 ;
sh:datatype schema:URL ;
] ;
.
49 changes: 3 additions & 46 deletions shacl/credit-classes/C01-verified-carbon-standard-class.ttl
Original file line number Diff line number Diff line change
@@ -1,52 +1,9 @@
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix regen: <https://schema.regen.network#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

regen:C01-CreditClass rdfs:subClassOf regen:CreditClass .

regen:C01-CreditClassShape a sh:NodeShape ;
sh:targetClass regen:C01-CreditClass ;
sh:property [
sh:path schema:description ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:minLength 1 ;
sh:datatype xsd:string ;
] ;
sh:property [
sh:path schema:name ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:minLength 1 ;
sh:datatype xsd:string ;
] ;
sh:property [
sh:path schema:url ;
sh:datatype schema:URL ;
] ;
sh:property [
sh:path regen:sourceRegistry ;
sh:node regen:NameUrlShape ;
] ;
sh:property [
sh:path regen:sectoralScope ;
sh:node dash:ListShape ;
sh:property [
sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
sh:datatype xsd:string ;
sh:minLength 1 ;
] ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property regen:OffsetGenerationMethodPropertyShape ;
sh:property regen:ApprovedMethodologiesPropertyShape ;
sh:property [
sh:path regen:verificationMethod ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:minLength 1 ;
sh:datatype xsd:string ;
] ;
.
Loading

0 comments on commit 92462e9

Please sign in to comment.