May 02, 2015


A commandline tool for parsing RDF in different formats and serializing the resulting graph to a chosen format., fmap=None)

Guess RDF serialization based on file suffix. Uses SUFFIX_FORMAT_MAP unless fmap is provided. Examples:

>>> guess_format('path/to/file.rdf')
>>> guess_format('path/to/file.owl')
>>> guess_format('path/to/file.ttl')
>>> guess_format('path/to/file.xhtml')
>>> guess_format('path/to/file.svg')
>>> guess_format('path/to/file.xhtml', {'xhtml': 'grddl'})

This also works with just the suffixes, with or without leading dot, and regardless of letter case:

>>> guess_format('.rdf')
>>> guess_format('rdf')
>>> guess_format('RDF')
'xml', input_format, guess, outfile, output_format, ns_bindings, store_conn='', store_type='IOMemory')[source][source]
>>> _format_and_kws("fmt")
('fmt', {})
>>> _format_and_kws("fmt:+a")
('fmt', {'a': True})
>>> _format_and_kws("fmt:a")
('fmt', {'a': True})
>>> _format_and_kws("fmt:+a,-b") 
('fmt', {'a': True, 'b': False})
>>> _format_and_kws("fmt:c=d")
('fmt', {'c': 'd'})[source][source]

Previous topic


Next topic