[interfaces] Protect Librdf blank nodes, closes #3478264

authorVincent Michel <vincent.michel@logilab.fr>
changeset57a9d36063bf
branchdefault
phasepublic
hiddenno
parent revision#6c910b2d35dd [dataimport] Allow to pass rdf_properties to relations_etype callback, closes #3478220
child revision#47f581626a1f [wip] External resources enrichment/aligner, #70c9ad0fc81d [wip] External resources enrichment/aligner, #f598b038dc50 Add dependency declarations for librdf/rdflib (Closes #3367828)
files modified by this revision
interfaces.py
# HG changeset patch
# User Vincent Michel <vincent.michel@logilab.fr>
# Date 1390556314 0
# Fri Jan 24 09:38:34 2014 +0000
# Node ID 57a9d36063bfe602f16d25a83e7bb543ed3f0340
# Parent 6c910b2d35ddf06e49e47106ce4c5c38e71168ed
[interfaces] Protect Librdf blank nodes, closes #3478264

diff --git a/interfaces.py b/interfaces.py
@@ -172,10 +172,12 @@
1 
2      def iterate_triples(self, stream):
3          """ Iterate triples using librdf
4          """
5          for triple in stream:
6 +            if triple.subject.is_blank() or triple.object.is_blank():
7 +                continue
8              _subject = unicode(triple.subject.uri)
9              _predicate = unicode(triple.predicate.uri)
10              if triple.object.is_resource():
11                  otype = u'resource'
12                  _object = unicode(triple.object.uri)