[web/views/rdf] Take the second element of XY equivalent for non final relation
authorDenis Laxalde <denis.laxalde@logilab.fr>
Fri, 13 Mar 2015 14:47:35 +0100
changeset 10234 a12e4459eee5
parent 10233 f7dfcb3add15
child 10266 813e30041a93
[web/views/rdf] Take the second element of XY equivalent for non final relation When given a Yams snippet of the form `<etype> <rtype>` ``xy.xeq()`` will return the XML snippet equivalent to this relation in the form of a tuple `(subject, rtype, object)` so ``item`` will always be a tuple here. In fact, the correct code appears just a few lines above (around line 88) for final relations so I guess this is a copy-paste mistake. Closes #4745929.
web/views/rdf.py
--- a/web/views/rdf.py	Wed Feb 11 12:42:19 2015 +0100
+++ b/web/views/rdf.py	Fri Mar 13 14:47:35 2015 +0100
@@ -94,7 +94,7 @@
                                 add( (cwuri, CW[rtype], URIRef(related.cwuri)) )
                                 try:
                                     for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
-                                        add( (cwuri, urijoin(item), URIRef(related.cwuri)) )
+                                        add( (cwuri, urijoin(item[1]), URIRef(related.cwuri)) )
                                 except xy.UnsupportedVocabulary:
                                     pass
                             else: