Skip to content

DCAT JSON-LD tags #5863

@jbrown-xentity

Description

@jbrown-xentity

User Story

In order to support cleaner searchability and follow web best practices, data.gov admins want JSON-LD for DCAT tags applied to dataset pages in scripts.

Acceptance Criteria

Background

Raised via Linked In, but we did this on the old catalog (handled by CKAN extension dcat: https://github.com/GSA/catalog.data.gov/blob/main/ckan/setup/ckan.ini#L136, and https://github.com/ckan/ckanext-dcat). This will help with semantic web and searchability as bots begin crawling the new site.

Security Considerations (required)

None.

Sketch

Should just be able to drop the whole dataset listing raw into the document in a separate script tag. Might need to apply the "@type": "schema:Dataset" to make sure it complies with web standards, everything else should be good. This will actually be an improvement, the JSON-LD that was exported on the CKAN DCAT extension was bare bones (just name, description, keywords; they didn't even have the distributions mapped properly!).

This could be verified by visiting https://search.google.com/test/rich-results/result?id=h3LXEIIGxYdPLHXqxo-x2g

example:

<script type="application/ld+json" class="jsonld-dataset">
      {
        "@type": "schema:Dataset",
        "name": "Department of Education - 2017-18 Arrests Civil Rights Data Collection",
        "description": "This set of Excel file contains data on student referrals to law enforcement by disability and student-related arrests by disability for all states. It also contains data on...",
        "keywords": [
          
            
              "arrests",
            
              "children-with-disabilities",
            
              "civil-rights",
            
              "crdc",
            
              "disability",
            
              "elementary-and-secondary",
            
              "language",
            
              "law-enforcement",
            
              "minority",
            
              "ocr",
            
              "race",
            
              "student-enrollment",
            
              "student-retention",
            
              "students"
            
          
        ],
        "publisher": {
          "type": "Organization",
          "contactPoint": { "type": "PostalAddress" }
        },
        "distribution": []
      }
    </script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    📟 Sprint Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions