Copyright | (c) 2003 Graham Klyne 2009 Vasili I Galchin 2011 2012 2014 2020 2021 Douglas Burke |
---|---|
License | GPL V2 |
Maintainer | Douglas Burke |
Stability | experimental |
Portability | OverloadedStrings |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This Module implements a Notation 3 formatter
for an RDFGraph
value.
REFERENCES:
- "Notation3 (N3): A readable RDF syntax", W3C Team Submission 14 January 2008, http://www.w3.org/TeamSubmission/2008/SUBM-n3-20080114/
- Tim Berners-Lee's design issues series notes and description, http://www.w3.org/DesignIssues/Notation3.html
- Notation 3 Primer by Sean Palmer, http://www.w3.org/2000/10/swap/Primer.html
TODO:
- Initial prefix list to include nested formulae; then don't need to update prefix list for these.
- correct output of strings containing unsupported escape
characters (such as
\q
) - more flexible terminator generation for formatted formulae (for inline blank nodes.)
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.
Convert the graph to a builder using the given indentation text.