nordlys.core.storage.parser.nt_parser module

NTriples Parser

NTriples parser with URI prefixing

Author:Krisztian Balog
class nordlys.core.storage.parser.nt_parser.NTParser[source]

Bases: object

NTriples parser class

parse_file(filename, triplehandler)[source]

Parses file and calls callback function with the parsed triple

class nordlys.core.storage.parser.nt_parser.Triple(prefix=None)[source]

Bases: object

Representation of a Triple to be used by the rdflib NTriplesParser.

object()[source]
object_prefixed()[source]
predicate()[source]
predicate_prefixed()[source]
subject()[source]
subject_prefixed()[source]
triple(s, p, o)[source]

Assign current triple object

Parameters:
  • s – subject
  • p – predicate
  • o – object
class nordlys.core.storage.parser.nt_parser.TripleHandler[source]

Bases: object

This is an abstract class

triple_parsed(triple)[source]

This method is called each time a triple is parsed, with the triple as parameter.

class nordlys.core.storage.parser.nt_parser.TripleHandlerPrinter[source]

Bases: nordlys.core.storage.parser.nt_parser.TripleHandler

Example triple handler that only prints whatever it received.

triple_parsed(triple)[source]

This method is called each time a triple is parsed, with the triple as parameter.

nordlys.core.storage.parser.nt_parser.main(argv)[source]