AS.hs revision 44985cbd4eb61dbc348617ebdd44a774e51dac07
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceModule : $Header$
5d801400993c9671010d244646936d8fd435638cChristian MaederCopyright : (c) C. Maeder
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceLicense : GPLv2 or higher, see LICENSE.txt
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceMaintainer : Christian.Maeder@dfki.de
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceStability : provisional
5d801400993c9671010d244646936d8fd435638cChristian MaederPortability : portable
5d801400993c9671010d244646936d8fd435638cChristian MaederCommon datatypes for the Functional and Manchester Syntaxes of OWL 2
5d801400993c9671010d244646936d8fd435638cChristian Maeder <http://www.w3.org/TR/2009/REC-owl2-syntax-20091027/#Functional-Style_Syntax>
5d801400993c9671010d244646936d8fd435638cChristian Maeder <http://www.w3.org/TR/owl2-manchester-syntax/>
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Manceimport qualified Data.Map as Map
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance{- | full or abbreviated IRIs with a possible uri for the prefix
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance or a local part following a hash sign -}
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mancedata QName = QN
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance { namePrefix :: String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance -- ^ the name prefix part of a qualified name \"namePrefix:localPart\"
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance , localPart :: String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance -- ^ the local part of a qualified name \"namePrefix:localPart\"
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance , isFullIri :: Bool
0ec1551231bc5dfdcb3f2bd68fec7457fade7bfdFelix Gabriel Mance , expandedIRI :: String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance -- ^ the associated namespace uri (not printed)
852bd6145634dc2832b61c44678fe539bc1682d5Christian Maeder , iriPos :: Range
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder } deriving Show
fc7bd98aabe1bc26058660085e8c77d60a97bcecChristian Maederinstance GetRange QName where
fc7bd98aabe1bc26058660085e8c77d60a97bcecChristian Maeder getRange = iriPos
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowQN :: QName -> String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowQN q = (if isFullIri q then showQI else showQU) q
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance-- | show QName as abbreviated iri
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowQU :: QName -> String
852bd6145634dc2832b61c44678fe539bc1682d5Christian MaedershowQU (QN pre local _ _ _) =
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance if null pre then local else pre ++ ":" ++ local
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance-- | show QName in ankle brackets as full iris
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowQI :: QName -> String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowQI = ('<' :) . (++ ">") . showQU
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel MancenullQName :: QName
852bd6145634dc2832b61c44678fe539bc1682d5Christian MaedernullQName = QN "" "" False "" nullRange
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel MancedummyQName :: QName
852bd6145634dc2832b61c44678fe539bc1682d5Christian Maeder QN "http" "//www.dfki.de/sks/hets/ontology/unamed" True "" nullRange
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel MancemkQName :: String -> QName
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel MancemkQName s = nullQName { localPart = s }
852bd6145634dc2832b61c44678fe539bc1682d5Christian MaedersetQRange :: Range -> QName -> QName
852bd6145634dc2832b61c44678fe539bc1682d5Christian MaedersetQRange r q = q { iriPos = r }
ea3f858eb531d981df3ed00beeadd99cf025adecChristian MaedersetPrefix :: String -> QName -> QName
ea3f858eb531d981df3ed00beeadd99cf025adecChristian MaedersetPrefix s q = q { namePrefix = s }
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Manceinstance Eq QName where
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance p == q = compare p q == EQ
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Manceinstance Ord QName where
852bd6145634dc2832b61c44678fe539bc1682d5Christian Maeder compare (QN p1 l1 b1 n1 _) (QN p2 l2 b2 n2 _) = case (n1, n2) of
806e8e0fe1a46ce1523c0d7804f1c193321f7981Christian Maeder ("", "") -> compare (b1, p1, l1) (b2, p2, l2)
806e8e0fe1a46ce1523c0d7804f1c193321f7981Christian Maeder ("", _) -> LT
806e8e0fe1a46ce1523c0d7804f1c193321f7981Christian Maeder (_, "") -> GT
806e8e0fe1a46ce1523c0d7804f1c193321f7981Christian Maeder _ -> compare n1 n2 -- compare fully expanded names only
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype IRIreference = QName
dd3c105fcc30b5d6b750d8fbe32250207b996109Felix Gabriel Mancetype IRI = QName
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance-- | prefix -> localname
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype PrefixMap = Map.Map String String
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype LexicalForm = String
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype LanguageTag = String
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype ImportIRI = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype OntologyIRI = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype Class = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype Datatype = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype ObjectProperty = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype DataProperty = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype AnnotationProperty = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype NamedIndividual = IRI
9cb6af1a7632f12b60f592ce5eb2ac51e6bd33bbFelix Gabriel Mancetype Individual = IRI
097bc9f18b722812d480df0f5c634d09cbca8e21Felix Gabriel Mancedata TypedOrUntyped = Typed Datatype | Untyped (Maybe LanguageTag)
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Show, Eq, Ord)
a921ae1da1302f673204e7b63cdce01439a9bd5eFelix Gabriel Mancedata Literal = Literal LexicalForm TypedOrUntyped
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Show, Eq, Ord)
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel MancecTypeS :: String
1435782fda52a2898ea74e99088351d4f5b450dcChristian Maeder-- * PROPERTY EXPRESSIONS
097bc9f18b722812d480df0f5c634d09cbca8e21Felix Gabriel Mancetype InverseObjectProperty = ObjectPropertyExpression
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maederdata ObjectPropertyExpression = ObjectProp ObjectProperty
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder | ObjectInverseOf InverseObjectProperty
5d801400993c9671010d244646936d8fd435638cChristian Maeder deriving (Show, Eq, Ord)
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype DataPropertyExpression = DataProperty
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance-- | data type strings (some are not listed in the grammar)
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel MancedatatypeKeys :: [String]
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance , negativeIntegerS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance , nonNegativeIntegerS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance , nonPositiveIntegerS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance , positiveIntegerS
44985cbd4eb61dbc348617ebdd44a774e51dac07Christian MaederisDatatypeKey :: IRI -> Bool
44985cbd4eb61dbc348617ebdd44a774e51dac07Christian MaederisDatatypeKey u =
44985cbd4eb61dbc348617ebdd44a774e51dac07Christian Maeder elem (localPart u) datatypeKeys && elem (namePrefix u) ["", "xsd"]
1435782fda52a2898ea74e99088351d4f5b450dcChristian Maeder-- * DATA RANGES
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mancedata DatatypeFacet =
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | MININCLUSIVE
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | MINEXCLUSIVE
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | MAXINCLUSIVE
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | MAXEXCLUSIVE
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | FRACTIONDIGITS
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Show, Eq, Ord)
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowFacet :: DatatypeFacet -> String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowFacet df = case df of
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance LENGTH -> lengthS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MINLENGTH -> minLengthS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MAXLENGTH -> maxLengthS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance PATTERN -> patternS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MININCLUSIVE -> lessEq
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MINEXCLUSIVE -> lessS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MAXINCLUSIVE -> greaterEq
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MAXEXCLUSIVE -> greaterS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance TOTALDIGITS -> digitsS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance FRACTIONDIGITS -> fractionS
962c83276bc80dd04f4a83e47eb81524d5294a4fChristian Maederdata DataRange
5d801400993c9671010d244646936d8fd435638cChristian Maeder = DataType Datatype [(ConstrainingFacet, RestrictionValue)]
5d801400993c9671010d244646936d8fd435638cChristian Maeder | DataJunction JunctionType [DataRange]
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder -- at least two elements in the list
5d801400993c9671010d244646936d8fd435638cChristian Maeder | DataComplementOf DataRange
5d801400993c9671010d244646936d8fd435638cChristian Maeder | DataOneOf [Literal] -- at least one element in the list
5d801400993c9671010d244646936d8fd435638cChristian Maeder deriving (Show, Eq, Ord)
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancedata JunctionType = UnionOf | IntersectionOf deriving (Show, Eq, Ord)
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype ConstrainingFacet = IRI
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype RestrictionValue = Literal
1435782fda52a2898ea74e99088351d4f5b450dcChristian Maeder-- * CLASS EXPERSSIONS
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancedata QuantifierType = AllValuesFrom | SomeValuesFrom deriving (Show, Eq, Ord)
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel ManceshowQuantifierType :: QuantifierType -> String
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel ManceshowQuantifierType ty = case ty of
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance AllValuesFrom -> onlyS
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance SomeValuesFrom -> someS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mancedata CardinalityType = MinCardinality | MaxCardinality | ExactCardinality
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance deriving (Show, Eq, Ord)
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowCardinalityType :: CardinalityType -> String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowCardinalityType ty = case ty of
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MinCardinality -> minS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance MaxCardinality -> maxS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance ExactCardinality -> exactlyS
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mancedata Cardinality a b = Cardinality CardinalityType Int a (Maybe b)
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Show, Eq, Ord)
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancedata ClassExpression =
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance Expression Class
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectJunction JunctionType [ClassExpression] -- min. 2 ClassExpressions
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectComplementOf ClassExpression
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectOneOf [Individual] -- min. 1 Individual
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectValuesFrom QuantifierType ObjectPropertyExpression ClassExpression
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectHasValue ObjectPropertyExpression Individual
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectHasSelf ObjectPropertyExpression
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | ObjectCardinality (Cardinality ObjectPropertyExpression ClassExpression)
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder | DataValuesFrom QuantifierType
a6526952d69bccd048c954eb920493a6a83e78faFelix Gabriel Mance DataPropertyExpression DataRange
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mance | DataHasValue DataPropertyExpression Literal
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | DataCardinality (Cardinality DataPropertyExpression DataRange)
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Show, Eq, Ord)
1435782fda52a2898ea74e99088351d4f5b450dcChristian Maeder-- * ANNOTATIONS
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancedata Annotation = Annotation [Annotation] AnnotationProperty AnnotationValue
1435782fda52a2898ea74e99088351d4f5b450dcChristian Maeder deriving (Show, Eq, Ord)
962c83276bc80dd04f4a83e47eb81524d5294a4fChristian Maederdata AnnotationValue
5d801400993c9671010d244646936d8fd435638cChristian Maeder = AnnValue IRI
5d801400993c9671010d244646936d8fd435638cChristian Maeder | AnnValLit Literal
5d801400993c9671010d244646936d8fd435638cChristian Maeder deriving (Show, Eq, Ord)
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mancedata Entity = Entity EntityType IRI deriving (Show, Eq, Ord)
852bd6145634dc2832b61c44678fe539bc1682d5Christian Maederinstance GetRange Entity where
852bd6145634dc2832b61c44678fe539bc1682d5Christian Maeder getRange (Entity _ iri) = iriPos iri
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mancedata EntityType =
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance | ObjectProperty
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance | DataProperty
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance | AnnotationProperty
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance | NamedIndividual
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance deriving (Enum, Bounded, Show, Read, Eq, Ord)
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel ManceshowEntityType :: EntityType -> String
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel ManceshowEntityType e = case e of
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance Datatype -> datatypeC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance Class -> classC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance ObjectProperty -> objectPropertyC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance DataProperty -> dataPropertyC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance AnnotationProperty -> annotationPropertyC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mance NamedIndividual -> individualC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel ManceentityTypes :: [EntityType]
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel ManceentityTypes = [minBound .. maxBound]
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype SourceIndividual = Individual
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype TargetIndividual = Individual
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancetype TargetValue = Literal
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mancedata EquivOrDisjoint = Equivalent | Disjoint
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance deriving (Show, Eq, Ord)
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel ManceshowEquivOrDisjoint :: EquivOrDisjoint -> String
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel ManceshowEquivOrDisjoint ed = case ed of
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance Equivalent -> equivalentToC
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance Disjoint -> disjointWithC
bf47922605c34ddeb05f77188da395945ac2a2c8Felix Gabriel Mancedata DomainOrRange = ADomain | ARange deriving (Show, Eq, Ord)
bf47922605c34ddeb05f77188da395945ac2a2c8Felix Gabriel ManceshowDomainOrRange :: DomainOrRange -> String
bf47922605c34ddeb05f77188da395945ac2a2c8Felix Gabriel ManceshowDomainOrRange dr = case dr of
bf47922605c34ddeb05f77188da395945ac2a2c8Felix Gabriel Mance ADomain -> domainC
bf47922605c34ddeb05f77188da395945ac2a2c8Felix Gabriel Mance ARange -> rangeC
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel Mancedata Relation =
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance EDRelation EquivOrDisjoint
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder | SubPropertyOf
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance | DRRelation DomainOrRange
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel Mance | SDRelation SameOrDifferent
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder deriving (Show, Eq, Ord)
aa64389ee694577d9e665cf57331129000072a79Felix Gabriel ManceshowRelation :: Relation -> String
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel ManceshowRelation r = case r of
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance EDRelation ed -> showEquivOrDisjoint ed
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder SubPropertyOf -> subPropertyOfC
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder InverseOf -> inverseOfC
ba2c0d8be230f0b274cf3e0013e3844a80d9afd4Christian Maeder SubClass -> subClassOfC
f853560cb2b56c631af268adec9dd0c1f518ffd8Felix Gabriel Mance Types -> typesC
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance DRRelation dr -> showDomainOrRange dr
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel Mance SDRelation sd -> showSameOrDifferent sd
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel MancegetDR :: Relation -> DomainOrRange
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel MancegetDR r = case r of
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance DRRelation dr -> dr
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance _ -> error "not domain or range"
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel MancegetED :: Relation -> EquivOrDisjoint
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel MancegetED r = case r of
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance EDRelation ed -> ed
f07079faf4e99014e900c7c99adb5ff7fa106b61Felix Gabriel Mance _ -> error "not domain or range"
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel MancegetSD :: Relation -> SameOrDifferent
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel MancegetSD s = case s of
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel Mance SDRelation sd -> sd
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel Mance _ -> error "not same or different"
8af00c8930672188ae80c8829428859160d329d0Felix Gabriel Mancedata DataDomainOrRange = DataDomain ClassExpression | DataRange DataRange
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Show, Eq, Ord)
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mancedata Character =
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | InverseFunctional
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance | Antisymmetric
968930c7674ae3b63d308bf4fa651400aa263054Christian Maeder deriving (Enum, Bounded, Show, Eq, Ord)
ae9f6ee28850f767319629d3c2e28918698dce3bChristian Maederdata SameOrDifferent = Same | Different deriving (Show, Eq, Ord)
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowSameOrDifferent :: SameOrDifferent -> String
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel ManceshowSameOrDifferent sd = case sd of
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance Same -> sameAsC
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mance Different -> differentFromC
c298a419605037f5352b5ad0f67b3e06db094051Felix Gabriel Mancedata PositiveOrNegative = Positive | Negative deriving (Show, Eq, Ord)