diff options
author | Gunnar Aastrand Grimnes <gromgull@gmail.com> | 2016-11-19 06:53:51 +0100 |
---|---|---|
committer | Gunnar Aastrand Grimnes <gromgull@gmail.com> | 2017-01-30 17:43:04 +0100 |
commit | 1746c32bed985fd0adb5e6deab638c24ba313a78 (patch) | |
tree | 7bd8de48776ab44e0df008ea8e11167104bfa8fa /rdflib/tools | |
parent | b93cddb3517ec6a3654cd255b2beb10331a1a0c7 (diff) | |
download | rdflib-1746c32bed985fd0adb5e6deab638c24ba313a78.tar.gz |
trivial py3 conversion of tools
Diffstat (limited to 'rdflib/tools')
-rw-r--r-- | rdflib/tools/graphisomorphism.py | 6 | ||||
-rw-r--r-- | rdflib/tools/rdf2dot.py | 2 | ||||
-rw-r--r-- | rdflib/tools/rdfpipe.py | 2 | ||||
-rw-r--r-- | rdflib/tools/rdfs2dot.py | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/rdflib/tools/graphisomorphism.py b/rdflib/tools/graphisomorphism.py index 09518110..9ecab86b 100644 --- a/rdflib/tools/graphisomorphism.py +++ b/rdflib/tools/graphisomorphism.py @@ -3,7 +3,9 @@ A commandline tool for testing if RDF graphs are isomorpic, i.e. equal if BNode labels are ignored. """ -from rdflib.graph import Graph +from __future__ import absolute_import + +from rdflib import Graph from rdflib import BNode from itertools import combinations @@ -39,7 +41,7 @@ class IsomorphicTestableGraph(Graph): yield tuple(self.vhashtriple(t, term, done)) def vhashtriple(self, triple, term, done): - for p in xrange(3): + for p in range(3): if not isinstance(triple[p], BNode): yield triple[p] elif done or (triple[p] == term): diff --git a/rdflib/tools/rdf2dot.py b/rdflib/tools/rdf2dot.py index 9a8fd49f..9c098786 100644 --- a/rdflib/tools/rdf2dot.py +++ b/rdflib/tools/rdf2dot.py @@ -9,6 +9,8 @@ You can draw the graph of an RDF file directly: """ +from __future__ import absolute_import + import rdflib import rdflib.extras.cmdlineutils diff --git a/rdflib/tools/rdfpipe.py b/rdflib/tools/rdfpipe.py index 9fb4b3b9..b7a56453 100644 --- a/rdflib/tools/rdfpipe.py +++ b/rdflib/tools/rdfpipe.py @@ -5,6 +5,8 @@ A commandline tool for parsing RDF in different formats and serializing the resulting graph to a chosen format. """ +from __future__ import absolute_import + import sys from optparse import OptionParser import logging diff --git a/rdflib/tools/rdfs2dot.py b/rdflib/tools/rdfs2dot.py index 3ffde041..15857a6b 100644 --- a/rdflib/tools/rdfs2dot.py +++ b/rdflib/tools/rdfs2dot.py @@ -9,6 +9,8 @@ You can draw the graph of an RDFS file directly: rdf2dot my_rdfs_file.rdf | dot -Tpng | display """ +from __future__ import absolute_import + import rdflib.extras.cmdlineutils import sys |