-1

I'm trying to do a proper JSON-LD markup for my page. I'm working on NextJS (injecting JSON-LD via dangerouslySetInnerHTML), so I inject raw stringified JSON into the render.

Let's say my page wants to be detected as an Organization first (in order to improve rich results), I go like this:

{
        "@context": "https://schema.org",
        "@type": "Organization",
        "name": "Name",
        "legalName": "Legal Name",
        "url": "https://example.com",
        ... other properties
}

But I'd like to include as well a "@type": "WebPage" and a "@type": "WebSite" nodes to describe the page itself.

How should I proceed? Do I have to separate the main nodes or just include WebSite and WebPage as subtypes?

I've seen people do the @graph approach to separate nodes, but I wonder if it's the best solution.

1 Answer 1

0

@graph is a good approach for entities that are not referenced by anything or are referenced from several places. You can list them all in one @graph instead of creating new scripts for each.

Some entities make more sense to be embedded inside other ones, like the address of an Organization. Or a WebPage could be part of (isPartOf) a WebSite.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.