Commits

Doug Burke committed 4d9b554

Minor doc fixes and additions

Comments (0)

Files changed (9)

   which will run the W3C Turtle tests (if downloaded from
   http://www.w3.org/2013/TurtleTests/).
 
+  Minor fixes and additions to the documentation.
+
 0.9.0.3:
 
   Fix minor Haddock issue with Swish.RDF.Parser.Utils.appendURIs.

src/Swish/QName.hs

 > swish> let qn2 = "http://example.com/bob" :: QName
 > swish> let qn3 = "http://example.com/bob/fred" :: QName
 > swish> let qn4 = "http://example.com/bob/fred#x" :: QName
-> swish> map getLocalName [qn1, qn2, qn3, qn4]
-> ["","bob","fred","x"]
+> swish> let qn5 = "http://example.com/bob/fred:joe" :: QName
+> swish> map getLocalName [qn1, qn2, qn3, qn4, qn5]
+> ["","bob","fred","x","fred:joe"]
 > swish> getNamespace qn1
-> http://example.com
+> http://example.com/
 > swish> getNamespace qn2
-> http://example.com
+> http://example.com/
 > swish> getNamespace qn3
 > http://example.com/bob/
 > swish> getNamespace qn4
     compare = comparing getQNameURI
   
 -- | The format used to display the URI is @\<uri\>@, and does not
---   include the password if using baccess access authorization.
+--   include the password if using basic access authorization.
 instance Show QName where
     show (QName u _ _) = "<" ++ show u ++ ">"
 

src/Swish/RDF/Formatter/Internal.hs

 
 Turtle supports 4 ways of quoting text,
 
-  1) '...'
-  2) '''...'''
-  3) "..."
-  4) """..."""
+  (1) @\'...\'@
 
-where there are constraints on ... for each one. At present
+  (2) @\'\'\'...\'\'\'@
+
+  (3) @\"...\"@
+
+  (4) @\"\"\"...\"\"\"@
+
+where there are slightly-different
+constraints on @...@ for each one. At present
 we assume that the string is to be quoted as 3 or 4; this
 could be extended to allow for 1 or 2 as well.
 
 For now option 4 is only used when the contents contain a
-@\n@ character and does not contain @"""@.
+@\n@ character and does not contain @\"\"\"@.
 -}
 
 -- The original thinking was that a scan of the string is worthwhile

src/Swish/RDF/Formatter/NTriples.hs

 --  Stability   :  experimental
 --  Portability :  OverloadedStrings
 --
---  This Module implements a NTriples formatter for an 'RDFGraph'.
+--  This Module implements a NTriples formatter for a 'RDFGraph'.
 --
 --  REFERENCES:
 --
 --     W3C Recommendation 10 February 2004,
 --     <http://www.w3.org/TR/rdf-testcases/#ntriples>
 --
+-- NOTES:
+--
+--  - Update to the document \"N-Triples. A line-based syntax for an RDF graph\"
+--    W3C Working Group Note 09 April 2013,
+--    <http://www.w3.org/TR/2013/NOTE-n-triples-20130409/>
+--
 --------------------------------------------------------------------------------
 
 module Swish.RDF.Formatter.NTriples

src/Swish/RDF/Formatter/Turtle.hs

 --
 -- NOTES:
 --
---  - The formatter needs to be updated to the latest working draft (10 July 2012,
---    <http://www.w3.org/TR/2012/WD-turtle-20120710/#sec-changelog>) and *then*
---    the Candidate Recommendation (19 February 2013,
---    <http://www.w3.org/TR/2013/CR-turtle-20130219/#sec-changelog>).
+--  - 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

src/Swish/RDF/Graph.hs

 --  Stability   :  experimental
 --  Portability :  FlexibleInstances, MultiParamTypeClasses, OverloadedStrings
 --
---  This module defines a memory-based RDF graph instance.
+--  This module defines a memory-based RDF graph instance. At present only
+--  RDF 1.0 is explicitly supported; I have not gone through the RDF 1.1
+--  changes to see how the code needs to be updated. This means that you
+--  can have untyped strings in your graph that do not match the same content
+--  but with an explicit @xsd:string@ datatype.
+--
+--  Note that the identifiers for blank nodes may /not/ be propogated when
+--  a graph is written out using one of the formatters, such as
+--  'Swish.RDF.Formatter.Turtle'. There is limited support for
+--  generating new blank nodes from an existing set of triples; e.g.
+--  'newNode' and 'newNodes'.
 --
 --------------------------------------------------------------------------------
 
 
 -- | RDF graph node values
 --
---  cf. <http://www.w3.org/TR/rdf-concepts/#section-Graph-syntax>
+--  cf. <http://www.w3.org/TR/rdf-concepts/#section-Graph-syntax> version 1.0
 --
 --  This is extended from the RDF abstract graph syntax in the
 --  following ways:
 
 {-| N3-style quoting rules for a string.
 
-*WARNING*: the output is /incorrect/ if the flag is `False` and
-the text contains 3 or more consecutive @"@ characters.
+WARNING: the output is /incorrect/ if the flag is @False@ and
+the text contains 3 or more consecutive @\"@ characters.
 -}
 
 quote :: 
         mapbn' = (dn,dnmap):mapbn
         allbn' = dnmap:allbn
 
+--  TODO: optimize this for common case @nnn@ and @_nnn@:
+--    always generate @_nnn@ and keep track of last allocated
+--
+
 -- |Given a node and a list of existing nodes, find a new node for
 --  the supplied node that does not clash with any existing node.
 --  (Generates an non-terminating list of possible replacements, and
 --  picks the first one that isn't already in use.)
 --
---  TODO: optimize this for common case @nnn@ and @_nnn@:
---    always generate @_nnn@ and keep track of last allocated
---
 newNode :: (Label lb) => lb -> [lb] -> lb
 newNode dn existnodes =
     head $ newNodes dn existnodes

src/Swish/RDF/Parser/NTriples.hs

 --
 --  - The case of language tags is retained.
 --
+--  - Update to the document \"N-Triples. A line-based syntax for an RDF graph\"
+--    W3C Working Group Note 09 April 2013,
+--    <http://www.w3.org/TR/2013/NOTE-n-triples-20130409/>
+--
 --------------------------------------------------------------------------------
 
 module Swish.RDF.Parser.NTriples

src/Swish/RDF/Parser/Turtle.hs

 --     others - e.g. Sparql or the N3 parser?
 
 module Swish.RDF.Parser.Turtle
-       {- EXPORT EVERYTHING FOR TESTING; TODO REMOVE XXX
     ( ParseResult
     , parseTurtle      
     , parseTurtlefromText      
     )
--}
 where
 
 import Swish.GraphClass (arc)
   specification; added minor improvements to error messages when
   given invalid syntax. As part of the upgrade, there is no longer a
   default namespace set up for the empty prefix and numeric literals
-  are no-longer converted into a 'canonical' form.
+  are no-longer converted into a canonical form.
   .
   * Turtle/N3 output: improved string formatting (better handling of
-  string literals with three or more consecutive @"@ characters); blank
+  string literals with three or more consecutive @\"@ characters); blank
   node handling has been improved but the output may not be as elegant.
   .
   * NTriples parser: now accepts upper-case language tags such as
   which will run the W3C Turtle tests (if downloaded from
   <http://www.w3.org/2013/TurtleTests/>).
   .
+  * Minor fixes and additions to the documentation.
+  .
   Changes in version @0.9.0.3@:
   .
   * Minor Haddock fix to @Swish.RDF.Parser.Utils.appendURIs@.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.