在RDF中自动添加具有增量值的记录
我想记录匿名用户“喜欢”记录:
user:1 vocab:likes record:123234 .
user:2 vocab:likes record:124534 .
有没有办法在 rdf/turtle 中添加增量值而不明确说明它们?
I want to record anonymous users 'liking' records:
user:1 vocab:likes record:123234 .
user:2 vocab:likes record:124534 .
Is there a way to add incremental values in rdf/turtle without explicitly stating them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 RDF 数据模型中没有任何内容允许您创建顺序 URI。也许您可以查看 RDF 接下来的步骤,看看是否有有东西要来了。最接近的可能是 RDF 列表,我强烈不推荐它,它们很难在应用程序级别处理。
我也不会使用 bNode,因为它们会在很多方面限制您的应用程序的功能。创建对象后,您将无法对其进行进一步链接。我总是尽可能避免创建 bNode。
大多数时候,您可以使用哈希函数来创建 URI。例如,如果您的应用程序处理唯一的用户 ID,那么您可以执行以下操作:
对于记录,如果您有唯一的信息,请使用它来生成 URI,或者在最坏的情况下使用基于时间戳的 URI。
这不是最聪明的解决方案,但它确实有效。
I don't think there is nothing in the RDF Data Model that allows you to create sequential URIs. Maybe you could have a look to the RDF next steps to see if there is something coming. The closest thing might RDF Lists which I strongly not recommend, they are difficult to handle at the application level.
I would not use bNodes either because they will limit the ability of your app in many ways. You won't be able to do further linking of the object once you've created it. I always avoid creating bNodes whenever is possible.
Most of the times there is hash function that you could use to create URIs. For instance if your app handles unique user ids then you could do:
For the records if you have unique piece of information use it to generate the URI or in the worst case scenario use a timestamp based URI.
It is not the smartest solution but it works.
我不确定我是否正确理解了你所追求的。假设您想要主题
user:n
部分使用某种匿名资源,您可以使用空白节点,例如:I'm not sure I understood correctly what you're after. Assuming you want some kind of anonymous resource for the subject
user:n
part, you can use blank nodes, like: