如何将帖子/评论表示为开放图中的对象?
开放图谱的一个限制是它只接受现实世界的对象,例如:电影、作者、新闻和乐队。我想使用更多非现实世界的对象,例如帖子、问题或评论。
有一个实体可能适合这种用途,即文章,但将其用于帖子(例如博客帖子)及其评论会有点不合适。
然而,还有另一种不太现实的类型,即新闻,我认为这可能适合这样的用例:博客文章作为文章,其评论作为新闻,这会很难看吗?
One limitation in Open Graph that it accepts only real-world objects like: Movie, Author, News and Band. I would like to use with more non-real-world objects like a post, question or a comment.
There is one entity that might fit in such use which is the Article, but using it for both a post (e.g. blog post) and it's comments would be a little inappropriate.
However there is another not very real-world type which is News I though that this might fit in such use case: Blog Post as Article and it's comments as News, would this be ugly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
开放图谱允许您创建任何您想要的对象和操作。
在本例中,创建一个代表用户正在评论的对象的自定义对象和一个自定义操作“评论”。添加评论操作的自定义属性,用于存储评论文本。
对于帖子,您可以创建一个自定义对象“post”和一个自定义操作“authored” - 生成诸如“{user} 创作了 {post title}” 之类的故事 - 您可以使用 write、posted 等作为创作的替代方案。
The Open Graph allows you to create any objects and actions you want.
In this case, create a custom object which represents the object the user is commenting on and a custom action "comment". Add a custom property of the comment action which stores the text of the comment.
For posts, you can create a custom object "post" and a custom action "authored" - resulting in stories like "{user} authored {post title}" - you could use wrote, posted etc as alternatives to authored.