Since default.install now creates a taxonomy and image field, we might as well annotate them with the proper RDF mapping! It's also a good example showing how to use the RDF Mapping API.

Comments

scor’s picture

Status: Active » Needs review
StatusFileSize
new619 bytes

and here is a simple patch which should not cause any trouble to the bot.

Anonymous’s picture

I wonder if we might want to use media:image for the image predicate instead. Right now, it implies that the image depicts the node, which I'm not sure is accurate.

Here are the specs for comparison:

media:image
An image of something. Use this property to relate a document to an Image object embedded in it or in general to relate an object to an image representation of that object.

foaf:depiction
The foaf:depiction property is a relationship between a thing and an foaf:Image that depicts it.

Anonymous’s picture

I discussed this with cygri, he also believes that foaf:depiction is not quite accurate here since the image isn't really a visual depiction of the node itself or even necessarily a depiction of the concept talked about in the node.

He recommended looking for a predicate that is closer to a 'featured image' concept, but said that a safe fallback would be the generic dc:related. The only thing I could find was hasPageImage from the document vocabulary of Mindswap, but I don't think that is widely deployed.

In addition to whatever main predicate we use, I think we should also include media:image. GoodRelations does this, citing is as a Yahoo! recommendation (which probably means something for Search Monkey results).

scor’s picture

That's great. I'm fine with either, as long as we have something to relate the image to the node :) feel free to reroll.

Anonymous’s picture

This uses dc:relation and media:image to annotate the relationship between node and image.

Because dc:relation is general, we should make the rdf type explicit (ie foaf:Image). I have created an issue, #642596: Annotate images with RDFa 'typeof'

scor’s picture

Status: Needs review » Needs work

I can't dereference http://purl.org/media#image.

rapper -g http://purl.org/media# | grep image returns only the triple:

<http://purl.org/media#depiction> <http://www.w3.org/2000/01/rdf-schema#comment> "An image summary of the media recording."@en .

which is not what I expected. Lin, can you point me to the document where you found a definition for media:image?

scor’s picture

I'd like to settle on rdfs:seeAlso for the description of the image. I'm not happy with the Yahoo! media vocabulary because it does not dereference, and SearchMonkey seems to understand rdfs:seeAlso anyways.

scor’s picture

