diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-10 16:37:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-10 16:37:19 +0000 |
commit | e892ed5c317f7d37da09a2ad3a0e113703437b10 (patch) | |
tree | 6da9fe80374cabfe7885ff0c0d547468649353bd /modules | |
parent | b225882e5e8adfe6a3f21dbd7f1e8f858cd41c79 (diff) | |
download | brdo-e892ed5c317f7d37da09a2ad3a0e113703437b10.tar.gz brdo-e892ed5c317f7d37da09a2ad3a0e113703437b10.tar.bz2 |
- Patch #712538 by scor: clean up RDF namespaces and mappings before Drupal 7 release.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/comment.test | 6 | ||||
-rw-r--r-- | modules/rdf/rdf.module | 9 | ||||
-rw-r--r-- | modules/rdf/rdf.test | 8 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 11 | ||||
-rw-r--r-- | modules/user/user.module | 2 |
5 files changed, 15 insertions, 21 deletions
diff --git a/modules/comment/comment.test b/modules/comment/comment.test index ab81035ff..43f3c26ae 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -1180,7 +1180,7 @@ class CommentRdfaTestCase extends CommentHelperCase { // Tests comment #2 as anonymous user. $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user); // Tests the RDFa markup for the homepage (specific to anonymous comments). - $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:User" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); + $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); $this->assertTrue(!empty($comment_homepage), t('RDFa markup for the homepage of anonymous user found.')); // There should be no about attribute on anonymous comments. $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[@about]'); @@ -1191,7 +1191,7 @@ class CommentRdfaTestCase extends CommentHelperCase { $this->drupalGet('node/' . $this->node2->nid); $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user); // Tests the RDFa markup for the homepage (specific to anonymous comments). - $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:User" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); + $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); $this->assertTrue(!empty($comment_homepage), t("RDFa markup for the homepage of anonymous user found.")); // There should be no about attribute on anonymous comments. $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[@about]'); @@ -1216,7 +1216,7 @@ class CommentRdfaTestCase extends CommentHelperCase { $comment_date = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//*[contains(@property, "dc:date") and contains(@property, "dc:created")]'); $this->assertTrue(!empty($comment_date), t("RDFa markup for the date of the comment found.")); // The author tag can be either a or span - $comment_author = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/*[contains(@class, "username") and @typeof="sioc:User" and @property="foaf:name"]'); + $comment_author = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/*[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name"]'); $name = empty($account["name"]) ? $this->web_user->name : $account["name"] . " (not verified)"; $this->assertEqual((string)$comment_author[0], $name, t("RDFa markup for the comment author found.")); $comment_body = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//div[@class="content"]//div[contains(@class, "comment-body")]//div[@property="content:encoded"]'); diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 78dfb6e34..0c6ea4f8a 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -77,7 +77,6 @@ define('RDF_DEFAULT_BUNDLE', ''); */ function rdf_rdf_namespaces() { return array( - 'admin' => 'http://webns.net/mvcb/', 'content' => 'http://purl.org/rss/1.0/modules/content/', 'dc' => 'http://purl.org/dc/terms/', 'foaf' => 'http://xmlns.com/foaf/0.1/', @@ -85,10 +84,8 @@ function rdf_rdf_namespaces() { 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', 'rss' => 'http://purl.org/rss/1.0/', - 'tags' => 'http://www.holygoat.co.uk/owl/redwood/0.1/tags/', 'sioc' => 'http://rdfs.org/sioc/ns#', 'sioct' => 'http://rdfs.org/sioc/types#', - 'ctag' => 'http://commontag.org/ns#', 'skos' => 'http://www.w3.org/2004/02/skos/core#', 'xsd' => 'http://www.w3.org/2001/XMLSchema#', ); @@ -439,7 +436,7 @@ function rdf_process(&$variables, $hook) { function rdf_preprocess_node(&$variables) { // Adds RDFa markup to the node container. The about attribute specifies the // URI of the resource described within the HTML element, while the typeof - // attribute indicates its RDF type (foaf:Document, or sioc:User, etc.). + // attribute indicates its RDF type (foaf:Document, or sioc:Person, etc.). $variables['attributes_array']['about'] = empty($variables['node_url']) ? NULL: $variables['node_url']; $variables['attributes_array']['typeof'] = empty($variables['node']->rdf_mapping['rdftype']) ? NULL : $variables['node']->rdf_mapping['rdftype']; @@ -549,8 +546,8 @@ function rdf_preprocess_user_profile(&$variables) { $variables['attributes_array']['typeof'] = $account->rdf_mapping['rdftype']; $variables['attributes_array']['about'] = url($uri['path'], $uri['options']); } - // Adds the relationship between the sioc:User and the foaf:Person who holds - // the account. + // Adds the relationship between the sioc:UserAccount and the foaf:Person who + // holds the account. $account_holder_meta = array( '#tag' => 'meta', '#attributes' => array( diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index 6182717f8..f6b28c27a 100644 --- a/modules/rdf/rdf.test +++ b/modules/rdf/rdf.test @@ -322,7 +322,7 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase { $account_uri = url('user/' . $user2->uid); $person_uri = url('user/' . $user2->uid, array('fragment' => 'me')); - $user2_profile_about = $this->xpath('//div[@class="profile" and @typeof="sioc:User" and @about=:account-uri]', array( + $user2_profile_about = $this->xpath('//div[@class="profile" and @typeof="sioc:UserAccount" and @about=:account-uri]', array( ':account-uri' => $account_uri, )); $this->assertTrue(!empty($user2_profile_about), t('RDFa markup found on user profile page')); @@ -331,7 +331,7 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase { ':person-uri' => $person_uri, ':account-uri' => $account_uri, )); - $this->assertTrue(!empty($user_account_holder), t('URI created for account holder and username set on sioc:User.')); + $this->assertTrue(!empty($user_account_holder), t('URI created for account holder and username set on sioc:UserAccount.')); $user_username = $this->xpath('//meta[@about=:account-uri and contains(@property, "foaf:name") and @content=:username]', array( ':account-uri' => $account_uri, @@ -346,7 +346,7 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase { $this->drupalGet('node/' . $node->nid); // Ensures the default bundle mapping for user is used on the Authored By // information on the node. - $author_about = $this->xpath('//a[@typeof="sioc:User" and @about=:account-uri and @property="foaf:name" and contains(@xml:lang, "")]', array( + $author_about = $this->xpath('//a[@typeof="sioc:UserAccount" and @about=:account-uri and @property="foaf:name" and contains(@xml:lang, "")]', array( ':account-uri' => $account_uri, )); $this->assertTrue(!empty($author_about), t('RDFa markup found on author information on post. xml:lang on username is set to empty string.')); @@ -466,7 +466,7 @@ class RdfTrackerAttributesTestCase extends DrupalWebTestCase { $this->assertTrue(!empty($tracker_title), t('Title property attribute found on @user content.', array('@user'=> $user))); // Tests whether the relationship between the content and user has been set. - $tracker_user = $this->xpath('//tr[@about=:url]//td[contains(@rel, "sioc:has_creator")]//*[contains(@typeof, "sioc:User") and contains(@property, "foaf:name")]', array(':url' => $url)); + $tracker_user = $this->xpath('//tr[@about=:url]//td[contains(@rel, "sioc:has_creator")]//*[contains(@typeof, "sioc:UserAccount") and contains(@property, "foaf:name")]', array(':url' => $url)); $this->assertTrue(!empty($tracker_user), t('Typeof and name property attributes found on @user.', array('@user'=> $user))); // There should be an about attribute on logged in users and no about // attribute for anonymous users. diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 1738014b2..8f9786dac 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1421,12 +1421,9 @@ function taxonomy_rdf_mapping() { 'description' => array( 'predicates' => array('skos:definition'), ), - // The vocabulary this term belongs to. The type 'rev' is used to denote - // the fact that the skos:member property domain is skos:Collection and - // its range is skos:Concept or skos:Collection. 'vid' => array( - 'predicates' => array('skos:member'), - 'type' => 'rev', + 'predicates' => array('skos:inScheme'), + 'type' => 'rel', ), 'parent' => array( 'predicates' => array('skos:broader'), @@ -1438,9 +1435,9 @@ function taxonomy_rdf_mapping() { 'type' => 'taxonomy_vocabulary', 'bundle' => RDF_DEFAULT_BUNDLE, 'mapping' => array( - 'rdftype' => array('skos:Collection'), + 'rdftype' => array('skos:ConceptScheme'), 'name' => array( - 'predicates' => array('rdfs:label'), + 'predicates' => array('dc:title'), ), 'description' => array( 'predicates' => array('rdfs:comment'), diff --git a/modules/user/user.module b/modules/user/user.module index 1441dc831..dc1c0c1d4 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -3522,7 +3522,7 @@ function user_rdf_mapping() { 'type' => 'user', 'bundle' => RDF_DEFAULT_BUNDLE, 'mapping' => array( - 'rdftype' => array('sioc:User'), + 'rdftype' => array('sioc:UserAccount'), 'name' => array( 'predicates' => array('foaf:name'), ), |