For SEO reasons I need to complete the Organization schema markup that is on a website but I only have access via javascript. I can't edit HTML, only JS and CSS overwrites. The Organization object is missing a telephone and other properties. I rather not to create a second Organization object that is complete and have the good and the bad version up in the site. I was wondering if it is possible to reference an existing object somehow via json-ld? or do you think I should just add a second object?
Asked
Active
Viewed 397 times
2
-
So the page already uses the syntax Microdata (`itemscope` etc.) and now you wonder if you should edit this Microdata via JavaScript, or if you should add a `script` element that contains JSON-LD, duplicating many of the properties already specified in Microdata? – unor Aug 08 '15 at 11:20
-
I actually had not think of the possibility of injecting more itemscopes in there for some reason; that may work too. I thought the only way to handle schema with JS was JSON-LD. Thanks – willdouglas Aug 09 '15 at 04:16
-
Yeah, if it’s dynamically generated, some consumers might only support JSON-LD (instead of Microdata/RDFa) -- this is [probably the case for Google](http://stackoverflow.com/a/29066759/1591669). – unor Aug 09 '15 at 18:41
-
`Google can read JSON-LD data even when it is dynamically injected into the page's contents, such as by Javascript code or embedded "widgets".` https://developers.google.com/structured-data/schema-org . I don't know how everyone else does it, but I think Microdata is read once on load. Google's Search Console let's you "fetch" or "fetch and render" which suggests that it uses both methods to parse data. You could always do both - it won't hurt anything. – Ken Sharp Feb 25 '16 at 04:40
1 Answers
1
I was wondering if it is possible to reference an existing object somehow via json-ld?
In practice, not really (theoretically you could give them the same identifier and when converted to RDF the data should be merged).
or do you think I should just add a second object?
I personally would do that. That way clients that (just) understand JSON-LD would get the complete information.

Markus Lanthaler
- 3,683
- 17
- 20