Package RDFClosure :: Package parsers
[hide private]
[frames] | no frames]

Package parsers

source code

Parser module with a slightly improved versions of the Turtle parser.

The main issue is that the parser distributed by rdflib does not handle literals properly when they are not in quotes. Ie, for example,:

 <aaa> <bbbb> true .

is not recognized as:

 <aaa> <bbbb> "true"^^xsd:boolean .

The errors are:

This module provides an alternative parser that takes care of the first three problems.

Obviously, this parser can be used directly, too. Here is a way to do it:

 from rdflib.plugin import register
 from rdflib.syntax import parsers
 register("my_turtle", parsers.Parser, "RDFClosure.parsers.N3Parser","N3Parser")
 ...
 graph.parse(<file>,format="my_turtle")

Requires: RDFLib, 2.2.2. and higher

License: This software is available for use under the W3C Software License

Organization: World Wide Web Consortium

Author: Ivan Herman

Contact: Ivan Herman, ivan@w3.org

Submodules [hide private]

Variables [hide private]
  __author__ = 'Ivan Herman'
  __license__ = u'W3C® SOFTWARE NOTICE AND LICENSE, http://www.w...
  __package__ = None
Variables Details [hide private]

__license__

Value:
u'W3C® SOFTWARE NOTICE AND LICENSE, http://www.w3.org/Consortium/Legal\
/2002/copyright-software-20021231'