regen-network / regen-registry-standards

:seedling: RDF and SHACL schemas for Regen Registry
4 stars 1 forks source link

C02 project shacl schema does not specify the regen:offsetGenerationMethod #35

Closed wgwz closed 1 year ago

wgwz commented 1 year ago

We missed this part of the SHACL schema prior to going live with C02.

regen-web changes/effects for this can be seen with the following data through the compaction in the jsonld-playground:

jsonld input:

{
  "@context": {
    "schema": "http://schema.org/",
    "regen": "http://regen.network/",
    "qudt": "http://qudt.org/schema/qudt/",
    "unit": "http://qudt.org/vocab/unit/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "regen:cfcProjectPage": {
      "@type": "schema:URL"
    },
    "regen:projectDesignDocument": {
      "@type": "schema:URL"
    },
    "schema:url": {
      "@type": "schema:URL"
    },
    "regen:previewPhoto": {
      "@type": "schema:URL"
    },
    "regen:galleryPhotos": {
      "@container": "@list",
      "@type": "schema:URL"
    },
    "qudt:unit": {
      "@type": "qudt:Unit"
    },
    "qudt:numericValue": {
      "@type": "xsd:double"
    },
    "regen:projectStartDate": {
      "@type": "xsd:date"
    },
    "regen:projectEndDate": {
      "@type": "xsd:date"
    }
  },
  "@type": "regen:C02-Project",
  "schema:name": "Buena Vista Heights Conservation Area",
  "regen:cfcProjectId": "9",
  "regen:cfcProjectPage": "https://www.cityforestcredits.org/carbon-credits/carbon-registry/pittsburgh-forest-carbon-offsets/",
  "regen:projectDesignDocument": "https://www.cityforestcredits.org/wp-content/uploads/2020/02/Buena-Vista-Heights-Project-Design-Document-1.pdf",
  "schema:description": "Outside Pittsburgh, Allegheny Land Trust protected 124 acres of woodlands from rapid encroaching residential development in southeastern Allegheny County. The 40 year old maple, cherry and oak-hickory forest provides habitat for deer, turkey, and many species of birds. Hikers, birders, and mountain bikers will be able to explore the area, and possibly catch a glimpse of a majestic 200 year old oak tree.\n\nProtection of this forest also contributes to maintaining clean drinking water for Pittsburgh region’s residents. Located within the lower Youghiogheny River Watershed, the property is five miles upstream from the confluence with the Monongahela River.\n\nRevenue generated from the sale of carbon credits will be put towards acquisition costs, land stewardship, and future expansion of this and other conservation lands.",
  "regen:projectOperator": {
    "schema:name": "Allegheny Land Trust",
    "schema:url": "https://alleghenylandtrust.org/"
  },
  "regen:projectType": "Agriculture Forestry and Other Land Use",
  "regen:projectActivity": {
    "schema:name": "Tree Preservation"
  },
  "regen:offsetGenerationMethod": "Avoided Emissions",
  "regen:projectSize": {
    "qudt:unit": "unit:HA",
    "qudt:numericValue": 50.14
  },
  "regen:projectStartDate": "2020-06-30",
  "regen:projectEndDate": "2060-06-30",
  "schema:location": {
    "@context": {
      "type": "@type",
      "@vocab": "https://purl.org/geojson/vocab#",
      "coordinates": {
        "@container": "@list"
      },
      "bbox": {
        "@container": "@list"
      }
    },
    "type": "Feature",
    "place_name": "Elizabeth Township, Pennsylvania, United States, North America",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -79.899246,
        40.263906
      ]
    }
  },
  "regen:previewPhoto": "https://regen-registry.s3.amazonaws.com/projects/C02/buena-vista-01.jpg",
  "regen:galleryPhotos": [
    "https://regen-registry.s3.amazonaws.com/projects/C02/buena-vista-01.jpg",
    "https://regen-registry.s3.amazonaws.com/projects/C02/buena-vista-02.jpg"
  ],
  "regen:offsetProtocol": {
    "schema:name": "Preservation Protocol - 40 years",
    "schema:url": "https://www.cityforestcredits.org/wp-content/uploads/2022/07/City-Forest-Preservation-Protocol-40-Years-V11.40.pdf",
    "schema:version": "v8.40"
  }
}

jsonld context (from regen-web):

{
  "schema": "http://schema.org/",
  "regen": "http://regen.network/",
  "qudt": "http://qudt.org/schema/qudt/",
  "unit": "http://qudt.org/vocab/unit/",
  "xsd": "http://www.w3.org/2001/XMLSchema#",
  "regen:ecosystemType": {
    "@container": "@list"
  },
  "regen:projectActivities": {
    "@container": "@list"
  },
  "regen:offsetGenerationMethod": {
    "@container": "@list"
  },
  "regen:sectoralScope": {
    "@container": "@list"
  },
  "regen:verificationReports": {
    "@container": "@list"
  },
  "regen:cfcCreditSerialNumbers": {
    "@container": "@list"
  },
  "schema:itemListElement": {
    "@container": "@list"
  },
  "schema:location": {
    "@context": {
      "type": "@type",
      "@vocab": "https://purl.org/geojson/vocab#",
      "coordinates": {
        "@container": "@list"
      }
    }
  }
}

output (see offsetGenerationMethod):

