In a discussion on groups.drupal.org, fago suggested to agree on a foaf:Person URI for each user profile. This is also on the wish list of Dan Brickley's feedback on the integration of RDFa in Drupal 7 (point 3).
Having core asserting this foaf:Person URI would prevent contrib modules to mint their own URI according to their own rules, which would lead to a mess. It would also make it easier for people to update their foaf file with the foaf:Person URI associated with their account on Drupal sites.
The reason for distinguishing between a sioc:User and a foaf:Person is that these types carry different information, e.g. a date of birth is associated with a foaf:Person, while a registration date or a username describe the user account (sioc:User).
Appending #me
to the user profile URI looks like a good pattern, e.g. http://example.com/user/4#me
The foaf:Person URI only needs to be added on the user profile page.
Comment | File | Size | Author |
---|---|---|---|
#16 | rdf_foafagent-uri_701672-16.patch | 4.17 KB | linclark |
#14 | rdf_foafagent-uri_701672-14.patch | 1.64 KB | linclark |
#10 | rdf_foafagent-uri_701672-10.patch | 4.78 KB | linclark |
#7 | rdf_foafagent-uri_701672-7.patch | 3.04 KB | linclark |
#5 | rdf_foafagent-uri_701672-5.patch | 853 bytes | linclark |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedAdding a wrapping div to the user that contains the foaf:account relationship with the foaf:Agent... Is this too hard-coded??
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
scor CreditAttribution: scor commentedlooks like what you're trying to do could be achieved with the rdf_metadata theme function, see how
rdf_metadata_attributes_array
is implemented in rdf_preprocess_comment() for example. It would also allow other modules to alter this markup if necessary, which they can't do if you're hard-coding it in HTML.Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedSetting the rdf_metadata_attributes_array does not work as expected when used with MODULE_preprocess_user_profile.
I have created an issue for this, #702664: theme_rdf_metadata doesn't work for most MODULE_preprocess_HOOK()
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThis patch adds the #me URI using rdf_metadata_attributes_array.
It is dependent on the patch from #702664: theme_rdf_metadata doesn't work for most MODULE_preprocess_HOOK().
I can write tests for this sometime this week.
Comment #6
scor CreditAttribution: scor commentedAt this stage since we're dependent on this other issue which might never move on, it's best to just add the following to the tag (like we do for node title):
The benefit is also that we get 2 triples for the price of one tag.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedThis patch adds a meta tag as per suggestion in #6 and a test.
Comment #8
aspilicious CreditAttribution: aspilicious commentedComment #9
scor CreditAttribution: scor commentedno need to use the lengthy
$variables['elements']['#account']
here: we already have all this information in$account
which contains the user object loaded at the beginning of rdf_preprocess_user_profile().Powered by Dreditor.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedThis patch also includes the relationship between the sioc:User and username.
Because the current rdf_preprocess_user_profile loads the logged in user into the $account variable, this is dependent on #711592: rdf_preprocess_user_profile uses currently logged in user to really work.
Comment #11
scor CreditAttribution: scor commentedlike when displaying a full node, we follow the same practice which is to include the name of the user in a meta tag at the top of the page. The main reason being that the title is tricky to annotate with RDFa, themers are likely to want to tweak it and we don't want them to have to deal with RDFa.
We could also remove " // @todo move to user.module". We've decided to keep that in rdf.module.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedThinking about this, should the typeof really be foaf:Person? There may be organization accounts, so should we use foaf:Agent instead?
Comment #13
scor CreditAttribution: scor commentedlet's go with foaf:Person for now and discuss this later. There will be a pre release patch to clean-up some non-used namespaces, and such a change could also be integrated (see #712538: Clean up RDF namespaces and mappings before Drupal 7 release).
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedRerolled... now with 1 fewer errant todo.
Comment #15
scor CreditAttribution: scor commentedlooks like we lost the tests...
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedHmmm... whooooops.
Here is the patch with the tests reincorporated.
Comment #17
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #18
scor CreditAttribution: scor commentedThanks Lin! tried the patch and works as intended.
Comment #19
scor CreditAttribution: scor commented#16: rdf_foafagent-uri_701672-16.patch queued for re-testing.
Comment #20
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #22
tourendal CreditAttribution: tourendal commentedSorry to comment on a closed bug. Let me know if this is worth opening a new bug...
I noticed, that in the meta tag of the profile HTML I get "/users/username#me" but in the RDF at '/users/1/rdf' I see "/users/username#this".
It would be nice if there weren't several URIs created for the same thing/person. Is this data from different modules? I don't fully understand the difference between data in RDF and RDFa in Drupal.
Best.
Comment #23
scor CreditAttribution: scor commented@Atrus, don't be sorry at all :) yes, this issue belongs to the RDF package in contrib, please an issue at http://drupal.org/project/issues/rdf?version=7.x
Comment #24
tourendal CreditAttribution: tourendal commentedThe bug is at #1139894: Person identifier "#me" vs. "#this" in Drupal's RDFa vs. RDF.
Scor, thanks for the warm welcome.
Comment #25
Liam MorlandThis now causes a validation error and should be removed or changed, see #2931842: Validation error with foaf:Person URI.