swish-0.10.4.0: A semantic web toolkit.

Copyright | (c) 2003 Graham Klyne 2009 Vasili I Galchin 2011 2012 2013 2014 2018 2019 2020 2021 Douglas Burke
License | GPL V2
Maintainer | Douglas Burke
Stability | experimental
Portability | CPP, OverloadedStrings
Safe Haskell | Safe-Inferred
Language | Haskell2010

Swish.RDF.Formatter.Turtle

Description

This Module implements a Turtle formatter for an `RDFGraph` value.

REFERENCES:

- "Turtle, Terse RDF Triple Language", W3C Working Draft 09 August 2011 (http://www.w3.org/TR/2011/WD-turtle-20110809/) http://www.w3.org/TR/turtle/

NOTES:

- The formatter needs to be updated to the W3C Candidate Recommendation (19 February 2013, http://www.w3.org/TR/2013/CR-turtle-20130219/).
- Should literal strings (`Lit`) be written out as `xsd:string`, or should `TypedLit` strings with a type of `xsd:string` be written out with no type? (e.g. see http://www.w3.org/TR/2011/WD-turtle-20110809/#terms).

Synopsis

- type NodeGenLookupMap = Map RDFLabel Word32
- formatGraphAsText :: RDFGraph -> Text
- formatGraphAsLazyText :: RDFGraph -> Text
- formatGraphAsBuilder :: RDFGraph -> Builder
- formatGraphIndent :: Builder -> Bool -> RDFGraph -> Builder
- formatGraphDiag :: Builder -> Bool -> RDFGraph -> (Builder, NodeGenLookupMap, Word32, [String])

# Documentation

type NodeGenLookupMap = Map RDFLabel Word32 Source #

Node name generation state information that carries through and is updated by nested formulae.

formatGraphAsText :: RDFGraph -> Text Source #

Convert the graph to text.

formatGraphAsLazyText :: RDFGraph -> Text Source #

Convert the graph to text.

formatGraphAsBuilder :: RDFGraph -> Builder Source #

Convert the graph to a Builder.

formatGraphIndent Source #

Arguments

:: Builder | indentation text
-> Bool | are prefixes to be generated?
-> RDFGraph | graph
-> Builder |

Convert the graph to a builder using the given indentation text.

formatGraphDiag Source #

Arguments

:: Builder | indentation
-> Bool | are prefixes to be generated?
-> RDFGraph |
-> (Builder, NodeGenLookupMap, Word32, [String]) |

Format graph and return additional information.