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
@iddoes not have to resolve to a page. It is a name. Using a URL with a fragment, such ashttps://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 tourlandsameAsfor 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.
| Node | Type | Example @id | Lives on |
|---|---|---|---|
| Brand | Organization (or MedicalOrganization) | https://www.example-hospital.in/#organization | Home page |
| Website | WebSite | https://www.example-hospital.in/#website | Home page |
| Campus | Hospital | https://www.example-hospital.in/hospitals/gurugram/#hospital | Campus page |
| Department | Organization nested through department | .../hospitals/gurugram/cardiology/#department | Campus department page |
| Doctor | Physician | .../doctors/dr-example/#physician | Doctor profile |
| Service | MedicalProcedure or MedicalTest | .../treatments/angioplasty/#procedure | Treatment 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.
- Build it from the canonical URL. Use the canonical, absolute, https form with the preferred host. If your site flips between
wwwand non-www, or trailing slash and none, your@idvalues will fork. - Use a fragment to name the role.
#hospital,#physicianand#procedureleave room for theWebPagenode to share the URL as#webpage. - 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.
- 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. - Never reuse an
@idfor a different thing. If a campus closes and a new one opens at the same address, give the new one a new identifier. - 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.
| From | Property | To | Meaning |
|---|---|---|---|
Campus Hospital | parentOrganization | Brand | The campus belongs to the brand |
| Brand | subOrganization | Each campus | Optional reverse listing |
Campus Hospital | department | Department nodes | Departments of this campus only |
Campus Hospital | availableService | Procedure and test nodes | What the campus offers |
Campus Hospital | medicalSpecialty | Specialty values | Confirmed by the clinical team |
Doctor Physician | hospitalAffiliation | Campus Hospital | Where the doctor practises |
Page WebPage | about or mainEntity | The page's entity | What the page is about |
Page WebPage | isPartOf | WebSite | Membership |
| Brand | sameAs | Official external profiles | Identity 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.




