Automatically add records with incremental values in RDF
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?开发者_Python百科
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:
user:msalvadores vocab:likes record:hashRecordId1 .
user:significance vocab:likes record:hasRecordId2 .
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.
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:
[] vocab:likes record:r123234 .
[] vocab:likes record:r123234, record:r124534 . # this anon. user likes two records
精彩评论