RDF 的模板系统?
RDF 是一个用于表示数据的无模式系统。然而,大多数时候我发现自己正在编写一种众所周知的图结构,并且我必须一个接一个地构建。 在更一般的情况下,这个众所周知的图结构当然不能保证完整或固定(例如可以添加其他东西)。然而,如果存在或多或少不变的主干,最好用占位符描述该主干,然后传递上下文以生成完全部署的 RDF 图。
Python 中存在这样的东西吗?
RDF is a schema-free system to represent data. However, most of the time I find myself writing a sort of well-known graph structure, and I have to build triple by triple.
In the more general case, this well known graph structure is of course not guaranteed to be complete nor fixed (e.g. something else can be added). However, if a more or less invariant backbone exists, it would be nice to describe this backbone with placeholders and then pass a context to produce the fully deployed RDF graph.
Does something like this exist in Python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来有点像使用 SPARQL
CONSTRUCT
查询来制作最终图表。针对图表运行常规查询 (WHERE {}
) 以形成一些变量绑定,然后使用CONSTRUCT {}
块将模板化图表变成最终答案。任何现代 rdf 库都应该支持 SPARQL。Sounds a little like using a SPARQL
CONSTRUCT
query to make the final graph. Run a regular query (WHERE {}
) against a graph to form some variable bindings and then use theCONSTRUCT {}
block to make the templated graph into your final answer. Any modern rdf library should have support for SPARQL.