swish 0.9.0.15 → 0.9.1.0
raw patch · 5 files changed
+153/−73 lines, 5 filesdep +network-uridep ~networkdep ~textdep ~timePVP ok
version bump matches the API change (PVP)
Dependencies added: network-uri
Dependency ranges changed: network, text, time
API changes (from Hackage documentation)
Files
- src/Network/URI/Ord.hs +12/−33
- src/Swish/RDF/Graph.hs +13/−4
- src/Swish/RDF/Parser/Utils.hs +5/−17
- swish.cabal +114/−15
- tests/RDFGraphTest.hs +9/−4
src/Network/URI/Ord.hs view
@@ -1,55 +1,34 @@-{-# LANGUAGE CPP #-}- -------------------------------------------------------------------------------- -- See end of this file for licence information. -------------------------------------------------------------------------------- -- | -- Module : Ord--- Copyright : (c) 2012 Douglas Burke+-- Copyright : (c) 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : CPP+-- Portability : As it provides nothing, it should be pretty portable ----- Provide an ordering for URIs (that is, an 'Ord' instance for--- 'URI').+-- *This module is deprecated and will be removed* ----- This instance is provided so that URIs can be used as the--- key of a 'Data.Map.Map'. Case is relevant for the ordering,--- and no attempt is made to decode percent-encoded values (i.e.--- the comparison does /not/ use a canonical or normalized form).+-- This module no-longer does anything since +-- 'Network.URI.URI' now has an 'Ord' instance by+-- default (prior to @network @2.4.0.0@ this was not the case). ----- For @network@ version @2.4.0.0@ and higher, this module is a no-op,--- since 'Network.URI' now defines these instances.+-- This module used to provide an ordering for earlier versions+-- of the network package, but with the split of 'Network.URI'+-- out to the @network-uri@ in version @2.6.0.0@, the CPP+-- needed to keep this going got annoying enough for me to+-- just require a recent @network@ package. -- -------------------------------------------------------------------------------- module Network.URI.Ord () where -#if MIN_VERSION_network(2,4,0)--#else--import Network.URI (URI(..), URIAuth(..))---- NOTE: we do not say compare = comparing show for the URI--- instance since the standard show instance for URIs does not--- include a password if included as part of the authority field.--instance Ord URI where- URI s1 a1 o1 q1 f1 `compare` URI s2 a2 o2 q2 f2 =- (s1,a1,o1,q1,f1) `compare` (s2,a2,o2,q2,f2)--instance Ord URIAuth where- URIAuth ui1 rn1 p1 `compare` URIAuth ui2 rn2 p2 =- (ui1,rn1,p1) `compare` (ui2,rn2,p2)--#endif- -------------------------------------------------------------------------------- ----- Copyright (c) 2012 Douglas Burke+-- Copyright (c) 2014 Douglas Burke -- All rights reserved. -- -- This file is part of Swish.
src/Swish/RDF/Graph.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-}@@ -8,12 +9,12 @@ -- | -- Module : Graph -- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012, 2013 Douglas Burke+-- 2011, 2012, 2013, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : FlexibleInstances, MultiParamTypeClasses, OverloadedStrings+-- Portability : CPP, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings -- -- 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@@ -209,9 +210,13 @@ import Data.Word (Word32) import Data.String (IsString(..))-import Data.Time (UTCTime, Day, ParseTime, parseTime, formatTime) +#if MIN_VERSION_time(1,5,0)+import Data.Time (UTCTime, Day, ParseTime, parseTimeM, formatTime, defaultTimeLocale)+#else+import Data.Time (UTCTime, Day, ParseTime, parseTime, formatTime) import System.Locale (defaultTimeLocale) +#endif import Text.Printf @@ -603,7 +608,11 @@ toTimeFormat fmt inVal = let fmtHHMM = fmt ++ "%z" fmtZ = fmt ++ "Z"+#if MIN_VERSION_time(1,5,0)+ pt f = parseTimeM True defaultTimeLocale f inVal+#else pt f = parseTime defaultTimeLocale f inVal+#endif in case pt fmtHHMM of o@(Just _) -> o _ -> case pt fmtZ of@@ -1596,7 +1605,7 @@ -------------------------------------------------------------------------------- -- -- Copyright (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012, 2013 Douglas Burke+-- 2011, 2012, 2013, 2014 Douglas Burke -- All rights reserved. -- -- This file is part of Swish.
src/Swish/RDF/Parser/Utils.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -6,12 +5,12 @@ -------------------------------------------------------------------------------- -- | -- Module : Utils--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2013 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2013, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : CPP, OverloadedStrings+-- Portability : OverloadedStrings -- -- Support for the RDF Parsing modules. --@@ -82,30 +81,19 @@ -- Code -- | Append the two URIs. Given the change in signature of--- `Network.URI.relativeTo` in versino @2.4.0.0@ of @network@,+-- `Network.URI.relativeTo` in version @2.4.0.0@ of @network@, -- it is not clear that this function is necessary. At the--- very lease, it will be changed to just return a `URI`.+-- very least, it should be changed to just return a `URI`. -- appendURIs :: URI -- ^ The base URI -> URI -- ^ The URI to append (it can be an absolute URI). -> Either String URI-#if MIN_VERSION_network(2,4,0) appendURIs base uri = case uriScheme uri of "" -> Right $ uri `relativeTo` base _ -> Right uri -#else-appendURIs base uri =- case uriScheme uri of- "" -> case uri `relativeTo` base of- Just out -> Right out- _ -> Left $ "Unable to append <" ++ show uri ++ "> to base=<" ++ show base ++ ">"- _ -> Right uri--#endif- -- | Type for special name lookup table type SpecialMap = M.Map String ScopedName @@ -356,7 +344,7 @@ -------------------------------------------------------------------------------- -- -- Copyright (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012 Douglas Burke+-- 2011, 2012, 2014 Douglas Burke -- All rights reserved. -- -- This file is part of Swish.
swish.cabal view
@@ -1,5 +1,5 @@ Name: swish-Version: 0.9.0.15+Version: 0.9.1.0 Stability: experimental License: LGPL License-file: LICENSE @@ -44,6 +44,21 @@ . * Complete, ready-to-run, command-line and script-driven programs. .+ Changes in version @0.9.1.0@:+ .+ * The network-uri flag has been added, which uses the network-uri+ package to provide @Network.URI@. This has lead to the minimum version+ of the network package being bumped to @2.4.0.0@ to avoid some CPP+ issues during building. The @Network.URI.Ord@ module now really does+ nothing. + .+ * Updated the upper bound on the text dependency (requires an+ update to intern to use).+ .+ * Updated the upper bound on the time dependency to 1.5 (at this time+ the test suite will not build due to a failing dependency, so+ it is untested).+ . Changes in version @0.9.0.15@: . * Updated the upper bound on the semigroups dependency.@@ -184,6 +199,17 @@ Description: Build the RunW3CTests application Default: False +-- Prior to network-2.6, Network.URI was in network;+-- for >= 2.6 it's in network-uri.+--+-- TODO: check; perhaps we don't need to install+-- network if we have network-uri, particularly for the+-- tests. If so, do we need network-uri < 2.6?+--+Flag network-uri+ Description: Get Network.URI from the network-uri package+ Default: True+ Library Build-Depends: base >=3 && < 5,@@ -192,13 +218,19 @@ -- Early versions of hashable 1.2 are problematic hashable (>= 1.1 && < 1.2) || (>= 1.2.0.6 && <1.3), mtl >= 2 && < 3,- network >= 2.2 && < 2.6, old-locale == 1.0.*, polyparse >= 1.6 && <= 1.9, semigroups >= 0.5 && < 0.16,- text >= 0.11 && < 1.2,- time >= 1.1 && < 1.5+ text >= 0.11 && < 1.3,+ time >= 1.1 && < 1.6 + if flag(network-uri)+ build-depends: network-uri == 2.6.*+ -- , network == 2.6.*+ else+ build-depends: network-uri < 2.6+ , network >= 2.4 && < 2.6+ if impl(ghc < 7.4.0) Build-Depends: intern == 0.8 if impl(ghc >= 7.4.0)@@ -358,12 +390,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-n3parser type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -377,12 +415,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-n3formatter type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -396,12 +440,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-rdfdatatypexsdinteger type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -415,12 +465,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-rdfgraph type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -434,7 +490,6 @@ base, containers, HUnit,- network, old-locale, swish, test-framework,@@ -442,6 +497,13 @@ text, time + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-rdfproofcontext type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -455,12 +517,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-rdfproof type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -474,12 +542,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-rdfquery type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -493,12 +567,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ Test-Suite test-rdfruleset type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -512,12 +592,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ --, network+ else+ build-depends: network-uri+ , network+ Test-Suite test-varbinding type: exitcode-stdio-1.0 Hs-Source-Dirs: tests/@@ -548,12 +634,18 @@ base, containers, HUnit,- network, swish, test-framework, test-framework-hunit == 0.3.*, text + if flag(network-uri)+ build-depends: network-uri+ -- , network+ else+ build-depends: network-uri+ , network+ -- we do not have the data files to run this test -- Executable SwishTest -- Main-Is: tests/SwishTest.hs@@ -608,8 +700,15 @@ containers, directory, filepath,- network, swish, text++ if flag(network-uri)+ build-depends: network-uri+ --, network+ else+ build-depends: network-uri+ , network+ else Buildable: False
tests/RDFGraphTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : RDFGraphTest--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2013 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2013, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module contains test cases for module RDFGraph. --@@ -67,11 +68,15 @@ import Data.Maybe (fromJust, fromMaybe) import Data.Monoid (Monoid(..)) import Data.Ord (comparing)-import Data.Time (UTCTime(..), Day, fromGregorian, buildTime) import Network.URI (URI, parseURI) +#if MIN_VERSION_time(1,5,0)+import Data.Time (UTCTime(..), Day, fromGregorian, buildTime, defaultTimeLocale)+#else+import Data.Time (UTCTime(..), Day, fromGregorian, buildTime) import System.Locale (defaultTimeLocale)+#endif import Test.HUnit ( Test(TestCase,TestList,TestLabel)@@ -1596,7 +1601,7 @@ -------------------------------------------------------------------------------- -- -- Copyright (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012, 2013 Douglas Burke +-- 2011, 2012, 2013, 2014 Douglas Burke -- All rights reserved. -- -- This file is part of Swish.