module Logic.KnownIris where
import qualified Data.Map as Map
logPrefix, serPrefix :: String
logPrefix :: String
logPrefix = "http://purl.net/dol/logics/"
serPrefix :: String
serPrefix = "http://purl.net/dol/serializations/"
logicNames :: Map.Map String String
logicNames :: Map String String
logicNames =
[(String, String)] -> Map String String
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
[ (String
logPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "CommonLogic", "CommonLogic"),
(String
logPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "Propositional", "Propositional"),
(String
logPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "OWL2", "OWL") ]
lookupLogicName :: String -> Maybe String
lookupLogicName :: String -> Maybe String
lookupLogicName = (String -> Map String String -> Maybe String
forall k a. Ord k => k -> Map k a -> Maybe a
`Map.lookup` Map String String
logicNames)
serializations :: String -> Map.Map String String
serializations :: String -> Map String String
serializations l :: String
l
| String
l String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "CommonLogic" =
[(String, String)] -> Map String String
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [ (String
serPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "CommonLogic/CLIF", "CLIF"),
(String
serPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "CommonLogic/KIF", "KIF") ]
| String
l String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "Propositional" =
[(String, String)] -> Map String String
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [ (String
serPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "Propositional/Hets", "Hets") ]
| String
l String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "OWL" =
[(String, String)] -> Map String String
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [ (String
serPrefix String -> String -> String
forall a. [a] -> [a] -> [a]
++ "OWL2/Manchester", "Manchester") ]
| Bool
otherwise = Map String String
forall k a. Map k a
Map.empty
lookupSerialization :: String -> String -> Maybe String
lookupSerialization :: String -> String -> Maybe String
lookupSerialization l :: String
l = (String -> Map String String -> Maybe String
forall k a. Ord k => k -> Map k a -> Maybe a
`Map.lookup` String -> Map String String
serializations String
l)