Commit 02c97c30 authored by mzheng's avatar mzheng

added a bit a documention on the field structIsChildOf_fs

parent 229fdf40
...@@ -51,6 +51,17 @@ instance FromJSON Document where ...@@ -51,6 +51,17 @@ instance FromJSON Document where
let _document_struct_id = map fst structIdname let _document_struct_id = map fst structIdname
let _document_authors_affiliations = map snd structIdname let _document_authors_affiliations = map snd structIdname
{-
structIsChildOf_fs is a field in the HAL API that is a list that goes by pair
here is an exemple :
https://api.archives-ouvertes.fr/search/?q=(en_title_t:(glass)%20OR%20en_abstract_t:(glass))%20AND%20(structId_i:6279)%20AND%20(language_s:en)&wt=json&fl=docid,label_s,uri_s,structId_i,title_s,structIsChildOf_fs&rows=80)
the first line of a pair tells you which type of a structure the child is (e.g. laboratory, institution, etc...)
the second line tells you what is the structId and name of the child structure aswell as the strucId of the parent and the name of the parent structure
for now we are not using the type of structure that's why we have a removeUnusedData that removes the first line of each pair
-}
structChild <- o .:? "structIsChildOf_fs" :: Parser (Maybe [Text]) structChild <- o .:? "structIsChildOf_fs" :: Parser (Maybe [Text])
let _document_institutes_tree = Map.fromListWith (++) $ getStructParentChild $ removeUnusedData $ fromMaybe [] structChild let _document_institutes_tree = Map.fromListWith (++) $ getStructParentChild $ removeUnusedData $ fromMaybe [] structChild
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment