aboutsummaryrefslogtreecommitdiffstats
path: root/src/Data/JLD/Model/TermDefinition.hs
blob: 5f39eee9bf3cae05e371924dd983d2bd4b6ca28c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module Data.JLD.Model.TermDefinition (TermDefinition (..), newTermDefinition) where

import Data.JLD.Prelude

import Data.JLD.Model.Direction (Direction)
import Data.JLD.Model.Language (Language)

import Data.Aeson (Value)
import Text.URI (URI)

data TermDefinition = TermDefinition
    { termDefinitionIriMapping :: Maybe Text
    , termDefinitionPrefixFlag :: Bool
    , termDefinitionProtectedFlag :: Bool
    , termDefinitionReversePropertyFlag :: Bool
    , termDefinitionBaseUrl :: Maybe URI
    , termDefinitionLocalContext :: Maybe Value
    , termDefinitionContainerMapping :: Set Text
    , termDefinitionIndexMapping :: Maybe Text
    , termDefinitionNestValue :: Maybe Text
    , termDefinitionTypeMapping :: Maybe Text
    , termDefinitionDirectionMapping :: Maybe Direction
    , termDefinitionLanguageMapping :: Maybe Language
    }
    deriving (Show, Eq)

newTermDefinition :: Bool -> (TermDefinition -> TermDefinition) -> TermDefinition
newTermDefinition protectedFlag fn =
    fn
        TermDefinition
            { termDefinitionIriMapping = Nothing
            , termDefinitionPrefixFlag = False
            , termDefinitionProtectedFlag = protectedFlag
            , termDefinitionReversePropertyFlag = False
            , termDefinitionBaseUrl = Nothing
            , termDefinitionLocalContext = Nothing
            , termDefinitionContainerMapping = mempty
            , termDefinitionIndexMapping = Nothing
            , termDefinitionNestValue = Nothing
            , termDefinitionTypeMapping = Nothing
            , termDefinitionDirectionMapping = Nothing
            , termDefinitionLanguageMapping = Nothing
            }