+++ profiles/default/default.install	25 Nov 2009 13:05:19 -0000
@@ -180,6 +180,14 @@ function default_install() {
+          'predicates' => array('foaf:topic'),

I think sioc:topic might be more appropriate here, SearchMonkey recognizes this property as part of the Discussion objects. Also the domain of foaf:topic is foaf:Document, which means that if we want to described sioc:Items for example we need something more generic like sioc:topic which has no domain restriction.

Anonymous’s picture

StatusFileSize
new800 bytes

Good point about sioc:topic.

I removed media:image. I also replaced dc:relation with rdfs:seeAlso because they are similar in how general they are.

Because rdfs:seeAlso is so general, it makes #642596: Annotate images with RDFa 'typeof' all the more important. I forgot that I was going to write a basic test for that, will work on it soon.

Anonymous’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: -RDF, -RDFa

The last submitted patch failed testing.

Status: Needs work » Needs review
Issue tags: +RDF, +RDFa

Re-test of from comment #2385212 was requested by @user.

scor’s picture

Status: Needs review » Reviewed & tested by the community

looks good. RTBC

Status: Reviewed & tested by the community » Needs review

Re-test of default_install-field_mapping-632484-9.patch from comment #9 was requested by webchick.

scor’s picture

Status: Needs review » Needs work

This will need a reroll since profiles/default/default.install was renamed to profiles/standard/standard.install in #420358: Write clear install profile descriptions.

aspilicious’s picture

StatusFileSize
new719 bytes

I'll try this...

apparently this isn't working...
What am i doing wrong...

aspilicious’s picture

StatusFileSize
new719 bytes

maybe "patch" isn't allow in name?

EDIT: i give up

lilou’s picture

Status: Needs work » Needs review
aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

green

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Could someone please change the tabs => spaces and re-upload?

aspilicious’s picture

StatusFileSize
new768 bytes

Another try, srry webchick.
Hopefully this is a good one...

aspilicious’s picture

Status: Needs work » Needs review

needs testbot review

scor’s picture

Status: Needs review » Needs work

aspilicious : Great to see you posting your first patch. The indentation of the context line 'rdftype' is not right and the patch does not apply. Did you edit the patch file? If so, that's not recommended, you should only edit the actual files (standard.install here), roll the patch (with cvs diff) and post it. The best way to reroll this patch is to edit standard.install and paste the following right after 'rdftype' => array('sioc:Item', 'foaf:Document'),:

        'field_image' => array(
          'predicates' => array('rdfs:seeAlso'),
          'type' => 'rel',
        ),
        'taxonomy_tags' => array(
          'predicates' => array('sioc:topic'),
          'type' => 'rel',
        ),

With some context, standard.install should look like:

    array(
      'type' => 'node',
      'bundle' => 'article',
      'mapping' => array(
        'rdftype' => array('sioc:Item', 'foaf:Document'),
        'field_image' => array(
          'predicates' => array('rdfs:seeAlso'),
          'type' => 'rel',
        ),
        'taxonomy_tags' => array(
          'predicates' => array('sioc:topic'),
          'type' => 'rel',
        ),
      ),
    ),
aspilicious’s picture

StatusFileSize
new781 bytes

thnx scor...

so maybe this one works lol

aspilicious’s picture

Status: Needs work » Needs review
scor’s picture

Status: Needs review » Needs work
+++ profiles/standard/standard.install	6 Jan 2010 14:13:14 -0000
@@ -255,6 +255,14 @@
+        'field_image' => array(
+            'predicates' => array('rdfs:seeAlso'),
+            'type' => 'rel',

Your editor might be messing up the indentation. According to the Drupal coding standards, you should use 2 spaces for indenting (not 4 spaces). The indentation of the 4 four lines 'predicates'..., 'type'..., 'predicates'..., 'type'... need to be fixed (remove 2 spaces from each).

Powered by Dreditor.

aspilicious’s picture

Status: Needs work » Needs review
StatusFileSize
new742 bytes

Im wondering how many times i gotta do this again...
Thnx for your patience!

aspilicious’s picture

StatusFileSize
new796 bytes

certainly one more time

Status: Needs review » Needs work

The last submitted patch, another_another_try2.patch, failed testing.

aspilicious’s picture

StatusFileSize
new773 bytes

I rly suck in committing a fucking easy patch!

Fuck windows endings
Fuck tabs
Fuck 4 spaces

Maybe shouting works....

aspilicious’s picture

Status: Needs work » Needs review
scor’s picture

I can't help you since I'm not a Windows user, but you could look at http://drupal.org/node/323 and http://drupal.org/node/60234 to learn how to roll patches on Windows. However this patch applies and looks good, let's wait for the testing bot results.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

MHHAHAHAHAHAHAHAHAHAHHAHAHA

scor’s picture

Status: Reviewed & tested by the community » Needs review

@aspilicious: it's generally frown upon to RTBC your own patch: the "needs review" status is not only for the testing bot, but also and foremost for other people from the community to review the patches. Peer review is what makes Drupal core code better quality, and it also saves time for webchick and Dries since other people are likely to catch bugs, typos, coding standards etc.

I'm going to leave this as "needs review" for now as I'm just thinking we might want to also add sioc:Post as rdftype of article.

aspilicious’s picture

srry, i'll be slower....

Anonymous’s picture

Initially, I agreed about sioc:Post, but reviewing the definition of sioc:Post this morning changed my mind.

It seems that sioc:Post is really focused on community sites. For instance, in the definition of sioc:Item, it says "[A subclass of sioc:Item is] sioc:Post, used to describe articles or messages created within online community Sites." sioc:Posts are also supposed to be submitted to a forum, and the definition of forum implies interactivity.

In contrast, I can see a lot of people using the Article content type as a container for their news and press releases on brochure-ware sites and turning off comments, so I think this might stretch the definition.

scor’s picture

I agree article will be used to many different use cases and we cannot know in advance what people will use it for, hence we need to keep the mapping generic. The only thing we know almost for sure is that it'll have comments enabled and thus enable some form of discussion (though not in a forum setting you Lin points out). Many will use it as a single user blog I think, though that's just one use case out of many.

Anonymous’s picture

The user might also turn off comments on the Article type—I know I did that frequently for University department sites, using the default Story content type with comments turned off for the News section.

scor’s picture

Status: Needs review » Reviewed & tested by the community

right, so really we can't be more specific here wrt to the mapping, and it's best to let the user choose more specific mappings (if she cares to do so) via the rdf contrib module.

scor’s picture

When are we required to implement update functions for non code changes? if it's after the first alpha release, then we should really get this patch committed before Friday: the RDF mappings are stored in the db upon installation.

scor’s picture

StatusFileSize
new626 bytes

rerolled patch.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

scor’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.09 KB

This is a follow up on the best way to describe the relation between a node and its image as discussed in #2 onwards. At the time there was no explicit property to link an article to its featured image, but with the Open Graph protocol, we now have og:image which matches this use case perfectly.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Good call, this does seem to be a fit. The OG namespace doesn't dereference, but I checked the docs and the namespace is correct.

RTBC.

scor’s picture

@linclark, I'm working with the Facebook team to fix the namespace which should dereference pretty soon. This doesn't hold up this patch though.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

gábor hojtsy’s picture

Status: Fixed » Closed (fixed)
Issue tags: -RDF, -RDFa

Automatically closed -- issue fixed for 2 weeks with no activity.