the rdf triple “Picasso’s first name is Pablo” as http://example.org/Picasso foaf:firstName "Pablo" Why is needed foaf, in front of :firstName?.It seems clear enough that :firstName refer to Pablo. Can ":firstName" be understood to refer to something else? It would generate an error if foaf or "http://xmlns.com/foaf/0.1/" would be missing?
Foaf purpose in front of :firstName
149 Views Asked by Bogdan AtThere are 2 best solutions below

RDF is all about trying to describe resources clearly.
If you used just firstName
(without a prefix) - as a person I can guess what you mean but as a computer it's not clear (maybe you mean the first name given to a project before the final project name is decided?).
In RDF we expect each usage to have a different URI so it is clear which type of first name is being used, e.g. http://xmlns.com/foaf/0.1/firstName
vs. http://example.com/project/firstName
.
So this expanded triple says exactly the same as yours: http://example.org/Picasso http://xmlns.com/foaf/0.1/firstName "Pablo"
URIs are long, so it's easier for humans to use a nickname for each - this is where readable prefixes come from. You need to specify which nickname maps to which base URI.
Technically you can decide to specify that something else like foobar
means http://xmlns.com/foaf/0.1/
(e.g. foobar:firstName
), but FOAF is widely known, so most people use foaf:firstName
.
What you have been shown on screen in your example is foaf:firstName
, but the system that showed it to you will will somewhere have a definition of what foaf:
actually represents, i.e. http://xmlns.com/foaf/0.1/
.
foaf
(friend of a friend) is just a standard way of referring in your rdf triple which contains the predicatesfirstName
/lastName
andhttp://xmlns.com/foaf/0.1/
is the URI for that. You can, however, choose any meaningful URI to denote thefirstName
. However, please note that when your data is shared across other applications, you should use something generic which is understood and recognized by the other applications. Sofoaf
would be the right choice.