Schema.NET icon indicating copy to clipboard operation
Schema.NET copied to clipboard

graph support enhancement

Open jtkent opened this issue 5 years ago • 6 comments

Do you have any plans to implement the @graph syntax to allow for mulitple JSON-types to be written at once.

Example: https://stackoverflow.com/questions/30505796/json-ld-schema-org-multiple-video-image-page/

This would allow for writing of only one script element rather than mulitple.

jtkent avatar Feb 04 '20 16:02 jtkent

Interesting. I was not aware of the @graph property. I think it would be fairly straightforward to add a new property to the base JsonLdObject class:

[DataMember(Name = "@type", Order = 1)]
public virtual string Type { get; }

[DataMember(Name = "@graph", Order = 2)]
public virtual Thing Graph { get; }

The only reall work will be to add some smarts to the JSON serializer to switch between using the type property or the graph property.

RehanSaeed avatar Feb 04 '20 16:02 RehanSaeed

This library is awesome, however missing support for entity graphs is a huge drawback.

https://yoast.com/regarding-googles-related-entities-patent/

vmateianu avatar Jun 15 '20 16:06 vmateianu

Would be willing to take a PR if you're really interested.

RehanSaeed avatar Jun 15 '20 16:06 RehanSaeed

Any news here? Is it possible to merge enclosed MR #182 ? It would be very useful for us.

maraerben avatar Mar 27 '23 12:03 maraerben

Hey @maraerben - Currently #182 is only the most surface level changes needed, I haven't yet got around to any further development for it. My last comment on the PR covers generally what I think we'd need to do for graph support but it has been a while since I've taken a deep dive at it.

I don't know when I'd be getting back to it myself so I'd definitely welcome any PRs to add graph support in the mean time.

Turnerj avatar Mar 29 '23 12:03 Turnerj

what is the status of @graph ?

wstaelens avatar Jul 12 '23 10:07 wstaelens