← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~sinzui/launchpad/rdf-links-1 into lp:launchpad/devel

 

Curtis Hovey has proposed merging lp:~sinzui/launchpad/rdf-links-1 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #6405 /rdf page doesn't provide access to RDF exports
  https://bugs.launchpad.net/bugs/6405
  #660832 invalid syntax on team members RDF
  https://bugs.launchpad.net/bugs/660832


This is my branch to use foaf to specify membership and ownership.

    lp:~sinzui/launchpad/rdf-links-1
    Diff size: 164
    Launchpad bug: https://bugs.launchpad.net/bugs/660832
    Test command: ./bin/test -vv -t rdf
    Pre-implementation: no one
    Target release: 10.11


Use foaf to specify membership and ownership
---------------------------------------------

A recent change to Launchpad (james_w at #launchpad mentioned
https://code.edge.launchpad.net/~sinzui/launchpad/rdf-links-0/+merge/36475)
broke the RDF syntax for the team members list.

Looks like the lp's OWL never expected to use its own specifiedAt as a member.
However, I do not think the lp:specifiedAt is needed. We can express this in
FOAF and FOAF is good. lp:owner will also need updating.


Rules
-----

    * Teams will use:
      <foaf:Group>
        <foaf:member rdf:resource="/~user-id/+rdf"/>
      </foaf:Group>
    * Projects, products, and releases will use:
      <lp:owner>
        <foaf:Agent>
          <foaf:Account rdf:resource="/~user-id/+rdf"/>
        </foaf:Agent>
      </lp:owner>

QA
--

>From a python console with python-rdflib installed run this:
      from rdflib.Graph import Graph
      g = Graph()
      g.parse('https://edge.launchpad.net/~getdeb-uploaders/+rdf')
      g.parse('https://edge.launchpad.net/~sinzui/+rdf')
      g.parse('https://edge.launchpad.net/gdp/+rdf')
      g.parse('https://edge.launchpad.net/launchpad-project/+rdf')


Lint
----

Linting changed files:
  lib/lp/registry/stories/person/xx-person-rdf.txt
  lib/lp/registry/stories/product/xx-product-rdf.txt
  lib/lp/registry/stories/project/xx-project-rdf.txt
  lib/lp/registry/templates/person-rdf-contents.pt
  lib/lp/registry/templates/product-rdf.pt
  lib/lp/registry/templates/productrelease-rdf.pt
  lib/lp/registry/templates/project-rdf.pt

^ There are indentation problems in the tests. I will fix these after the
review so that the diff does not hide my changes.


Test
----

Revised test to verify foaf markup.
    * lib/lp/registry/stories/person/xx-person-rdf.txt
    * lib/lp/registry/stories/product/xx-product-rdf.txt
    * lib/lp/registry/stories/project/xx-project-rdf.txt


Implementation
--------------

Updated member markup
    * lib/lp/registry/templates/person-rdf-contents.pt

Updated owner markup:
    * lib/lp/registry/templates/product-rdf.pt
    * lib/lp/registry/templates/productrelease-rdf.pt
    * lib/lp/registry/templates/project-rdf.pt
-- 
https://code.launchpad.net/~sinzui/launchpad/rdf-links-1/+merge/38573
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/rdf-links-1 into lp:launchpad/devel.
=== modified file 'lib/lp/registry/stories/person/xx-person-rdf.txt'
--- lib/lp/registry/stories/person/xx-person-rdf.txt	2010-09-23 04:29:51 +0000
+++ lib/lp/registry/stories/person/xx-person-rdf.txt	2010-10-15 17:31:06 +0000
@@ -1,4 +1,5 @@
-= Person RDF Pages =
+Person RDF Pages
+================
 
 We export FOAF RDF metadata from the /~Person.name/+index document.
 
@@ -9,7 +10,9 @@
     >>> print soup.renderContents()
     <link rel="meta" type="application/rdf+xml" title="FOAF" href="+rdf" />
 
-== Individual RDF ==
+
+Individual RDF
+--------------
 
 And this is what the FOAF document for an individual actually looks
 like. It includes GPG information, if the user has any.
@@ -54,7 +57,9 @@
     >>> print document.documentElement.nodeName
     rdf:RDF
 
-== Team RDF ==
+
+Team RDF
+--------
 
 Teams also have an RDF export, which includes information for each
 member of the team. Let's add a logo to Mark's user so we can see the
@@ -79,21 +84,16 @@
       <foaf:Group>
         <foaf:name>testing Spanish team</foaf:name>
         <foaf:nick>testing-spanish-team</foaf:nick>
-        <foaf:member>
-            <lp:specifiedAt rdf:resource="/~carlos/+rdf"/>
-        </foaf:member>
-        <foaf:member>
-          <lp:specifiedAt rdf:resource="/~name16/+rdf"/>
-        </foaf:member>
-        <foaf:member>
-          <lp:specifiedAt rdf:resource="/~mark/+rdf"/>
-        </foaf:member>
+        <foaf:member rdf:resource="/~carlos/+rdf"/>
+        <foaf:member rdf:resource="/~name16/+rdf"/>
+        <foaf:member rdf:resource="/~mark/+rdf"/>
     ...
       </foaf:Group>
     </rdf:RDF>
 
 
-== Corner Cases ==
+Corner Cases
+------------
 
 Note how ascii and non-ascii names are rendered properly:
 
@@ -127,3 +127,5 @@
         <foaf:nick>name21</foaf:nick>
       </foaf:Group>
     </rdf:RDF>
+
+

=== modified file 'lib/lp/registry/stories/product/xx-product-rdf.txt'
--- lib/lp/registry/stories/product/xx-product-rdf.txt	2010-09-23 04:29:51 +0000
+++ lib/lp/registry/stories/product/xx-product-rdf.txt	2010-10-15 17:31:06 +0000
@@ -13,7 +13,9 @@
       <lp:title>Mozilla Firefox</lp:title>
   ...
       <lp:owner>
-        <lp:specifiedAt rdf:resource="/~name12/+rdf"/>
+        <foaf:Agent>
+          <foaf:Accoun rdf:resource="/~name12/+rdf"/>
+        </foaf:Agent>
       </lp:owner>
   ...
     </lp:Product>

=== modified file 'lib/lp/registry/stories/project/xx-project-rdf.txt'
--- lib/lp/registry/stories/project/xx-project-rdf.txt	2010-09-23 04:29:51 +0000
+++ lib/lp/registry/stories/project/xx-project-rdf.txt	2010-10-15 17:31:06 +0000
@@ -13,7 +13,9 @@
       <lp:title>The Mozilla Project</lp:title>
   ...
       <lp:owner>
-        <lp:specifiedAt rdf:resource="/~name12/+rdf"/>
+        <foaf:Agent>
+          <foaf:Accoun rdf:resource="/~name12/+rdf"/>
+        </foaf:Agent>
       </lp:owner>
   ...
      </lp:Project>

=== modified file 'lib/lp/registry/templates/person-rdf-contents.pt'
--- lib/lp/registry/templates/person-rdf-contents.pt	2010-09-23 17:23:06 +0000
+++ lib/lp/registry/templates/person-rdf-contents.pt	2010-10-15 17:31:06 +0000
@@ -43,8 +43,10 @@
         <foaf:img tal:condition="context/mugshot"
                   tal:attributes="rdf:resource context/mugshot/http_url" />
         <foaf:member tal:repeat="person context/allmembers">
-            <lp:specifiedAt tal:attributes="rdf:resource
-                string:${person/fmt:url}/+rdf" />
+            <foaf:Group>
+                <foaf:member
+                    tal:attributes="rdf:resource string:${person/fmt:url}/+rdf" />
+            </foaf:Group>
         </foaf:member>
     </foaf:Group>
   </tal:public>

=== modified file 'lib/lp/registry/templates/product-rdf.pt'
--- lib/lp/registry/templates/product-rdf.pt	2010-09-23 03:24:10 +0000
+++ lib/lp/registry/templates/product-rdf.pt	2010-10-15 17:31:06 +0000
@@ -56,8 +56,10 @@
             </lp:ProductSeries>
         </lp:series>
         <lp:owner>
-            <lp:specifiedAt tal:attributes="rdf:resource
-                string:${context/owner/fmt:url}/+rdf" />
+            <foaf:Agent>
+                <foaf:Account
+                    tal:attributes="rdf:resource string:${context/owner/fmt:url}/+rdf"/>
+            </foaf:Agent>
         </lp:owner>
         <lp:status tal:condition="context/active">Active</lp:status>
         <lp:status tal:condition="not:context/active">Inactive</lp:status>

=== modified file 'lib/lp/registry/templates/productrelease-rdf.pt'
--- lib/lp/registry/templates/productrelease-rdf.pt	2010-09-23 03:24:10 +0000
+++ lib/lp/registry/templates/productrelease-rdf.pt	2010-10-15 17:31:06 +0000
@@ -32,8 +32,10 @@
             </lp:ProductSeries>
         </lp:inProductSeries>
         <lp:owner>
-            <lp:specifiedAt tal:attributes="rdf:resource
-                string:${context/owner/fmt:url}/+rdf" />
+            <foaf:Agent>
+                <foaf:Account
+                    tal:attributes="rdf:resource string:${context/owner/fmt:url}/+rdf"/>
+            </foaf:Agent>
         </lp:owner>
     </lp:ProductRelease>
 </rdf:RDF>

=== modified file 'lib/lp/registry/templates/project-rdf.pt'
--- lib/lp/registry/templates/project-rdf.pt	2010-09-23 03:24:10 +0000
+++ lib/lp/registry/templates/project-rdf.pt	2010-10-15 17:31:06 +0000
@@ -42,8 +42,10 @@
             </lp:Product>
         </lp:product>
         <lp:owner>
-            <lp:specifiedAt tal:attributes="rdf:resource
-                string:${context/owner/fmt:url}/+rdf" />
+            <foaf:Agent>
+                <foaf:Account
+                    tal:attributes="rdf:resource string:${context/owner/fmt:url}/+rdf"/>
+            </foaf:Agent>
         </lp:owner>
         <lp:status tal:condition="context/active">Active</lp:status>
         <lp:status tal:condition="not:context/active">Inactive</lp:status>