In a database, information stored in tables have a primary key. Primary keys are unique only for this specific table. A resource is a piece of information which contains system-wide unique key. This is usually achieved by adding a prefix in front of the primary key. i.e. a news item with an id of 500 has a resource id of news:500, which is unique system wide.
A resource is not necessarily stored in the database. It can be information retrieved by i.e. Invoking a web service or stored in an xml file in the disk.
A resource -id is not necessarily in the form of prefix:number. If for example your table has 2 primary keys, the resource id can be prefix:id1,id2 . If your information has a string as a unique key, then the resource id is prefix:string .
Some example resource ids:
"news:100" , a news article. In db the primary key has a value of 100.
"book:200" , a book
"user:100" , a user
"relation:400,500" , a relation from id 400 to id 500
No comments:
Post a Comment