2

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?

4
  • 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? Commented Aug 8, 2015 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 Commented Aug 9, 2015 at 4: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. Commented Aug 9, 2015 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". 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. Commented Feb 25, 2016 at 4:40

1 Answer 1

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.

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.