Skip to main content
NewNMC’s advertising guidelines for doctors are in force from 6 Oct 2026. See what to change, and get a free compliance auditNew NMC advertising rules for doctors: what to change
SEO

A Connected JSON-LD @id Graph for a Multi-Location Hospital

Use stable @id values to link Organization, Hospital, Department, Physician and Service nodes, so every branch is distinct and the brand stays one entity. Rules, edges and failure modes.

A Connected JSON-LD @id Graph for a Multi-Location Hospital

This post is for the technical SEO lead or developer at a hospital group that runs several campuses under one brand and wants the structured data to say so clearly. Each branch should be a distinct entity with its own address, departments and doctors, while the brand stays one entity behind them. It assumes you can read JSON-LD and have already marked up individual pages.

The question it answers is how to build a connected graph with stable @id values. Which nodes do you need, how should identifiers be written, which properties connect them, and where does the approach break? We use an invented three-campus group as the running example and a hypothetical domain. Nothing here reports a result from a real client.

The branding and local SEO side of multi-location work is covered in our posts on scaling multi-location marketing, branding consistency across locations and SEO and branding for hospital chains. This article stays inside the markup.

What @id is for, and what it is not

In JSON-LD, @id names a node. The W3C JSON-LD 1.1 specification says a node is identified with @id, preferably by an IRI, and that a node object holding only an @id is a reference to a node described elsewhere. That is the whole mechanism: describe a thing once, refer to it by name everywhere else.

Two limits to state plainly.

  • An @id does not have to resolve to a page. It is a name. Using a URL with a fragment, such as https://www.example-hospital.in/#organization, is a convention that gives you globally unique names under a domain you control.
  • Google's own Organization and local business documentation does not discuss @id. It points to url and sameAs for identifying an organisation, and asks for each physical location to be marked up as its own entity. A well-formed graph is good practice for any consumer of the data, but do not promise a specific effect in Google's results.

Google also does not guarantee that markup produces any feature, as its general guidelines state. The value here is a precise, internally consistent description of who is who.

The nodes you need

For a group called Example Hospitals with three campuses, the nodes fall into six families. The domain is hypothetical.

NodeTypeExample @idLives on
BrandOrganization (or MedicalOrganization)https://www.example-hospital.in/#organizationHome page
WebsiteWebSitehttps://www.example-hospital.in/#websiteHome page
CampusHospitalhttps://www.example-hospital.in/hospitals/gurugram/#hospitalCampus page
DepartmentOrganization nested through department.../hospitals/gurugram/cardiology/#departmentCampus department page
DoctorPhysician.../doctors/dr-example/#physicianDoctor profile
ServiceMedicalProcedure or MedicalTest.../treatments/angioplasty/#procedureTreatment page

Each page also gets a WebPage node with its own @id, such as .../hospitals/gurugram/#webpage. That node points to the entity it describes with mainEntity or about, and to the site with isPartOf.

Writing identifiers that survive

An @id is useful only if it never changes and never collides. Adopt these rules, and write them in your engineering handbook.

  1. Build it from the canonical URL. Use the canonical, absolute, https form with the preferred host. If your site flips between www and non-www, or trailing slash and none, your @id values will fork.
  2. Use a fragment to name the role. #hospital, #physician and #procedure leave room for the WebPage node to share the URL as #webpage.
  3. Make it independent of mutable data. Do not put a doctor's designation or a department's display name in the identifier. Use a slug that is fixed at creation time, or an internal ID.
  4. One entity, one identifier, everywhere. The campus appears on its own page, in the brand page's list of locations, in each doctor's affiliation and in every service listing, always under the same @id.
  5. Never reuse an @id for a different thing. If a campus closes and a new one opens at the same address, give the new one a new identifier.
  6. Generate, do not type. The identifier should come from one function in the codebase used by every template. Hand-typed values drift.

The edges that make it a graph

Nodes become a graph through the properties that connect them. These are all defined by schema.org.

FromPropertyToMeaning
Campus HospitalparentOrganizationBrandThe campus belongs to the brand
BrandsubOrganizationEach campusOptional reverse listing
Campus HospitaldepartmentDepartment nodesDepartments of this campus only
Campus HospitalavailableServiceProcedure and test nodesWhat the campus offers
Campus HospitalmedicalSpecialtySpecialty valuesConfirmed by the clinical team
Doctor PhysicianhospitalAffiliationCampus HospitalWhere the doctor practises
Page WebPageabout or mainEntityThe page's entityWhat the page is about
Page WebPageisPartOfWebSiteMembership
BrandsameAsOfficial external profilesIdentity anchors

Check the expected types. hospitalAffiliation on Physician expects a Hospital, and availableService on Hospital expects a MedicalProcedure, MedicalTest or MedicalTherapy. Organization defines department, parentOrganization and subOrganization with Organization values. A department is an Organization nested under a parent, which Google's local business guidance also describes: departments belong inside the department property of the main business, and an unbranded department is named with the business name followed by the department name.

A worked example, clearly hypothetical

