diff options
author | Volpeon <github@volpeon.ink> | 2023-05-27 20:36:26 +0200 |
---|---|---|
committer | Volpeon <github@volpeon.ink> | 2023-05-27 20:36:26 +0200 |
commit | 838ed8229ed13959d9235b5eafae959e8b8421c4 (patch) | |
tree | 1026b8039b841c4ee39b155c0bb8d00c7e39b391 /src/Data/JLD/Expansion | |
parent | Structural improvements (diff) | |
download | hs-jsonld-838ed8229ed13959d9235b5eafae959e8b8421c4.tar.gz hs-jsonld-838ed8229ed13959d9235b5eafae959e8b8421c4.tar.bz2 hs-jsonld-838ed8229ed13959d9235b5eafae959e8b8421c4.zip |
Added Node Map Generation algorithm
Diffstat (limited to 'src/Data/JLD/Expansion')
-rw-r--r-- | src/Data/JLD/Expansion/Context.hs | 27 |
1 files changed, 13 insertions, 14 deletions
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 (..)) | |||
13 | import Data.JLD.Model.TermDefinition (TermDefinition (..), newTermDefinition) | 13 | import Data.JLD.Model.TermDefinition (TermDefinition (..), newTermDefinition) |
14 | import Data.JLD.Model.URI (parseUri, uriToIri) | 14 | import Data.JLD.Model.URI (parseUri, uriToIri) |
15 | import Data.JLD.Options (ContextCache, Document (..), DocumentCache, DocumentLoader (..), JLDVersion (..)) | 15 | import Data.JLD.Options (ContextCache, Document (..), DocumentCache, DocumentLoader (..), JLDVersion (..)) |
16 | import Data.JLD.Util (flattenSingletonArray, valueContains, valueContainsAny, valueIsTrue, valueToArray) | 16 | import Data.JLD.Util (flattenSingletonArray, valueContains, valueContainsAny, valueToArray) |
17 | 17 | ||
18 | import Control.Monad.Except (MonadError (..)) | 18 | import Control.Monad.Except (MonadError (..)) |
19 | import Data.Aeson (Object, Value (..)) | 19 | import Data.Aeson (Object, Value (..)) |
@@ -73,7 +73,7 @@ bacBuildTermDefinition contextDefinition baseUrl term = do | |||
73 | p | 73 | p |
74 | { btdParamsBaseUrl = baseUrl | 74 | { btdParamsBaseUrl = baseUrl |
75 | , btdParamsOverrideProtectedFlag = bacEnvOverrideProtected | 75 | , btdParamsOverrideProtectedFlag = bacEnvOverrideProtected |
76 | , btdParamsProtectedFlag = contextDefinition |> KM.lookup (show KeywordProtected) .> maybe False valueIsTrue | 76 | , btdParamsProtectedFlag = contextDefinition |> KM.lookup (show KeywordProtected) .> maybe False (== Bool True) |
77 | , btdParamsRemoteContexts = remoteContexts | 77 | , btdParamsRemoteContexts = remoteContexts |
78 | } | 78 | } |
79 | (activeContext', _) <- | 79 | (activeContext', _) <- |
@@ -246,20 +246,19 @@ bacProcessItem baseUrl item = do | |||
246 | Nothing -> pure () | 246 | Nothing -> pure () |
247 | 247 | ||
248 | -- 5.13. | 248 | -- 5.13. |
249 | let filteredKeywords = | ||
250 | [ KeywordBase | ||
251 | , KeywordDirection | ||
252 | , KeywordImport | ||
253 | , KeywordLanguage | ||
254 | , KeywordPropagate | ||
255 | , KeywordProtected | ||
256 | , KeywordVersion | ||
257 | , KeywordVocab | ||
258 | ] | ||
249 | KM.keys contextDefinition' | 259 | KM.keys contextDefinition' |
250 | |> fmap K.toText | 260 | |> fmap K.toText |
251 | .> filter | 261 | .> filter (`isNotKeyword` filteredKeywords) |
252 | ( `isNotKeyword` | ||
253 | [ KeywordBase | ||
254 | , KeywordDirection | ||
255 | , KeywordImport | ||
256 | , KeywordLanguage | ||
257 | , KeywordPropagate | ||
258 | , KeywordProtected | ||
259 | , KeywordVersion | ||
260 | , KeywordVocab | ||
261 | ] | ||
262 | ) | ||
263 | .> mapM_ (bacBuildTermDefinition contextDefinition' baseUrl) | 262 | .> mapM_ (bacBuildTermDefinition contextDefinition' baseUrl) |
264 | -- 5.3. | 263 | -- 5.3. |
265 | _ -> throwError <| Left InvalidLocalContext | 264 | _ -> throwError <| Left InvalidLocalContext |