如何将帖子/评论表示为开放图中的对象?

发布于 2024-12-24 02:18:15 字数 224 浏览 2 评论 0原文

开放图谱的一个限制是它只接受现实世界的对象,例如:电影、作者、新闻和乐队。我想使用更多非现实世界的对象,例如帖子、问题或评论。

有一个实体可能适合这种用途,即文章,但将其用于帖子(例如博客帖子)及其评论会有点不合适。

然而,还有另一种不太现实的类型,即新闻,我认为这可能适合这样的用例:博客文章作为文章,其评论作为新闻,这会很难看吗?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪痕残 2024-12-31 02:18:15

开放图谱允许您创建任何您想要的对象和操作。

在本例中,创建一个代表用户正在评论的对象的自定义对象和一个自定义操作“评论”。添加评论操作的自定义属性,用于存储评论文本。

对于帖子,您可以创建一个自定义对象“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文