parser

package
v0.0.0-...-a35f667 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2016 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package parser provides parser to work with several RDF formats (N-Triples, Turtles, JSON-LD, ...)

Package parser provides utilities to work with RDF based languages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NTParser

type NTParser struct {
	// contains filtered or unexported fields
}

NTParser is a parser for reading & loading triples in N-Triples format.

N-Triples reference : https://www.w3.org/2011/rdf-wg/wiki/N-Triples-Format

func NewNTParser

func NewNTParser() *NTParser

NewNTParser creates a new NTParser

func (NTParser) Prefixes

func (p NTParser) Prefixes() map[string]string

Prefixes returns the prefixes read by the parser during the last parsing. Since N-Triples format doesn't use prefixes, this function always return nil.

func (NTParser) Read

func (p NTParser) Read(filename string) chan rdf.Triple

Read a file containg RDF triples in N-Triples format & convert them in triples.

Triples generated are send through a channel, which is closed when the parsing of the file has been completed.

type Parser

type Parser interface {
	Read(filename string) chan rdf.Triple
	Prefixes() map[string]string
}

Parser represent a generic interface for parsing every RDF format.

Package parser provides several implementations for this interface.

type TurtleParser

type TurtleParser struct {
	// contains filtered or unexported fields
}

TurtleParser is a parser for reading & loading triples in Turtle format.

Turtle reference : https://www.w3.org/TR/turtle/

func NewTurtleParser

func NewTurtleParser() *TurtleParser

NewTurtleParser creates a new TurtleParser

func (TurtleParser) Prefixes

func (p TurtleParser) Prefixes() map[string]string

Prefixes returns the prefixes read by the parser during the last parsing.

func (*TurtleParser) Read

func (p *TurtleParser) Read(filename string) chan rdf.Triple

Read a file containg RDF triples in Turtle format & convert them in triples.

Triples generated are send throught a channel, which is closed when the parsing of the file has been completed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL