From 838ed8229ed13959d9235b5eafae959e8b8421c4 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 27 May 2023 20:36:26 +0200 Subject: Added Node Map Generation algorithm --- src/Data/JLD/Expansion/Context.hs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/Data/JLD/Expansion') diff --git a/src/Data/JLD/Expansion/Context.hs b/src/Data/JLD/Expansion/Context.hs index ce61644..99daba0 100644 --- a/src/Data/JLD/Expansion/Context.hs +++ b/src/Data/JLD/Expansion/Context.hs @@ -13,7 +13,7 @@ import Data.JLD.Model.Language (Language (..)) import Data.JLD.Model.TermDefinition (TermDefinition (..), newTermDefinition) import Data.JLD.Model.URI (parseUri, uriToIri) import Data.JLD.Options (ContextCache, Document (..), DocumentCache, DocumentLoader (..), JLDVersion (..)) -import Data.JLD.Util (flattenSingletonArray, valueContains, valueContainsAny, valueIsTrue, valueToArray) +import Data.JLD.Util (flattenSingletonArray, valueContains, valueContainsAny, valueToArray) import Control.Monad.Except (MonadError (..)) import Data.Aeson (Object, Value (..)) @@ -73,7 +73,7 @@ bacBuildTermDefinition contextDefinition baseUrl term = do p { btdParamsBaseUrl = baseUrl , btdParamsOverrideProtectedFlag = bacEnvOverrideProtected - , btdParamsProtectedFlag = contextDefinition |> KM.lookup (show KeywordProtected) .> maybe False valueIsTrue + , btdParamsProtectedFlag = contextDefinition |> KM.lookup (show KeywordProtected) .> maybe False (== Bool True) , btdParamsRemoteContexts = remoteContexts } (activeContext', _) <- @@ -246,20 +246,19 @@ bacProcessItem baseUrl item = do Nothing -> pure () -- 5.13. + let filteredKeywords = + [ KeywordBase + , KeywordDirection + , KeywordImport + , KeywordLanguage + , KeywordPropagate + , KeywordProtected + , KeywordVersion + , KeywordVocab + ] KM.keys contextDefinition' |> fmap K.toText - .> filter - ( `isNotKeyword` - [ KeywordBase - , KeywordDirection - , KeywordImport - , KeywordLanguage - , KeywordPropagate - , KeywordProtected - , KeywordVersion - , KeywordVocab - ] - ) + .> filter (`isNotKeyword` filteredKeywords) .> mapM_ (bacBuildTermDefinition contextDefinition' baseUrl) -- 5.3. _ -> throwError <| Left InvalidLocalContext -- cgit v1.2.3-70-g09d2