|
I want to express some many to many relatinships from a database in RDF format. For example user A rated Item B with value C. How I have to express a many to many relationship in rdf? I am thinking of using a blank node. Example: user:1 item:ratting [ _:1 item:id "5";item:ratting-number "10".] In order to express that user 1 rated item 5 with 10. Is there a better way to do that? |
|
The approach you suggest is certainly a good option. Another popular approach is treating the relation as an object, e.g. for your example:
Though in this approach I would personally choose to create a new URI for the rating-object, rather than using a blank node, e.g. 'item:rating1'. There is a W3C Note that discusses several approaches to modeling n-ary relations in RDF, which might be worth looking into. Thank you for your imidiate response! I was thinking to use a blank node because I dont have an actual URI for the relation 3
Well, you certainly can use blank nodes, nothing wrong with that in principle, but not having a URI is no excuse: simply create one on the fly :) |

