rdflib.tools package

Submodules

rdflib.tools.csv2rdf module

A commandline tool for semi-automatically converting CSV to RDF.

See also https://github.com/RDFLib/pyTARQL in the RDFlib family of tools

try: csv2rdf --help

class rdflib.tools.csv2rdf.CSV2RDF[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'rdflib.tools.csv2rdf', '__init__': <function CSV2RDF.__init__>, 'triple': <function CSV2RDF.triple>, 'convert': <function CSV2RDF.convert>, '__dict__': <attribute '__dict__' of 'CSV2RDF' objects>, '__weakref__': <attribute '__weakref__' of 'CSV2RDF' objects>, '__doc__': None, '__annotations__': {}})
__init__()[source]
__module__ = 'rdflib.tools.csv2rdf'
__weakref__

list of weak references to the object (if defined)

convert(csvreader)[source]
triple(s, p, o)[source]

rdflib.tools.graphisomorphism module

A commandline tool for testing if RDF graphs are isomorpic, i.e. equal if BNode labels are ignored.

class rdflib.tools.graphisomorphism.IsomorphicTestableGraph(**kargs)[source]

Bases: rdflib.graph.Graph

Ported from: http://www.w3.org/2001/sw/DataAccess/proto-tests/tools/rdfdiff.py (Sean B Palmer’s RDF Graph Isomorphism Tester)

__eq__(G)[source]

Graph isomorphism testing.

__hash__ = None
__init__(**kargs)[source]
__module__ = 'rdflib.tools.graphisomorphism'
__ne__(G)[source]

Negative graph isomorphism testing.

hashtriples()[source]
internal_hash()[source]

This is defined instead of __hash__ to avoid a circular recursion scenario with the Memory store for rdflib which requires a hash lookup in order to return a generator of triples

vhash(term, done=False)[source]
vhashtriple(triple, term, done)[source]
vhashtriples(term, done)[source]
rdflib.tools.graphisomorphism.main()[source]

rdflib.tools.rdf2dot module

A commandline tool for drawing RDF graphs in Graphviz DOT format

You can draw the graph of an RDF file directly:

rdflib.tools.rdf2dot.main()[source]
rdflib.tools.rdf2dot.rdf2dot(g, stream, opts={})[source]

Convert the RDF graph to DOT writes the dot output to the stream

rdflib.tools.rdfpipe module

A commandline tool for parsing RDF in different formats and serializing the resulting graph to a chosen format.

rdflib.tools.rdfpipe.main()[source]
rdflib.tools.rdfpipe.make_option_parser()[source]
rdflib.tools.rdfpipe.parse_and_serialize(input_files, input_format, guess, outfile, output_format, ns_bindings, store_conn='', store_type=None)[source]

rdflib.tools.rdfs2dot module

A commandline tool for drawing RDFS Class diagrams in Graphviz DOT format

You can draw the graph of an RDFS file directly:

rdflib.tools.rdfs2dot.main()[source]
rdflib.tools.rdfs2dot.rdfs2dot(g, stream, opts={})[source]

Convert the RDFS schema in a graph writes the dot output to the stream

Module contents

Various commandline tools for working with RDFLib