swish 0.9.1.1 → 0.9.1.2
raw patch · 37 files changed
+228/−234 lines, 37 filesdep ~polyparsePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: polyparse
API changes (from Hackage documentation)
Files
- CHANGELOG +9/−0
- README.md +2/−0
- src/Swish/Commands.hs +3/−2
- src/Swish/GraphMatch.hs +3/−3
- src/Swish/GraphMem.hs +3/−1
- src/Swish/Namespace.hs +5/−2
- src/Swish/RDF/ClassRestrictionRule.hs +7/−3
- src/Swish/RDF/Datatype/XSD/Decimal.hs +6/−3
- src/Swish/RDF/Datatype/XSD/Integer.hs +7/−3
- src/Swish/RDF/Datatype/XSD/MapDecimal.hs +2/−2
- src/Swish/RDF/Datatype/XSD/String.hs +5/−2
- src/Swish/RDF/Formatter/Internal.hs +3/−1
- src/Swish/RDF/Formatter/N3.hs +13/−9
- src/Swish/RDF/Formatter/NTriples.hs +7/−2
- src/Swish/RDF/Formatter/Turtle.hs +8/−4
- src/Swish/RDF/Graph.hs +8/−3
- src/Swish/RDF/Parser/N3.hs +5/−3
- src/Swish/RDF/Parser/Turtle.hs +3/−3
- src/Swish/RDF/Parser/Utils.hs +1/−1
- src/Swish/RDF/Proof.hs +7/−3
- src/Swish/RDF/ProofContext.hs +5/−2
- src/Swish/RDF/Query.hs +28/−9
- src/Swish/RDF/Ruleset.hs +6/−2
- src/Swish/RDF/Vocabulary.hs +5/−2
- src/Swish/Script.hs +6/−2
- src/Swish/VarBinding.hs +9/−3
- swish.cabal +3/−134
- tests/GraphTest.hs +2/−2
- tests/N3FormatterTest.hs +7/−3
- tests/N3ParserTest.hs +6/−2
- tests/QNameTest.hs +2/−2
- tests/RDFDatatypeXsdIntegerTest.hs +6/−2
- tests/RDFGraphTest.hs +13/−12
- tests/RDFProofContextTest.hs +5/−1
- tests/RDFProofTest.hs +6/−2
- tests/RDFQueryTest.hs +6/−2
- tests/RDFRulesetTest.hs +6/−2
CHANGELOG view
@@ -1,3 +1,12 @@+0.9.1.2:++ Updated the upper bound on the polyparse dependency and fixed an+ error in the Swish.RDF.Query documentation (issue #25). Initial+ support for ghc 7.10.++ The list of changes has been removed from the cabal file since it+ is in the CHANGELOG.+ 0.9.1.1: Updated the upper bound on the semigroups and polyparse dependencies.
README.md view
@@ -1,6 +1,8 @@  +[drone.io status page](https://drone.io/bitbucket.org/doug_burke/swish)+ # Introduction Swish - which stands for Semantic Web Inference Scripting in Haskell -
src/Swish/Commands.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : Commands--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : FlexibleContexts, OverloadedStrings -- -- Functions to deal with indivudual Swish command options. --
src/Swish/GraphMatch.hs view
@@ -587,13 +587,13 @@ where gen' = gen+1 newEntries = [ (l, (gen', fromIntegral (newIndex l))) | l <- ls ]- -- TODO: should review this given the changes to the hash code+ -- TODO: should review this given the changes to the hash code -- since it was re-written newIndex l | labelIsVar l = mapAdjacent l -- adjacency classifies variable labels | otherwise = fromIntegral $ hashVal gen l -- otherwise rehash (to disentangle collisions) - -- mapAdjacent used to use `rem` hashModulus+ -- mapAdjacent used to use `rem` hashModulus mapAdjacent l = hashModulus `hashWithSalt` sum (sigsOver l) gls = S.toList gs@@ -633,7 +633,7 @@ map (sigCalc . arcToTriple) where sigCalc (s,p,o) =- hashModulus `hashWithSalt`+ hashModulus `hashWithSalt` ( labelVal2 s + labelVal2 p * 3 + labelVal2 o * 5 )
src/Swish/GraphMem.hs view
@@ -8,7 +8,7 @@ -- | -- Module : GraphMem -- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012 Douglas Burke+-- 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke@@ -36,7 +36,9 @@ import Swish.GraphMatch import Data.Hashable (Hashable(..))+#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import Data.Ord (comparing) import qualified Data.Set as S
src/Swish/Namespace.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -6,12 +7,12 @@ -- | -- Module : Namespace -- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012 Douglas Burke+-- 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module defines algebraic datatypes for namespaces and scoped names. --@@ -43,7 +44,9 @@ import Swish.QName (QName, LName, newQName, getLName, emptyLName, getQNameURI, getNamespace, getLocalName) import Data.Maybe (fromMaybe)+#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import Data.Ord (comparing) import Data.String (IsString(..))
src/Swish/RDF/ClassRestrictionRule.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -6,12 +7,12 @@ -- | -- Module : ClassRestrictionRule -- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012 Douglas Burke+-- 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module implements an inference rule based on a restruction on class -- membership of one or more values.@@ -60,8 +61,11 @@ import Data.List (delete, nub, subsequences) import Data.Maybe (fromJust, fromMaybe, mapMaybe)-import Data.Monoid (Monoid (..)) import Data.Ord.Partial (minima, maxima, partCompareEq, partComparePair, partCompareListMaybe, partCompareListSubset)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710)+import Data.Monoid (Monoid (..))+#endif import qualified Data.Map as M import qualified Data.Set as S
src/Swish/RDF/Datatype/XSD/Decimal.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -6,12 +7,12 @@ -- | -- Module : Decimal -- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011 William Waites, 2011, 2012 Douglas Burke+-- 2011 William Waites, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module defines the structures used to represent and -- manipulate RDF @xsd:decimal@ datatyped literals.@@ -70,7 +71,9 @@ , namespaceXsdType ) -import Data.Monoid(Monoid(..))+#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710)+import Data.Monoid (Monoid(..))+#endif import qualified Data.Text.Lazy.Builder as B
src/Swish/RDF/Datatype/XSD/Integer.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : Integer--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module defines the structures used to represent and -- manipulate RDF @xsd:integer@ datatyped literals.@@ -61,9 +62,12 @@ , namespaceXsdType ) -import Data.Monoid(Monoid(..)) import Control.Monad (liftM) import Data.Maybe (maybeToList)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710)+import Data.Monoid (Monoid(..))+#endif import qualified Data.Text.Lazy.Builder as B
src/Swish/RDF/Datatype/XSD/MapDecimal.hs view
@@ -36,8 +36,8 @@ mapXsdDecimal = DatatypeMap { -- mapL2V :: T.Text -> Maybe Double mapL2V = \txt -> case T.double txt of- Right (val, "") -> Just val- _ -> Nothing+ Right (val, "") -> Just val+ _ -> Nothing -- mapV2L :: Double -> Maybe T.Text -- TODO: for now convert via String as issues with text-format
src/Swish/RDF/Datatype/XSD/String.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : String--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module defines the structures used to represent and -- manipulate RDF @xsd:string@ datatyped literals.@@ -59,7 +60,9 @@ , namespaceXsdType ) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid(Monoid(..))+#endif import qualified Data.Text as T import qualified Data.Text.Lazy.Builder as B
src/Swish/RDF/Formatter/Internal.hs view
@@ -7,7 +7,7 @@ -- | -- Module : Internal -- 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@@ -79,7 +79,9 @@ import Data.List (foldl', groupBy, intersperse, partition) import Data.Maybe (isJust)+#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..), mconcat)+#endif import Data.Word import Network.URI (URI)
src/Swish/RDF/Formatter/N3.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -6,7 +7,7 @@ -- | -- Module : N3 -- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin,--- 2011, 2012 Douglas Burke+-- 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke@@ -69,12 +70,12 @@ , emptyNgs , findMaxBnode , processArcs- , quoteB- , formatScopedName- , formatPlainLit- , formatLangLit- , formatTypedLit- , insertList+ , quoteB+ , formatScopedName+ , formatPlainLit+ , formatLangLit+ , formatTypedLit+ , insertList , nextLine_ , mapBlankNode_ , formatPrefixes_@@ -84,7 +85,7 @@ , formatObjects_ , insertBnode_ , extractList_- ) + ) import Swish.Namespace (ScopedName) @@ -108,8 +109,11 @@ import Control.Monad.State (State, modify, get, gets, put, runState) import Data.Char (isDigit)-import Data.Monoid (Monoid(..)) import Data.Word (Word32)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710)+import Data.Monoid (Monoid(..))+#endif -- it strikes me that using Lazy Text here is likely to be -- wrong; however I have done no profiling to back this
src/Swish/RDF/Formatter/NTriples.hs view
@@ -1,16 +1,18 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-}+ -------------------------------------------------------------------------------- -- See end of this file for licence information. -------------------------------------------------------------------------------- -- | -- Module : NTriples -- 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 : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This Module implements a NTriples formatter for a 'RDFGraph'. --@@ -53,7 +55,10 @@ import Control.Applicative ((<$>)) import Data.Char (ord, intToDigit, toUpper)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid+#endif -- it strikes me that using Lazy Text here is likely to be -- wrong; however I have done no profiling to back this
src/Swish/RDF/Formatter/Turtle.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -6,12 +7,12 @@ -- | -- Module : Turtle -- 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 : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This Module implements a Turtle formatter -- for an 'RDFGraph' value.@@ -77,7 +78,7 @@ , formatObjects_ , insertBnode_ , extractList_- )+ ) import Swish.RDF.Graph ( RDFGraph, RDFLabel(..)@@ -93,8 +94,11 @@ import Control.Monad.State (State, modify, gets, runState) import Data.Char (isDigit)-import Data.Monoid (Monoid(..)) import Data.Word (Word32)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710)+import Data.Monoid (Monoid(..))+#endif -- it strikes me that using Lazy Text here is likely to be -- wrong; however I have done no profiling to back this
src/Swish/RDF/Graph.hs view
@@ -196,12 +196,17 @@ import Swish.GraphMatch (graphMatch) import Swish.QName (QName, getLName) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Control.Applicative (Applicative(pure), (<$>), (<*>))+import Data.Monoid (Monoid(..))+#else+import Control.Applicative ((<$>))+#endif+ import Control.Arrow ((***)) import Network.URI (URI) -import Data.Monoid (Monoid(..)) import Data.Maybe (mapMaybe) import Data.Char (ord, isDigit) import Data.Hashable (hashWithSalt)@@ -1396,7 +1401,7 @@ graphMatch matchable (getArcs g1) (getArcs g2) where matchable l1 l2 = mapFormula g1 l1 == mapFormula g2 l2- -- hmmm, if we compare the formula, rather then graph,+ -- hmmm, if we compare the formula, rather then graph, -- a lot of tests fail (when the formulae are named by blank -- nodes). Presumably because the quality check for Formula forces -- the label to be identical, which it needn't be with bnodes@@ -1581,7 +1586,7 @@ ns = mapMaybe (fmap getScopeNamespace . getNS) $ S.toList lbls nsmap = foldl' (\m ins -> let (p,u) = getNamespaceTuple ins- in M.insertWith (flip const) p u m)+ in M.insertWith (flip const) p u m) emptyNamespaceMap ns in mempty { namespaces = nsmap, statements = arcs }
src/Swish/RDF/Parser/N3.hs view
@@ -5,7 +5,7 @@ -------------------------------------------------------------------------------- -- | -- Module : N3--- 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@@ -483,7 +483,7 @@ inBody :: Char -> Bool inBody c = let i = ord c- in c `elem` "-_" || i == 0x007 ||+ in c `elem` ("-_"::String) || i == 0x007 || match c [('0', '9'), ('A', 'Z'), ('a', 'z')] || match i [(0x00c0, 0x00d6), (0x00d8, 0x00f6), (0x00f8, 0x037d), (0x037f, 0x1fff), (0x200c, 0x200d), (0x203f, 0x2040), @@ -1103,7 +1103,9 @@ n3decimal = (++) <$> n3integer <*> ( (:) <$> char '.' <*> many digit ) n3double :: N3Parser String-n3double = (++) <$> n3decimal <*> ( (:) <$> satisfy (`elem` "eE") <*> n3integer )+n3double = (++) + <$> n3decimal + <*> ( (:) <$> satisfy (`elem` ("eE"::String)) <*> n3integer ) -- Convert a double, as returned by n3double, into it's -- canonical XSD form. We assume that n3double returns
src/Swish/RDF/Parser/Turtle.hs view
@@ -5,7 +5,7 @@ -------------------------------------------------------------------------------- -- | -- Module : Turtle--- 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@@ -641,7 +641,7 @@ isIRIChar c = c > chr 0x20 && - c `notElem` "<>\"{}|^`\\"+ c `notElem` ("<>\"{}|^`\\"::String) {- [139s] PNAME_NS ::= PN_PREFIX? ':'@@ -777,7 +777,7 @@ -- Returns True for + and False for -. _leadingSign :: TurtleParser (Maybe Bool) _leadingSign = do- ms <- optional (satisfy (`elem` "+-"))+ ms <- optional (satisfy (`elem` ("+-"::String))) return $ (=='+') `fmap` ms {-
src/Swish/RDF/Parser/Utils.hs view
@@ -93,7 +93,7 @@ case uriScheme uri of "" -> Right $ uri `relativeTo` base _ -> Right uri- + -- | Type for special name lookup table type SpecialMap = M.Map String ScopedName
src/Swish/RDF/Proof.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} @@ -6,12 +7,12 @@ -------------------------------------------------------------------------------- -- | -- Module : Proof--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : FlexibleInstances, UndecidableInstances+-- Portability : CPP, FlexibleInstances, UndecidableInstances -- -- This module instantiates the 'Proof' framework for -- constructing proofs over 'RDFGraph' expressions.@@ -44,7 +45,10 @@ import Swish.Utils.ListHelpers (flist) import Data.List (subsequences)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import qualified Data.Map as M import qualified Data.Set as S@@ -175,7 +179,7 @@ mapList = remapLabelList nonvarNodes varNodes mapSubLists = (tail . subsequences) mapList mapGr ls = fmapNSGraph - (\l -> M.findWithDefault l l+ (\l -> M.findWithDefault l l (M.fromList ls)) in -- Return all remappings of the original merged graph
src/Swish/RDF/ProofContext.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : ProofContext--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module contains proof-context declarations based on -- the RDF, RDFS, and RDF datatyping semantics specifications.@@ -64,7 +65,9 @@ , scopeRDFD ) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import qualified Data.Text.Lazy.Builder as B
src/Swish/RDF/Query.hs view
@@ -1,14 +1,16 @@+{-# LANGUAGE CPP #-}+ -------------------------------------------------------------------------------- -- See end of this file for licence information. -------------------------------------------------------------------------------- -- | -- Module : Query--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : H98+-- Portability : CPP -- -- This module defines functions for querying an RDF graph to obtain -- a set of variable substitutions, and to apply a set of variable@@ -19,18 +21,32 @@ -- A minimal example is shown below, where we query a very simple -- graph: ----- >>> :m + Swish.RDF Swish.RDF.Parser.N3 Swish.RDF.Query -- >>> :set -XOverloadedStrings+-- >>> import Swish.RDF+-- >>> import Swish.RDF.Parser.N3 (parseN3fromText)+-- >>> import Swish.RDF.Query+-- >>> import Swish.VarBinding (VarBinding(vbMap))+-- >>> import Network.URI (parseURI)+-- >>> import Data.Maybe (fromJust, mapMaybe) -- >>> let qparse = either error id . parseN3fromText -- >>> let igr = qparse "@prefix a: <http://example.com/>. a:a a a:A ; a:foo a:bar. a:b a a:B ; a:foo a:bar." -- >>> let qgr = qparse "?node a ?type."--- >>> rdfQueryFind qgr igr--- [[(?type,a:B),(?node,a:b)],[(?type,a:A),(?node,a:a)]]--- >>> let bn = (toRDFLabel . Data.Maybe.fromJust . Network.URI.parseURI) "http://example.com/B"--- >>> rdfFindArcs (rdfObjEq bn) igr+-- >>> let ans = rdfQueryFind qgr igr+-- >>> :t ans+-- ans :: [Swish.RDF.VarBinding.RDFVarBinding]+-- >>> ans+-- [[(?node,a:a),(?type,a:A)],[(?node,a:b),(?type,a:B)]]+-- >>> let bn = toRDFLabel . fromJust . parseURI $ "http://example.com/B"+-- >>> let arcs = rdfFindArcs (rdfObjEq bn) igr+-- >>> :t arcs+-- arcs :: [RDFTriple]+-- >>> arcs -- [(a:b,rdf:type,a:B)]--- >>> Data.Maybe.mapMaybe (flip Swish.RDF.VarBinding.vbMap (Var "type")) $ rdfQueryFind qgr igr--- [a:B,a:A]+-- >>> let lbls = mapMaybe (`vbMap` (Var "type")) ans+-- >>> :t lbls+-- lbls :: [RDFLabel]+-- >>> lbls+-- [a:A,a:B] -- -------------------------------------------------------------------------------- @@ -83,7 +99,10 @@ import Control.Monad.State (State, runState, modify) import Data.Maybe (mapMaybe, isJust, fromJust)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import qualified Data.Set as S
src/Swish/RDF/Ruleset.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : Ruleset--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module defines some datatypes and functions that are -- used to define rules and rulesets over RDF graphs.@@ -74,7 +75,10 @@ import Data.List (nub) import Data.Maybe (fromMaybe)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import qualified Data.Set as S import qualified Data.Text.Lazy.Builder as B
src/Swish/RDF/Vocabulary.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : Vocabulary--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module defines some commonly used vocabulary terms, -- using the 'Namespace' and 'ScopedName' data types. Additional vocabularies@@ -73,7 +74,9 @@ import Data.Char (isDigit, isAsciiLower) import Data.List (isPrefixOf) import Data.List.NonEmpty (NonEmpty(..))+#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (mappend, mconcat)+#endif import Data.Maybe (fromJust, fromMaybe) import Data.String (IsString(..))
src/Swish/Script.hs view
@@ -1,15 +1,17 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-}+ -------------------------------------------------------------------------------- -- See end of this file for licence information. -------------------------------------------------------------------------------- {- | Module : Script-Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke License : GPL V2 Maintainer : Douglas Burke Stability : experimental-Portability : OverloadedStrings+Portability : CPP, OverloadedStrings This module implements the Swish script processor: it parses a script from a supplied string, and returns a list of Swish state transformer@@ -126,7 +128,9 @@ import Control.Monad (unless, when, liftM, void) import Control.Monad.State (modify, gets, lift) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import Network.URI (URI(..))
src/Swish/VarBinding.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-}@@ -7,12 +8,12 @@ -------------------------------------------------------------------------------- -- | -- Module : VarBinding--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : FlexibleInstances, OverloadedStrings, TypeSynonymInstances+-- Portability : CPP, FlexibleInstances, OverloadedStrings, TypeSynonymInstances -- -- This module defines functions for representing and manipulating query -- binding variable sets. This is the key data that mediates between@@ -47,13 +48,18 @@ import Swish.Utils.ListHelpers (flist) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Control.Applicative ((<$>), (<*>))+import Data.Monoid (Monoid(..), mconcat)+#else+import Control.Applicative ((<$>))+#endif+ import Control.Monad (mplus) import Data.Function (on) import Data.List (find, intersect, union, (\\), foldl', permutations) import Data.Maybe (mapMaybe, fromMaybe, isJust, fromJust, listToMaybe)-import Data.Monoid (Monoid(..), mconcat) import Data.Ord (comparing) import qualified Data.Map as M
swish.cabal view
@@ -1,5 +1,5 @@ Name: swish-Version: 0.9.1.1+Version: 0.9.1.2 Stability: experimental License: LGPL License-file: LICENSE @@ -44,138 +44,7 @@ . * Complete, ready-to-run, command-line and script-driven programs. .- Changes in version @0.9.1.1@:- .- * Updated the upper bound on the semigroups and polyparse dependencies.- .- 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.- .- Changes in version @0.9.0.14@:- .- * Updated the upper bound on the network dependency.- .- Changes in version @0.9.0.13@:- .- * Updated the upper bound on the semigroups dependency.- .- Changes in version @0.9.0.12@:- .- * Updated the upper bound on the text dependency to include version- 1.1 (requires an update to semigroups to use).- .- Changes in version @0.9.0.11@:- .- * Hackage has a better chance of finding the CHANGELOG file if it- is included in the distribution! There are *no* changes to the - library or examples.- .- Changes in version @0.9.0.10@:- .- * Renamed CHANGES to CHANGELOG in the hope it will get picked up- by Hackage. There are *no* changes to the library or examples.- .- Changes in version @0.9.0.9@:- .- * Updated the upper bound on the semigroups dependency (thanks to - Leif Warner).- .- * Updated the upper bound on the text dependency (however, requires- changes to intern and semigroups to use).- .- Changes in version @0.9.0.8@:- .- * Updated the upper bound on the semigroups dependency (thanks to - Leif Warner).- .- * Display library version when running the @runw3ctests@ executable- and ensure there is a space between file name and test result in the- screen output.- .- Changes in version @0.9.0.7@:- .- * Minor documentation fix for @Swish.RDF.Graph.quote@.- .- Changes in version @0.9.0.6@:- .- * Turtle/N3 output: @\\f@ characters in literals are converted to- @\\u000C@ to work around some interoperability issues.- .- * Changed the test handling to use @test-framework@.- .- Changes in version @0.9.0.5@:- .- * Turtle/N3 output: more changes for string literals containing- double-quote characters.- .- * N3 Parser: parsing of string literals within three quote marks has- been updated to match the Turtle parser.- .- * Turtle Parser: a few more error messages have been added.- .- Changes in version @0.9.0.4@:- .- * Turtle parser: updated to the Candidate Recommendation (19 February 2013)- 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.- .- * Turtle/N3 output: improved string formatting (better handling of- 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- @en-UK@ (case is preserved).- .- * @Swish.QName.LName@ names can now contain @#@, @:@ and @/@ characters.- .- * Added tests for the Turtle parser and formatter.- .- * The new @w3ctests@ flag will build the @runw3ctests@ executable,- 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@.- .- Changes in version @0.9.0.2@:- .- * Updated the upper bound on the polyparse dependency.- .- Changes in version @0.9.0.1@:- .- * Updated the upper bound on the semigroups dependency (thanks to - Leif Warner).- .- Changes in version @0.9.0.0@:- .- * Updated to support @hashable-1.2@ series; although this should *not*- change the API from the @0.8@ series, I have decided to bump up the version to- @0.9@ just in case.- .- * Fix failing test on 64-bit GHC (no change to the library).- .- Changes in previous versions can be found at <https://bitbucket.org/doug_burke/swish/src/tip/CHANGELOG>.+ Changes are given in the <https://bitbucket.org/doug_burke/swish/src/tip/CHANGELOG>. . References: .@@ -223,7 +92,7 @@ hashable (>= 1.1 && < 1.2) || (>= 1.2.0.6 && <1.3), mtl >= 2 && < 3, old-locale == 1.0.*, - polyparse >= 1.6 && <= 1.10,+ polyparse >= 1.6 && <= 1.11, semigroups >= 0.5 && < 0.17, text >= 0.11 && < 1.3, time >= 1.1 && < 1.6
tests/GraphTest.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : GraphTest--- 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@@ -34,7 +34,7 @@ mapLabelIndex, {-mapLabelList,-} setLabelHash, newLabelMap, graphLabels, assignLabelMap, newGenerationMap -- graphMatch1 only used with pairSort- , equivalenceClasses+ , equivalenceClasses ) -- import Swish.Utils.ListHelpers (subset)
tests/N3FormatterTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : N3FormatterTest--- 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 defines test cases for module Parse parsing functions. --@@ -47,7 +48,10 @@ import Network.URI (URI, parseURI) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif+ import Data.Maybe (fromJust) import Data.String (IsString(..))@@ -462,7 +466,7 @@ { namespaces = nslist , formulae = M.singleton b2 x12fg -- $ Formula b2 x12fg , statements = S.fromList - [ arc s1 p1 b1+ [ arc s1 p1 b1 , arc b1 p1 o1 , arc b2 p2 f2 , arc s3 p3 b3
tests/N3ParserTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : N3ParserTest--- 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 "N3Parser". --@@ -66,7 +67,10 @@ import Network.URI (URI, nullURI, parseURIReference) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif+ import Data.Maybe (fromJust, fromMaybe) import Data.List (intercalate)
tests/QNameTest.hs view
@@ -5,7 +5,7 @@ -------------------------------------------------------------------------------- -- | -- Module : QNameTest--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2013 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2013, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke@@ -109,7 +109,7 @@ [ testQNameEq (testLab l1 l2) (testEq l1 l2) n1 n2 | (l1,n1) <- qnlist , (l2,n2) <- qnlist ] where- testLab l1 l2 = l1 ++ "-" ++ l2+ testLab l1 l2 = l1 ++ ("-"::String) ++ l2 testEq l1 l2 = (l1 == l2) || (l1,l2) `elem` qneqlist || (l2,l1) `elem` qneqlist
tests/RDFDatatypeXsdIntegerTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : RDFDatatypeXsdIntegerTest--- 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 variable binding values and -- variable binding modifier values.@@ -59,7 +60,10 @@ import Data.List (intersperse) import Data.Maybe (fromMaybe, fromJust)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import Network.URI (URI, parseURI)
tests/RDFGraphTest.hs view
@@ -66,9 +66,12 @@ import Data.List (elemIndex, intercalate) import Data.Maybe (fromJust, fromMaybe)-import Data.Monoid (Monoid(..)) import Data.Ord (comparing) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710)+import Data.Monoid (Monoid(..))+#endif+ import Network.URI (URI, parseURI) #if MIN_VERSION_time(1,5,0)@@ -131,12 +134,14 @@ testLangEq :: String -> Bool -> Lang -> Lang -> Test testLangEq = testCompareEq "testLangEq:" +hyphen :: String -> String -> String+hyphen a b = a ++ "-" ++ b+ testLangEqSuite :: Test testLangEqSuite = TestList- [ testLangEq (tLab ll1 ll2) (tEq ll1 ll2) t1 t2+ [ testLangEq (ll1 `hyphen` ll2) (tEq ll1 ll2) t1 t2 | (ll1,t1) <- langlist , (ll2,t2) <- langlist ] where- tLab ll1 ll2 = ll1 ++ "-" ++ ll2 tEq ll1 ll2 = (ll1 == ll2) || (ll1,ll2) `elem` langeqlist || (ll2,ll1) `elem` langeqlist@@ -334,10 +339,9 @@ testNodeEqSuite :: Test testNodeEqSuite = TestList- [ testLabelEq (tLab ll1 ll2) (tEq ll1 ll2) n1 n2+ [ testLabelEq (ll1 `hyphen` ll2) (tEq ll1 ll2) n1 n2 | (ll1,n1) <- nodelist , (ll2,n2) <- nodelist ] where- tLab ll1 ll2 = ll1 ++ "-" ++ ll2 tEq ll1 ll2 = (ll1 == ll2) || (ll1,ll2) `elem` nodeeqlist || (ll2,ll1) `elem` nodeeqlist@@ -731,10 +735,9 @@ testNodeOrdSuite :: Test testNodeOrdSuite = TestList- [ testLabelOrd (tLab ll1 ll2) (tOrd ll1 ll2) n1 n2+ [ testLabelOrd (ll1 `hyphen` ll2) (tOrd ll1 ll2) n1 n2 | (ll1,n1) <- nodelist , (ll2,n2) <- nodelist ] where- tLab ll1 ll2 = ll1 ++ "-" ++ ll2 tOrd ll1 ll2 | tEq ll1 ll2 = EQ | otherwise = comparing fromJust @@ -783,7 +786,7 @@ tlist = [ (lab s p o,trp s p o) | s <- slist, p <- plist, o <- olist ] where- lab (s,_) (p,_) (o,_) = intercalate "." [s, p, o]+ lab (s,_) (p,_) (o,_) = intercalate ("."::String) [s, p, o] trp (_,s) (_,p) (_,o) = arc s p o stmteqlist :: [(String, String)]@@ -808,10 +811,9 @@ testStmtEqSuite :: Test testStmtEqSuite = TestList- [ testStmtEq (tLab ll1 ll2) (tEq ll1 ll2) t1 t2+ [ testStmtEq (ll1 `hyphen` ll2) (tEq ll1 ll2) t1 t2 | (ll1,t1) <- tlist , (ll2,t2) <- tlist ] where- tLab ll1 ll2 = ll1 ++ "-" ++ ll2 tEq ll1 ll2 = (ll1 == ll2) || (ll1,ll2) `elem` stmteqlist || (ll2,ll1) `elem` stmteqlist@@ -970,10 +972,9 @@ testGraphEqSuite :: Test testGraphEqSuite = TestList- [ testGraphEq (tLab ll1 ll2) (tEq ll1 ll2) gg1 gg2+ [ testGraphEq (ll1 `hyphen` ll2) (tEq ll1 ll2) gg1 gg2 | (ll1,gg1) <- glist , (ll2,gg2) <- glist ] where- tLab ll1 ll2 = ll1 ++ "-" ++ ll2 tEq ll1 ll2 = (ll1 == ll2) || (ll1,ll2) `elem` grapheqlist || (ll2,ll1) `elem` grapheqlist
tests/RDFProofContextTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,7 +6,7 @@ -------------------------------------------------------------------------------- -- | -- Module : RDFProofContextTest--- 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@@ -55,7 +56,10 @@ ) import Data.Maybe (isNothing, fromJust, fromMaybe)++#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif import Network.URI (URI, parseURI)
tests/RDFProofTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : RDFProofTest--- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2013 Douglas Burke+-- Copyright : (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2013, 2014 Douglas Burke -- License : GPL V2 -- -- Maintainer : Douglas Burke -- Stability : experimental--- Portability : OverloadedStrings+-- Portability : CPP, OverloadedStrings -- -- This module tests the RDFproof module, which instantiates the proof -- rule class over RDF graphs.@@ -51,7 +52,10 @@ ( Label(..), RDFLabel(..), RDFGraph , addGraphs, allLabels, allNodes ) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif+ import Data.Maybe (fromJust) import Network.URI (URI, parseURI)
tests/RDFQueryTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : RDFQueryTest--- 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 defines test cases for querying an RDF graph to obtain -- a set of variable substitutions, and to apply a set of variable@@ -61,7 +62,10 @@ import Swish.RDF.Vocabulary (namespaceRDF, toLangTag, swishName, rdfType, rdfXMLLiteral) import Swish.RDF.Parser.N3 (parseN3) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif+ import Data.Maybe (fromJust) import Network.URI (URI, parseURI)
tests/RDFRulesetTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -5,12 +6,12 @@ -------------------------------------------------------------------------------- -- | -- Module : RDFRulesetTest--- 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 ruleset data. --@@ -63,7 +64,10 @@ import Swish.RDF.Vocabulary (namespaceRDF, namespaceRDFS, namespaceOWL, scopeRDF) +#if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Data.Monoid (Monoid(..))+#endif+ import Data.List (sort) import Data.Maybe (isJust, fromJust) import Data.Text (Text)