Example Hospitals has campuses in Gurugram, Noida and Dwarka. The home page carries the brand, the website and the home WebPage. The brand lists no addresses of its own, since it is a company, not a place. It does list its three campuses by reference only.

The Gurugram page carries the Gurugram Hospital node in full: name, address, telephone, opening hours, geo coordinates, parentOrganization referencing the brand by @id, a department entry for each department that has its own timings, and availableService entries referencing procedure nodes by @id. It also contains the WebPage node for itself.

A doctor's profile page carries the Physician node in full. hospitalAffiliation refers to the Gurugram campus by @id alone, without redefining the hospital. If the doctor also consults at Noida, the page lists both campus references in visible text, and the markup affiliates the doctor with each Hospital node that the page genuinely supports.

Now compare the common alternative: one Hospital node on the brand page with three addresses, doctors with no affiliation, and no identifiers. Everything is on the page, but nothing says which doctor works where. The graph version answers "which doctor, at which campus, offering which procedure" without guessing.

Want this applied to your practice? Get a free seo audit.

Book my free audit

Decide where each node is defined in full

Each page is read on its own. Consumers of markup frequently see a single page without the rest of your site, so a reference-only node is meaningful only if the consumer also holds the full definition from another page. Do not depend on cross-page resolution unless the consumer documents it.

A practical rule: define every node the page is about in full, and define only the minimal facts (@id, @type, name, url) for the nodes it references. The doctor page defines the doctor in full and gives the campus a stub with its name and URL. The campus page defines the campus in full and gives the brand a stub.

Failure modes

  • Conflicting definitions. The same @id appears with different phone numbers on two pages. Pick one source of truth and generate from it.
  • Identifiers that change on redesign. A new CMS rewrites every URL and every @id with it. Keep identifiers in a stored field, not computed from slugs that change.
  • A group page typed as Hospital. The brand then competes with its own campuses. Keep the brand an organisation.
  • Departments as hospitals. A cardiology department with its own address is probably a clinic; one on the same premises is a department.
  • Doctors without affiliation. The edge that connects people to places is the one most often missing.
  • Stubs that drift. A stub carries an old campus name after a rename. Generate stubs from the same data as the full node.
  • Unseen content. Markup that lists services not shown on the page violates the visibility rule.

For hospital groups, the multi-location SEO service and the medical entity SEO service describe how we scope this kind of work.

Anchor each campus to the outside world

Identifiers inside your site describe your own graph. External anchors tie it to other records. On the brand node, sameAs can list the official social and encyclopaedic profiles. On each campus, sameAs can carry the URL of that campus's Business Profile or its listing on an accreditation body's directory, if the campus has one and the page links to it visibly. Never point two campuses at the same external profile, and never point a campus at the brand's profile.

Keep the campus name, address and telephone identical to the Business Profile for that campus. The NAP consistency glossary entry explains why. If one campus trades under a slightly different name, say so in visible text and keep the markup truthful to that.

Accreditation claims need the same discipline. If one campus holds an accreditation and the others do not, the claim belongs on that campus node and page only. Do not put it on the brand and let it imply coverage of all three. Ask the quality team for the exact accredited entity and current status before writing it down.

Validate the graph, not just the page

The Schema Markup Validator checks vocabulary, and the Rich Results Test checks Google feature eligibility. Neither tells you whether your graph is consistent across 300 pages. Build a check that crawls the site, collects every @id and its properties, and reports any @id with conflicting values, any reference to an @id never defined in full anywhere, and any Physician without an affiliation. That check belongs in your release process.

Where to start

Draw the graph for one campus on paper: brand, campus, two departments, three doctors and two procedures. Write the identifier convention and the function that creates identifiers. Implement it on that campus and its linked pages, run the consistency check, and have the clinical team confirm the services and specialties. Then roll out to the other campuses. If the group has a multi-location website, put the identifier function in the shared template, so each new campus gets its identifiers on day one.

Filed underJSON-LD @id graphJSON-LD for hospital groupmulti-location hospital schemaschema parentOrganization hospitalJSON-LD entity graphPhysician hospitalAffiliation

About the author

Co-Founder & CTO · Gurugram, India

Arush builds the systems the rest of the company runs on — the patient-acquisition pipelines, the AI chatbots, the analytics that tie a single click to a booked appointment. If a campaign reports a number, it's because something his team built is tracking it.

Free guide · 15 pages

The Patient Acquisition Blueprint

A 90-day plan from first search to booked appointment.

The Pioneers Brief — one essay, three benchmarks, one teardown, every Thursday. Subscribe free →

Free seo audit

Your next chapter starts with a conversation.

Three quick questions. We come prepared with a plan for your specialty and city.

  • A 30-minute call with a healthcare specialist
  • Your top three growth opportunities, in writing
  • Honest advice — even if that means not hiring us
  • No obligation and no hard sell
You’ll speak with a senior strategist
Consultations are hosted by Arush Thapar’s team.
Step 1 of 3Takes 30 seconds

What do you want to improve first?

Details stay privateNo obligationReply within 1 working day

Client portfolio · Healthcare websites

Work relevant to a connected json ld id graph for a multi location hospital.

Explore client work →