Repository navigation
Conversation
This feature dynamically generates and injects Croissant dataset metadata (JSON-LD format) into the Knowledge Graph Browser for provenance nodes (dc/base/*). - Queries the Mixer V2 Node API to retrieve dataset properties like name, description, license, and creator source. - Injects the JSON-LD script into the node.html template for SEO and metadata crawlers.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Knowledge Graph Browser by adding support for Croissant JSON-LD metadata. By dynamically querying dataset properties for provenance nodes and injecting them into the page template, the changes ensure that metadata crawlers can better index and understand the datasets presented in the browser. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new feature flag, croissant_json_ld, and adds support for generating and embedding Croissant JSON-LD metadata on provenance pages. The metadata is built in a new library, server/lib/croissant_metadata.py, and injected into the HTML template. The review feedback focuses on improving robustness when parsing API responses by safely handling potential None values to prevent AttributeErrors.
- Refactored Croissant logic out of browser routing and into server/lib/croissant_metadata.py. - Replaced brittle dc/base/ string prefix check with a robust typeOf API check to safely support custom DCP users. - Added strict fail-fast validation for missing required graph properties (isPartOf, description, license, source). - Removed redundant | safe filter from Jinja template. - Added comprehensive mock-based unit tests covering feature flags, invalid types, missing properties, and perfect data scenarios.
|
Closing this PR as the changes got merged through another PR. |
This feature dynamically generates and injects Croissant dataset metadata (JSON-LD format) into the Knowledge Graph Browser for provenance nodes (dc/base/*).