Skip to content

Commit

Permalink
Fix for cgi import and empty <B>
Browse files Browse the repository at this point in the history
  • Loading branch information
datadavev committed Aug 9, 2020
1 parent f0498c2 commit 0a2b4fc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rdflib/tools/rdf2dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import rdflib.extras.cmdlineutils

import sys
import cgi
import html as cgi
import collections

from rdflib import XSD
Expand Down Expand Up @@ -103,9 +103,14 @@ def label(x, g):
return l

try:
return g.namespace_manager.compute_qname(x)[2]
l = g.namespace_manager.compute_qname(x)[2]
if l:
return l
except:
return x
if x:
return x
#dot throws up a little with empty <B>
return " "

def formatliteral(l, g):
v = cgi.escape(l)
Expand Down

0 comments on commit 0a2b4fc

Please sign in to comment.