Skip to content

Commit

Permalink
rdf: add minimal NTriples encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
boutros committed May 17, 2017
1 parent e430b41 commit cb2980a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions rdf/encode.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package rdf

import "io"

type Format int

const (
NTtriples Format = iota
Turtle
)

type Encoder struct {
w io.Writer
}

func NewNTriplesEncoder(w io.Writer) *Encoder {
return &Encoder{w: w}
}

func (e *Encoder) Encode(tr Triple) error {
_, err := e.w.Write([]byte(tr.String()))
return err
}

0 comments on commit cb2980a

Please sign in to comment.