Skip to content

Upgrade from RDFa to JSON-LD #54

@davebridges

Description

@davebridges

1. Rationale

Our current website utilizes RDFa (Resource Description Framework in Attributes) for schema markup. However, the Schema Markup Validator is failing to correctly parse our Organization and Member data.

To improve our SEO and follow modern web standards, we should migrate to JSON-LD.

Why the move?

  • Google's Preference: Google explicitly states that JSON-LD is the preferred format for structured data.
  • Decoupled Design: RDFa is "baked into" the HTML tags. If we change our UI or rearrange <div> elements, the metadata often breaks. JSON-LD exists in a standalone script block, making it much more resilient to design changes.
  • Django-Friendly: Using Django templates to loop through a queryset and generate a JSON object is significantly cleaner and less error-prone than injecting attributes into individual loop items in the DOM.

2. Implementation Steps

Phase 1: Global Organization Schema

Add a static JSON-LD block to the <head> of our base.html template to define the Lab globally.

  • Implement Organization schema including lab name, University of Michigan affiliation, and official URL.
  • Add sameAs links for social media or institutional profiles (e.g., Twitter, LinkedIn, LabArchives).

Phase 2: Dynamic Member Schema (People Page)

Update the people.html template to iterate over our members queryset.

  • Create a Person object for each lab member.
  • Link these members to the Organization using the member property.
  • Map Django model fields (Name, Title, Bio, Image) to Schema properties.

Phase 3: Site-wide Enhancements

  • Breadcrumbs: Implement BreadcrumbList schema to improve the "path" appearance in Google search results.
  • Research Articles: If applicable, add ScholarlyArticle markup to our publications list.

Phase 4: Validation & Cleanup

  • Verify the new implementation using the Schema Markup Validator.
  • Remove legacy RDFa: Delete vocab, typeof, and property attributes from our HTML templates to reduce DOM clutter and prevent validation conflicts.

3. Useful Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions