Morphism.hs revision 5efb71382fdcce83a76a6d40e5f8def0462bf8a8
e83ed59502a681713982f25c559aae77a4145734Christian MaederModule : $Header$
eb483f2216949400bfef8f6deb5320f071445626Christian MaederDescription : RDF Morphism
e6d40133bc9f858308654afb1262b8b483ec5922Till MossakowskiCopyright : (c) Francisc-Nicolae Bungiu, 2011
eb483f2216949400bfef8f6deb5320f071445626Christian MaederLicense : GPLv2 or higher, see LICENSE.txt
eb483f2216949400bfef8f6deb5320f071445626Christian MaederMaintainer : f.bungiu@jacobs-university.de
3f69b6948966979163bdfe8331c38833d5d90ecdChristian MaederStability : provisional
eb483f2216949400bfef8f6deb5320f071445626Christian MaederPortability : portable
f3a94a197960e548ecd6520bb768cb0d547457bbChristian MaederMorphisms for RDF
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder ( RDFMorphism (..)
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder , isRDFInclusion
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder , inclRDFMorphism
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , composeMor
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , cogeneratedSign
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , generatedSign
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , matchesSym
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , statSymbItems
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , statSymbMapItems
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder-- , inducedFromMor
e83ed59502a681713982f25c559aae77a4145734Christian Maederimport Common.Utils (composeMap)
e83ed59502a681713982f25c559aae77a4145734Christian Maederimport Common.Lib.State (execState)
e83ed59502a681713982f25c559aae77a4145734Christian Maederimport qualified Data.Map as Map
e83ed59502a681713982f25c559aae77a4145734Christian Maederimport qualified Data.Set as Set
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maederdata RDFMorphism = RDFMorphism
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder { osource :: Sign
e83ed59502a681713982f25c559aae77a4145734Christian Maeder , otarget :: Sign
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder , mmaps :: MorphMap
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder , pmap :: StringMap
e83ed59502a681713982f25c559aae77a4145734Christian Maeder } deriving (Show, Eq, Ord)
e83ed59502a681713982f25c559aae77a4145734Christian MaederinclRDFMorphism :: Sign -> Sign -> RDFMorphism
9929f81562adecc8aafaefb14a0159afcf4a3351Christian MaederinclRDFMorphism s t = RDFMorphism
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder { osource = s
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder , otarget = t
9929f81562adecc8aafaefb14a0159afcf4a3351Christian MaederisRDFInclusion :: RDFMorphism -> Bool
9929f81562adecc8aafaefb14a0159afcf4a3351Christian MaederisRDFInclusion m = Map.null (pmap m)
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder && Map.null (mmaps m) && isSubSign (osource m) (otarget m)