Core Concepts
Deduping Nodes
 On this page 
Deduplicating a node
When generating many of the Schema.org nodes a default global @id is used to help with best practices.
For example:
import { defineOrganization, useSchemaOrg } from '#imports'
useSchemaOrg([
  defineOrganization() // generates the nodes with an #identity id
])
This allows the node relations to be automatically mapped for best practices.
import { defineWebPage, useSchemaOrg } from '#imports'
useSchemaOrg([
  defineWebPage() // knows to link the #identity id
])
However, it can get in the way of
configuring multiple nodes of the same type. To get around this you should provide your own @id on the node:
import { defineOrganization, useSchemaOrg } from '#imports'
useSchemaOrg([
  defineOrganization({
    '@id': '#some-company'
  })
])
Replacing a node
If you're likd to replace a node, you can use provide a tagDuplicateStrategy to the useSchemaOrg composable.
import { defineOrganization, useSchemaOrg } from '#imports'
useSchemaOrg([
  defineOrganization({
    '@id': '#some-company',
    'name': 'Bar Company',
    'url': 'https://bar.com',
  }),
])
useSchemaOrg([
  defineOrganization({
    '@id': '#some-company',
    'name': 'Foo Company',
  })
], {
  tagDuplicateStrategy: 'replace'
})
// Replaced!
// {
//   '@id': '#some-company',
//   name: 'Foo Company',
// }
 Did this page help you?