Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/app/alternatives/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getBenchCreatedAt } from "@/lib/seo/bench-dates";
import { capDescription } from "@/lib/seo-text";
import { SectionLabel, SummaryStat } from "@/components/summary-stat";
import { SITE } from "@/data/site";
import { CREATOR_PUBLISHER, CITABLE_JSON_URL, DATASET_LICENSE, HF_DATASET_URL } from "@/lib/dataset-jsonld";
import { loadAlternative } from "@/lib/alternatives";
import { Breadcrumb } from "@/components/breadcrumb";
import { buildBreadcrumbJsonLd, safeJsonLd } from "@/lib/jsonld";
Expand Down Expand Up @@ -120,14 +121,27 @@ export default async function AlternativePage({
bench.metric,
...bench.results.map((r) => r.name),
].join(", "),
creator: { "@id": `${SITE.url}/#org` },
publisher: { "@id": `${SITE.url}/#org` },
creator: CREATOR_PUBLISHER,
publisher: CREATOR_PUBLISHER,
isAccessibleForFree: true,
license: "https://creativecommons.org/licenses/by/4.0/",
license: DATASET_LICENSE,
datePublished: getBenchCreatedAt(bench.slug).toISOString(),
...(citableAsOf(bench) ? { dateModified: bench.lastRunAt } : {}),
variableMeasured: bench.metric,
isBasedOn: benchUrl,
distribution: [
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: `${SITE.url}/api/stat/${bench.slug}`,
},
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: CITABLE_JSON_URL,
},
],
sameAs: [HF_DATASET_URL],
},
{
"@type": "Article",
Expand Down
7 changes: 5 additions & 2 deletions src/app/compare/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { capDescription } from "@/lib/seo-text";
import { Breadcrumb } from "@/components/breadcrumb";
import { buildBreadcrumbJsonLd, safeJsonLd } from "@/lib/jsonld";
import { SITE } from "@/data/site";
import { CREATOR_PUBLISHER, DATASET_LICENSE } from "@/lib/dataset-jsonld";
import type { Benchmark } from "@/types/benchmark";
import {
computeInputsHash,
Expand Down Expand Up @@ -711,8 +712,10 @@ export default async function ComparePage({
name: `${a.name} vs ${b.name} OpenChainBench measurements`,
description: `Side by side live measurements for ${a.name} and ${b.name} on ${shared.length} shared OpenChainBench benchmarks.`,
url,
creator: { "@id": `${SITE.url}/#org` },
license: "https://creativecommons.org/licenses/by/4.0/",
creator: CREATOR_PUBLISHER,
publisher: CREATOR_PUBLISHER,
isAccessibleForFree: true,
license: DATASET_LICENSE,
measurementTechnique: `${SITE.url}/methodology`,
variableMeasured: shared.map((s) => ({
"@type": "PropertyValue",
Expand Down
19 changes: 17 additions & 2 deletions src/app/products/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from "@/data/provider-registry";
import { Breadcrumb } from "@/components/breadcrumb";
import { buildBreadcrumbJsonLd, safeJsonLd } from "@/lib/jsonld";
import { CREATOR_PUBLISHER, CITABLE_JSON_URL, DATASET_LICENSE } from "@/lib/dataset-jsonld";
import {
fetchHlBuilderStats,
isHlBuilderSlug,
Expand Down Expand Up @@ -427,8 +428,22 @@ export default async function ProviderPage({
name: a.benchmark.title,
description: capDescription(a.benchmark.subtitle, 990),
url: `${SITE.url}/benchmarks/${a.benchmark.slug}`,
creator: { "@id": `${SITE.url}/#org` },
license: "https://creativecommons.org/licenses/by/4.0/",
creator: CREATOR_PUBLISHER,
publisher: CREATOR_PUBLISHER,
isAccessibleForFree: true,
license: DATASET_LICENSE,
distribution: [
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: `${SITE.url}/api/stat/${a.benchmark.slug}`,
},
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: CITABLE_JSON_URL,
},
],
})),
},
// NB: previously emitted a SoftwareApplication node here, but Google's
Expand Down
14 changes: 13 additions & 1 deletion src/lib/dataset-jsonld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,25 @@ const KEYWORDS = [
"infrastructure",
];

const CREATOR_PUBLISHER = {
/** Embedded Org node used for Dataset `creator` / `publisher`. Exported
* so pages emitting a Dataset outside the home graph can inline the
* full node (Google Search Console flags an `@id`-only reference as
* "missing field creator" when the referenced Org isn't declared on
* the same page). */
export const CREATOR_PUBLISHER = {
"@type": "Organization",
"@id": `${SITE.url}/#org`,
name: SITE.name,
url: SITE.url,
} as const;

/** Full JSON download of the current benchmark corpus. Used as the
* default `distribution.contentUrl` for Dataset nodes emitted outside
* `/benchmarks/[slug]` (products, alternatives, compare) so every
* Dataset carries a machine-readable download link, satisfying the
* Google Dataset "encodingFormat" / "contentUrl" requirements. */
export const CITABLE_JSON_URL = `${SITE.url}/api/citable`;

/**
* Site-wide Dataset entry. Emitted on the home page so Google Dataset
* Search and Perplexity have a single canonical record pointing at both
Expand Down
Loading