AS.hs revision ba2c0d8be230f0b274cf3e0013e3844a80d9afd4
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian Maeder{- |
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian MaederModule : $Header$
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian MaederCopyright : (c) Heng Jiang, Uni Bremen 2004-2007
75a6279dbae159d018ef812185416cf6df386c10Till MossakowskiLicense : GPLv2 or higher, see LICENSE.txt
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian Maeder
eca29a7be76eb73944ec19b06eda3d6a9e6e543dChristian MaederMaintainer : Christian.Maeder@dfki.de
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian MaederStability : provisional
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian MaederPortability : non-portable(deriving Typeable)
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian Maeder
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian MaederCommon datatypes for Functional and Manchester Syntax of OWl 2
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian MaederIt is modeled after the W3C document:
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder<http://www.w3.org/TR/2009/REC-owl2-syntax-20091027/#Functional-Style_Syntax>
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder-}
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder
04dada28736b4a237745e92063d8bdd49a362debChristian Maedermodule OWL2.AS where
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maederimport Common.Keywords
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder
23f8d286586ff38a9e73052b2c7c04c62c5c638fChristian Maederimport OWL.Keywords
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maederimport OWL.ColonKeywords
f353be6210f67ffd4a46967bba749afc968cee52Christian Maederimport qualified Data.Map as Map
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian Maeder{- | full or abbreviated IRIs with a possible uri for the prefix
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder or a local part following a hash sign -}
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maederdata QName = QN
1738d16957389457347bee85075d3d33d002158fChristian Maeder { namePrefix :: String
1738d16957389457347bee85075d3d33d002158fChristian Maeder -- ^ the name prefix part of a qualified name \"namePrefix:localPart\"
1738d16957389457347bee85075d3d33d002158fChristian Maeder , localPart :: String
1738d16957389457347bee85075d3d33d002158fChristian Maeder -- ^ the local part of a qualified name \"namePrefix:localPart\"
1738d16957389457347bee85075d3d33d002158fChristian Maeder , isFullIri :: Bool
1738d16957389457347bee85075d3d33d002158fChristian Maeder , namespaceUri :: String
1738d16957389457347bee85075d3d33d002158fChristian Maeder -- ^ the associated namespace uri (not printed)
1738d16957389457347bee85075d3d33d002158fChristian Maeder } deriving Show
1738d16957389457347bee85075d3d33d002158fChristian Maeder
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian MaedershowQN :: QName -> String
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian MaedershowQN q = (if isFullIri q then showQI else showQU) q
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder-- | show QName as abbreviated iri
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian MaedershowQU :: QName -> String
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian MaedershowQU (QN pre local _ _) =
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder if null pre then local else pre ++ ":" ++ local
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maeder
e92ae8b45c138b6cf7db8b69e2d099d7f62f24f0Christian Maeder-- | show QName in ankle brackets as full iris
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian MaedershowQI :: QName -> String
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian MaedershowQI = ('<' :) . (++ ">") . showQU
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian MaedernullQName :: QName
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian MaedernullQName = QN "" "" False ""
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian MaederdummyQName :: QName
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian MaederdummyQName = QN "http" "//www.dfki.de/sks/hets/ontology/unamed" True ""
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian MaedermkQName :: String -> QName
cc8b603388a7deb7fb8045db0341f550f8be5844Christian MaedermkQName s = nullQName { localPart = s }
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maeder
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maederinstance Eq QName where
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maeder p == q = compare p q == EQ
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian Maeder
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maederinstance Ord QName where
04dada28736b4a237745e92063d8bdd49a362debChristian Maeder compare (QN p1 l1 b1 n1) (QN p2 l2 b2 n2) =
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder if null n1 then
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder if null n2 then compare (b1, p1, l1) (b2, p2, l2) else LT
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder else if null n2 then GT else compare (b1, l1, n1) (b2, l2, n2)
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype IRIreference = QName
04dada28736b4a237745e92063d8bdd49a362debChristian Maedertype IRI = QName
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian Maeder
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maeder-- | prefix -> localname
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maedertype PrefixMap = Map.Map String String
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maeder
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maedertype NodeID = IRI
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maedertype LexicalForm = String
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maedertype LanguageTag = String
cf5149eb4d0faef6272231879c04aa740f5abc2bChristian Maedertype PrefixName = String
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype ImportIRI = IRI
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype OntologyIRI = IRI
7abd0c58a5ce51db13f93de82407b2188d55d298Christian Maedertype Class = IRI
7abd0c58a5ce51db13f93de82407b2188d55d298Christian Maedertype Datatype = IRI
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype ObjectProperty = IRI
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype DataProperty = IRI
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype AnnotationProperty = IRI
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maedertype NamedIndividual = IRI
04dada28736b4a237745e92063d8bdd49a362debChristian Maedertype Individual = IRI
ce5ff829db5f0bb4f16ad4de150eed4401d6acd5Christian Maeder
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder-------------------------
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder-- LITERALS
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder-------------------------
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maederdata TypedOrUntyped = Typed Datatype | Untyped (Maybe LanguageTag)
04dada28736b4a237745e92063d8bdd49a362debChristian Maeder deriving (Show, Eq, Ord)
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder
bf8221af2a4e579e1a616e3d472e9e8533cd8f8cChristian Maederdata Literal = Literal LexicalForm TypedOrUntyped
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder deriving (Show, Eq, Ord)
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder
04dada28736b4a237745e92063d8bdd49a362debChristian MaedercTypeS :: String
bf8221af2a4e579e1a616e3d472e9e8533cd8f8cChristian MaedercTypeS = "^^"
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder
bf8221af2a4e579e1a616e3d472e9e8533cd8f8cChristian Maeder-- | a lexical representation either with an "^^" URI (typed) or
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder-- an optional language tag starting with "\@" (untyped)
bf8221af2a4e579e1a616e3d472e9e8533cd8f8cChristian Maeder
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder--------------------------
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder-- PROPERTY EXPRESSIONS
bf8221af2a4e579e1a616e3d472e9e8533cd8f8cChristian Maeder--------------------------
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maeder
7dec34aee2b609b9535c48d060e0f7baf3536457Christian Maedertype InverseObjectProperty = ObjectPropertyExpression
bf8221af2a4e579e1a616e3d472e9e8533cd8f8cChristian Maeder
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maederdata ObjectPropertyExpression = ObjectProp ObjectProperty
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder | ObjectInverseOf InverseObjectProperty
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maeder deriving (Show, Eq, Ord)
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maeder
0df692ce8b9293499b2e1768458613a63e7b5cd0Christian Maedertype DataPropertyExpression = DataProperty
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder-- | data type strings (some are not listed in the grammar)
cc8b603388a7deb7fb8045db0341f550f8be5844Christian MaederdatatypeKeys :: [String]
cc8b603388a7deb7fb8045db0341f550f8be5844Christian MaederdatatypeKeys =
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder [ booleanS
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder , dATAS
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder , decimalS
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder , floatS
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder , integerS
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder , negativeIntegerS
f4741f6b7da52b5417899c8fcbe4349b920b006eChristian Maeder , nonNegativeIntegerS
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder , nonPositiveIntegerS
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder , positiveIntegerS
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder , stringS
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder , universalS
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder ]
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder--------------------------
cdaff0507c1b7240e2660dbb311f9c4646a6d14aChristian Maeder-- DATA RANGES
cdaff0507c1b7240e2660dbb311f9c4646a6d14aChristian Maeder--------------------------
cdaff0507c1b7240e2660dbb311f9c4646a6d14aChristian Maeder
cdaff0507c1b7240e2660dbb311f9c4646a6d14aChristian Maederdata DatatypeFacet =
e92ae8b45c138b6cf7db8b69e2d099d7f62f24f0Christian Maeder LENGTH
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian Maeder | MINLENGTH
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder | MAXLENGTH
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder | PATTERN
e92ae8b45c138b6cf7db8b69e2d099d7f62f24f0Christian Maeder | MININCLUSIVE
dedabc954aa15f6ad0764472a9434dc6dafe3db2Christian Maeder | MINEXCLUSIVE
fc816c737e569f135d8e2f79fc83521c85fae667Christian Maeder | MAXINCLUSIVE
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder | MAXEXCLUSIVE
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder | TOTALDIGITS
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder | FRACTIONDIGITS
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder deriving (Show, Eq, Ord)
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder
fc816c737e569f135d8e2f79fc83521c85fae667Christian MaedershowFacet :: DatatypeFacet -> String
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian MaedershowFacet df = case df of
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder LENGTH -> lengthS
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder MINLENGTH -> minLengthS
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder MAXLENGTH -> maxLengthS
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder PATTERN -> patternS
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder MININCLUSIVE -> lessEq
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder MINEXCLUSIVE -> lessS
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder MAXINCLUSIVE -> greaterEq
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder MAXEXCLUSIVE -> greaterS
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder TOTALDIGITS -> digitsS
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder FRACTIONDIGITS -> fractionS
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maederdata DataRange
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder = DataType Datatype
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | DataJunction JunctionType [DataRange]
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder -- at least two elements in the list
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder | DataComplementOf DataRange
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder | DataOneOf [Literal] -- at least one element in the list
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder | DatatypeRestriction Datatype [(ConstrainingFacet, RestrictionValue)]
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder -- at least one element in the list
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder deriving (Show, Eq, Ord)
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maederdata JunctionType = UnionOf | IntersectionOf deriving (Show, Eq, Ord)
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maedertype ConstrainingFacet = IRI
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maedertype RestrictionValue = Literal
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder---------------------------
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder-- CLASS EXPERSSIONS
ac19f8695aa1b2d2d1cd1319da2530edd8f46a96Christian Maeder---------------------------
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maederdata QuantifierType = AllValuesFrom | SomeValuesFrom deriving (Show, Eq, Ord)
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian MaedershowQuantifierType :: QuantifierType -> String
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian MaedershowQuantifierType ty = case ty of
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder AllValuesFrom -> onlyS
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder SomeValuesFrom -> someS
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maederdata CardinalityType = MinCardinality | MaxCardinality | ExactCardinality
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder deriving (Show, Eq, Ord)
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian MaedershowCardinalityType :: CardinalityType -> String
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian MaedershowCardinalityType ty = case ty of
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder MinCardinality -> minS
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder MaxCardinality -> maxS
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder ExactCardinality -> exactlyS
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maederdata Cardinality a b = Cardinality CardinalityType Int a (Maybe b)
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder deriving (Show, Eq, Ord)
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maederdata ClassExpression =
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder Expression Class
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | ObjectJunction JunctionType [ClassExpression] -- min. 2 ClassExpressions
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder | ObjectComplementOf ClassExpression
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | ObjectOneOf [Individual] -- min. 1 Individual
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | ObjectValuesFrom QuantifierType ObjectPropertyExpression ClassExpression
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder | ObjectHasValue ObjectPropertyExpression Individual
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder | ObjectHasSelf ObjectPropertyExpression
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | ObjectCardinality (Cardinality ObjectPropertyExpression ClassExpression)
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder | DataValuesFrom QuantifierType
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder DataPropertyExpression [DataPropertyExpression] DataRange
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder | DataHasValue DataPropertyExpression Literal
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | DataCardinality (Cardinality DataPropertyExpression DataRange)
887c59029c7d60230a8cf2a2ac2130991de7d1feChristian Maeder deriving (Show, Eq, Ord)
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder-------------------
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder-- ANNOTATIONS
33e20dfe7c1c35c8ac2cf937230c7d91f58e1ff8Christian Maeder-------------------
33e20dfe7c1c35c8ac2cf937230c7d91f58e1ff8Christian Maeder
33e20dfe7c1c35c8ac2cf937230c7d91f58e1ff8Christian Maederdata Annotation = Annotation [Annotation] AnnotationProperty AnnotationValue
33e20dfe7c1c35c8ac2cf937230c7d91f58e1ff8Christian Maeder deriving (Show, Eq, Ord)
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder
20fe556546c9277cf017931a07d90add61f199d9Christian Maederdata AnnotationAxiom
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder = AnnotationAssertion [Annotation] IRI
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder | SubAnnotationPropertyOf [Annotation] AnnotationProperty AnnotationProperty
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder | AnnotationPropertyDomainOrRange AnnotationDomainOrRange [Annotation] AnnotationProperty IRI
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder deriving (Show, Eq, Ord)
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maederdata AnnotationDomainOrRange = AnnDomain | AnnRange deriving (Show, Eq, Ord)
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian MaedershowAnnDomainOrRange :: AnnotationDomainOrRange -> String
cc8b603388a7deb7fb8045db0341f550f8be5844Christian MaedershowAnnDomainOrRange dr = case dr of
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder AnnDomain -> domainC
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder AnnRange -> rangeC
04dada28736b4a237745e92063d8bdd49a362debChristian Maeder
04dada28736b4a237745e92063d8bdd49a362debChristian Maederdata AnnotationValue
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder = AnnValue IRI
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder | AnnValLit Literal
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder deriving (Show, Eq, Ord)
04dada28736b4a237745e92063d8bdd49a362debChristian Maeder
278de8173a1b7b7f6299f7c804135d14560176daChristian Maedertype SourceIndividual = Individual
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maedertype TargetIndividual = Individual
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maedertype TargetValue = Literal
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maederdata EquivOrDisjoint =
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder Equivalent
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder | Disjoint
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder | SubPropertyOf
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder | InverseOf
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder | SubClass
20fe556546c9277cf017931a07d90add61f199d9Christian Maeder deriving (Show, Eq, Ord)
278de8173a1b7b7f6299f7c804135d14560176daChristian Maeder
278de8173a1b7b7f6299f7c804135d14560176daChristian MaedershowEquivOrDisjoint :: EquivOrDisjoint -> String
cc8b603388a7deb7fb8045db0341f550f8be5844Christian MaedershowEquivOrDisjoint ed = case ed of
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder Equivalent -> equivalentToC
cc8b603388a7deb7fb8045db0341f550f8be5844Christian Maeder Disjoint -> disjointWithC
278de8173a1b7b7f6299f7c804135d14560176daChristian Maeder SubPropertyOf -> subPropertyOfC
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder InverseOf -> inverseOfC
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder SubClass -> subClassOfC
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maederdata ObjDomainOrRange = ObjDomain | ObjRange deriving (Show, Eq, Ord)
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maeder
e76e6a43f51438215737d6fc176c89da05bb86daChristian MaedershowObjDomainOrRange :: ObjDomainOrRange -> String
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian MaedershowObjDomainOrRange dr = case dr of
04dada28736b4a237745e92063d8bdd49a362debChristian Maeder ObjDomain -> domainC
04dada28736b4a237745e92063d8bdd49a362debChristian Maeder ObjRange -> rangeC
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder
e76e6a43f51438215737d6fc176c89da05bb86daChristian Maederdata DataDomainOrRange = DataDomain ClassExpression | DataRange DataRange
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder deriving (Show, Eq, Ord)
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder
04dada28736b4a237745e92063d8bdd49a362debChristian Maederdata Character =
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder Functional
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | InverseFunctional
3f63b98c111e5e2bb2cf13795cf6e084a78b0a8dChristian Maeder | Reflexive
f626b1acbe874a48143a6f8d6246bf9d7a055ffbChristian Maeder | Irreflexive
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | Symmetric
5ea395cc3b73b43104a2416bf41994533eb8f93dChristian Maeder | Asymmetric
5ea395cc3b73b43104a2416bf41994533eb8f93dChristian Maeder | Antisymmetric
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | Transitive
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder deriving (Enum, Bounded, Show, Eq, Ord)
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maederdata SameOrDifferent = Same | Different | Individuals deriving (Show, Eq, Ord)
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
9c18d9c5e0fc46145bb481301533c5eb03514c29Christian MaedershowSameOrDifferent :: SameOrDifferent -> String
9c18d9c5e0fc46145bb481301533c5eb03514c29Christian MaedershowSameOrDifferent sd = case sd of
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder Same -> sameAsC
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder Different -> differentFromC
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder Individuals -> individualsC
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maederdata PositiveOrNegative = Positive | Negative deriving (Show, Eq, Ord)
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maederdata SubObjectPropertyExpression
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder = OPExpression ObjectPropertyExpression
0f67ca7b0c738a28f6688ba6e96d44d7c14af611Christian Maeder | SubObjectPropertyChain [ObjectPropertyExpression] -- min. 2 ObjectPropertyExpression
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder deriving (Show, Eq, Ord)
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maederdata EntityType =
e92ae8b45c138b6cf7db8b69e2d099d7f62f24f0Christian Maeder Datatype
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder | Class
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder | ObjectProperty
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder | DataProperty
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder | AnnotationProperty
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder | NamedIndividual
e817ea5134dced9e0bcce1a9d6b8fe4f81d36e56Christian Maeder deriving (Enum, Bounded, Show, Read, Eq, Ord)
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian Maeder
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian MaederentityTypes :: [EntityType]
f9a73de15ef09dbd6b391c7b1f695c79b4446fe2Christian MaederentityTypes = [minBound .. maxBound]
e92ae8b45c138b6cf7db8b69e2d099d7f62f24f0Christian Maeder