{
  "@context": {
    "schema": "http://schema.org/",
    "regen": "http://regen.network/",
    "qudt": "http://qudt.org/schema/qudt/",
    "unit": "http://qudt.org/vocab/unit/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "regen:ecosystemType": {
      "@container": "@list"
    },
    "regen:projectActivities": {
      "@container": "@list"
    },
    "regen:offsetGenerationMethod": {
      "@container": "@list"
    },
    "regen:sectoralScope": {
      "@container": "@list"
    },
    "regen:verificationReports": {
      "@container": "@list"
    },
    "regen:cfcCreditSerialNumbers": {
      "@container": "@list"
    },
    "schema:itemListElement": {
      "@container": "@list"
    },
    "schema:location": {
      "@context": {
        "type": "@type",
        "@vocab": "https://purl.org/geojson/vocab#",
        "coordinates": {
          "@container": "@list"
        }
      }
    }
  },
  "@type": "regen:C02-Project",
  "regen:cfcProjectId": "9",
  "regen:cfcProjectPage": {
    "@type": "schema:URL",
    "@value": "https://www.cityforestcredits.org/carbon-credits/carbon-registry/pittsburgh-forest-carbon-offsets/"
  },
  "regen:galleryPhotos": {
    "@list": [
      {
        "@type": "schema:URL",
        "@value": "https://regen-registry.s3.amazonaws.com/projects/C02/buena-vista-01.jpg"
      },
      {
        "@type": "schema:URL",
        "@value": "https://regen-registry.s3.amazonaws.com/projects/C02/buena-vista-02.jpg"
      }
    ]
  },
  "http://regen.network/offsetGenerationMethod": "Avoided Emissions",
  "regen:offsetProtocol": {
    "schema:name": "Preservation Protocol - 40 years",
    "schema:url": {
      "@type": "schema:URL",
      "@value": "https://www.cityforestcredits.org/wp-content/uploads/2022/07/City-Forest-Preservation-Protocol-40-Years-V11.40.pdf"
    },
    "schema:version": "v8.40"
  },
  "regen:previewPhoto": {
    "@type": "schema:URL",
    "@value": "https://regen-registry.s3.amazonaws.com/projects/C02/buena-vista-01.jpg"
  },
  "regen:projectActivity": {
    "schema:name": "Tree Preservation"
  },
  "regen:projectDesignDocument": {
    "@type": "schema:URL",
    "@value": "https://www.cityforestcredits.org/wp-content/uploads/2020/02/Buena-Vista-Heights-Project-Design-Document-1.pdf"
  },
  "regen:projectEndDate": {
    "@type": "xsd:date",
    "@value": "2060-06-30"
  },
  "regen:projectOperator": {
    "schema:name": "Allegheny Land Trust",
    "schema:url": {
      "@type": "schema:URL",
      "@value": "https://alleghenylandtrust.org/"
    }
  },
  "regen:projectSize": {
    "qudt:numericValue": {
      "@type": "xsd:double",
      "@value": 50.14
    },
    "qudt:unit": {
      "@type": "qudt:Unit",
      "@value": "unit:HA"
    }
  },
  "regen:projectStartDate": {
    "@type": "xsd:date",
    "@value": "2020-06-30"
  },
  "regen:projectType": "Agriculture Forestry and Other Land Use",
  "schema:description": "Outside Pittsburgh, Allegheny Land Trust protected 124 acres of woodlands from rapid encroaching residential development in southeastern Allegheny County. The 40 year old maple, cherry and oak-hickory forest provides habitat for deer, turkey, and many species of birds. Hikers, birders, and mountain bikers will be able to explore the area, and possibly catch a glimpse of a majestic 200 year old oak tree.\n\nProtection of this forest also contributes to maintaining clean drinking water for Pittsburgh region’s residents. Located within the lower Youghiogheny River Watershed, the property is five miles upstream from the confluence with the Monongahela River.\n\nRevenue generated from the sale of carbon credits will be put towards acquisition costs, land stewardship, and future expansion of this and other conservation lands.",
  "schema:location": {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -79.899246,
        40.263906
      ]
    },
    "place_name": "Elizabeth Township, Pennsylvania, United States, North America"
  },
  "schema:name": "Buena Vista Heights Conservation Area"
}

Note: there is an inconsistency as well, we generally expect offsetGenerationMethod to be a list, but in the example shared here it is a string value. This will be part of fixing this issue.

/cc @mhagel

blushi commented 1 year ago

Note: there is an inconsistency as well, we generally expect offsetGenerationMethod to be a list, but in the example shared here it is a string value. This will be part of fixing this issue.

@wgwz I believe we'd rather use offsetGenerationMethods (plural) when it's a list and offsetGenerationMethod (singular) when it's a string

wgwz commented 1 year ago

Hey @S4mmyb 👋 I just wanted to attempt to sync you up on the issue here. @blushi pointed out in a separate task that we had an issue with the regen:offsetGenerationMethod. That brought us to this current thread I'm replying to right now, it's a related issue.

So the issue is as follows:

@blushi and I discussed two possible solutions for this.

  1. Support the list and the string version. The list version would be called regen:offsetGenerationMethods and the string version would be called regen:offsetGenerationMethod. However, this would mean that we would need to update the credit classes metadata on-chain (because we made the name of the field plural).
  2. Only support a list version and keep the name as regen:offsetGenerationMethod. This would only require that we update project metadata to use the list version, which we already need to do for project metadata separation (#37).

The second solution could be beneficial if a project would ever have more than one offset generation method. Is that a conceivable possibility at this time?

S4mmyb commented 1 year ago

I think we should just do a single regen:offsetGenerationMethod which is a list of strings where the user can only have a single one if they chose, so probably option two. In the long term we will likely only have one offsetGenerationMethod, but some credit classes may have two so providing the option for both makes sense.

blushi commented 1 year ago

I think the second option indeed gives us the most flexibility in case we want to support multiple offset generation methods per project in the future. The only comment that I have is that for fields that are supposed to be lists , we sometimes use plural (eg regen:projectActivities), and sometimes singular (regen:sectoralScope) which is not very consistent... Maybe not something we need to fix now but I guess it might be important once we start defining our regen schema and vocabulary more precisely.