packages feed

XSaiga 1.3.0.1 → 1.4.0.0

raw patch · 13 files changed

+7024/−2892 lines, 13 filesdep +XSaiga

Dependencies added: XSaiga

Files

− AGParser2.hs
@@ -1,717 +0,0 @@-{-# LANGUAGE Trustworthy #-}-module AGParser2 where-import Prelude hiding ((*>))-import Text.PrettyPrint.HughesPJ as PPH hiding (empty)  -- ((PPH.<+>), vcat, text, render,($$),nest,Doc)-import Data.List-import TypeAg2-import Control.Monad-import Control.Applicative hiding ((<|>), (*>))--------- ************************************ -------------------------type Instance = IRec-                -data SorI     = S | I |NILL  deriving (Eq,Ord,Show, Enum) -                -- Synthesized or inherited or NILL---type IRec     = (SorI, Id) -                -- uniquely determines synthesized or inherited attribute for an NT-                -data Useless  = OF|ISEQUALTO  deriving (Show, Eq)-                -- for decorating the semantic rules---       -data SRule_   = NT {iden :: Id, par :: NTType} | Rule {par' :: SeqType} | DRule {par'' :: SRule_ } --type NTType  = Id -> InsAttVals -> M Foo-type SeqType = Id -> InsAttVals -> [SemRule] -> Result -> M Foo-type AltType = NTType-type SemRule =  (Instance,(InsAttVals, Id) -> InsAttVals)--------------data Tree a = Leaf (a,Instance)-            | Branch [Tree a] -            | SubNode ((NodeName, Instance), (Start1,End))-              deriving (Eq)---type NodeName = MemoL-type Start1   = (Int, InsAttVals)-type Start    = ((Int,InsAttVals), [String])-type End      = (Int, InsAttVals)-type Atts     = [AttValue] -- [(AttType, AttValue)]-type InsAttVals = [(Instance, Atts)]---type Mtable   = [(MemoL-                 ,[(Start1,(Context,Result))]-                 )-                ] -type Result   = [((Start1, End),[Tree MemoL])]--type State    = Mtable-type Context  = ([MemoL],[(Int,[(MemoL, Int)])])--type M a = Start -> Context -> StateM a-type Seq a = Id -> InsAttVals -> [SemRule] -> Result -> Start -> Context -> StateM a-type Foo = (Context, Result)---- ============================-newtype StateM t = State { unState :: State -> (t,State) }--instance Functor StateM where-    fmap  = liftM--instance Applicative StateM where-    pure  = return-    (<*>) = ap  -- defined in Control.Monad--instance Monad StateM where-  -- defines state propagation-  State m            >>= k -         = State (\s -> let (a,y) = m s in unState (k a) y)-  return k             =  State (\s -> (k,s))--- -- extracts the state from the monad-get       :: StateM State-get        = State (\s -> (s,s))-put       :: State -> StateM ()-put s      = State (\_ -> ((),s))-modify    :: (State -> State) -> StateM ()-modify sf  = State (\s -> ((), sf s))---- =============================----------------- ******************************************** -----------------------------(<|>) :: AltType -> AltType -> AltType-(p <|> q) idx inhx ((i,a),inp) c - = do (l1,m) <- p idx inhx ((i,[]),inp) c -      (l2,n) <- q idx inhx ((i,[]),inp) c-      return ((union (fst l1) (fst l2),[]) ,(m ++ n))-----------------------------------------------------------(*>) :: SeqType -> SeqType -> SeqType-(p *> q) idx inhx semx resx -                 ((i,a),inp) cc - = do (l,m) <- p idx inhx semx resx -                 ((i,[]),inp) cc -      let passCtxt  e          -           = if e == i then cc -             else empty_cuts-          mergeCuts e prev new -           = if e == i -             then (union prev new) -             else prev  -       -          apply_to_all q [] l cc  -           = return ((fst l,[]),[])-   -          apply_to_all q (r:rs) l cc -            = do (l1,m) <- q `add_P` (r,cc)-                 (l2,n) <- apply_to_all q rs l cc-                 return ((union (fst l1) (fst l2),[]),( m ++  n))-              -          q `add_P` (rp,cc) -            = do let e  = pickEnd rp-                 (l1,m) <- (q idx inhx semx resx (e,inp) (passCtxt (fst e))) -                 return ((mergeCuts (fst e) (fst l) (fst l1),[]),(addP m rp))       -   -      (apply_to_all q m l cc) -- CHANGE cc HERE-                        -pickEnd (((s,iA),(e,a)),t) = (e,[]) -       -addP  [] ((s1,e1),t1)                    = []-addP  ((((s2,inA2),(e2,synA2)),t2):restQ) (((s1,inA1),(e1,synA1)),t1)  - = (((s1,[]),(e2,[])),  a_P_Q_branch) : addP  restQ (((s1,inA1),(e1,synA1)),t1)-                                                                         -   where-   a_P_Q_branch = addToBranch (((s2,inA2),(e2,synA2)),t2)  (((s1,inA1),(e1,synA1)),t1)---------- ************* ----------------addToBranch (q1,((SubNode (name2,q)):ts2)) -            (p1,((SubNode (name1,p)):ts1)) -                            = [Branch [(SubNode (name1,p)),(SubNode (name2,q))]]--addToBranch (q1,((Branch t2):ts2)) -            (p1,((Branch t1):ts1))-                            = [Branch (t1++t2)]--addToBranch (q1,((Branch t2):ts)) -            (p1,((SubNode (name1,p)):ts1))-                            = [Branch ((SubNode (name1,p)):t2)]--addToBranch (q1,((SubNode (name2,q)):ts2)) -            (p1,((Branch t1):ts))-                            = [Branch (t1++[(SubNode (name2,q))])]-                            --addToBranch (q1,((SubNode (name2,q)):ts2)) -            (p1,[Leaf (x,i)])-                            = [Branch [(SubNode ((x,i) ,p1)),(SubNode (name2,q))]]-addToBranch (q1,[Leaf (x,i)]) -            (p1,((SubNode (name1,p)):ts1)) -                            = [Branch [(SubNode (name1,p)),(SubNode ((x,i),q1))]]-addToBranch (q1,((Branch t2):ts)) -            (p1,[Leaf (x,i)])-                            = [Branch ((SubNode ((x,i),p1)):t2)]-addToBranch (q1,[Leaf (x,i)]) -            (p1,((Branch t1):ts))-                            = [Branch (t1++[(SubNode ((x,i),q1))])]-addToBranch (q1,[Leaf (x2,i2)]) -            (p1,[Leaf (x1,i1)])                         = [Branch [(SubNode ((x1,i1),p1)),(SubNode ((x2,i2),q1))]]---------- ************* ------------------empty_cuts = ([],[])                   -empty :: [(Instance, Atts)] -> M Foo-empty atts (x,inp) l = return (empty_cuts,[((x,(fst x,atts)), [Leaf (Emp, (NILL,O0))])])--term :: String -> Instance -> [(Instance, Atts)] -> [(Instance, Atts)] -> M Foo-term c id atts iatts ((r,a),dInp) l - |r - 1 == length dInp       = return (empty_cuts,[])- |dInp!!(r - 1) == c         = return (empty_cuts,[(((r,[]),(r+1,atts)),[Leaf (ALeaf c, id)])])- |otherwise                  = return (empty_cuts,[])  --        -memoize name f id downAtts ((inp,dAtts),dInput) context - = do s <- get        -      case (lookupT name inp (snd context) s) of   -       Just lRes -> do let lookUpRes = addNode name (S, id) (inp,downAtts) (snd1 lRes) -                       return (fst1 lRes,lookUpRes)-       Nothing-           | funccount (snd context) inp name > (length dInput) - inp + 1-               -> return (([name],[]),[])-           | otherwise -> do let iC = ([],(incContext (snd context) name inp))-                             (l,newRes) <- f id downAtts ((inp,dAtts),dInput) iC -                   -- let ((l,newRes),s1) = unState (f id downAtts (inp,dAtts) iC) s-                             let l1          = makeContext (fst l) (findContext (snd context) inp)-                             s1             <- get-                             let udtTab      = udt (l1,newRes) s1 name (inp,downAtts)  -                             let newFoundRes = addNode name (S, id) (inp,downAtts) newRes-                             put udtTab-                             return ( l1 ,newFoundRes)--        ---findContext []     inp                    = []-findContext ((st,rest):sr) inp| st == inp = [(st,rest)]-                      | otherwise = findContext sr inp-                                                 -        -      --funccount []         inp name         = 0-funccount ((key,funcp):rest) inp name | key == inp = findf funcp -                          | otherwise  = funccount rest inp name--                 where-                 findf  []           = 0-                 findf  ((tk,fc):rx) | tk == name = fc -                         | otherwise  = findf rx        -        -            -fst1 [(a,b)] = a-snd1 [(a,b)] = b   --makeContext [] [(st,((n,c):ncs))]          = ([],[])-makeContext (r:rs) []                      = ((r:rs),[])-makeContext [] []                          = ([],[])-makeContext (r:rs) [(st,((n,c):ncs))]      = ((r:rs), [(st,makeContext_ (r:rs) ((n,c):ncs))])--makeContext_ [] ((n,c):ncs)      = []-makeContext_ (r:rs) ((n,c):ncs)  = makeContext__ r ((n,c):ncs) ++ makeContext_ rs ((n,c):ncs)--makeContext__ r [] = []-makeContext__ r ((n,c):ncs) | r == n    = (n,c): makeContext__ r ncs-                            | otherwise = makeContext__ r ncs---incContext [] name inp  = [(inp,[(name,1)])]-incContext ((st,((n,c):nc)):sn) name inp  -                  | st == inp = ((st, (addNT ((n,c):nc)) name inp ) :sn) -                  | otherwise = ((st,((n,c):nc)): incContext sn name inp )- --addNT []  name inp                     = [(name,1)]-addNT ((n,c):nc) name inp  | n == name = ((n,(c + 1)):nc)-                           | otherwise = ((n,c):addNT nc name inp)-                           --addNode name id (s',dA)  []                            -                       = []                           -addNode name id (s',dA)  oldRes -- ((((s,newIh),(e,atts)),t):rs)  - = let res     = packAmb oldRes-       newSh x = [ ((sOri, snd id),attVal)| ((sOri, idOld),attVal)<- x]-   in  [(((s,newIh),(e, newSh atts)),[SubNode ((name, id),((s,nub dA),(e, newSh atts)))]) -       | (((s,newIh),(e,atts)),t) <- oldRes]-mapName i []            = []-mapName i ((i',r):rest) = (i,r): mapName i rest---packAmb []                                                  = []-packAmb [((s1,e1),t1)]                                      = [((s1,e1),t1)]-packAmb [((s1,e1),t1),((s2,e2),t2)]    | isEq (s1,e1) (s2,e2) = [((s2,(fst e2, groupAtts (snd e1 ++ snd e2))), t1++t2)]-                                       | otherwise          = [((s1,e1),t1),((s2,e2),t2)]--packAmb (((s1,e1),t1):((s2,e2),t2):xs) | isEq (s1,e1) (s2,e2) = packAmb (((s2,(fst e2, groupAtts (snd e1 ++ snd e2))), t1++t2):xs)-                                       | otherwise          = ((s1,e1),t1):packAmb (((s2,e2),t2):xs)--isEq ((s1,b1),(e1,y1)) ((s2,b2),(e2,y2))- | s1 == s2 && e1 == e2 = True- | otherwise            = False- --lookupT name inp context mTable - | lookupT1 name inp context mTable == [] = Nothing- | otherwise                              = Just (lookupT1 name inp context mTable) ---lookupT1 name inp context mTable | res_in_table == [] = [] -                                 | otherwise          = checkUsability inp context (lookupRes (res_in_table !! 0) inp)-                        -                   where -                   res_in_table = [pairs|(n,pairs) <- mTable,n == name]---lookupRes [] inp                       = []-lookupRes (((i,dA),res):rs) inp | i == inp  = [res]-                                | otherwise = lookupRes rs inp ---checkUsability inp context [] = []-checkUsability inp context [((re,sc),res)] | re == []  =  [((re,sc),res)]-                                           | otherwise =  checkUsability_ (findInp inp context) (findInp inp sc) [((re,sc),res)]---findInp inp []                     = []-findInp inp ((s,c):sc) | s == inp  = c-                       | otherwise = findInp inp sc-- -checkUsability_ [] [] [(sc,res)]             = [(sc,res)]-checkUsability_ ((n,cs):ccs) [] [(sc,res)]   = [(sc,res)] -- if lc at j is empty then re-use-checkUsability_ [] ((n1,cs1):scs) [(sc,res)] = []         -- if cc at j is empty then don't re-use-checkUsability_ ((n,cs):ccs) ((n1,cs1):scs) [(sc,res)] -                                             | and $ condCheck ((n,cs):ccs) ((n1,cs1):scs) = [(sc,res)]-                                             | otherwise                                   = []-                                             -                                             --condCheck ((n,cs):ccs) [(n1,cs1)]     = [condCheck_ ((n,cs):ccs) (n1,cs1)]-condCheck ((n,cs):ccs) ((n1,cs1):scs) = condCheck_ ((n,cs):ccs) (n1,cs1) : condCheck ((n,cs):ccs) scs--condCheck_ [] (n1,cs1)                  = False-condCheck_ ((n,cs):ccs) (n1,cs1) -                 | n1 == n && cs >= cs1 = True-                 | n1 == n && cs < cs1  = False-                 | otherwise            = condCheck_ ccs (n1,cs1)-                          ---udt :: (Context, Result) -> State -> MemoL -> Start1 -> State-udt res mTable name (inp,dAtts)  -               = update mTable name (inp,dAtts) res -               -update [] name (inp,dAtts) res                 = [(name,[((inp,dAtts), res)])]-update ((key, pairs):rest) name (inp,dAtts) res -               | key == name = (key,my_merge (inp,dAtts)  res pairs):rest-               | otherwise   = ((key, pairs): update rest name (inp,dAtts) res )---my_merge (inp,dAtts)  res [] = [((inp,nub dAtts), res)]-my_merge (inp,dAtts)  res (((i,dA), es):rest) -               |inp == i  = ((inp,nub dAtts{-nub (dA ++ dAtts)-}), res):rest -               |otherwise = ((i,dA), es): my_merge (inp,dAtts) res rest ---pickResult ((c,r),t) = r------------------ ************************* semantics of ATTRIBUTE GRAMMAR ************************* ----------------------------terminal syn semRules id inhAtts ((i,a),inp) c  - = do  syn (S,id) [((S,id),semRules)] inhAtts ((i,[]),inp) c--nt :: NTType -> Id -> SeqType-nt fx idx id inhAtts semRules altFromSibs - = let groupRule'' id rules         = [rule | (ud,rule) <- rules, id == ud]-       ownInAtts                    = mapInherited (groupRule'' (I, idx) semRules)  altFromSibs inhAtts id -   in fx idx ownInAtts --parser :: SeqType -> [SemRule] -> Id -> InsAttVals -> M Foo-parser synRule semRules id inhAtts i c- =      do-           s <- get-           let ((e,altFromSibs),d)     =-                let sRule                        = groupRule'' (S, LHS) semRules-                    ((l,newRes),st)              = unState ((synRule id inhAtts semRules altFromSibs) i c) s-                    groupRule'' id rules         = [rule | (ud,rule) <- rules, id == ud]-                in  ((l, mapSynthesize  sRule newRes inhAtts id),st)-           put d-           return (e,altFromSibs)-      -                          -                                       -                     -mapSynthesize []   res  downAtts id   = res-mapSynthesize sems res  downAtts id- = let appSems' [] vals        = []-       appSems' (r:rules) vals -        = let [((ud, id'), atts)] = r (vals, id) -          in  [((ud, id), atts)] ++ appSems' rules vals  -   in  [(((st,inAtts), (en,appSems' sems (findAtts t))),[t]) -       |(((st,inAtts), (en,synAtts)),[t]) <- res]-   ---- mapSem' [] _ _            = []-mapInherited sems res []       id    - = let appSems [] vals        = []-       appSems (r:rules) vals = r (vals, id) ++ appSems rules vals -   in  concat [appSems sems (findAtts t) | (((st,inAtts), (en,synAtts)),[t]) <- res]-   -mapInherited sems []  downAtts id    - = let appSems [] vals        = []-       appSems (r:rules) vals = r (vals, id) ++ appSems rules vals   -   in  appSems sems downAtts -- concat ( map (appSems id sems) (group downAtts))--mapInherited sems res downAtts id    - = let appSems [] vals        = []-       appSems (r:rules) vals = r (vals, id) ++ appSems rules vals   -   in  concat [appSems sems ((groupAtts downAtts) ++ synAtts ++ (findAtts t)) -              | (((st,inAtts), (en,synAtts)),[t]) <- res]-----------------------------------------gMax []        = []-gMax [(a,[b])] = [(a,[b])]--gMax [(a,[b]),(a1,[b1])] | getAVAL b >= getAVAL b1 = [(a,[b])]-                         | otherwise  = [(a1,[b1])]--gMax ((a,[b]):(a1,[b1]):rest) | getAVAL b >= getAVAL b1 = gMax ((a,[b]):rest)-                              | otherwise  = gMax ((a1,[b1]):rest)---groupAtts []                    = []-groupAtts [(a,b)]               = [(a,b)]-groupAtts [(a,b),(a1,b1)]       = [(a,b++b1)]-groupAtts ((a,b):(a1,b1):rest)  = (a,b++b1): groupAtts rest -----------------------------------------findAtts (Branch (t:ts))                 - = findAtts t ++ findAtts (Branch ts)-findAtts (SubNode ((n,i),((s,v'),(e,v)))) =  v' ++ v-findAtts (Leaf (a,id))                    =  [] -findAtts (Branch [])                      =  []--addAtts x y = x ++ y-------------------------------------------------------------rule_i          = rule I-rule_s          = rule S--rule s_or_i typ oF pID isEq userFun listOfExp - = let formAtts  id spec =  (id, (forNode id . spec))-       forNode   id atts = [(id, atts)]-       resType           = userFun  listOfExp-   in  formAtts (s_or_i,pID) (setAtt (typ undefined) . resType)-------- **** -------synthesized = valOf S-inherited   = valOf I--valOf :: SorI -> (a -> AttValue) -> Useless -> Id -> [(Instance, Atts)] ->  Id -> [AttValue]-valOf ud typ o_f x  ivs x' | x == LHS   = getAttVals (ud , x') ivs typ-                           | otherwise  = getAttVals (ud , x ) ivs typ--getAttVals :: Instance -> [(Instance, Atts)] -> (a -> AttValue) -> [AttValue]-getAttVals x ((i,v):ivs) typ =- let typeCheck typ t = if (typ undefined) == t then True else False-     getAttVals_ typ (t:tvs) = if (typ undefined) == t then (t :getAttVals_ typ tvs)-                               else getAttVals_ typ tvs                -     getAttVals_ typ []      = [] -- ErrorVal {-- 100 --} "ERROR id found but no value"- in  -     if(i == x) then getAttVals_ typ v else   getAttVals x ivs typ-getAttVals x [] typ          = [ErrorVal {-- 200 --} "ERROR no id"]-- --------- ************************************** --------------------------------------- user functions ------------------   -apply :: [(Instance,Atts)] -> Id -> ([(Instance,Atts)] -> Id -> AttValue) -> Int-apply  y i x   = getAVAL (x y i)-apply_ y i x   = getB_OP (x y i)--apply__ :: [(Instance,Atts)] -> Id -> ([(Instance,Atts)] -> Id -> AttValue) -> DisplayTree-apply__ y i x  = getRVAL (x y i)--applyMax  y i x   = getAVAL (foldr (getMax) (MaxVal 0) (x y i))-getMax    x   y   = MaxVal  (max (getAVAL x) (getAVAL y))--findMax      spec  = \(atts,i) -> -                       MaxVal (foldr (max) 0 (map (applyMax atts i) spec))-convertRep   spec  = \(atts,i) -> -                       RepVal (foldr (max) 0 (map (applyMax atts i) spec))--makeTree  (x:xs)     = \(atts,i) -> Res (B           (map (apply__ atts i) (x:xs)))--mt [a,b,c] = (B [a,b,c]) -mt [a]     = (B [a])------------- for arithmetic expr -----------------  -applyBiOp [e1,op,e2] - = \atts ->  VAL ((getAtts getB_OP atts op ) (getAtts getAVAL atts e1 ) (getAtts getAVAL atts e2))-getAtts f (y,i) x - = f (head (x y i))------------- general copy -------------------------copy      [b]     - = \(atts,i) -> head (b atts i)-getTypVal ((a,b):abs) t | a undefined == t = b t-                        | otherwise        = getTypVal abs t-------------- for arithmetic expr -----------------  --toTree    [b]        = \(atts,i) -> Res (N ((map (apply atts i) [b])!!0))--                      ----- JUNK TEST ----------------- MAIN -------------------------- EXAMPLE EX-SPEC FOR TREE-REPLACEMENT ------------------start  = memoize Start -      (parser -       (nt tree T0)-       [-        rule_i RepVal OF T0  ISEQUALTO convertRep    [synthesized  MaxVal OF T0]-       ]-      )-      -tree   = memoize Tree -        (   parser -           (nt tree T1 *> nt tree T2 *> nt num T3)-       [ rule_s   MaxVal OF LHS  ISEQUALTO findMax [  synthesized  MaxVal OF T1, -                                                 synthesized  MaxVal OF T2,-                                                 synthesized  MaxVal OF T3-                                               ],       -        rule_i   RepVal OF T1   ISEQUALTO convertRep    [inherited RepVal OF LHS],-        rule_i   RepVal OF T2   ISEQUALTO convertRep    [inherited RepVal OF LHS],-        rule_i   RepVal OF T3   ISEQUALTO convertRep    [inherited RepVal OF LHS]-       ]- <|> -            parser -           (nt num N1)-           [ rule_i   RepVal OF N1   ISEQUALTO convertRep    [inherited    RepVal OF LHS],-             rule_s   MaxVal OF LHS  ISEQUALTO findMax       [synthesized  MaxVal OF N1]-           ]           ---  )-  --num  = memoize Num-       (-        terminal (term "1") [MaxVal 1] <|> -    terminal (term "2") [MaxVal 2] <|>-    terminal (term "3") [MaxVal 3] <|>  -    terminal (term "4") [MaxVal 4] <|>  -    terminal (term "5") [MaxVal 5]  -       )------------------------------------------------- Arithmetic Expression --------------------------------------------------eT - = memoize ET-   (-   parser-   (nt expr E1)-   [rule_s VAL OF LHS ISEQUALTO copy [synthesized VAL  OF E1]]-   )- -expr = memoize Expr-       (-        parser-        (nt expr E1 *> nt op O1 *> nt expr E2)-        [rule_s VAL OF LHS ISEQUALTO applyBiOp [synthesized VAL  OF E1,-                                                synthesized B_OP OF O1,-                                                synthesized VAL  OF E2] -        ]-         -        <|> -        parser-        (nt num N1)-        [rule_s VAL OF LHS  ISEQUALTO copy [synthesized MaxVal OF N1]]-       )--op   = memoize Op-       (-    terminal (term "+") [B_OP (+)] <|> -    terminal (term "-") [B_OP (-)] <|>  -    terminal (term "*") [B_OP (*)] <|>   -    terminal (term "/") [B_OP (div)]    -       )-------------------------------------------------- Arithmetic Expression ------------------------------------------------------------- PrettyPrint -------------------------po :: (PP' a) => (String -> IO ()) -> a -> IO ()-po act x = do-    stuff <- pp' x-    act $ render80 stuff-    -render80 = renderStyle (style{lineLength = 80})---class PP' a where-      pp' :: a -> IO Doc--instance PP' Doc where-      pp' c = return c--instance PP' Char where-      pp' c = return $ text $ show c-instance PP' AttValue where-      pp' (VAL i) = showio (VAL i) >>= return . text-      pp' (B_OP i)= showio (B_OP i) >>= return .text-      -      -instance PP' Int where-      pp' i = return $ text $ show i-    -instance PP' Id where-      pp' i = return $ text $ show i       --instance PP' a => PP' (Maybe a) where-      pp' Nothing  = return $ text "Nothing"-      pp' (Just x) = pp' x >>= (\y -> return $ parens $ text "Just" PPH.<+> y)--instance (PP' a, PP' b) => PP' (a,b) where-      -- pp' (a,b) = parens $ pp' a PPH.<+> text "->" PPH.<+> pp' b-      pp' (a,b) =  pp' a >>= \z -> (pp' b >>= (\y -> return $ z PPH.<+> text "->" PPH.<+> y))-instance PP' a => PP' [a] where-      pp' []     = return $ brackets $ text ""-      pp' (x:xs) = liftM sep $ (liftM2 (:)) (pp' x) (sequence [ pp' y | y <- xs ])-                      -instance (Show t) => PP' (Tree t) where-      -- pp' Empty             = text "{_}"-      pp' (Leaf x)          = return $ text "Leaf" PPH.<+> text (show x)-      pp' (Branch ts)       = liftM2 (PPH.<+>) (return $ text "Branch") (liftM brackets $ liftM sep $ liftM (punctuate comma) $ sequence $ map pp' ts)-      --pp' (SubNode (x,(s,e))) = return $ text "SubNode" PPH.<+> text (show x) PPH.<+> text (show (s,e)) -      -- PPH.<+> pp' ts--{-TODO:-format :: Mtable -> Doc-format t- = vcat-   [ text (show s) -     $$                                          -     nest 3 (pp' [text "START at:" PPH.<+> pp' i PPH.<+>  text "; Inherited atts:" PPH.<+>  vcat [vcat [text (showID id0) PPH.<+> vcat [text (show ty0v0) |ty0v0 <-val0]|(id0,val0)<-inAt1]] PPH.<+>-                  text "" $$ vcat [{-    text "Inherited Atts. -" -                                   -                                   $$   -                                       vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-(nub inAtt2)]] -                                   -                                   $$-}  nest 3-                                   (   text "END at:" PPH.<+> pp' end                                    -                                   $$  text "Synthesized Atts. -"-                                   -                                   $$  vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]] -                                   -                                   $$  text "Packed Tree -"-                                   -                                   $$  pp' ts)-                                       |(((st,inAtt2),(end,synAtts)), ts)<-rs] -                                   -                | ((i,inAt1),((cs,ct),rs)) <- sr ])-   -   -   | (s,sr) <- t ]--}-   --showID (x,y) = show y -- only the instance------ ** printing ony own atts ** ----{-TODO:-formatAtts :: MemoL -> Mtable -> Doc-formatAtts key t- = vcat-   [ text (show s) -     $$                                          -     nest 3 (pp' [text "START at:" PPH.<+> pp' i PPH.<+>  text "; Inherited atts:" PPH.<+>  vcat [vcat [text (showID id0) PPH.<+> vcat [text (show ty0v0) |ty0v0 <-val0]|(id0,val0)<-inAt1]] PPH.<+>-                  text "" $$ vcat [nest 3-                                   (   text "END at:" PPH.<+> pp' end                                    -                                   $$  text "Synthesized Atts. -"-                                   -                                   $$  vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]] -                                   -                                   -- $$  text "Packed Tree -"-                                   -                                   {- $$  pp' ts -} )-                                       |(((st,inAtt2),(end,synAtts)), ts)<-rs] -                                   -                | ((i,inAt1),((cs,ct),rs)) <- sr ])-   -   -   | (s,sr) <- t, s == key ]--}- -formatAttsFinalAlt :: MemoL -> Int -> State -> IO [Doc]-formatAttsFinalAlt  key e t  = -    --return [pp' [vcat [(vcat [vcat [vcat [text (show ty1v1)  |ty1v1<-val1]-    sequence [(sequence [liftM vcat $ sequence [(liftM vcat $ sequence [liftM vcat $ sequence [liftM vcat $ sequence [liftM text (showio ty1v1) | ty1v1<-val1]-                            |(id1,val1)<-synAtts]] )-                            |(((st,inAtt2),(end,synAtts)), ts)<-rs, end == e]                 -        | ((i,inAt1),((cs,ct),rs)) <- sr ]) >>= pp' | (s,sr) <- t, s == key ]--{-formatAttsFinal  key t  = -   [(pp' [vcat [(vcat [vcat [vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]] )|(((st,inAtt2),(end,synAtts)), ts)<-rs] -                                   -                | ((i,inAt1),((cs,ct),rs)) <- sr ]) | (s,sr) <- t, s == key ]-}-                    --- *************** for printing the fist element of the return pair ***************-{-TODO:-formatForFst ::Result -> Doc-formatForFst res = vcat -                 -- [text (show ty0v0) |ty0v0 <-val0]|(id0,val0)<-inAt1]] PPH.PPH.<+> text "" $$ vcat -                 -                 [   text "START at:" PPH.<+> pp' st -                 -                 {--                 $$  text "Inherited Atts. -" -                 $$  vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-inAtt2]] -                 -}-                 -                 PPH.<+> text "END at:" PPH.<+> pp' end -                 $$  nest 3 -                     (text "Synthesized Atts. of"-                 -                 PPH.<+> vcat [vcat [text (showID id1) PPH.<+> text "::" PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]]-                 -                 $$  pp' ts)-                    |(((st,inAtt2),(end,synAtts)), ts)<-res] ----}--- *************** for printing the fist element of the return pair ***************------------- PrettyPrint ---------------------------
− Getts.hs
@@ -1,279 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NoMonomorphismRestriction #-}--module Getts where-import Data.List-import Control.Monad-import Debug.Trace----For endpoint query-import Data.RDF hiding (triple, Triple)-import Database.HSparql.Connection-import Database.HSparql.QueryGenerator-import Data.Text hiding (head, concat, map, zip, drop, length)--import qualified Data.Map as M-import Data.IORef-import System.IO.Unsafe--addUri namespace_uri = (namespace_uri ++)----getts returns all triples in the triple store that match the given parameters-class TripleStore m where-    getts_1 :: m -> (Event, String, String) -> IO [String]-    getts_2 :: m -> (Event, String, String) -> IO [String]-    getts_3 :: m -> (Event, String, String) -> IO [String]-    --getts_image computes the relation [(x,e)] such that e is an event of type ev_type-    --and x is a subject of that event.  This is a default implementation that can be overridden-    --in instances.  Output is expected to be sorted. TODO: Update this -    getts_image :: m -> String -> String -> IO Image-    getts_image ev_data ev_type entity_type = do-        evs <- getts_1 ev_data ("?", "type", ev_type)-        getts_inverse ev_data entity_type evs-        -    --getts_inverse returns the entities of entity_type of the events in the list evs-    getts_inverse :: m -> String -> [Event] -> IO Image-    getts_inverse ev_data entity_type evs = do-        pairs <- liftM concat $ mapM (\ev -> do-            ents <- getts_3 ev_data (ev, entity_type,"?")-            return $ zip ents (repeat ev)) evs-        return $ condense $ sortFirst pairs-    -    --getts_members returns-    getts_members :: m -> String -> IO Image-    getts_members ev_data set = do-        evs_with_set_as_object <- getts_1 ev_data ("?", "object", set)-        evs_with_type_membership <- getts_1 ev_data ("?", "type", "membership")-        getts_inverse ev_data "subject" $ intersect evs_with_set_as_object evs_with_type_membership-            --sortFirst = sortBy (\x y -> compare (fst x) (fst y))--type Event = String-type Triple = (Event, String, String)-type Image = [(String,[Event])]----For the "In Program" triple store-instance TripleStore [Triple] where-    getts_1 ev_data ("?", b, c) = return [x | (x,y,z) <- ev_data, b == y, c == z]-    getts_2 ev_data (a, "?", c) = return [y | (x,y,z) <- ev_data, a == x, c == z]-    getts_3 ev_data (a, b, "?") = return [z | (x,y,z) <- ev_data, a == x, b == y]--data SPARQLBackend = SPARQL String String deriving (Ord, Eq)-    ---the String in this instance is to be the endpoint that you wish to query-instance TripleStore SPARQLBackend where-    --getts_1 =  getts_1''-    getts_1 = memoIO getts_1''-        where-        getts_1'' (SPARQL endpoint namespace_uri) ("?", b, c) = preprocess namespace_uri $ getts_1'(pack "?", pack (addUri namespace_uri b), pack (addUri namespace_uri c))-            where-            getts_1' :: (t, Text, Text) -> IO [[BindingValue]]-            getts_1' (a, b, c) = do-                 (Just s) <- selectQuery endpoint getts_1_query-                 return s-                 where-                   getts_1_query = do -                      x <- var-                      triple x (iriRef b) (iriRef c)-                      distinct-                      return SelectQuery { queryVars = [x] }-    --getts_2 =  getts_2''-    getts_2 = memoIO getts_2''-        where-        getts_2'' (SPARQL endpoint namespace_uri) (a, "?", c) = preprocess namespace_uri $ getts_2'(pack (addUri namespace_uri a), pack "?", pack (addUri namespace_uri c))-            where-                getts_2' :: (Text, Text, Text) -> IO [[BindingValue]]-                getts_2' (a, b, c) = do-                     (Just s) <- selectQuery endpoint getts_2_query  -                     return s-                     where-                       getts_2_query = do -                          x <- var-                          triple  (iriRef a) x (iriRef c)-                          distinct-                          return SelectQuery { queryVars = [x] }-    --getts_3 =  getts_3''-    getts_3 = memoIO getts_3''-        where-        getts_3'' (SPARQL endpoint namespace_uri) (a, b, "?") = preprocess namespace_uri $ getts_3'(pack (addUri namespace_uri a), pack (addUri namespace_uri b), pack "?")-            where-                getts_3' :: (Text, Text, Text) -> IO [[BindingValue]]-                getts_3' (a, b, c) = do-                     (Just s) <- selectQuery endpoint getts_3_query  -                     return s-                     where-                       getts_3_query = do -                          x <- var-                          triple (iriRef a) (iriRef b) x-                          distinct-                          return SelectQuery { queryVars = [x] }-    --Efficient implementation of getts_image for SPARQL backend-    getts_image = memoIO''' getts_image'''-        where-        getts_image''' (SPARQL endpoint namespace_uri) ev_type en_type = do-                m <- selectQuery endpoint query-                case m of-                    (Just res) -> return $ condense $ map (\[x, y] -> (removeUri namespace_uri $ deconstruct x, removeUri namespace_uri $ deconstruct y)) res-                    Nothing -> return []-                where-                    query :: Query SelectQuery-                    query = do-                        sol <- prefix (pack "sol") (iriRef (pack namespace_uri))-                        ev <- var-                        subj <- var-                        triple ev (sol .:. (pack "type")) (sol .:. (pack ev_type))-                        triple ev (sol .:. (pack en_type)) subj-                        orderNext subj-                        distinct-                        return SelectQuery { queryVars = [subj,ev] }-    -    --Efficient implementation of getts_inverse for SPARQL backend-    getts_inverse = memoIO'' getts_inverse''-        where-        getts_inverse'' (SPARQL endpoint namespace_uri) en_type evs = do-            m <- selectQuery endpoint query-            case m of-                (Just res) -> return $ condense $ map (\[x, y] -> (removeUri namespace_uri $ deconstruct x, removeUri namespace_uri $ deconstruct y)) res-                Nothing -> return []-            where-                query = do-                    sol <- prefix (pack "sol") (iriRef (pack namespace_uri))-                    subj <- var-                    ev <- var-                    triple ev (sol .:. (pack en_type)) subj-                    filterExpr $ regex ev $ (pack $ Data.List.intercalate "|" (map (++ "$") evs))-                    --Data.List.foldr1 Database.HSparql.QueryGenerator.union $ map (\ev -> triple (sol .:. pack(ev))  (sol .:. pack("subject")) subj) evs -- UNION nesting problem-                    distinct-                    return SelectQuery { queryVars = [subj,ev] } -                -    --Efficient implementation of getts_members for SPARQL backend-    -    getts_members = memoIO' getts_members'-    --getts_members = getts_members'-        where-        getts_members' (SPARQL endpoint namespace_uri) set = do-            m <- selectQuery endpoint query-            case m of-                (Just res) -> return $ condense $ map (\[x, y] -> (removeUri namespace_uri $ deconstruct x, removeUri namespace_uri $ deconstruct y)) res-                Nothing -> return []-            where-                query :: Query SelectQuery-                query = do-                    sol <- prefix (pack "sol") (iriRef (pack namespace_uri))-                    ev <- var-                    subj <- var-                    triple ev (sol .:. (pack "type")) (sol .:. (pack "membership"))-                    triple ev (sol .:. (pack "subject")) subj-                    triple ev (sol .:. (pack "object")) (sol .:. (pack set))-                    orderNext subj-                    distinct-                    return SelectQuery { queryVars = [subj,ev] }-    -            -removeUri :: String -> String -> String         -removeUri namespace_uri = drop $ length namespace_uri-                      -preprocess :: String -> IO [[BindingValue]] -> IO [String]-preprocess namespace_uri bvals = bvals >>= \x -> return $ map (removeUri namespace_uri . deconstruct) $ concat x---deconstruct :: BindingValue -> String-deconstruct value = do-    let (Bound node) = value-    case node of-        UNode strURI -> unpack strURI-        LNode (PlainL strLit) -> unpack strLit----memotable :: IORef (M.Map (SPARQLBackend,(String,String,String)) [String])-memotable = unsafePerformIO $ newIORef M.empty--memoIO ::(SPARQLBackend -> (String, String, String) -> IO [String]) -> SPARQLBackend -> (String, String, String) -> IO [String]-memoIO f a x = do-    m <- readIORef memotable-    case M.lookup (a,x) m of-        Nothing -> f a x >>= \q -> (writeIORef memotable (M.insert (a,x) q m) >> return q)-        Just r -> return r-        -memotable' :: IORef (M.Map (SPARQLBackend,String) Image)-memotable' = unsafePerformIO $ newIORef M.empty--memoIO' ::(SPARQLBackend -> (String) -> IO Image) -> SPARQLBackend -> (String) -> IO Image-memoIO' f a x = do-    m <- readIORef memotable'-    case M.lookup (a,x) m of-        Nothing -> f a x >>= \q -> (writeIORef memotable' (M.insert (a,x) q m) >> return q)-        Just r -> return r-        -memotable'' :: IORef (M.Map (SPARQLBackend,String,[String]) Image)-memotable'' = unsafePerformIO $ newIORef M.empty--memoIO'' ::(SPARQLBackend -> String -> [String] -> IO Image) -> SPARQLBackend -> String -> [String] -> IO Image-memoIO'' f a x y = do-    m <- readIORef memotable''-    case M.lookup (a,x,y) m of-        Nothing -> f a x y >>= \q -> (writeIORef memotable'' (M.insert (a,x,y) q m) >> return q)-        Just r -> return r-        -memotable''' :: IORef (M.Map (SPARQLBackend,String,String) Image)-memotable''' = unsafePerformIO $ newIORef M.empty--memoIO''' ::(SPARQLBackend -> String -> String -> IO Image) -> SPARQLBackend -> String -> String -> IO Image-memoIO''' f a x y = do-    m <- readIORef memotable'''-    case M.lookup (a,x,y) m of-        Nothing -> f a x y >>= \q -> (writeIORef memotable''' (M.insert (a,x,y) q m) >> return q)-        Just r -> return r--        ---Get members of named set-get_members :: (TripleStore m) => m -> String -> IO Image-get_members = getts_members-    ---Get all subjects of a given event type-get_subjs_of_event_type :: (TripleStore m) => m -> String -> IO Image-get_subjs_of_event_type ev_data ev_type = make_image ev_data ev_type "subject"---{-collect accepts a binary relation as input and computes the image img of each-element x in the projection of the left column of the relation, under the relation,-and returns all of these (x,img) pairs in a list--Note: Since == is an equivalence relation, if multiple elements in the projection-of the left column are in the same equivalence class, only the first member of that-equivalence class that appears in the input list (as the left hand column of a tuple)-will appear in the output (as the left hand column of a tuple).--That is, the first element of that equivalence class that appears in the input list-will be chosen to represent the entire equivalence class in the output.---}-    ---Faster collect: runs in n lg n time-collect = condense . sortFirst-    ---condense computes the image under a sorted relation---condense runs in O(n) time and is lazy, also is lazy in the list computed in each tuple---TODO: Use Map.toList/fromList to simplify?  Benchmark.---In particular: Should unstableSortBy be used?-condense :: (Eq a, Ord a) => [(a, a)] -> [(a, [a])]-condense [] = []-condense ((x,y):t) = (x, y:a):(condense r)-    where -    (a, r) = findall x t-    findall x [] = ([], [])-    findall x list@((t,y):ts) | x /= t = ([], list)-    findall x ((t,y):ts) | x == t = let (a2, t2) = (findall x ts) in (y:a2, t2)-----make_image accepts an event type as input, determines all subjects for---all events of that type, and computes the image under the relation---for each subject as described in the collect function---Arguments: triple store, Event type (i.e. join_rel), Entity type (i.e. subject, object)-make_image :: (TripleStore m) => m -> String -> String -> IO Image-make_image = getts_image -    -    
− Interactive.hs
@@ -1,386 +0,0 @@-{-# LANGUAGE NoMonomorphismRestriction #-}-{-# LANGUAGE NoImplicitPrelude #-}-module Interactive where--import SolarmanTriplestore-import Getts--a $ b = a b-infixr 0 $-a . b = \x -> a (b (x))-infixr 9 .--discover tmph = make_filtered_relation dataStore "discover_ev" [(["object"],tmph)]-discover' tmph preps = make_filtered_relation dataStore "discover_ev" $ (["object"], tmph):preps-discover_ = make_inverted_filtered_relation dataStore "discover_ev"--discovers tmph = make_filtered_relation dataStore "discover_ev" [(["object"],tmph)]-discovers' tmph preps = make_filtered_relation dataStore "discover_ev" $ (["object"], tmph):preps-discovers_ = make_inverted_filtered_relation dataStore "discover_ev"--discovered tmph = make_filtered_relation dataStore "discover_ev" [(["object"],tmph)]-discovered' tmph preps = make_filtered_relation dataStore "discover_ev" $ (["object"], tmph):preps-discovered_ = make_inverted_filtered_relation dataStore "discover_ev"--orbit tmph = make_filtered_relation dataStore "orbit_ev" [(["object"],tmph)]-orbit' tmph preps = make_filtered_relation dataStore "orbit_ev" $ (["object"], tmph):preps-orbit_ = make_inverted_filtered_relation dataStore "orbit_ev"--orbits tmph = make_filtered_relation dataStore "orbit_ev" [(["object"],tmph)]-orbits' tmph preps = make_filtered_relation dataStore "orbit_ev" $ (["object"], tmph):preps-orbits_ = make_inverted_filtered_relation dataStore "orbit_ev"--orbited tmph = make_filtered_relation dataStore "orbit_ev" [(["object"],tmph)]-orbited' tmph preps = make_filtered_relation dataStore "orbit_ev" $ (["object"], tmph):preps-orbited_ = make_inverted_filtered_relation dataStore "orbit_ev"--discoverer = get_subjs_of_event_type dataStore "discover_ev"-discoverers = get_subjs_of_event_type dataStore "discover_ev"-anyone = a person-anything = a thing-anybody = a person-someone = a person-something = a thing-somebody = a person-everyone = every person-everything = every thing-everybody = every person-thing = get_members dataStore "thing"-things = get_members dataStore "thing"-planets = get_members dataStore "planet"-planet = get_members dataStore "planet"-person = get_members dataStore "person"-sun = get_members dataStore "sun"-moon = get_members dataStore "moon"-moons = get_members dataStore "moon"-satellite = get_members dataStore "moon"-satellites = get_members dataStore "moon"-atmospheric = get_members dataStore "atmospheric"-blue = get_members dataStore "blue"-solid = get_members dataStore "solid"-brown = get_members dataStore "brown"-gaseous = get_members dataStore "gaseous"-green = get_members dataStore "green"-red = get_members dataStore "red"-ringed = get_members dataStore "ringed"-vacuumous = get_members dataStore "vacuumous"-exist = get_members dataStore "thing"-exists = get_members dataStore "thing"-spin = get_members dataStore "spin"-spins = get_members dataStore "spin"-bernard = make_pnoun "bernard"-bond = make_pnoun "bond"-venus = make_pnoun "venus"-cassini = make_pnoun "cassini"-dollfus = make_pnoun "dollfus"-galileo = make_pnoun "galileo"-hall = make_pnoun "hall"-herschel = make_pnoun "herschel"-huygens = make_pnoun "huygens"-kowal = make_pnoun "kowal"-kuiper = make_pnoun "kuiper"-larsen = make_pnoun "larsen"-lassell = make_pnoun "lassell"-melotte = make_pnoun "melotte"-nicholson = make_pnoun "nicholson"-perrine = make_pnoun "perrine"-pickering = make_pnoun "pickering"-almathea = make_pnoun "almathea"-ariel = make_pnoun "ariel"-callisto = make_pnoun "callisto"-charon = make_pnoun "charon"-deimos = make_pnoun "deimos"-dione = make_pnoun "dione"-earth = make_pnoun "earth"-enceladus = make_pnoun "enceladus"-europa = make_pnoun "europa"-ganymede = make_pnoun "ganymede"-hyperion = make_pnoun "hyperion"-iapetus = make_pnoun "iapetus"-io = make_pnoun "io"-janus = make_pnoun "janus"-jupiter = make_pnoun "jupiter"-jupitereighth = make_pnoun "jupitereighth"-jupitereleventh = make_pnoun "jupitereleventh"-jupiterfourteenth = make_pnoun "jupiterfourteenth"-jupiterninth = make_pnoun "jupiterninth"-jupiterseventh = make_pnoun "jupiterseventh"-jupitersixth = make_pnoun "jupitersixth"-jupitertenth = make_pnoun "jupitertenth"-jupiterthirteenth = make_pnoun "jupiterthirteenth"-jupitertwelfth = make_pnoun "jupitertwelfth"-luna = make_pnoun "luna"-mars = make_pnoun "mars"-mercury = make_pnoun "mercury"-mimas = make_pnoun "mimas"-miranda = make_pnoun "miranda"-neptune = make_pnoun "neptune"-nereid = make_pnoun "nereid"-oberon = make_pnoun "oberon"-phobos = make_pnoun "phobos"-phoebe = make_pnoun "phoebe"-pluto = make_pnoun "pluto"-rhea = make_pnoun "rhea"-saturn = make_pnoun "saturn"-saturnfirst = make_pnoun "saturnfirst"-sol = make_pnoun "sol"-tethys = make_pnoun "tethys"-titan = make_pnoun "titan"-titania = make_pnoun "titania"-triton = make_pnoun "triton"-umbriel = make_pnoun "umbriel"-uranus = make_pnoun "uranus"-human = get_members dataStore "person"-humans = get_members dataStore "person"-people = get_members dataStore "person"-telescope = get_members dataStore "telescope"-telescopes = get_members dataStore "telescopes"-cassegrain_telescope = make_pnoun "cassegrain_telescope"-hooker_telescope = make_pnoun "hooker_telescope"-schmidt_telescope = make_pnoun "schmidt_telescope"-subaru_reflector_telescope = make_pnoun "subaru_reflector_telescope"-canada_france_hawaii_telescope = make_pnoun "canada-france-hawaii_telescope"-aerial_telescope_1 = make_pnoun "aerial_telescope_1"-bruce_astrograph = make_pnoun "bruce_astrograph"-telescope_1 = make_pnoun "telescope_1"-hale_telescope = make_pnoun "hale_telescope"-hubble_space_telescope = make_pnoun "hubble_space_telescope"-blanco_telescope = make_pnoun "blanco_telescope"-crossley_reflector_telescope = make_pnoun "crossley_reflector_telescope"-refractor_telescope_1 = make_pnoun "refractor_telescope_1"-refractor_telescope_2 = make_pnoun "refractor_telescope_2"-refractor_telescope_3 = make_pnoun "refractor_telescope_3"-refractor_telescope_4 = make_pnoun "refractor_telescope_4"-reflector_telescope_1 = make_pnoun "reflector_telescope_1"-reflector_telescope_2 = make_pnoun "reflector_telescope_2"-reflector_telescope_3 = make_pnoun "reflector_telescope_3"-reflector_telescope_4 = make_pnoun "reflector_telescope_4"-ground_based_telescope_1 = make_pnoun "ground_based_telescope_1"-ground_based_telescope_2 = make_pnoun "ground_based_telescope_2"-ground_based_telescope_3 = make_pnoun "ground_based_telescope_3"-galilean_telescope_1 = make_pnoun "galilean_telescope_1"-team = get_members dataStore "science_team"-teams = get_members dataStore "science_team"-voyager_science_team = make_pnoun "voyager_science_team"-cassini_imaging_science_team = make_pnoun "cassini_imaging_science_team"-science_team_1 = make_pnoun "science_team_1"-science_team_2 = make_pnoun "science_team_2"-science_team_3 = make_pnoun "science_team_3"-science_team_4 = make_pnoun "science_team_4"-science_team_5 = make_pnoun "science_team_5"-science_team_6 = make_pnoun "science_team_6"-science_team_7 = make_pnoun "science_team_7"-science_team_8 = make_pnoun "science_team_8"-science_team_9 = make_pnoun "science_team_9"-science_team_10 = make_pnoun "science_team_10"-science_team_11 = make_pnoun "science_team_11"-science_team_12 = make_pnoun "science_team_12"-science_team_13 = make_pnoun "science_team_13"-science_team_14 = make_pnoun "science_team_14"-science_team_15 = make_pnoun "science_team_15"-science_team_16 = make_pnoun "science_team_16"-science_team_17 = make_pnoun "science_team_17"-science_team_18 = make_pnoun "science_team_18"-science_team_19 = make_pnoun "science_team_19"-science_team_20 = make_pnoun "science_team_20"-science_team_21 = make_pnoun "science_team_21"-larson = make_pnoun "larson"-fountain = make_pnoun "fountain"-scotti = make_pnoun "scotti"-spahr = make_pnoun "spahr"-mcmillan = make_pnoun "mcmillan"-montani = make_pnoun "montani"-gleason = make_pnoun "gleason"-gehrels = make_pnoun "gehrels"-roemer = make_pnoun "roemer"-sheppard = make_pnoun "sheppard"-jewitt = make_pnoun "jewitt"-fernandez = make_pnoun "fernandez"-magnier = make_pnoun "magnier"-kleyna = make_pnoun "kleyna"-gladman = make_pnoun "gladman"-kavelaars = make_pnoun "kavelaars"-petit = make_pnoun "petit"-allen = make_pnoun "allen"-laques = make_pnoun "laques"-lecacheux = make_pnoun "lecacheux"-smith = make_pnoun "smith"-reitsema = make_pnoun "reitsema"-pascu = make_pnoun "pascu"-seidelmann = make_pnoun "seidelmann"-baum = make_pnoun "baum"-currie = make_pnoun "currie"-showalter = make_pnoun "showalter"-scholl = make_pnoun "scholl"-holman = make_pnoun "holman"-marsden = make_pnoun "marsden"-burns = make_pnoun "burns"-milisavljevic = make_pnoun "milisavljevic"-grav = make_pnoun "grav"-karkoschka = make_pnoun "karkoschka"-lissauer = make_pnoun "lissauer"-fraser = make_pnoun "fraser"-christy = make_pnoun "christy"-weaver = make_pnoun "weaver"-stern = make_pnoun "stern"-mutchler = make_pnoun "mutchler"-steffl = make_pnoun "steffl"-buie = make_pnoun "buie"-merline = make_pnoun "merline"-spencer = make_pnoun "spencer"-young_e_f = make_pnoun "young_e_f"-young_l_a = make_pnoun "young_l_a"-hamilton = make_pnoun "hamilton"-soummer = make_pnoun "soummer"-throop = make_pnoun "throop"-spacecraft = get_members dataStore "spacecraft"-spacecrafts = get_members dataStore "spacecrafts"-voyager_1 = make_pnoun "voyager_1"-voyager_2 = make_pnoun "voyager_2"-place = get_members dataStore "place"-places = get_members dataStore "places"-mt_hopkins = make_pnoun "mt_hopkins"-fort_davis = make_pnoun "fort_davis"-cerro_tololo = make_pnoun "cerro_tololo"-us_naval_observatory = make_pnoun "us_naval_observatory"-padua = make_pnoun "padua"-mt_hamilton = make_pnoun "mt_hamilton"-greenwich = make_pnoun "greenwich"-mt_wilson = make_pnoun "mt_wilson"-mt_palomar = make_pnoun "mt_palomar"-kitt_peak = make_pnoun "kitt_peak"-mauna_kea = make_pnoun "mauna_kea"-slough = make_pnoun "slough"-paris = make_pnoun "paris"-the_hague = make_pnoun "the_hague"-cambridge = make_pnoun "cambridge"-liverpool = make_pnoun "liverpool"-arequipa = make_pnoun "arequipa"-pic_du_midi = make_pnoun "pic_du_midi"-flagstaff = make_pnoun "flagstaff"-la_silla = make_pnoun "la_silla"-himalia = make_pnoun "himalia"-elara = make_pnoun "elara"-pasiphae = make_pnoun "pasiphae"-sinope = make_pnoun "sinope"-lysithea = make_pnoun "lysithea"-carme = make_pnoun "carme"-ananke = make_pnoun "ananke"-leda = make_pnoun "leda"-thebe = make_pnoun "thebe"-adrastea = make_pnoun "adrastea"-metis = make_pnoun "metis"-callirrhoe = make_pnoun "callirrhoe"-themisto = make_pnoun "themisto"-megaclite = make_pnoun "megaclite"-taygete = make_pnoun "taygete"-chaldene = make_pnoun "chaldene"-harpalyke = make_pnoun "harpalyke"-kalyke = make_pnoun "kalyke"-iocaste = make_pnoun "iocaste"-erinome = make_pnoun "erinome"-isonoe = make_pnoun "isonoe"-praxidike = make_pnoun "praxidike"-autonoe = make_pnoun "autonoe"-thyone = make_pnoun "thyone"-hermippe = make_pnoun "hermippe"-aitne = make_pnoun "aitne"-eurydome = make_pnoun "eurydome"-euanthe = make_pnoun "euanthe"-euporie = make_pnoun "euporie"-orthosie = make_pnoun "orthosie"-sponde = make_pnoun "sponde"-kale = make_pnoun "kale"-pasithee = make_pnoun "pasithee"-hegemone = make_pnoun "hegemone"-mneme = make_pnoun "mneme"-aoede = make_pnoun "aoede"-thelxinoe = make_pnoun "thelxinoe"-arche = make_pnoun "arche"-kallichore = make_pnoun "kallichore"-helike = make_pnoun "helike"-carpo = make_pnoun "carpo"-eukelade = make_pnoun "eukelade"-cyllene = make_pnoun "cyllene"-kore = make_pnoun "kore"-herse = make_pnoun "herse"-epimetheus = make_pnoun "epimetheus"-helene = make_pnoun "helene"-telesto = make_pnoun "telesto"-calypso = make_pnoun "calypso"-atlas = make_pnoun "atlas"-prometheus = make_pnoun "prometheus"-pandora = make_pnoun "pandora"-pan = make_pnoun "pan"-ymir = make_pnoun "ymir"-paaliaq = make_pnoun "paaliaq"-tarvos = make_pnoun "tarvos"-ijiraq = make_pnoun "ijiraq"-suttungr = make_pnoun "suttungr"-kiviuq = make_pnoun "kiviuq"-mundilfari = make_pnoun "mundilfari"-albiorix = make_pnoun "albiorix"-skathi = make_pnoun "skathi"-erriapus = make_pnoun "erriapus"-siarnaq = make_pnoun "siarnaq"-thrymr = make_pnoun "thrymr"-narvi = make_pnoun "narvi"-methone = make_pnoun "methone"-pallene = make_pnoun "pallene"-polydeuces = make_pnoun "polydeuces"-daphnis = make_pnoun "daphnis"-aegir = make_pnoun "aegir"-bebhionn = make_pnoun "bebhionn"-bergelmir = make_pnoun "bergelmir"-bestla = make_pnoun "bestla"-farbauti = make_pnoun "farbauti"-fenrir = make_pnoun "fenrir"-fornjot = make_pnoun "fornjot"-hati = make_pnoun "hati"-hyrrokkin = make_pnoun "hyrrokkin"-kari = make_pnoun "kari"-loge = make_pnoun "loge"-skoll = make_pnoun "skoll"-surtur = make_pnoun "surtur"-anthe = make_pnoun "anthe"-jarnsaxa = make_pnoun "jarnsaxa"-greip = make_pnoun "greip"-tarqeq = make_pnoun "tarqeq"-aegaeon = make_pnoun "aegaeon"-cordelia = make_pnoun "cordelia"-ophelia = make_pnoun "ophelia"-bianca = make_pnoun "bianca"-cressida = make_pnoun "cressida"-desdemona = make_pnoun "desdemona"-juliet = make_pnoun "juliet"-portia = make_pnoun "portia"-rosalind = make_pnoun "rosalind"-belinda = make_pnoun "belinda"-puck = make_pnoun "puck"-caliban = make_pnoun "caliban"-sycorax = make_pnoun "sycorax"-prospero = make_pnoun "prospero"-setebos = make_pnoun "setebos"-stephano = make_pnoun "stephano"-trinculo = make_pnoun "trinculo"-francisco = make_pnoun "francisco"-margaret = make_pnoun "margaret"-ferdinand = make_pnoun "ferdinand"-perdita = make_pnoun "perdita"-mab = make_pnoun "mab"-cupid = make_pnoun "cupid"-naiad = make_pnoun "naiad"-thalassa = make_pnoun "thalassa"-despina = make_pnoun "despina"-galatea = make_pnoun "galatea"-larissa = make_pnoun "larissa"-proteus = make_pnoun "proteus"-halimede = make_pnoun "halimede"-psamathe = make_pnoun "psamathe"-sao = make_pnoun "sao"-laomedeia = make_pnoun "laomedeia"-neso = make_pnoun "neso"-nix = make_pnoun "nix"-hydra = make_pnoun "hydra"-kerberos = make_pnoun "kerberos"-styx = make_pnoun "styx"
Main.hs view
@@ -1,7 +1,8 @@ {-# LANGUAGE Trustworthy #-}+{-# LANGUAGE DoAndIfThenElse #-}  module Main where-import qualified SolarmanTriplestore as App+import qualified XSaiga.SolarmanTriplestore as App import Text.PrettyPrint.HughesPJ import Network.CGI 
− SolarmanTriplestore.hs
@@ -1,1312 +0,0 @@-{-# LANGUAGE NoMonomorphismRestriction #-}-{-# LANGUAGE Trustworthy #-}-module SolarmanTriplestore where--import Prelude hiding ((*>))-import Getts-import Data.List as List-import qualified Data.Set as Set-import AGParser2-import TypeAg2-import Control.Monad-import Debug.Trace-import qualified LocalData as Local----change between remoteData and localData---dataStore = Local.localData-dataStore = remoteData -- selects database--endpoint_uri = "http://speechweb2.cs.uwindsor.ca/sparql"-namespace_uri = "http://solarman.richard.myweb.cs.uwindsor.ca#"-remoteData = SPARQL endpoint_uri namespace_uri-    ---copied from gangster_v4: utility functions for making lists unique-subset s t = (s \\ t) == []--makeset x = Set.toList $ Set.fromList x-    ---copied from gangster_v4: combinators-termor tmph1 tmph2 ents =-        liftM List.nub $ liftM2 (++) (tmph1 ents) (tmph2 ents) --TODO: MERGE IMAGES PROPER--termand tmph1 tmph2 ents = do-        t1 <- tmph1 ents-        t2 <- tmph2 ents-        if t1 /= [] && t2 /= [] then return $ List.nub $ t1 ++ t2 else return []-        --May need to be changed to intersection?  Don't think so:  can't remove anything from nub (t1++t2) because all things are relevant to either t1 or t2-        --TODO: MERGE IMAGES PROPER (or do termphrases always preserve ents)--intersect_entevimages eei1  eei2 -                = [(subj2, evs2) | (subj1, evs1) <- eei1, (subj2, evs2) <- eei2, subj1 == subj2]-        -that = nounand--nounand = liftM2 intersect_entevimages--nounor' s t = List.nub(s ++ t)-nounor = liftM2 nounor'-       -{-a' nph vbph =-    length (intersect  nph vbph) /= 0-}-a = liftM2 intersect_entevimages    -any' = a-the = a-some = a-an = a--every' nph vbph | subset (map fst nph) (map fst vbph) = intersect_entevimages nph vbph-                | otherwise = []--every = liftM2 every'--{- TODO: -no' nph vbph =-    length (intersect nph vbph) == 0-no = liftM2 no'--}-    -{- TODO:-none' nph vbph =-    no nph vbph-none = liftM2 none'--}-  -one' nph vbph   | length (res) == 1 = res-                | otherwise = []-    where-    res = intersect_entevimages  nph vbph-    -one = liftM2 one'--two' nph vbph   | length (res) == 2 = res-                | otherwise = []-    where-    res = intersect_entevimages  nph vbph-    -two = liftM2 two'-  ----which nph vbph = if result /= [] then result else "none."---  where result = unwords $ intersect nph vbph--which nph vbph = do-    nph_ <- nph-    vbph_ <- vbph-    let result = unwords $ map fst $ intersect_entevimages nph_ vbph_-    return $ if result /= [] then result else "none."-    -how_many' nph vbph =-    show $ length (intersect_entevimages nph vbph)-how_many = liftM2 how_many'--who = which ((get_members dataStore "person") `nounor` (get_members dataStore "science_team"))----New-what' nph = if result /= [] then result else "nothing."-    where result = unwords $ map fst nph-what = liftM what'--with :: (IO Image -> IO Image) -> ([String], IO Image -> IO Image)-with tmph = (["with_implement"], tmph)--by tmph = (["subject"], tmph)--at tmph = (["location"], tmph)--in' tmph = (["location", "year"], make_pnoun $ show tmph)--make_pnoun noun = liftM $ make_pnoun' noun-make_pnoun' noun image = [(subj, evs) | (subj, evs) <- image, subj == noun]----New for new new semantics----TODO: Handle case where nothing is in props (return none)-make_prop_termphrase prop nph = do-    list <- nph-    props <- mapM (\(_,y) -> getts_inverse dataStore prop y >>= \loc -> return (map fst loc)) list-    let finalList = unwords $ List.nub $ concat props-    return $ if finalList /= [] then finalList else "nothing."--where' = make_prop_termphrase "location"-when' = make_prop_termphrase "year"-how' = make_prop_termphrase "with_implement"-whatobj = make_prop_termphrase "object"-----end of copied from gangster_v4--{--sun     = get_members dataStore ("sun")-planet  = get_members dataStore ("planet")-moon    = get_members dataStore ("moon")-person  = get_members dataStore ("person")-thing   = get_members dataStore ("thing")-telescope = get_members dataStore ("telescope")-science_team = get_members dataStore ("science_team")-spacecraft = get_members dataStore ("spacecraft")-place = get_members dataStore ("place")--atmospheric = get_members dataStore ("atmospheric")-blue = get_members dataStore ("blue")-depressed = get_members dataStore ("depressed")-solid = get_members dataStore ("solid")-brown   = get_members dataStore ("brown")-gaseous = get_members dataStore ("gaseous")-green   = get_members dataStore ("green")-red     = get_members dataStore ("red")-ringed  = get_members dataStore ("ringed")-vacuumous = get_members dataStore ("vacuumous")-exists = thing-spin   = get_members dataStore ("spin")--}---{--discover_intrans    = get_subjs_of_event_type dataStore ("discover_ev")-orbit_intrans       = get_subjs_of_event_type dataStore ("orbit_ev")--}--{-discover = make_relation "discover_ev" -discovered = discover--orbit = make_relation "orbit_ev" -orbited = orbit-}----For prepositional phrases-{-discover' = make_relation "discover_ev"-discovered' = discover'--orbit' = make_relation "orbit_ev" -orbited' = orbit'-}--{-hall = make_pnoun "hall"-phobos = make_pnoun "phobos"-mars = make_pnoun "mars"-refractor_telescope_1 = make_pnoun "refractor_telescope_1"--}--make_relation ev_type tmph = make_filtered_relation dataStore ev_type [(["object"],tmph)]--                -{-make_inverted_relation :: (TripleStore m) => m -> String -> (IO [String] -> IO Bool) -> IO [String]-make_inverted_relation ev_data rel tmph = do-        images <- make_image ev_data rel "object"-        objPairs <- filterM (\(_, evs) ->-            tmph $ liftM concat $ mapM (\ev -> getts_3 ev_data (ev, "subject", "?")) evs) images-        return $ map fst objPairs-}-        ---Prepositional filtering----filter_ev takes a list of ([String], IO [String] -> IO Bool) where the [String] is the list of identifiers corresponding---to the data the preposition predicate needs to evaluate (e.g., for location predicates the list will contain "location",-{-filter_ev :: (TripleStore m) => m -> [([String], IO [String] -> IO Bool)] -> Event -> IO Bool-filter_ev ev_data [] ev = return True-filter_ev ev_data ((names,pred):list) ev = do-    relevant_list <- mapM (\name -> getts_3 ev_data (ev, name, "?")) names-    res <- pred $ return $ concat relevant_list-    if res then filter_ev ev_data list ev else return False-}-    ---Modified filter_ev to accommodate predicates like every, one, two, etc...---The difference is that it concatenates the data the preposition predicate needs to evaluate across all events and---applies the preposition predicate to that, so that all data is available to the predicate rather than just the subset---given by a specific event---TODO: new filter_Ev-{-filter_ev :: (TripleStore m) => m -> [([String], IO Image -> IO Image)] -> [Event] -> IO Bool-filter_ev _ [] _ = return True-filter_ev ev_data ((names,pred):list) evs = do-    relevant_list <- mapM (\name -> getts_inverse ev_data name evs) names-    res <- pred $ return $ concat $ relevant_list-    if res /= [] then filter_ev ev_data list evs else return False-}-    ---new filter_ev: Handles prepositional phrases (IN TESTING)-filter_ev :: (TripleStore m) => m -> [([String], IO Image -> IO Image)] -> [Event] -> IO Bool-filter_ev _ [] _ = return True-filter_ev ev_data ((names,pred):list) evs = do-    relevant_list <- mapM (\name -> getts_inverse ev_data name evs) names-    res <- pred $ return $ concat $ relevant_list-    --NEW: Merge all events in predicate result for new query.  Result will be a subset of evs.-    let relevant_evs = List.nub $ concatMap snd res -    if res /= [] then filter_ev ev_data list relevant_evs else return False--{-make_filtered_relation :: (TripleStore m) => m -> String -> (IO [String] -> IO Bool) -> [([String], IO [String] -> IO Bool)] -> IO [String]-make_filtered_relation ev_data rel tmph preps = do-    images <- make_image ev_data rel "subject"-    subPairs <- filterM (\(_, evs) -> do-        filtEvents <- filterM (filter_ev ev_data preps) evs-        tmph $ liftM concat $ mapM (\ev -> getts_3 ev_data (ev, "object", "?")) filtEvents) images-    return $ map fst subPairs-}-    ---Modified version of make_filtered_relation to accomodate new filter_ev-make_filtered_relation :: (TripleStore m) => m -> String -> [([String], IO Image -> IO Image)] -> IO Image-make_filtered_relation ev_data rel preps = do-    images <- make_image ev_data rel "subject"-    filterM (\(_, evs) -> filter_ev ev_data preps evs) images-    -{-make_inverted_filtered_relation :: (TripleStore m) => m -> String -> [([String], IO [String] -> IO Bool)] -> IO [String]-make_inverted_filtered_relation ev_data rel preps = do-    images <- make_image ev_data rel "object"-    objPairs <- filterM (\(_, evs) -> anyM (filter_ev ev_data preps) evs) images-    return $ map fst objPairs-    where-        anyM :: (Monad m) => (a -> m Bool) -> [a] -> m Bool-        anyM pred lst = foldM (\x y -> pred y >>= \res -> return $ x || res) False lst -}----Modified version of make_inverted_filtered_relation to accomodate new filter_ev-make_inverted_filtered_relation :: (TripleStore m) => m -> String -> [([String], IO Image -> IO Image)] -> IO Image-make_inverted_filtered_relation ev_data rel preps = do-    images <- make_image ev_data rel "object"-    filterM (\(_, evs) -> filter_ev ev_data preps evs) images----Copied from old solarman:-yesno' x = if x /= [] then "yes." else "no"-yesno = liftM yesno'--does = yesno-did = yesno-do' = yesno-was = yesno-is = yesno-were = yesno-are = yesno----TODO: is this proper? -sand s1 s2 = do-    r1 <- s1-    r2 <- s2-    return $ if r1 /= [] && r2 /= [] then List.nub $ r1 ++ r2 else []--{--||------------------------------------------------------------------------------||  BASIC INTERPRETERS-||-------------------------------------------------------------------------------}---pnoun           =  pre_processed Pnoun-cnoun           =  pre_processed Cnoun-adj             =  pre_processed Adj-det             =  pre_processed Det-intransvb       =  pre_processed Intransvb-transvb         =  pre_processed Transvb-linkingvb       =  pre_processed Linkingvb-relpron         =  pre_processed Relpron-termphjoin      =  pre_processed Termphjoin-verbphjoin      =  pre_processed Verbphjoin-nounjoin        =  pre_processed Nounjoin-indefpron       =  pre_processed Indefpron-{--terminator      =  uninterpreted (SPECIAL_SYMBOL_TERM ".")-                   $orelse-                   uninterpreted (SPECIAL_SYMBOL_TERM "?")-                   $orelse-                   uninterpreted (SPECIAL_SYMBOL_TERM "\n")--}-sentjoin        =  pre_processed Sentjoin-quest1          =  pre_processed Quest1-quest2          =  pre_processed Quest2-quest3          =  pre_processed Quest3-quest4a         =  pre_processed Quest4a-quest4b         =  pre_processed Quest4b-quest5          =  pre_processed Quest5-quest6          =  pre_processed Quest6----NEW FOR PREPOSITIONAL PHRASES-prep            =  pre_processed Prepn-year            =  pre_processed Year---pre_processed key - = let formAlts altTerminals  = memoize key (altTerminals) -       formTerminal [x]       = x-       formTerminal (x:xs)    = x <|>  formTerminal xs-       list_of_ters           = [ terminal (term a) z -                                | (a,b,z) <- dictionary-                                , b == key]-   in  formAlts (formTerminal list_of_ters)---meaning_of p dInp key- = let dInput     = words dInp-       appParser  = unState (p T0 [] ((1,[]), dInput) ([],[])) [] -       upperBound = (length dInput) + 1-   in  formFinal key upperBound (snd $ appParser)   --meaning_of_ p dInp key- = let dInput     = words dInp-       appParser  = unState (p T0 [] ((1,[]), dInput) ([],[])) [] -       upperBound = (length dInput) + 1-   in  (snd $ appParser)   --formAtts key ePoint t - = concat $ concat $ concat $ concat  -   [[[[  val1 |(id1,val1)<-synAtts]-           |(((st,inAtt2),(end,synAtts)), ts)<-rs, st == 1 && end == ePoint]     -            |((i,inAt1),((cs,ct),rs)) <- sr ]-             |(s,sr) <- t, s == key ]-formFinal key ePoint t - = concat $ concat $ concat $ concat  -   [[[[  val1 |(id1,val1)<-synAtts]-           |(((st,inAtt2),(end,synAtts)), ts)<-rs, st == 1 && end == ePoint]     -            |((i,inAt1),((cs,ct),rs)) <- sr ]-             |(s,sr) <- t, s == key ]            -{--test p = unState (p ((1,[]),input) ([],[])) [] --main   = do putStr  $ render80 $ formatAtts Question $ snd $ test (question T0 [])--type Start1   = (Int, InsAttVals)-type Start    = ((Int,InsAttVals), [String])-type End      = (Int, InsAttVals)-type Atts     = [AttValue] -- [(AttType, AttValue)]-type InsAttVals = [(Instance, Atts)]---                 ,[(Start1,(Context,Result))]-type Mtable   = [(MemoL-                 )-                ] -type Result   = [((Start1, End),[Tree MemoL])]-||------------------------------------------------------------------------------|| THE ATTRIBUTE GRAMMAR-||-------------------------------------------------------------------------------}---- public <snouncla> = <cnoun> | <adjs> <cnoun>;-snouncla - = memoize Snouncla- (parser-  (nt cnoun S3) -  [rule_s NOUNCLA_VAL OF LHS ISEQUALTO copy [synthesized NOUNCLA_VAL OF S3]]-  <|>-  parser (nt adjs S1  *> nt cnoun S2)-  [rule_s NOUNCLA_VAL OF LHS ISEQUALTO intrsct1 [synthesized ADJ_VAL      OF  S1,-                                                 synthesized NOUNCLA_VAL  OF  S2]]-                                               - )------------------------------------------------------------------------------------ public <relnouncla> = <snouncla> <relpron> <joinvbph> | <snouncla>;-relnouncla   - = memoize Relnouncla-   (parser -    (nt snouncla S1  *> nt relpron S2  *> nt joinvbph S3)-    [rule_s NOUNCLA_VAL OF LHS ISEQUALTO apply_middle1[synthesized NOUNCLA_VAL  OF S1,-                                                       synthesized RELPRON_VAL  OF S2,-                                                       synthesized VERBPH_VAL   OF S3]]-    <|>   -    parser-    (nt snouncla S4)-    [rule_s NOUNCLA_VAL OF LHS ISEQUALTO copy [synthesized NOUNCLA_VAL OF S4]]-   )---------------------------------------------------------------------------------- public <nouncla> = <relnouncla> <nounjoin> <nouncla> | <relnouncla> <relpron> <linkingvb> <nouncla> | <relnouncla>;-nouncla - = memoize Nouncla -   (parser (nt relnouncla S1 *> nt nounjoin S2 *> nt nouncla S3)-    [rule_s NOUNCLA_VAL OF LHS ISEQUALTO apply_middle2 [synthesized NOUNCLA_VAL  OF S1,-                                                        synthesized NOUNJOIN_VAL OF S2,-                                                        synthesized NOUNCLA_VAL  OF S3]]-    <|>-    parser (nt relnouncla S1 *> nt relpron S2 *> nt linkingvb S3 *> nt nouncla S4) --Does this make sense?  Allows us to ask "which moon that was discovered by hall that is moon orbits mars"-    [rule_s NOUNCLA_VAL  OF LHS ISEQUALTO apply_middle3 [synthesized NOUNCLA_VAL  OF S1,-                                                         synthesized RELPRON_VAL  OF S2,-                                                         synthesized NOUNCLA_VAL  OF S4]]-    <|>-    parser (nt relnouncla S1)-    [rule_s NOUNCLA_VAL  OF LHS ISEQUALTO copy [synthesized NOUNCLA_VAL  OF S1]]-   )----------------------------------------------------------------------------------- public <adjs> = <adj> <adjs> | <adj>;-adjs   - = memoize Adjs      -   (parser (nt adj S1 *> nt adjs S2)-    [rule_s ADJ_VAL  OF LHS ISEQUALTO intrsct2 [synthesized ADJ_VAL  OF S1,-                                                synthesized ADJ_VAL  OF S2]]-    <|>-    parser (nt adj S3)-    [rule_s ADJ_VAL  OF LHS ISEQUALTO copy [synthesized ADJ_VAL  OF S3]]-   )---------------------------------------------------------------------------------- public <detph> = <indefpron> | <det> <nouncla>;-detph     - = memoize Detph-   (parser (nt indefpron S3)-    [rule_s TERMPH_VAL OF LHS ISEQUALTO copy [synthesized TERMPH_VAL OF S3]]-    <|>-    parser (nt det S1 *> nt nouncla S2)-    [rule_s TERMPH_VAL OF LHS ISEQUALTO applydet [synthesized DET_VAL      OF S1,-                                                  synthesized NOUNCLA_VAL  OF S2]]-   )                                              --------------------------------------------------------------------------------------{-- 	public <transvbph> = <transvb>-                        | <transvb> <preps>-                        | <transvb> <jointermph>-                        | <transvb> <jointermph> <preps>-                        | <linkingvb> <jointermph> <transvb>-                        | <linkingvb> <jointermph> <transvb> <preps>;- -}--transvbph - = memoize Transvbph-   (parser (nt transvb S1) --"discovered"-    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvb_no_tmph [synthesized VERB_VAL OF S1]]-    <|>-    parser (nt transvb S1 *> nt preps S2) --"discovered in..."-    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvb_no_tmph [synthesized VERB_VAL OF S1,-                                                              synthesized PREP_VAL OF S2]]-    <|>-    parser (nt transvb S1 *> nt jointermph S2) --"discovered phobos (and blah and blah and blah)"-    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvbprep [synthesized VERB_VAL    OF S1,-                                                          synthesized TERMPH_VAL  OF S2]]-    <|>-    parser (nt transvb S1 *> nt jointermph S2 *> nt preps S3) --"discovered phobos in..."-    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvbprep [synthesized VERB_VAL OF S1,-                                                          synthesized TERMPH_VAL OF S2,-                                                          synthesized PREP_VAL OF S3]]-    <|>-    parser (nt linkingvb S1 *> nt transvb S2) --"was discovered"-    [rule_s VERBPH_VAL  OF LHS ISEQUALTO drop3rdprep [synthesized LINKINGVB_VAL  OF  S1,-                                                      synthesized VERB_VAL       OF  S2]]-    <|>-    parser (nt linkingvb S1 *> nt transvb S2 *> nt preps S3) --"was discovered by hall in..."-    [rule_s VERBPH_VAL  OF LHS ISEQUALTO drop3rdprep [synthesized LINKINGVB_VAL  OF  S1,-                                                  synthesized VERB_VAL       OF  S2,-                                                  synthesized PREP_VAL       OF  S3]]-    <|>-    parser (nt linkingvb S1  *>  nt jointermph S2 *> nt transvb S3) --"was phobos discovered"-    [rule_s VERBPH_VAL  OF LHS ISEQUALTO apply_quest_transvb_passive [synthesized LINKINGVB_VAL OF  S1,-                                                                      synthesized TERMPH_VAL    OF  S2,-                                                                      synthesized VERB_VAL      OF  S3]]-    <|>-    parser (nt linkingvb S1  *>  nt jointermph S2 *> nt transvb S3 *> nt preps S4) --"was phobos discovered in..."-    [rule_s VERBPH_VAL  OF LHS ISEQUALTO apply_quest_transvb_passive [synthesized LINKINGVB_VAL OF  S1,-                                                                      synthesized TERMPH_VAL    OF  S2,-                                                                      synthesized VERB_VAL      OF  S3,-                                                                      synthesized PREP_VAL      OF  S4]]-   )-   --------------------------------------------------------------------------------------NEW FOR PREPOSITIONAL PHRASES---- public <preps> = <prepph> | <preph> <preps>;-preps- = memoize Preps-    (parser (nt prepph S1)-     [rule_s PREP_VAL OF LHS ISEQUALTO applyprep [synthesized PREPPH_VAL OF S1]]-     <|>-     parser (nt prepph S1 *> nt preps S2)-     [rule_s PREP_VAL OF LHS ISEQUALTO applypreps [synthesized PREPPH_VAL OF S1,-                                                   synthesized PREP_VAL OF S2]]-    )---- public <prepph> = <prep> <jointermph>;	-prepph- = memoize Prepph-    (parser (nt prep S1 *> nt jointermph S2)-     [rule_s PREPPH_VAL OF LHS ISEQUALTO applyprepph [synthesized PREPN_VAL OF S1,-                                                     synthesized TERMPH_VAL OF S2]]-    )---------------------------------------------------------------------------------------- public <verbph> = <transvbph> | <intransvb> | <linkingvb> <det> <nouncla>;-verbph - = memoize Verbph-   (-    parser (nt transvbph S4)-    [rule_s VERBPH_VAL OF LHS ISEQUALTO copy [synthesized VERBPH_VAL OF S4]]-   <|>-    parser (nt intransvb S5)-    [rule_s VERBPH_VAL OF LHS ISEQUALTO copy [synthesized VERBPH_VAL OF S5]]-   <|>-    parser (nt linkingvb S1 *> nt det S2 *> nt nouncla S3)-    [rule_s VERBPH_VAL OF LHS ISEQUALTO applyvbph [synthesized NOUNCLA_VAL OF S3]]-   )---------------------------------------------------------------------------------------- public <termph> = <pnoun> | <detph> | <year>;-termph    - = memoize Termph  -   (-   parser (nt pnoun S1) -   [rule_s TERMPH_VAL OF LHS ISEQUALTO copy [synthesized TERMPH_VAL OF S1]]-   <|>  -   parser (nt detph S2)-   [rule_s TERMPH_VAL OF LHS ISEQUALTO copy [synthesized TERMPH_VAL OF S2]]-   <|>-   parser (nt year S3)-   [rule_s TERMPH_VAL OF LHS ISEQUALTO applyyear [synthesized YEAR_VAL OF S3]]-   )-             ----------------------------------------------------------------------------------------- public <jointermph> = <jointermph> <termphjoin> <jointermph> | <termph>;-jointermph - = memoize Jointermph -   (-{-    parser (nt jointermph S1 *> nt termphjoin S2 *> nt termph S3)-        [rule_s TERMPH_VAL  OF LHS ISEQUALTO appjoin1 [synthesized TERMPH_VAL     OF S1,-                                                       synthesized TERMPHJOIN_VAL OF S2,-                                                       synthesized TERMPH_VAL     OF S3]]-   <|>--}-    parser (nt jointermph S1 *> nt termphjoin S2 *> nt jointermph S3) --"hall and galileo discovered...?"-    [rule_s TERMPH_VAL  OF LHS ISEQUALTO appjoin1 [synthesized TERMPH_VAL     OF S1,-                                                   synthesized TERMPHJOIN_VAL OF S2,-                                                   synthesized TERMPH_VAL     OF S3]]-   <|>-    parser (nt termph S4)-    [rule_s TERMPH_VAL  OF LHS ISEQUALTO copy [synthesized TERMPH_VAL  OF S4]]-   )---------------------------------------------------------------------------------------- public <joinvbph> = <verbph> <verbphjoin> <joinvbph> | <verbph>;-joinvbph  - = memoize Joinvbph   -   (-   parser (nt verbph S1  *> nt verbphjoin S2  *> nt joinvbph S3)-   [rule_s VERBPH_VAL  OF LHS ISEQUALTO appjoin2 [synthesized VERBPH_VAL    OF S1,-                                                  synthesized VBPHJOIN_VAL  OF S2,-                                                  synthesized VERBPH_VAL    OF S3]]-    <|>-    parser (nt verbph S4)-    [rule_s VERBPH_VAL  OF LHS ISEQUALTO copy [synthesized VERBPH_VAL  OF S4]]-   )------------------------------------------------------------------------------- public <sent> = <jointermph> <joinvbph>;-sent  - = memoize Sent-   (-    parser (nt jointermph S1  *> nt joinvbph S2)-    [rule_s SENT_VAL OF LHS ISEQUALTO apply_termphrase [synthesized TERMPH_VAL  OF  S1,-                                                        synthesized VERBPH_VAL  OF  S2]]-   )--- **************************************************************************** ----- public <two_sent> = <sent> <sentjoin> <sent>;-two_sent - = memoize Two_sent-   (-    parser (nt sent S1 *> nt sentjoin S2 *> nt sent S3)-    [rule_s SENT_VAL OF LHS ISEQUALTO sent_val_comp [synthesized SENT_VAL      OF  S1,-                                                     synthesized SENTJOIN_VAL  OF  S2,-                                                     synthesized SENT_VAL      OF  S3]] -   )--------------------------------------------------------------------------------------{--	public <question> = <quest1> <sent>-                        | <quest6> <quest1> <sent>-                        | <quest5> <quest1> <sent>-                        | <quest2> <joinvbph>-                        | <quest5> <joinvbph>-                        | <quest3> <nouncla>-                        | <quest3> <nouncla> <joinvbph>-                        | <quest4> <nouncla> <joinvbph>-                        | <two_sent>-                        | <sent>;---}-question   - = memoize Question  -   (-    parser (nt quest1 S1  *> nt sent S2 )-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans1 [synthesized QUEST1_VAL  OF  S1,-                                              synthesized SENT_VAL    OF  S2]]  -    <|>-    parser (nt quest6 S1  *> nt quest1 S2  *>  nt sent S3 )-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans5 [synthesized QUEST2_VAL  OF  S1,-                                              synthesized QUEST1_VAL OF S2,-                                              synthesized SENT_VAL    OF  S3]]  -    <|>-    parser (nt quest5 S1  *> nt quest1 S2  *>  nt sent S3 )-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans5 [synthesized QUEST2_VAL  OF  S1,-                                              synthesized QUEST1_VAL OF S2,-                                              synthesized SENT_VAL    OF  S3]]  -    <|>-    parser (nt quest2 S1 *> nt joinvbph S2)-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans2 [synthesized QUEST2_VAL    OF  S1,-                                              synthesized VERBPH_VAL    OF  S2]] -    <|>-    parser (nt quest5 S1 *> nt joinvbph S2)-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans2 [synthesized QUEST2_VAL    OF  S1,-                                              synthesized VERBPH_VAL    OF  S2]] -    <|>-    parser (nt quest3 S1 *> nt nouncla S2 *> nt joinvbph S3)-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans3 [synthesized QUEST3_VAL  OF S1,-                                              synthesized NOUNCLA_VAL OF S2,-                                              synthesized VERBPH_VAL  OF  S3]]-    <|>-    parser (nt quest4 S1 *> nt nouncla S2 *> nt joinvbph S3)-    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans3 [synthesized QUEST3_VAL  OF  S1,-                                              synthesized NOUNCLA_VAL OF  S2,-                                              synthesized VERBPH_VAL  OF  S3]]-    <|>-    parser (nt two_sent S1)-    [rule_s QUEST_VAL OF LHS ISEQUALTO truefalse [synthesized SENT_VAL OF  S1]]  -    <|>-    parser (nt sent S1)-    [rule_s QUEST_VAL  OF LHS ISEQUALTO truefalse [synthesized SENT_VAL OF  S1]]--   )---- public <quest4> = <quest4a> <quest4b>;-quest4 = memoize Quest4 -   (-   parser (nt quest4a S1 *> nt quest4b S2) -   [rule_s QUEST3_VAL  OF LHS ISEQUALTO copy [synthesized QUEST3_VAL  OF  S1]] -   )------------------------------------------------------------------------------------query = memoize Query-        (-        parser (nt question S1) -- *> nt terminator S2)-        [rule_s QUEST_VAL  OF LHS ISEQUALTO copy [synthesized QUEST_VAL  OF  S1]]-        )----{--|| ------------------------------------------------------------------------------|| THE SEMANTICS - PART I : The attribute evaluation  functions-||------------------------------------------------------------------------------applyBiOp [e1,op,e2] -                  = \atts -> VAL ((getAtts getB_OP atts op ) (getAtts getAVAL atts e1 ) (getAtts getAVAL atts e2))---}--- getAtts f (y,i) x = f (head (x y i))--- copy      [b]     = \(atts,i) -> head (b atts i)--intrsct1         [x, y]    - = \atts -> NOUNCLA_VAL (liftM2 intersect_entevimages (getAtts getAVALS atts x) (getAtts getAVALS atts y))--intrsct2         [x, y]         - = \atts -> ADJ_VAL (liftM2 intersect_entevimages (getAtts getAVALS atts x) (getAtts getAVALS atts y))--applydet         [x, y]                 - = \atts -> TERMPH_VAL $ (getAtts getDVAL atts x) (getAtts getAVALS atts y)- ---make_trans_vb is very similar to make_relation.  getBR must mean "get binary relation"---getTVAL must mean "get predicate" i.e. what would be "phobos" in "discover phobos"---Changed to get rid of make_trans_vb, since the getBR attribute was changed to not ---be a binary relation but instead a function that make_relation would give---I.e., the kind of function that make_trans_vb would have generated, since they were---nearly identical----NEW FOR PREPOSITIONAL PHRASES-applytransvbprep [x,y,z] atts = VERBPH_VAL $ make_filtered_relation dataStore reln ((["object"],predicate):preps)-    where -    reln = getAtts getBR atts x-    predicate = getAtts getTVAL atts y-    preps = getAtts getPREPVAL atts z-    -applytransvbprep [x,y] atts = VERBPH_VAL $ make_filtered_relation dataStore reln [(["object"],predicate)]-    where-    reln = getAtts getBR atts x-    predicate = getAtts getTVAL atts y--applytransvb_no_tmph [x,y] atts = VERBPH_VAL $ make_filtered_relation dataStore reln preps-    where-    reln = getAtts getBR atts x-    preps = getAtts getPREPVAL atts y--applytransvb_no_tmph [x] atts = VERBPH_VAL $ make_filtered_relation dataStore reln []-    where-    reln = getAtts getBR atts x----TODO: modify grammar so you can't ask "what was phobos discover", or if you can, make the answer sensible (e.g. hall, not phobos)-apply_quest_transvb_passive (x2:x3:x4:xs) atts = VERBPH_VAL $ termph $ make_inverted_filtered_relation dataStore reln preps-    where-    linkingvb = getAtts getLINKVAL atts x2-    termph = getAtts getTVAL atts x3-    reln = getAtts getBR atts x4-    preps = case xs of-        [] -> []-        (x5:_) -> getAtts getPREPVAL atts x5-    -applyprepph     [x, y]- = \atts -> PREPPH_VAL $-        let prep_names = getAtts getPREPNVAL atts x-            termph = getAtts getTVAL atts y in-        (prep_names, termph)-        -applyprep   [x]- = \atts -> PREP_VAL $ [(getAtts getPREPPHVAL atts x)] --[(["with_implement"], a telescope)]- -applypreps      [x, y]- = \atts -> PREP_VAL $ (getAtts getPREPPHVAL atts x):(getAtts getPREPVAL atts y)- -applyyear [x]- = \atts -> TERMPH_VAL $ make_pnoun $ show $ getAtts getYEARVAL atts x- ---END PREPOSITIONAL PHRASES-        -applyvbph        [z]    - = \atts -> VERBPH_VAL (getAtts getAVALS atts z)- -appjoin1         [x, y, z]     - = \atts -> TERMPH_VAL $ (getAtts getTJVAL atts y) (getAtts getTVAL atts x) (getAtts getTVAL atts z)--appjoin2         [x, y, z]    - = \atts -> VERBPH_VAL ((getAtts getVJVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))--apply_middle1    [x, y, z]    - = \atts -> NOUNCLA_VAL ((getAtts getRELVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))--apply_middle2    [x, y, z]                  - = \atts -> NOUNCLA_VAL ((getAtts getNJVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))--apply_middle3    [x, y, z]    - = \atts -> NOUNCLA_VAL ((getAtts getRELVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))---- Think "a orbited by b" vs "b orbits a"-{-drop3rd          [w, x, y, z]     - = \atts -> VERBPH_VAL $-        let reln = getAtts getBR atts x in-        let predicate = getAtts getTVAL atts z in-        make_inverted_relation dataStore reln predicate-}----NEW FOR PREPOSITIONAL PHRASES-drop3rdprep (w:x:xs) atts = VERBPH_VAL $ make_inverted_filtered_relation dataStore reln preps-        where-        reln = getAtts getBR atts x-        preps = case xs of -            [] -> []-            (p:ps) -> getAtts getPREPVAL atts p---END PREPOSITIONAL PHRASES-        -apply_termphrase [x, y]     - = \atts -> SENT_VAL ((getAtts getTVAL atts x) (getAtts getAVALS atts y))- -sent_val_comp    [s1, f, s2]      - = \atts -> SENT_VAL ((getAtts getSJVAL atts f) (getAtts getSV atts s1) (getAtts getSV atts s2))--ans1             [x, y]       - = \atts -> QUEST_VAL ((getAtts getQU1VAL atts x) (getAtts getSV atts y) )--ans2             [x, y]     - = \atts -> QUEST_VAL ((getAtts getQU2VAL atts x) (getAtts getAVALS atts y))--ans3             [x, y, z]     - = \atts -> QUEST_VAL ((getAtts getQU3VAL atts x) (getAtts getAVALS atts y) (getAtts getAVALS atts z))--ans5             [x, y, z]     - = \atts -> QUEST_VAL ((getAtts getQU2VAL atts x) (getAtts getSV atts z))- -truefalse        [x]       - = \atts -> QUEST_VAL $ do-        bool <- (getAtts getSV atts x)-        return $ if bool /= [] then "true." else "false."-        ---        -{--||------------------------------------------------------------------------------|| THE SEMANTICS - PART II : Functions used to obtain objects denoted by -||   proper nouns, verbs, etc.-||-------------------------------------------------------------------------------|| FUNCTION USED TO DEFINE OBJECTS ASSOCIATED WITH PROPER NOUNS--}---test_wrt e s = e `elem` s---- FUNCTION USED TO DEFINE MEANINGS OF VERBS IN TERMS OF RELATIONS---make_trans_vb rel p = [x | (x, image_x) <- collect rel, p image_x] -- Similar to make_relation--{- TERMINALS IN JSGF FORM--<Prepn> = with | in | at | by;--<Transvb> = discover | discovers | discovered | orbit | orbited | orbits;--<Indefpron> = anyone | anything | anybody | someone | something | somebody | everyone | everything | everybody;--<Quest5> = where | when | how;--<Quest4b> = many;--<Sentjoin> = and;--<Linkingvb> = is | was | are | were;--<Nounjoin> = and | or;--<Verbphjoin> = and | or;--<Quest3> = which | what;--<Det> = the | a | one | an | some | any | every | all | two;--<Termphjoin> = and | or;--<Quest6> = what;--<Intransvb> = exist | exists | spin | spins;---}--dictionary = [-    ("thing",              Cnoun,     [NOUNCLA_VAL $ get_members dataStore "thing"]),-    ("things",             Cnoun,     [NOUNCLA_VAL $ get_members dataStore "thing"]),-    ("planets",            Cnoun,     [NOUNCLA_VAL $ get_members dataStore "planet"]),-    ("planet",             Cnoun,     [NOUNCLA_VAL $ get_members dataStore "planet"]),-    ("person",             Cnoun,     [NOUNCLA_VAL $ get_members dataStore "person"]),   -    ("sun",                Cnoun,     [NOUNCLA_VAL $ get_members dataStore "sun"]), -    ("moon",               Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]), -    ("moons",              Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]),-    ("satellite",          Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]),-    ("satellites",         Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]),-    ("atmospheric",        Adj,       [ADJ_VAL $ get_members dataStore "atmospheric"]),-    ("blue",               Adj,       [ADJ_VAL $ get_members dataStore "blue"]),-    ("solid",              Adj,       [ADJ_VAL $ get_members dataStore "solid"]),     -    ("brown",              Adj,       [ADJ_VAL $ get_members dataStore "brown"]),   -    ("gaseous",            Adj,       [ADJ_VAL $ get_members dataStore "gaseous"]),  -    ("green",              Adj,       [ADJ_VAL $ get_members dataStore "green"]),  -    ("red",                Adj,       [ADJ_VAL $ get_members dataStore "red"]),  -    ("ringed",             Adj,       [ADJ_VAL $ get_members dataStore "ringed"]),  -    ("vacuumous",          Adj,       [ADJ_VAL $ get_members dataStore "vacuumous"]),-    ("exist",              Intransvb, [VERBPH_VAL $ get_members dataStore "thing"]),-    ("exists",             Intransvb, [VERBPH_VAL $ get_members dataStore "thing"]),-    ("spin",               Intransvb, [VERBPH_VAL $ get_members dataStore "spin"]),-    ("spins",              Intransvb, [VERBPH_VAL $ get_members dataStore "spin"]),-    ("the",                Det,       [DET_VAL $ the]),-    ("a",                  Det,       [DET_VAL $ a]),-    ("one",                Det,       [DET_VAL $ one]), -    ("an",                 Det,       [DET_VAL $ a]), -    ("some",               Det,       [DET_VAL $ a]), -    ("any",                Det,       [DET_VAL $ a]), -    --("no",                 Det,       [DET_VAL $ no]), -    ("every",              Det,       [DET_VAL $ every]), -    ("all",                Det,       [DET_VAL $ every]),  -    ("two",                Det,       [DET_VAL $ two]),-    ("bernard",            Pnoun,     [TERMPH_VAL $ make_pnoun "bernard"]),-    ("bond",               Pnoun,     [TERMPH_VAL $ make_pnoun "bond"]),-    ("venus",              Pnoun,     [TERMPH_VAL $ make_pnoun "venus"]),-    ("cassini",            Pnoun,     [TERMPH_VAL $ make_pnoun "cassini"]),-    ("dollfus",            Pnoun,     [TERMPH_VAL $ make_pnoun "dollfus"]),-    --("fouuntain",          Pnoun,     [TERMPH_VAL $ make_pnoun "Fouuntain"]),-    ("galileo",            Pnoun,     [TERMPH_VAL $ make_pnoun "galileo"]),-    ("hall",               Pnoun,     [TERMPH_VAL $ make_pnoun "hall"]),-    ("herschel",           Pnoun,     [TERMPH_VAL $ make_pnoun "herschel"]),-    ("huygens",            Pnoun,     [TERMPH_VAL $ make_pnoun "huygens"]),-    ("kowal",              Pnoun,     [TERMPH_VAL $ make_pnoun "kowal"]),-    ("kuiper",             Pnoun,     [TERMPH_VAL $ make_pnoun "kuiper"]),-    ("larsen",             Pnoun,     [TERMPH_VAL $ make_pnoun "larsen"]),-    ("lassell",            Pnoun,     [TERMPH_VAL $ make_pnoun "lassell"]),-    ("melotte",            Pnoun,     [TERMPH_VAL $ make_pnoun "melotte"]),-    ("nicholson",          Pnoun,     [TERMPH_VAL $ make_pnoun "nicholson"]),-    ("perrine",            Pnoun,     [TERMPH_VAL $ make_pnoun "perrine"]),-    ("pickering",          Pnoun,     [TERMPH_VAL $ make_pnoun "pickering"]),-    ("almathea",           Pnoun,     [TERMPH_VAL $ make_pnoun "almathea"]),-    ("ariel",              Pnoun,     [TERMPH_VAL $ make_pnoun "ariel"]),-    ("callisto",           Pnoun,     [TERMPH_VAL $ make_pnoun "callisto"]),-    ("charon",             Pnoun,     [TERMPH_VAL $ make_pnoun "charon"]),-    ("deimos",             Pnoun,     [TERMPH_VAL $ make_pnoun "deimos"]),-    ("dione",              Pnoun,     [TERMPH_VAL $ make_pnoun "dione"]),-    ("earth",              Pnoun,     [TERMPH_VAL $ make_pnoun "earth"]),-    ("enceladus",          Pnoun,     [TERMPH_VAL $ make_pnoun "enceladus"]),-    ("europa",             Pnoun,     [TERMPH_VAL $ make_pnoun "europa"]),-    ("ganymede",           Pnoun,     [TERMPH_VAL $ make_pnoun "ganymede"]),-    ("hyperion",           Pnoun,     [TERMPH_VAL $ make_pnoun "hyperion"]),-    ("iapetus",            Pnoun,     [TERMPH_VAL $ make_pnoun "iapetus"]),-    ("io",                 Pnoun,     [TERMPH_VAL $ make_pnoun "io"]),-    ("janus",              Pnoun,     [TERMPH_VAL $ make_pnoun "janus"]),-    ("jupiter",            Pnoun,     [TERMPH_VAL $ make_pnoun "jupiter"]),-    ("jupitereighth",      Pnoun,     [TERMPH_VAL $ make_pnoun "jupitereighth"]),-    ("jupitereleventh",    Pnoun,     [TERMPH_VAL $ make_pnoun "jupitereleventh"]),-    ("jupiterfourteenth",  Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterfourteenth"]),-    ("jupiterninth",       Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterninth"]),-    ("jupiterseventh",     Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterseventh"]),-    ("jupitersixth",       Pnoun,     [TERMPH_VAL $ make_pnoun "jupitersixth"]),-    ("jupitertenth",       Pnoun,     [TERMPH_VAL $ make_pnoun "jupitertenth"]),-    ("jupiterthirteenth",  Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterthirteenth"]),-    ("jupitertwelfth",     Pnoun,     [TERMPH_VAL $ make_pnoun "jupitertwelfth"]),-    ("luna",               Pnoun,     [TERMPH_VAL $ make_pnoun "luna"]),-    ("mars",               Pnoun,     [TERMPH_VAL $ make_pnoun "mars"]),-    ("mercury",            Pnoun,     [TERMPH_VAL $ make_pnoun "mercury"]),-    ("mimas",              Pnoun,     [TERMPH_VAL $ make_pnoun "mimas"]),-    ("miranda",            Pnoun,     [TERMPH_VAL $ make_pnoun "miranda"]),-    ("neptune",            Pnoun,     [TERMPH_VAL $ make_pnoun "neptune"]),-    ("nereid",             Pnoun,     [TERMPH_VAL $ make_pnoun "nereid"]),-    ("oberon",             Pnoun,     [TERMPH_VAL $ make_pnoun "oberon"]),-    ("phobos",             Pnoun,     [TERMPH_VAL $ make_pnoun "phobos"]),-    ("phoebe",             Pnoun,     [TERMPH_VAL $ make_pnoun "phoebe"]),-    ("pluto",              Pnoun,     [TERMPH_VAL $ make_pnoun "pluto"]),-    ("rhea",               Pnoun,     [TERMPH_VAL $ make_pnoun "rhea"]),-    ("saturn",             Pnoun,     [TERMPH_VAL $ make_pnoun "saturn"]),-    ("saturnfirst",        Pnoun,     [TERMPH_VAL $ make_pnoun "saturnfirst"]),-    ("sol",                Pnoun,     [TERMPH_VAL $ make_pnoun "sol"]),-    ("tethys",             Pnoun,     [TERMPH_VAL $ make_pnoun "tethys"]),-    ("titan",              Pnoun,     [TERMPH_VAL $ make_pnoun "titan"]),-    ("titania",            Pnoun,     [TERMPH_VAL $ make_pnoun "titania"]),-    ("triton",             Pnoun,     [TERMPH_VAL $ make_pnoun "triton"]),-    ("umbriel",            Pnoun,     [TERMPH_VAL $ make_pnoun "umbriel"]),-    ("uranus",             Pnoun,     [TERMPH_VAL $ make_pnoun "uranus"]),-    ("venus",              Pnoun,     [TERMPH_VAL $ make_pnoun "venus"]),-    ("discover",           Transvb,   [VERB_VAL ("discover_ev")]),-    ("discovers",          Transvb,   [VERB_VAL ("discover_ev")]),-    ("discovered",         Transvb,   [VERB_VAL ("discover_ev")]),-    ("orbit",              Transvb,   [VERB_VAL ("orbit_ev")]),-    ("orbited",            Transvb,   [VERB_VAL ("orbit_ev")]),-    ("orbits",             Transvb,   [VERB_VAL ("orbit_ev")]),-    ("is",                 Linkingvb, [LINKINGVB_VAL  id]),-    ("was",                Linkingvb, [LINKINGVB_VAL  id]), -    ("are",                Linkingvb, [LINKINGVB_VAL  id]),-    ("were",               Linkingvb, [LINKINGVB_VAL  id]),-    ("that",               Relpron,   [RELPRON_VAL    $ that]),-    ("who",                Relpron,   [RELPRON_VAL    $ that]),-    ("which",              Relpron,   [RELPRON_VAL    $ that]),-    ("and",                Verbphjoin,[VBPHJOIN_VAL   $ nounand]),-    ("or",                 Verbphjoin,[VBPHJOIN_VAL   $ nounor]),-    ("and",                Nounjoin,  [NOUNJOIN_VAL   $ nounand]),-    ("or",                 Nounjoin,  [NOUNJOIN_VAL   $ nounor]),-    ("and",                Termphjoin,[TERMPHJOIN_VAL termand]),-    ("or",                 Termphjoin,[TERMPHJOIN_VAL termor]), -    ("and",                Sentjoin,  [SENTJOIN_VAL   $ sand]),-    ("does",               Quest1,    [QUEST1_VAL     $ yesno]),-    ("did",                Quest1  ,  [QUEST1_VAL     $ yesno]),-    ("do",                 Quest1,    [QUEST1_VAL     $ yesno]),-    ("is",                 Quest1,    [QUEST1_VAL     $ yesno]),-    ("was",                Quest1,    [QUEST1_VAL     $ yesno]),-    ("are",                Quest1,    [QUEST1_VAL     $ yesno]),  -    ("were",               Quest1,    [QUEST1_VAL     $ yesno]),  -    ("what",               Quest2,    [QUEST2_VAL     $ what]),-    ("who",                Quest2,    [QUEST2_VAL     $ who]),-    ("what",               Quest6,    [QUEST2_VAL     $ whatobj]),-    ("where",              Quest5,    [QUEST2_VAL     $ where']),-    ("when",               Quest5,    [QUEST2_VAL     $ when']),-    ("how",                Quest5,    [QUEST2_VAL     $ how']),-    ("which",              Quest3,    [QUEST3_VAL     which]),-    ("what",               Quest3,    [QUEST3_VAL     which]),-    ("how",                Quest4a,   [QUEST3_VAL     $ how_many]),-    ("many",               Quest4b,   [QUEST3_VAL     $ how_many]),-    ("human",       Cnoun,    meaning_of nouncla "person" Nouncla),-    ("discoverer",  Cnoun,            [NOUNCLA_VAL $ get_subjs_of_event_type dataStore "discover_ev"]),-    ("discoverers", Cnoun,            [NOUNCLA_VAL $ get_subjs_of_event_type dataStore "discover_ev"]), -    ("humans",      Cnoun,    meaning_of nouncla "person" Nouncla), -    ("people",      Cnoun,    meaning_of nouncla "person" Nouncla),-    --("orbit",       Intransvb,        [VERBPH_VAL $ get_subjs_of_event_type dataStore "orbit_ev"]), -    --("orbits",      Intransvb,        [VERBPH_VAL $ get_subjs_of_event_type dataStore "orbit_ev"]),-    ("anyone",      Indefpron,meaning_of detph   "a person" Detph),-    ("anything",    Indefpron,meaning_of detph   "a thing" Detph),-    ("anybody",     Indefpron,meaning_of detph   "a person" Detph),-    ("someone",     Indefpron,meaning_of detph   "a person" Detph),-    ("something",   Indefpron,meaning_of detph   "a thing" Detph),-    ("somebody",    Indefpron,meaning_of detph   "a person" Detph),-    ("everyone",    Indefpron,meaning_of detph   "every person" Detph),-    ("everything",  Indefpron,meaning_of detph   "every thing" Detph),-    ("everybody",   Indefpron,meaning_of detph   "every person" Detph),-    --("nobody",      Indefpron,meaning_of detph   "no person" Detph),-    --("noone",       Indefpron,meaning_of detph   "no person" Detph),-    --Begin prepositional stuff---    ("with",        Prepn, [PREPN_VAL ["with_implement"]]),-    ("in",          Prepn, [PREPN_VAL ["location","year"]]),-    ("at",          Prepn, [PREPN_VAL ["location"]]),-    ("by",          Prepn, [PREPN_VAL ["subject"]]),-    --Begin telescope stuff---    ("telescope",   Cnoun, [NOUNCLA_VAL $ get_members dataStore "telescope"]),-    ("telescopes",  Cnoun, [NOUNCLA_VAL $ get_members dataStore "telescope"]),-    ("cassegrain_telescope",            Pnoun,[TERMPH_VAL $ make_pnoun "cassegrain_telescope"]),-    ("hooker_telescope",                Pnoun,[TERMPH_VAL $ make_pnoun "hooker_telescope"]),-    ("schmidt_telescope",               Pnoun,[TERMPH_VAL $ make_pnoun "schmidt_telescope"]),-    ("subaru_reflector_telescope",      Pnoun,[TERMPH_VAL $ make_pnoun "subaru_reflector_telescope"]),-    ("canada-france-hawaii_telescope",  Pnoun,[TERMPH_VAL $ make_pnoun "canada-france-hawaii_telescope"]),-    ("aerial_telescope_1",              Pnoun,[TERMPH_VAL $ make_pnoun "aerial_telescope_1"]),-    ("bruce_astrograph",                Pnoun,[TERMPH_VAL $ make_pnoun "bruce_astrograph"]),-    ("telescope_1",                     Pnoun,[TERMPH_VAL $ make_pnoun "telescope_1"]),-    ("hale_telescope",                  Pnoun,[TERMPH_VAL $ make_pnoun "hale_telescope"]),-    ("hubble_space_telescope",          Pnoun,[TERMPH_VAL $ make_pnoun "hubble_space_telescope"]),-    ("blanco_telescope",                Pnoun,[TERMPH_VAL $ make_pnoun "blanco_telescope"]),-    ("crossley_reflector_telescope",    Pnoun,[TERMPH_VAL $ make_pnoun "crossley_reflector_telescope"]),-    ("refractor_telescope_1",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_1"]),-    ("refractor_telescope_2",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_2"]),-    ("refractor_telescope_3",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_3"]),-    ("refractor_telescope_4",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_4"]),-    ("reflector_telescope_1",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_1"]),-    ("reflector_telescope_2",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_2"]),-    ("reflector_telescope_3",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_3"]),-    ("reflector_telescope_4",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_4"]),-    ("ground_based_telescope_1",        Pnoun,[TERMPH_VAL $ make_pnoun "ground_based_telescope_1"]),-    ("ground_based_telescope_2",        Pnoun,[TERMPH_VAL $ make_pnoun "ground_based_telescope_2"]),-    ("ground_based_telescope_3",        Pnoun,[TERMPH_VAL $ make_pnoun "ground_based_telescope_3"]),-    ("galilean_telescope_1",            Pnoun,[TERMPH_VAL $ make_pnoun "galilean_telescope_1"]),-    --Begin science team stuff-    ("team",                            Cnoun, [NOUNCLA_VAL $ get_members dataStore "science_team"]),-    ("teams",                           Cnoun, [NOUNCLA_VAL $ get_members dataStore "science_team"]),-    ("voyager_science_team",            Pnoun,[TERMPH_VAL $ make_pnoun "voyager_science_team"]),-    ("cassini_imaging_science_team",    Pnoun,[TERMPH_VAL $ make_pnoun "cassini_imaging_science_team"]),-    ("science_team_1",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_1"]),-    ("science_team_2",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_2"]),-    ("science_team_3",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_3"]),-    ("science_team_4",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_4"]),-    ("science_team_5",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_5"]),-    ("science_team_6",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_6"]),-    ("science_team_7",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_7"]),-    ("science_team_8",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_8"]),-    ("science_team_9",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_9"]),-    ("science_team_10",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_10"]),-    ("science_team_11",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_11"]),-    ("science_team_12",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_12"]),-    ("science_team_13",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_13"]),-    ("science_team_14",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_14"]),-    ("science_team_15",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_15"]),-    ("science_team_16",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_16"]),-    ("science_team_17",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_17"]),-    ("science_team_18",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_18"]),-    ("science_team_19",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_19"]),-    ("science_team_20",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_20"]),-    ("science_team_21",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_21"]),-    --Begin new people stuff---    ("larson", Pnoun, [TERMPH_VAL $ make_pnoun "larson"]),-    ("fountain", Pnoun, [TERMPH_VAL $ make_pnoun "fountain"]),-    ("scotti", Pnoun, [TERMPH_VAL $ make_pnoun "scotti"]),-    ("spahr", Pnoun, [TERMPH_VAL $ make_pnoun "spahr"]),-    ("mcmillan", Pnoun, [TERMPH_VAL $ make_pnoun "mcmillan"]),-    ("montani", Pnoun, [TERMPH_VAL $ make_pnoun "montani"]),-    ("gleason", Pnoun, [TERMPH_VAL $ make_pnoun "gleason"]),-    ("gehrels", Pnoun, [TERMPH_VAL $ make_pnoun "gehrels"]),-    ("roemer", Pnoun, [TERMPH_VAL $ make_pnoun "roemer"]),-    ("sheppard", Pnoun, [TERMPH_VAL $ make_pnoun "sheppard"]),-    ("jewitt", Pnoun, [TERMPH_VAL $ make_pnoun "jewitt"]),-    ("fernandez", Pnoun, [TERMPH_VAL $ make_pnoun "fernandez"]),-    ("magnier", Pnoun, [TERMPH_VAL $ make_pnoun "magnier"]),-    ("kleyna", Pnoun, [TERMPH_VAL $ make_pnoun "kleyna"]),-    ("gladman", Pnoun, [TERMPH_VAL $ make_pnoun "gladman"]),-    ("kavelaars", Pnoun, [TERMPH_VAL $ make_pnoun "kavelaars"]),-    ("petit", Pnoun, [TERMPH_VAL $ make_pnoun "petit"]),-    ("allen", Pnoun, [TERMPH_VAL $ make_pnoun "allen"]),-    ("laques", Pnoun, [TERMPH_VAL $ make_pnoun "laques"]),-    ("lecacheux", Pnoun, [TERMPH_VAL $ make_pnoun "lecacheux"]),-    ("smith", Pnoun, [TERMPH_VAL $ make_pnoun "smith"]),-    ("reitsema", Pnoun, [TERMPH_VAL $ make_pnoun "reitsema"]),-    ("pascu", Pnoun, [TERMPH_VAL $ make_pnoun "pascu"]),-    ("seidelmann", Pnoun, [TERMPH_VAL $ make_pnoun "seidelmann"]),-    ("baum", Pnoun, [TERMPH_VAL $ make_pnoun "baum"]),-    ("currie", Pnoun, [TERMPH_VAL $ make_pnoun "currie"]),-    ("showalter", Pnoun, [TERMPH_VAL $ make_pnoun "showalter"]),-    ("scholl", Pnoun, [TERMPH_VAL $ make_pnoun "scholl"]),-    ("holman", Pnoun, [TERMPH_VAL $ make_pnoun "holman"]),-    ("marsden", Pnoun, [TERMPH_VAL $ make_pnoun "marsden"]),-    ("burns", Pnoun, [TERMPH_VAL $ make_pnoun "burns"]),-    ("milisavljevic", Pnoun, [TERMPH_VAL $ make_pnoun "milisavljevic"]),-    ("grav", Pnoun, [TERMPH_VAL $ make_pnoun "grav"]),-    ("karkoschka", Pnoun, [TERMPH_VAL $ make_pnoun "karkoschka"]),-    ("lissauer", Pnoun, [TERMPH_VAL $ make_pnoun "lissauer"]),-    ("fraser", Pnoun, [TERMPH_VAL $ make_pnoun "fraser"]),-    ("christy", Pnoun, [TERMPH_VAL $ make_pnoun "christy"]),-    ("weaver", Pnoun, [TERMPH_VAL $ make_pnoun "weaver"]),-    ("stern", Pnoun, [TERMPH_VAL $ make_pnoun "stern"]),-    ("mutchler", Pnoun, [TERMPH_VAL $ make_pnoun "mutchler"]),-    ("steffl", Pnoun, [TERMPH_VAL $ make_pnoun "steffl"]),-    ("buie", Pnoun, [TERMPH_VAL $ make_pnoun "buie"]),-    ("merline", Pnoun, [TERMPH_VAL $ make_pnoun "merline"]),-    ("spencer", Pnoun, [TERMPH_VAL $ make_pnoun "spencer"]),-    ("young_e_f", Pnoun, [TERMPH_VAL $ make_pnoun "young_e_f"]),-    ("young_l_a", Pnoun, [TERMPH_VAL $ make_pnoun "young_l_a"]),-    ("hamilton", Pnoun, [TERMPH_VAL $ make_pnoun "hamilton"]),-    ("soummer", Pnoun, [TERMPH_VAL $ make_pnoun "soummer"]),-    ("throop", Pnoun, [TERMPH_VAL $ make_pnoun "throop"]),-    --Begin new spacecraft stuff---    ("spacecraft",  Cnoun, [NOUNCLA_VAL $ get_members dataStore "spacecraft"]),-    ("spacecrafts", Cnoun, [NOUNCLA_VAL $ get_members dataStore "spacecraft"]),-    ("voyager_1",   Pnoun, [TERMPH_VAL $ make_pnoun "voyager_1"]),-    ("voyager_2",   Pnoun, [TERMPH_VAL $ make_pnoun "voyager_2"]),-    ("cassini", Pnoun, [TERMPH_VAL $ make_pnoun "voyager_2"]),-    --Begin new places stuff---    ("place",   Cnoun, [NOUNCLA_VAL $ get_members dataStore "place"]),-    ("places",  Cnoun, [NOUNCLA_VAL $ get_members dataStore "place"]),-    ("mt_hopkins", Pnoun, [TERMPH_VAL $ make_pnoun "mt_hopkins"]),-    ("fort_davis", Pnoun, [TERMPH_VAL $ make_pnoun "fort_davis"]),-    ("cerro_tololo", Pnoun, [TERMPH_VAL $ make_pnoun "cerro_tololo"]),-    ("us_naval_observatory", Pnoun, [TERMPH_VAL $ make_pnoun "us_naval_observatory"]),-    ("padua", Pnoun, [TERMPH_VAL $ make_pnoun "padua"]),-    ("mt_hamilton", Pnoun, [TERMPH_VAL $ make_pnoun "mt_hamilton"]),-    ("greenwich", Pnoun, [TERMPH_VAL $ make_pnoun "greenwich"]),-    ("mt_wilson", Pnoun, [TERMPH_VAL $ make_pnoun "mt_wilson"]),-    ("mt_palomar", Pnoun, [TERMPH_VAL $ make_pnoun "mt_palomar"]),-    ("kitt_peak", Pnoun, [TERMPH_VAL $ make_pnoun "kitt_peak"]),-    ("mauna_kea", Pnoun, [TERMPH_VAL $ make_pnoun "mauna_kea"]),-    ("slough", Pnoun, [TERMPH_VAL $ make_pnoun "slough"]),-    ("paris", Pnoun, [TERMPH_VAL $ make_pnoun "paris"]),-    ("the_hague", Pnoun, [TERMPH_VAL $ make_pnoun "the_hague"]),-    ("cambridge", Pnoun, [TERMPH_VAL $ make_pnoun "cambridge"]),-    ("liverpool", Pnoun, [TERMPH_VAL $ make_pnoun "liverpool"]),-    ("arequipa", Pnoun, [TERMPH_VAL $ make_pnoun "arequipa"]),-    ("pic_du_midi", Pnoun, [TERMPH_VAL $ make_pnoun "pic_du_midi"]),-    ("flagstaff", Pnoun, [TERMPH_VAL $ make_pnoun "flagstaff"]),-    ("la_silla", Pnoun, [TERMPH_VAL $ make_pnoun "la_silla"]),-    --Begin new moons stuff---    ("himalia",            Pnoun,     [TERMPH_VAL $ make_pnoun "himalia"]),-    ("elara",              Pnoun,     [TERMPH_VAL $ make_pnoun "elara"]),-    ("pasiphae",           Pnoun,     [TERMPH_VAL $ make_pnoun "pasiphae"]),-    ("sinope",             Pnoun,     [TERMPH_VAL $ make_pnoun "sinope"]),-    ("lysithea",           Pnoun,     [TERMPH_VAL $ make_pnoun "lysithea"]),-    ("carme",              Pnoun,     [TERMPH_VAL $ make_pnoun "carme"]),-    ("ananke",             Pnoun,     [TERMPH_VAL $ make_pnoun "ananke"]),-    ("leda",               Pnoun,     [TERMPH_VAL $ make_pnoun "leda"]),-    ("thebe",              Pnoun,     [TERMPH_VAL $ make_pnoun "thebe"]),-    ("adrastea",           Pnoun,     [TERMPH_VAL $ make_pnoun "adrastea"]),-    ("metis",              Pnoun,     [TERMPH_VAL $ make_pnoun "metis"]),-    ("callirrhoe",         Pnoun,     [TERMPH_VAL $ make_pnoun "callirrhoe"]),-    ("themisto",           Pnoun,     [TERMPH_VAL $ make_pnoun "themisto"]),-    ("megaclite",          Pnoun,     [TERMPH_VAL $ make_pnoun "megaclite"]),-    ("taygete",            Pnoun,     [TERMPH_VAL $ make_pnoun "taygete"]),-    ("chaldene",           Pnoun,     [TERMPH_VAL $ make_pnoun "chaldene"]),-    ("harpalyke",          Pnoun,     [TERMPH_VAL $ make_pnoun "harpalyke"]),-    ("kalyke",             Pnoun,     [TERMPH_VAL $ make_pnoun "kalyke"]),-    ("iocaste",            Pnoun,     [TERMPH_VAL $ make_pnoun "iocaste"]),-    ("erinome",            Pnoun,     [TERMPH_VAL $ make_pnoun "erinome"]),-    ("isonoe",             Pnoun,     [TERMPH_VAL $ make_pnoun "isonoe"]),-    ("praxidike",          Pnoun,     [TERMPH_VAL $ make_pnoun "praxidike"]),-    ("autonoe",            Pnoun,     [TERMPH_VAL $ make_pnoun "autonoe"]),-    ("thyone",             Pnoun,     [TERMPH_VAL $ make_pnoun "thyone"]),-    ("hermippe",           Pnoun,     [TERMPH_VAL $ make_pnoun "hermippe"]),-    ("aitne",              Pnoun,     [TERMPH_VAL $ make_pnoun "aitne"]),-    ("eurydome",           Pnoun,     [TERMPH_VAL $ make_pnoun "eurydome"]),-    ("euanthe",            Pnoun,     [TERMPH_VAL $ make_pnoun "euanthe"]),-    ("euporie",            Pnoun,     [TERMPH_VAL $ make_pnoun "euporie"]),-    ("orthosie",           Pnoun,     [TERMPH_VAL $ make_pnoun "orthosie"]),-    ("sponde",             Pnoun,     [TERMPH_VAL $ make_pnoun "sponde"]),-    ("kale",               Pnoun,     [TERMPH_VAL $ make_pnoun "kale"]),-    ("pasithee",           Pnoun,     [TERMPH_VAL $ make_pnoun "pasithee"]),-    ("hegemone",           Pnoun,     [TERMPH_VAL $ make_pnoun "hegemone"]),-    ("mneme",              Pnoun,     [TERMPH_VAL $ make_pnoun "mneme"]),-    ("aoede",              Pnoun,     [TERMPH_VAL $ make_pnoun "aoede"]),-    ("thelxinoe",          Pnoun,     [TERMPH_VAL $ make_pnoun "thelxinoe"]),-    ("arche",              Pnoun,     [TERMPH_VAL $ make_pnoun "arche"]),-    ("kallichore",         Pnoun,     [TERMPH_VAL $ make_pnoun "kallichore"]),-    ("helike",             Pnoun,     [TERMPH_VAL $ make_pnoun "helike"]),-    ("carpo",              Pnoun,     [TERMPH_VAL $ make_pnoun "carpo"]),-    ("eukelade",           Pnoun,     [TERMPH_VAL $ make_pnoun "eukelade"]),-    ("cyllene",            Pnoun,     [TERMPH_VAL $ make_pnoun "cyllene"]),-    ("kore",               Pnoun,     [TERMPH_VAL $ make_pnoun "kore"]),-    ("herse",              Pnoun,     [TERMPH_VAL $ make_pnoun "herse"]),-    ("epimetheus",         Pnoun,     [TERMPH_VAL $ make_pnoun "epimetheus"]),-    ("helene",             Pnoun,     [TERMPH_VAL $ make_pnoun "helene"]),-    ("telesto",            Pnoun,     [TERMPH_VAL $ make_pnoun "telesto"]),-    ("calypso",            Pnoun,     [TERMPH_VAL $ make_pnoun "calypso"]),-    ("atlas",              Pnoun,     [TERMPH_VAL $ make_pnoun "atlas"]),-    ("prometheus",         Pnoun,     [TERMPH_VAL $ make_pnoun "prometheus"]),-    ("pandora",            Pnoun,     [TERMPH_VAL $ make_pnoun "pandora"]),-    ("pan",                Pnoun,     [TERMPH_VAL $ make_pnoun "pan"]),-    ("ymir",               Pnoun,     [TERMPH_VAL $ make_pnoun "ymir"]),-    ("paaliaq",            Pnoun,     [TERMPH_VAL $ make_pnoun "paaliaq"]),-    ("tarvos",             Pnoun,     [TERMPH_VAL $ make_pnoun "tarvos"]),-    ("ijiraq",             Pnoun,     [TERMPH_VAL $ make_pnoun "ijiraq"]),-    ("suttungr",           Pnoun,     [TERMPH_VAL $ make_pnoun "suttungr"]),-    ("kiviuq",             Pnoun,     [TERMPH_VAL $ make_pnoun "kiviuq"]),-    ("mundilfari",         Pnoun,     [TERMPH_VAL $ make_pnoun "mundilfari"]),-    ("albiorix",           Pnoun,     [TERMPH_VAL $ make_pnoun "albiorix"]),-    ("skathi",             Pnoun,     [TERMPH_VAL $ make_pnoun "skathi"]),-    ("erriapus",           Pnoun,     [TERMPH_VAL $ make_pnoun "erriapus"]),-    ("siarnaq",            Pnoun,     [TERMPH_VAL $ make_pnoun "siarnaq"]),-    ("thrymr",             Pnoun,     [TERMPH_VAL $ make_pnoun "thrymr"]),-    ("narvi",              Pnoun,     [TERMPH_VAL $ make_pnoun "narvi"]),-    ("methone",            Pnoun,     [TERMPH_VAL $ make_pnoun "methone"]),-    ("pallene",            Pnoun,     [TERMPH_VAL $ make_pnoun "pallene"]),-    ("polydeuces",         Pnoun,     [TERMPH_VAL $ make_pnoun "polydeuces"]),-    ("daphnis",            Pnoun,     [TERMPH_VAL $ make_pnoun "daphnis"]),-    ("aegir",              Pnoun,     [TERMPH_VAL $ make_pnoun "aegir"]),-    ("bebhionn",           Pnoun,     [TERMPH_VAL $ make_pnoun "bebhionn"]),-    ("bergelmir",          Pnoun,     [TERMPH_VAL $ make_pnoun "bergelmir"]),-    ("bestla",             Pnoun,     [TERMPH_VAL $ make_pnoun "bestla"]),-    ("farbauti",           Pnoun,     [TERMPH_VAL $ make_pnoun "farbauti"]),-    ("fenrir",             Pnoun,     [TERMPH_VAL $ make_pnoun "fenrir"]),-    ("fornjot",            Pnoun,     [TERMPH_VAL $ make_pnoun "fornjot"]),-    ("hati",               Pnoun,     [TERMPH_VAL $ make_pnoun "hati"]),-    ("hyrrokkin",          Pnoun,     [TERMPH_VAL $ make_pnoun "hyrrokkin"]),-    ("kari",               Pnoun,     [TERMPH_VAL $ make_pnoun "kari"]),-    ("loge",               Pnoun,     [TERMPH_VAL $ make_pnoun "loge"]),-    ("skoll",              Pnoun,     [TERMPH_VAL $ make_pnoun "skoll"]),-    ("surtur",             Pnoun,     [TERMPH_VAL $ make_pnoun "surtur"]),-    ("anthe",              Pnoun,     [TERMPH_VAL $ make_pnoun "anthe"]),-    ("jarnsaxa",           Pnoun,     [TERMPH_VAL $ make_pnoun "jarnsaxa"]),-    ("greip",              Pnoun,     [TERMPH_VAL $ make_pnoun "greip"]),-    ("tarqeq",             Pnoun,     [TERMPH_VAL $ make_pnoun "tarqeq"]),-    ("aegaeon",            Pnoun,     [TERMPH_VAL $ make_pnoun "aegaeon"]),-    ("cordelia",           Pnoun,     [TERMPH_VAL $ make_pnoun "cordelia"]),-    ("ophelia",            Pnoun,     [TERMPH_VAL $ make_pnoun "ophelia"]),-    ("bianca",             Pnoun,     [TERMPH_VAL $ make_pnoun "bianca"]),-    ("cressida",           Pnoun,     [TERMPH_VAL $ make_pnoun "cressida"]),-    ("desdemona",          Pnoun,     [TERMPH_VAL $ make_pnoun "desdemona"]),-    ("juliet",             Pnoun,     [TERMPH_VAL $ make_pnoun "juliet"]),-    ("portia",             Pnoun,     [TERMPH_VAL $ make_pnoun "portia"]),-    ("rosalind",           Pnoun,     [TERMPH_VAL $ make_pnoun "rosalind"]),-    ("belinda",            Pnoun,     [TERMPH_VAL $ make_pnoun "belinda"]),-    ("puck",               Pnoun,     [TERMPH_VAL $ make_pnoun "puck"]),-    ("caliban",            Pnoun,     [TERMPH_VAL $ make_pnoun "caliban"]),-    ("sycorax",            Pnoun,     [TERMPH_VAL $ make_pnoun "sycorax"]),-    ("prospero",           Pnoun,     [TERMPH_VAL $ make_pnoun "prospero"]),-    ("setebos",            Pnoun,     [TERMPH_VAL $ make_pnoun "setebos"]),-    ("stephano",           Pnoun,     [TERMPH_VAL $ make_pnoun "stephano"]),-    ("trinculo",           Pnoun,     [TERMPH_VAL $ make_pnoun "trinculo"]),-    ("francisco",          Pnoun,     [TERMPH_VAL $ make_pnoun "francisco"]),-    ("margaret",           Pnoun,     [TERMPH_VAL $ make_pnoun "margaret"]),-    ("ferdinand",          Pnoun,     [TERMPH_VAL $ make_pnoun "ferdinand"]),-    ("perdita",            Pnoun,     [TERMPH_VAL $ make_pnoun "perdita"]),-    ("mab",                Pnoun,     [TERMPH_VAL $ make_pnoun "mab"]),-    ("cupid",              Pnoun,     [TERMPH_VAL $ make_pnoun "cupid"]),-    ("triton",             Pnoun,     [TERMPH_VAL $ make_pnoun "triton"]),-    ("naiad",              Pnoun,     [TERMPH_VAL $ make_pnoun "naiad"]),-    ("thalassa",           Pnoun,     [TERMPH_VAL $ make_pnoun "thalassa"]),-    ("despina",            Pnoun,     [TERMPH_VAL $ make_pnoun "despina"]),-    ("galatea",            Pnoun,     [TERMPH_VAL $ make_pnoun "galatea"]),-    ("larissa",            Pnoun,     [TERMPH_VAL $ make_pnoun "larissa"]),-    ("proteus",            Pnoun,     [TERMPH_VAL $ make_pnoun "proteus"]),-    ("halimede",           Pnoun,     [TERMPH_VAL $ make_pnoun "halimede"]),-    ("psamathe",           Pnoun,     [TERMPH_VAL $ make_pnoun "psamathe"]),-    ("sao",                Pnoun,     [TERMPH_VAL $ make_pnoun "sao"]),-    ("laomedeia",          Pnoun,     [TERMPH_VAL $ make_pnoun "laomedeia"]),-    ("neso",               Pnoun,     [TERMPH_VAL $ make_pnoun "neso"]),-    ("nix",                Pnoun,     [TERMPH_VAL $ make_pnoun "nix"]),-    ("hydra",              Pnoun,     [TERMPH_VAL $ make_pnoun "hydra"]),-    ("kerberos",           Pnoun,     [TERMPH_VAL $ make_pnoun "kerberos"]),-    ("styx",               Pnoun,     [TERMPH_VAL $ make_pnoun "styx"])--    ] ++ list_of_years-    -{-Major hack: Since the basic unit that the parser understands is strings (not characters), we have to manually add all years that we can query into the dictionary...-That is, we can't make the parser understand "1984" and "1245" by having it recognize four numbers, instead it must recognize the entire string of numbers at once-as a terminal (i.e., "1984" would be a terminal, not a non-terminal composed of "1", "9", "8", and "4").  Therefore, all possible strings must be added to the dictionary so that the parser can match them.--**this might need to be altered**--}--list_of_years = map (\n -> (show n, Year, [YEAR_VAL n])) $ concat [[1000 + x, 2000 + x] | x <- [0..999]]-    ---test1 p p_ inp = do putStr  $ render80 $ format{-Atts p_-} $ snd $ unState (p T0 [] ((1,[]),words inp) ([],[])) [] -test p input = unState (p ((1,[]),input) ([],[])) [] ----parse i = formatAttsFinalAlt Question  ((length (words i))+1) $ snd $ test (question T0 []) (words i)-    -findStart st ((s,ss):rest) | s == st   = [(s,ss)]-                           | otherwise = findStart st rest-findStart st []                        = []     --input = words i1--i1 = "which moons that were discovered by hall orbit mars" -- OK-i2 = "who discovered a moon that orbits mars" -- OK-i3 = "did hall discover every moon that orbits mars" -- OK-i4 = "how many moons were discovered by hall and kuiper" -- OK-i5 = "how many moons were discovered by hall or kuiper" -- OK-i6 = "every moon was discovered by a person" -- OK-i7 = "which planets are orbited by a moon that was discovered by galileo" -- OK-i8 = "which moons were discovered by nobody" -- OK-i9 = "is every planet orbited by a moon" -- Broken in original too-i10 = "which planets are orbited by two moons" -- OK-i11 = "who was the discoverer of phobos" -- Broken in original too-i12 = "hall discovered a moon that orbits mars" -- OK-i13 = "which moons that orbit mars were discovered by hall" -- OK-i14 = "every moon orbits every planet" -- OK-i15 = "every planet is orbited by a moon" -- OK-i16 = "a planet is orbited by a moon" -- OK-i17 = "does phobos orbit mars" -- OK----i18 = "did hall discover deimos or phobos and miranda" -- Broken in original too-i19 = "did hall discover deimos or phobos and miranda or deimos and deimos" -- Broken in original too
− TypeAg2.hs
@@ -1,192 +0,0 @@-{-# LANGUAGE Trustworthy #-}-module TypeAg2 where--import Getts--data AttValue = VAL             {getAVAL    ::   Int} -              | MaxVal          {getAVAL    ::   Int} -              | SubVal          {getAVAL    ::   Int}-              | RepVal          {getAVAL    ::   Int}-              | Res             {getRVAL    ::   DisplayTree}-              | B_OP            {getB_OP    ::   (Int -> Int -> Int)} -              | U_OP            {getU_OP    ::   (Int -> Int)} -              | SENT_VAL        {getSV      ::   IO ES}-              | ErrorVal        {getEVAL    ::   String}    -          | NOUNCLA_VAL     {getAVALS   ::   IO ES} -          | VERBPH_VAL      {getAVALS   ::   IO ES}  -          | ADJ_VAL         {getAVALS   ::   IO ES} -          | TERMPH_VAL      {getTVAL    ::   (IO ES -> IO ES)}     -          | DET_VAL         {getDVAL    ::   (IO ES -> IO ES -> IO ES)} -          | VERB_VAL        {getBR      ::   Relation}      -          | RELPRON_VAL     {getRELVAL  ::   (IO ES -> IO ES -> IO ES)}    -          | NOUNJOIN_VAL    {getNJVAL   ::   (IO ES -> IO ES -> IO ES)}-          | VBPHJOIN_VAL    {getVJVAL   ::   (IO ES -> IO ES -> IO ES)}    -          | TERMPHJOIN_VAL  {getTJVAL   ::   ((IO ES -> IO ES) -> (IO ES -> IO ES) -> (IO ES -> IO ES)) }-          | PREP_VAL        {getPREPVAL ::  ([([String], IO ES -> IO ES)])} -- used in "hall discovered phobos with a telescope" as "with".  -          | PREPN_VAL       {getPREPNVAL :: [String]} --used for mapping between prepositions and their corresponding identifiers in the database.  I.e., "in" -> ["location", "year"]-          | PREPPH_VAL      {getPREPPHVAL :: ([String], IO ES -> IO ES)}-          | LINKINGVB_VAL   {getLINKVAL ::   (IO ES -> IO ES)}-          | SENTJOIN_VAL    {getSJVAL   ::   (IO ES -> IO ES -> IO ES)}-          | DOT_VAL         {getDOTVAL  ::   IO String}-          | QM_VAL          {getQMVAL   ::   IO String}-          | QUEST_VAL       {getQUVAL   ::   IO String}-          | QUEST1_VAL      {getQU1VAL  ::   (IO ES -> IO String)}-          | QUEST2_VAL      {getQU2VAL  ::   (IO ES -> IO String)}-          | QUEST3_VAL      {getQU3VAL  ::   (IO ES -> IO ES -> IO String)}-          | YEAR_VAL        {getYEARVAL ::   Int}----            | RESULT [sys_message]-data MemoL    = Start | Tree | Num | Emp | ALeaf String | Expr | Op  | ET-              | Pnoun|Cnoun|Adj|Det|Intransvb|Transvb|Linkingvb|Relpron|Termphjoin|Verbphjoin|Nounjoin|Preps|Prepph|Prepn|Indefpron|Sentjoin|Quest1|Quest2|Quest3|Quest4a|Quest4b-              | Snouncla|Relnouncla|Nouncla|Adjs|Detph|Transvbph|Verbph|Termph|Jointermph|Joinvbph|Sent|Two_sent|Question|Quest4|Query|Year|Quest5|Quest6-                deriving (Eq,Ord,Show)--data Id       = O0|S0 |S1|S2|S3|S4|S5|S6|S7|S8|S9|T0|T1 | T2 | T3 |T4 | N1| N2 | N3 | E0 |E1 |E2 | O1| LHS  deriving (Eq,Ord,Show, Enum)-                -- basic IDs for identifying each NT  --{---attFunc - = [-    (VAL,getAVAL), (MaxVal,getAVAL), (SubVal,getAVAL), (RepVal,getAVAL), (Res,getRVAL), (B_OP,getB_OP),(U_OP,getU_OP),(SENT_VAL,getSV),(ErrorVal,getEVAL),-    (NOUNCLA_VAL,getAVALS),(VERBPH_VAL,getAVALS),(ADJ_VAL,getAVALS),(TERMPH_VAL,getTVAL),(DET_VAL,getDVAL),(VERB_VAL,getBR),(RELPRON_VAL,getRELVAL),(NOUNJOIN_VAL,getNJVAL),-    (VBPHJOIN_VAL,getVJVAL),(TERMPHJOIN_VAL,getTJVAL),(PREP_VAL,getPREPVAL),(LINKINGVB_VAL,getLINKVAL),(SENTJOIN_VAL,getSJVAL),(DOT_VAL,getDOTVAL),(QM_VAL,getQMVAL),(QUEST1_VAL,getQU1VAL),-    (QUEST2_VAL,getQU2VAL),(QUEST3_VAL,getQU3VAL)   -   ]--}-type Entity         =  String  -type ES             =  Image -- [Int]---type Bin_Rel        =  [(Entity,Entity)] -- [(Int, Int)]---type Relation     = (ES -> Bool) -> ES-type Relation = String--data DisplayTree = B [DisplayTree]-                 | N Int-                   deriving (Show, Eq)-----instance Show AttValue where--showio :: AttValue -> IO String-showio (VAL  j)     = return $ "VAL "    ++ show j-showio (MaxVal j)   = return $ "MaxVal " ++ show j-showio (SubVal j)   = return $ "SubVal " ++ show j-showio (RepVal j)   = return $ "RepVal " ++ show j-showio (Res j)      = return $ "Tree: "  ++ show j-showio (B_OP j)     = return $ "B_OP"-showio (U_OP j)     = return $ "U_OP"-showio (SENT_VAL j) = j >>= return . show -showio (ErrorVal j) = return j-showio (NOUNCLA_VAL j) = j >>= return . (++) "NOUNCLA_VAL " . unwords . map fst-showio (VERBPH_VAL j)  = j >>= return . (++) "VERBPH_VAL " . unwords . map fst-showio (ADJ_VAL    j)  = j >>= return . (++) "ADJ_VAL " . unwords . map fst-showio (TERMPH_VAL j)  = return "TERMPH_VAL "      -showio (DET_VAL j)     = return "DET_VAL " -showio (VERB_VAL j)    = return $ "VERB_VAL " ++ j-showio (RELPRON_VAL j)  = return "RELPRON_VAL "-showio (NOUNJOIN_VAL j)  = return "NOUNJOIN_VAL "-showio (VBPHJOIN_VAL j)  = return "VBPHJOIN_VAL "-showio (TERMPHJOIN_VAL j)  = return "TERMPHJOIN_VAL "-showio (PREP_VAL j)  = return "PREP_VAL "-showio (LINKINGVB_VAL j)  = return "LINKINGVB_VAL "-showio (SENTJOIN_VAL j)  = return "SENTJOIN_VAL "-showio (DOT_VAL j) = j -showio (QM_VAL j) = j -showio (QUEST_VAL j) = j -showio (QUEST1_VAL j)  = return "QUEST1_VAL"-showio (QUEST2_VAL j)  = return "QUEST2_VAL"-showio (QUEST3_VAL j)  = return "SENTJOIN_VAL"--instance Eq AttValue where-    (VAL  j)           == (VAL  j')     = True-    (MaxVal j)         == (MaxVal j')   = True-    (SubVal j)         == (SubVal j')   = True-    (RepVal j)         == (RepVal j')   = True-    (Res j)            == (Res j')      = True-    (B_OP j)           == (B_OP j')     = True-    (U_OP j)           == (U_OP j')     = True-    (SENT_VAL j)       == (SENT_VAL j') = True-    (NOUNCLA_VAL j)    == (NOUNCLA_VAL j') = True-    (VERBPH_VAL j)     == (VERBPH_VAL j') = True-    (ADJ_VAL j)        == (ADJ_VAL j') = True-    (TERMPH_VAL j)     == (TERMPH_VAL j') = True-    (DET_VAL j)        == (DET_VAL j') = True-    (VERB_VAL j)       == (VERB_VAL j') = True-    (RELPRON_VAL j)    == (RELPRON_VAL j') = True-    (NOUNJOIN_VAL j)   == (NOUNJOIN_VAL j') = True-    (VBPHJOIN_VAL j)   == (VBPHJOIN_VAL j') = True-    (TERMPHJOIN_VAL j) == (TERMPHJOIN_VAL j') = True-    (LINKINGVB_VAL j)  == (LINKINGVB_VAL j') = True-    (SENTJOIN_VAL j)   == (SENTJOIN_VAL j') = True-    (DOT_VAL j)        == (DOT_VAL j') = True-    (QM_VAL j)         == (QM_VAL j') = True-    (QUEST_VAL j)      == (QUEST_VAL j') = True-    (QUEST1_VAL j)     == (QUEST1_VAL j') = True-    (QUEST2_VAL j)     == (QUEST2_VAL j') = True-    (QUEST3_VAL j)     == (QUEST3_VAL j') = True-    (PREP_VAL s1)      == (PREP_VAL s) = True-    (PREPN_VAL s1)     == (PREPN_VAL s) = True-    (PREPPH_VAL s1)    == (PREPPH_VAL s) = True-    (YEAR_VAL s1)      == (YEAR_VAL s) = True-    _                  == _              = False---------------- *********************** ----------------- needs to be simplified ---setAtt (MaxVal s1)   (MaxVal s)       = [MaxVal s] -setAtt (MaxVal s1)   (SubVal s)       = [MaxVal s] -setAtt (MaxVal s1)   (RepVal s)       = [MaxVal s] -setAtt (MaxVal s1)   (VAL s)          = [MaxVal s] -setAtt (MaxVal s1)   (ErrorVal s)     = [ErrorVal s] --setAtt (SubVal s1)   (MaxVal s)       = [SubVal s] -setAtt (SubVal s1)   (SubVal s)       = [SubVal s] -setAtt (SubVal s1)   (RepVal s)       = [SubVal s]-setAtt (SubVal s1)   (VAL s)          = [SubVal s]-setAtt (SubVal s1)   (ErrorVal s)     = [ErrorVal s] --setAtt (RepVal s1)   (MaxVal s)       = [RepVal s] -setAtt (RepVal s1)   (SubVal s)       = [RepVal s] -setAtt (RepVal s1)   (RepVal s)       = [RepVal s]-setAtt (RepVal s1)   (VAL s)          = [RepVal s]-setAtt (RepVal s1)   (ErrorVal s)     = [ErrorVal s] --setAtt (VAL s1)   (VAL s)          = [VAL s] -setAtt (VAL s1)   (MaxVal s)       = [VAL s] -setAtt (VAL s1)   (SubVal s)       = [VAL s] -setAtt (VAL s1)   (RepVal s)       = [VAL s] -setAtt (VAL s1)   (ErrorVal s)     = [ErrorVal s] ---setAtt (Res s1)      (Res s)        = [Res s] -setAtt (Res s1)      (ErrorVal s)   = [ErrorVal s] -setAtt (ErrorVal s1) (ErrorVal s)   = [ErrorVal s] --setAtt (NOUNCLA_VAL s1)  (NOUNCLA_VAL s)    = [NOUNCLA_VAL s] -setAtt (ADJ_VAL s1)      (ADJ_VAL s)        = [ADJ_VAL s] -setAtt (TERMPH_VAL s1)   (TERMPH_VAL s)     = [TERMPH_VAL s] -setAtt (VERBPH_VAL s1)   (VERBPH_VAL s)     = [VERBPH_VAL s] -setAtt (SENT_VAL   s1)   (SENT_VAL   s)     = [SENT_VAL s] -setAtt (QUEST_VAL  s1)   (QUEST_VAL  s)     = [QUEST_VAL s]-setAtt (QUEST1_VAL  s1)   (QUEST1_VAL  s)     = [QUEST1_VAL s]-setAtt (QUEST2_VAL  s1)   (QUEST2_VAL  s)     = [QUEST2_VAL s]-setAtt (QUEST3_VAL  s1)   (QUEST3_VAL  s)     = [QUEST3_VAL s]--setAtt (PREP_VAL s1) (PREP_VAL s) = [PREP_VAL s]-setAtt (PREPN_VAL s1) (PREPN_VAL s) = [PREPN_VAL s]-setAtt (PREPPH_VAL s1) (PREPPH_VAL s) = [PREPPH_VAL s]-setAtt (YEAR_VAL s1) (YEAR_VAL s) = [YEAR_VAL s]------------ *********************** ---------------------
XSaiga.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                XSaiga
-version:             1.3.0.1
+version:             1.4.0.0
 synopsis:            An implementation of a polynomial-time top-down parser suitable for NLP
 -- description:
 homepage:            http://hafiz.myweb.cs.uwindsor.ca/proHome.html
@@ -38,12 +38,10 @@ 
 Library
   build-depends: base >=4.6 && < 5, pretty, hsparql >=0.2, rdf4h, text, containers
-  exposed-modules: Getts, AGParser2, TypeAg2, SolarmanTriplestore
-  other-modules: Interactive
+  exposed-modules: XSaiga.Getts, XSaiga.AGParser2, XSaiga.TypeAg2, XSaiga.SolarmanTriplestore, XSaiga.Interactive, XSaiga.LocalData
 
 Executable Solarman
   main-is: Main.hs
   --other-modules:  SolarmanTriplestore
-  other-modules: Interactive
-  build-depends:  base >=4.6 && < 5, containers >=0.5, pretty >=1.1, cgi >=3001.1, rdf4h >=1.2, hsparql >=0.2, text >=0.11
+  build-depends:  base >=4.6 && < 5, containers >=0.5, pretty >=1.1, cgi >=3001.1, rdf4h >=1.2, hsparql >=0.2, text >=0.11, XSaiga >= 1.4.0.0
   extensions: DoAndIfThenElse,FlexibleInstances,NoMonomorphismRestriction
+ XSaiga/AGParser2.hs view
@@ -0,0 +1,717 @@+{-# LANGUAGE Trustworthy #-}+module XSaiga.AGParser2 where+import Prelude hiding ((*>))+import Text.PrettyPrint.HughesPJ as PPH hiding (empty)  -- ((PPH.<+>), vcat, text, render,($$),nest,Doc)+import Data.List+import XSaiga.TypeAg2+import Control.Monad+import Control.Applicative hiding ((<|>), (*>))+++++---- ************************************ -----------------------++type Instance = IRec+                +data SorI     = S | I |NILL  deriving (Eq,Ord,Show, Enum) +                -- Synthesized or inherited or NILL+++type IRec     = (SorI, Id) +                -- uniquely determines synthesized or inherited attribute for an NT+                +data Useless  = OF|ISEQUALTO  deriving (Show, Eq)+                -- for decorating the semantic rules+++       +data SRule_   = NT {iden :: Id, par :: NTType} | Rule {par' :: SeqType} | DRule {par'' :: SRule_ } ++type NTType  = Id -> InsAttVals -> M Foo+type SeqType = Id -> InsAttVals -> [SemRule] -> Result -> M Foo+type AltType = NTType+type SemRule =  (Instance,(InsAttVals, Id) -> InsAttVals)+------------+data Tree a = Leaf (a,Instance)+            | Branch [Tree a] +            | SubNode ((NodeName, Instance), (Start1,End))+              deriving (Eq)+++type NodeName = MemoL+type Start1   = (Int, InsAttVals)+type Start    = ((Int,InsAttVals), [String])+type End      = (Int, InsAttVals)+type Atts     = [AttValue] -- [(AttType, AttValue)]+type InsAttVals = [(Instance, Atts)]+++type Mtable   = [(MemoL+                 ,[(Start1,(Context,Result))]+                 )+                ] +type Result   = [((Start1, End),[Tree MemoL])]++type State    = Mtable+type Context  = ([MemoL],[(Int,[(MemoL, Int)])])++type M a = Start -> Context -> StateM a+type Seq a = Id -> InsAttVals -> [SemRule] -> Result -> Start -> Context -> StateM a+type Foo = (Context, Result)++-- ============================+newtype StateM t = State { unState :: State -> (t,State) }++instance Functor StateM where+    fmap  = liftM++instance Applicative StateM where+    pure  = return+    (<*>) = ap  -- defined in Control.Monad++instance Monad StateM where+  -- defines state propagation+  State m            >>= k +         = State (\s -> let (a,y) = m s in unState (k a) y)+  return k             =  State (\s -> (k,s))+++ -- extracts the state from the monad+get       :: StateM State+get        = State (\s -> (s,s))+put       :: State -> StateM ()+put s      = State (\_ -> ((),s))+modify    :: (State -> State) -> StateM ()+modify sf  = State (\s -> ((), sf s))++-- =============================++--------------- ******************************************** ---------------------------++(<|>) :: AltType -> AltType -> AltType+(p <|> q) idx inhx ((i,a),inp) c + = do (l1,m) <- p idx inhx ((i,[]),inp) c +      (l2,n) <- q idx inhx ((i,[]),inp) c+      return ((union (fst l1) (fst l2),[]) ,(m ++ n))++--------------------------------------------------------+(*>) :: SeqType -> SeqType -> SeqType+(p *> q) idx inhx semx resx +                 ((i,a),inp) cc + = do (l,m) <- p idx inhx semx resx +                 ((i,[]),inp) cc +      let passCtxt  e          +           = if e == i then cc +             else empty_cuts+          mergeCuts e prev new +           = if e == i +             then (union prev new) +             else prev  +       +          apply_to_all q [] l cc  +           = return ((fst l,[]),[])+   +          apply_to_all q (r:rs) l cc +            = do (l1,m) <- q `add_P` (r,cc)+                 (l2,n) <- apply_to_all q rs l cc+                 return ((union (fst l1) (fst l2),[]),( m ++  n))+              +          q `add_P` (rp,cc) +            = do let e  = pickEnd rp+                 (l1,m) <- (q idx inhx semx resx (e,inp) (passCtxt (fst e))) +                 return ((mergeCuts (fst e) (fst l) (fst l1),[]),(addP m rp))       +   +      (apply_to_all q m l cc) -- CHANGE cc HERE+                        +pickEnd (((s,iA),(e,a)),t) = (e,[]) +       +addP  [] ((s1,e1),t1)                    = []+addP  ((((s2,inA2),(e2,synA2)),t2):restQ) (((s1,inA1),(e1,synA1)),t1)  + = (((s1,[]),(e2,[])),  a_P_Q_branch) : addP  restQ (((s1,inA1),(e1,synA1)),t1)+                                                                         +   where+   a_P_Q_branch = addToBranch (((s2,inA2),(e2,synA2)),t2)  (((s1,inA1),(e1,synA1)),t1)++-------- ************* ---------------+addToBranch (q1,((SubNode (name2,q)):ts2)) +            (p1,((SubNode (name1,p)):ts1)) +                            = [Branch [(SubNode (name1,p)),(SubNode (name2,q))]]++addToBranch (q1,((Branch t2):ts2)) +            (p1,((Branch t1):ts1))+                            = [Branch (t1++t2)]++addToBranch (q1,((Branch t2):ts)) +            (p1,((SubNode (name1,p)):ts1))+                            = [Branch ((SubNode (name1,p)):t2)]++addToBranch (q1,((SubNode (name2,q)):ts2)) +            (p1,((Branch t1):ts))+                            = [Branch (t1++[(SubNode (name2,q))])]+                            ++addToBranch (q1,((SubNode (name2,q)):ts2)) +            (p1,[Leaf (x,i)])+                            = [Branch [(SubNode ((x,i) ,p1)),(SubNode (name2,q))]]+addToBranch (q1,[Leaf (x,i)]) +            (p1,((SubNode (name1,p)):ts1)) +                            = [Branch [(SubNode (name1,p)),(SubNode ((x,i),q1))]]+addToBranch (q1,((Branch t2):ts)) +            (p1,[Leaf (x,i)])+                            = [Branch ((SubNode ((x,i),p1)):t2)]+addToBranch (q1,[Leaf (x,i)]) +            (p1,((Branch t1):ts))+                            = [Branch (t1++[(SubNode ((x,i),q1))])]+addToBranch (q1,[Leaf (x2,i2)]) +            (p1,[Leaf (x1,i1)])                         = [Branch [(SubNode ((x1,i1),p1)),(SubNode ((x2,i2),q1))]]++-------- ************* ---------------+++empty_cuts = ([],[])                   +empty :: [(Instance, Atts)] -> M Foo+empty atts (x,inp) l = return (empty_cuts,[((x,(fst x,atts)), [Leaf (Emp, (NILL,O0))])])++term :: String -> Instance -> [(Instance, Atts)] -> [(Instance, Atts)] -> M Foo+term c id atts iatts ((r,a),dInp) l + |r - 1 == length dInp       = return (empty_cuts,[])+ |dInp!!(r - 1) == c         = return (empty_cuts,[(((r,[]),(r+1,atts)),[Leaf (ALeaf c, id)])])+ |otherwise                  = return (empty_cuts,[])  ++        +memoize name f id downAtts ((inp,dAtts),dInput) context + = do s <- get        +      case (lookupT name inp (snd context) s) of   +       Just lRes -> do let lookUpRes = addNode name (S, id) (inp,downAtts) (snd1 lRes) +                       return (fst1 lRes,lookUpRes)+       Nothing+           | funccount (snd context) inp name > (length dInput) - inp + 1+               -> return (([name],[]),[])+           | otherwise -> do let iC = ([],(incContext (snd context) name inp))+                             (l,newRes) <- f id downAtts ((inp,dAtts),dInput) iC +                   -- let ((l,newRes),s1) = unState (f id downAtts (inp,dAtts) iC) s+                             let l1          = makeContext (fst l) (findContext (snd context) inp)+                             s1             <- get+                             let udtTab      = udt (l1,newRes) s1 name (inp,downAtts)  +                             let newFoundRes = addNode name (S, id) (inp,downAtts) newRes+                             put udtTab+                             return ( l1 ,newFoundRes)++        +++findContext []     inp                    = []+findContext ((st,rest):sr) inp| st == inp = [(st,rest)]+                      | otherwise = findContext sr inp+                                                 +        +      ++funccount []         inp name         = 0+funccount ((key,funcp):rest) inp name | key == inp = findf funcp +                          | otherwise  = funccount rest inp name++                 where+                 findf  []           = 0+                 findf  ((tk,fc):rx) | tk == name = fc +                         | otherwise  = findf rx        +        +            +fst1 [(a,b)] = a+snd1 [(a,b)] = b   ++makeContext [] [(st,((n,c):ncs))]          = ([],[])+makeContext (r:rs) []                      = ((r:rs),[])+makeContext [] []                          = ([],[])+makeContext (r:rs) [(st,((n,c):ncs))]      = ((r:rs), [(st,makeContext_ (r:rs) ((n,c):ncs))])++makeContext_ [] ((n,c):ncs)      = []+makeContext_ (r:rs) ((n,c):ncs)  = makeContext__ r ((n,c):ncs) ++ makeContext_ rs ((n,c):ncs)++makeContext__ r [] = []+makeContext__ r ((n,c):ncs) | r == n    = (n,c): makeContext__ r ncs+                            | otherwise = makeContext__ r ncs+++incContext [] name inp  = [(inp,[(name,1)])]+incContext ((st,((n,c):nc)):sn) name inp  +                  | st == inp = ((st, (addNT ((n,c):nc)) name inp ) :sn) +                  | otherwise = ((st,((n,c):nc)): incContext sn name inp )+ ++addNT []  name inp                     = [(name,1)]+addNT ((n,c):nc) name inp  | n == name = ((n,(c + 1)):nc)+                           | otherwise = ((n,c):addNT nc name inp)+                           ++addNode name id (s',dA)  []                            +                       = []                           +addNode name id (s',dA)  oldRes -- ((((s,newIh),(e,atts)),t):rs)  + = let res     = packAmb oldRes+       newSh x = [ ((sOri, snd id),attVal)| ((sOri, idOld),attVal)<- x]+   in  [(((s,newIh),(e, newSh atts)),[SubNode ((name, id),((s,nub dA),(e, newSh atts)))]) +       | (((s,newIh),(e,atts)),t) <- oldRes]+mapName i []            = []+mapName i ((i',r):rest) = (i,r): mapName i rest+++packAmb []                                                  = []+packAmb [((s1,e1),t1)]                                      = [((s1,e1),t1)]+packAmb [((s1,e1),t1),((s2,e2),t2)]    | isEq (s1,e1) (s2,e2) = [((s2,(fst e2, groupAtts (snd e1 ++ snd e2))), t1++t2)]+                                       | otherwise          = [((s1,e1),t1),((s2,e2),t2)]++packAmb (((s1,e1),t1):((s2,e2),t2):xs) | isEq (s1,e1) (s2,e2) = packAmb (((s2,(fst e2, groupAtts (snd e1 ++ snd e2))), t1++t2):xs)+                                       | otherwise          = ((s1,e1),t1):packAmb (((s2,e2),t2):xs)++isEq ((s1,b1),(e1,y1)) ((s2,b2),(e2,y2))+ | s1 == s2 && e1 == e2 = True+ | otherwise            = False+ ++lookupT name inp context mTable + | lookupT1 name inp context mTable == [] = Nothing+ | otherwise                              = Just (lookupT1 name inp context mTable) +++lookupT1 name inp context mTable | res_in_table == [] = [] +                                 | otherwise          = checkUsability inp context (lookupRes (res_in_table !! 0) inp)+                        +                   where +                   res_in_table = [pairs|(n,pairs) <- mTable,n == name]+++lookupRes [] inp                       = []+lookupRes (((i,dA),res):rs) inp | i == inp  = [res]+                                | otherwise = lookupRes rs inp +++checkUsability inp context [] = []+checkUsability inp context [((re,sc),res)] | re == []  =  [((re,sc),res)]+                                           | otherwise =  checkUsability_ (findInp inp context) (findInp inp sc) [((re,sc),res)]+++findInp inp []                     = []+findInp inp ((s,c):sc) | s == inp  = c+                       | otherwise = findInp inp sc++ +checkUsability_ [] [] [(sc,res)]             = [(sc,res)]+checkUsability_ ((n,cs):ccs) [] [(sc,res)]   = [(sc,res)] -- if lc at j is empty then re-use+checkUsability_ [] ((n1,cs1):scs) [(sc,res)] = []         -- if cc at j is empty then don't re-use+checkUsability_ ((n,cs):ccs) ((n1,cs1):scs) [(sc,res)] +                                             | and $ condCheck ((n,cs):ccs) ((n1,cs1):scs) = [(sc,res)]+                                             | otherwise                                   = []+                                             +                                             ++condCheck ((n,cs):ccs) [(n1,cs1)]     = [condCheck_ ((n,cs):ccs) (n1,cs1)]+condCheck ((n,cs):ccs) ((n1,cs1):scs) = condCheck_ ((n,cs):ccs) (n1,cs1) : condCheck ((n,cs):ccs) scs++condCheck_ [] (n1,cs1)                  = False+condCheck_ ((n,cs):ccs) (n1,cs1) +                 | n1 == n && cs >= cs1 = True+                 | n1 == n && cs < cs1  = False+                 | otherwise            = condCheck_ ccs (n1,cs1)+                          +++udt :: (Context, Result) -> State -> MemoL -> Start1 -> State+udt res mTable name (inp,dAtts)  +               = update mTable name (inp,dAtts) res +               +update [] name (inp,dAtts) res                 = [(name,[((inp,dAtts), res)])]+update ((key, pairs):rest) name (inp,dAtts) res +               | key == name = (key,my_merge (inp,dAtts)  res pairs):rest+               | otherwise   = ((key, pairs): update rest name (inp,dAtts) res )+++my_merge (inp,dAtts)  res [] = [((inp,nub dAtts), res)]+my_merge (inp,dAtts)  res (((i,dA), es):rest) +               |inp == i  = ((inp,nub dAtts{-nub (dA ++ dAtts)-}), res):rest +               |otherwise = ((i,dA), es): my_merge (inp,dAtts) res rest +++pickResult ((c,r),t) = r+++--------------- ************************* semantics of ATTRIBUTE GRAMMAR ************************* --------------------------++terminal syn semRules id inhAtts ((i,a),inp) c  + = do  syn (S,id) [((S,id),semRules)] inhAtts ((i,[]),inp) c++nt :: NTType -> Id -> SeqType+nt fx idx id inhAtts semRules altFromSibs + = let groupRule'' id rules         = [rule | (ud,rule) <- rules, id == ud]+       ownInAtts                    = mapInherited (groupRule'' (I, idx) semRules)  altFromSibs inhAtts id +   in fx idx ownInAtts ++parser :: SeqType -> [SemRule] -> Id -> InsAttVals -> M Foo+parser synRule semRules id inhAtts i c+ =      do+           s <- get+           let ((e,altFromSibs),d)     =+                let sRule                        = groupRule'' (S, LHS) semRules+                    ((l,newRes),st)              = unState ((synRule id inhAtts semRules altFromSibs) i c) s+                    groupRule'' id rules         = [rule | (ud,rule) <- rules, id == ud]+                in  ((l, mapSynthesize  sRule newRes inhAtts id),st)+           put d+           return (e,altFromSibs)+      +                          +                                       +                     +mapSynthesize []   res  downAtts id   = res+mapSynthesize sems res  downAtts id+ = let appSems' [] vals        = []+       appSems' (r:rules) vals +        = let [((ud, id'), atts)] = r (vals, id) +          in  [((ud, id), atts)] ++ appSems' rules vals  +   in  [(((st,inAtts), (en,appSems' sems (findAtts t))),[t]) +       |(((st,inAtts), (en,synAtts)),[t]) <- res]+   ++-- mapSem' [] _ _            = []+mapInherited sems res []       id    + = let appSems [] vals        = []+       appSems (r:rules) vals = r (vals, id) ++ appSems rules vals +   in  concat [appSems sems (findAtts t) | (((st,inAtts), (en,synAtts)),[t]) <- res]+   +mapInherited sems []  downAtts id    + = let appSems [] vals        = []+       appSems (r:rules) vals = r (vals, id) ++ appSems rules vals   +   in  appSems sems downAtts -- concat ( map (appSems id sems) (group downAtts))++mapInherited sems res downAtts id    + = let appSems [] vals        = []+       appSems (r:rules) vals = r (vals, id) ++ appSems rules vals   +   in  concat [appSems sems ((groupAtts downAtts) ++ synAtts ++ (findAtts t)) +              | (((st,inAtts), (en,synAtts)),[t]) <- res]++--------------------------------------+gMax []        = []+gMax [(a,[b])] = [(a,[b])]++gMax [(a,[b]),(a1,[b1])] | getAVAL b >= getAVAL b1 = [(a,[b])]+                         | otherwise  = [(a1,[b1])]++gMax ((a,[b]):(a1,[b1]):rest) | getAVAL b >= getAVAL b1 = gMax ((a,[b]):rest)+                              | otherwise  = gMax ((a1,[b1]):rest)+++groupAtts []                    = []+groupAtts [(a,b)]               = [(a,b)]+groupAtts [(a,b),(a1,b1)]       = [(a,b++b1)]+groupAtts ((a,b):(a1,b1):rest)  = (a,b++b1): groupAtts rest ++--------------------------------------+findAtts (Branch (t:ts))                 + = findAtts t ++ findAtts (Branch ts)+findAtts (SubNode ((n,i),((s,v'),(e,v)))) =  v' ++ v+findAtts (Leaf (a,id))                    =  [] +findAtts (Branch [])                      =  []++addAtts x y = x ++ y++--------------------------------------------------------+++rule_i          = rule I+rule_s          = rule S++rule s_or_i typ oF pID isEq userFun listOfExp + = let formAtts  id spec =  (id, (forNode id . spec))+       forNode   id atts = [(id, atts)]+       resType           = userFun  listOfExp+   in  formAtts (s_or_i,pID) (setAtt (typ undefined) . resType)++++---- **** -----++synthesized = valOf S+inherited   = valOf I++valOf :: SorI -> (a -> AttValue) -> Useless -> Id -> [(Instance, Atts)] ->  Id -> [AttValue]+valOf ud typ o_f x  ivs x' | x == LHS   = getAttVals (ud , x') ivs typ+                           | otherwise  = getAttVals (ud , x ) ivs typ++getAttVals :: Instance -> [(Instance, Atts)] -> (a -> AttValue) -> [AttValue]+getAttVals x ((i,v):ivs) typ =+ let typeCheck typ t = if (typ undefined) == t then True else False+     getAttVals_ typ (t:tvs) = if (typ undefined) == t then (t :getAttVals_ typ tvs)+                               else getAttVals_ typ tvs                +     getAttVals_ typ []      = [] -- ErrorVal {-- 100 --} "ERROR id found but no value"+ in  +     if(i == x) then getAttVals_ typ v else   getAttVals x ivs typ+getAttVals x [] typ          = [ErrorVal {-- 200 --} "ERROR no id"]++ +-------- ************************************** ------------++------------------------- user functions ------------------   +apply :: [(Instance,Atts)] -> Id -> ([(Instance,Atts)] -> Id -> AttValue) -> Int+apply  y i x   = getAVAL (x y i)+apply_ y i x   = getB_OP (x y i)++apply__ :: [(Instance,Atts)] -> Id -> ([(Instance,Atts)] -> Id -> AttValue) -> DisplayTree+apply__ y i x  = getRVAL (x y i)++applyMax  y i x   = getAVAL (foldr (getMax) (MaxVal 0) (x y i))+getMax    x   y   = MaxVal  (max (getAVAL x) (getAVAL y))++findMax      spec  = \(atts,i) -> +                       MaxVal (foldr (max) 0 (map (applyMax atts i) spec))+convertRep   spec  = \(atts,i) -> +                       RepVal (foldr (max) 0 (map (applyMax atts i) spec))++makeTree  (x:xs)     = \(atts,i) -> Res (B           (map (apply__ atts i) (x:xs)))++mt [a,b,c] = (B [a,b,c]) +mt [a]     = (B [a])++----------- for arithmetic expr -----------------  +applyBiOp [e1,op,e2] + = \atts ->  VAL ((getAtts getB_OP atts op ) (getAtts getAVAL atts e1 ) (getAtts getAVAL atts e2))+getAtts f (y,i) x + = f (head (x y i))++----------- general copy ------------------------+copy      [b]     + = \(atts,i) -> head (b atts i)+getTypVal ((a,b):abs) t | a undefined == t = b t+                        | otherwise        = getTypVal abs t+++----------- for arithmetic expr -----------------  ++toTree    [b]        = \(atts,i) -> Res (N ((map (apply atts i) [b])!!0))++                      +++-- JUNK TEST -----++++-------- MAIN ----------+--------------- EXAMPLE EX-SPEC FOR TREE-REPLACEMENT ----------------++start  = memoize Start +      (parser +       (nt tree T0)+       [+        rule_i RepVal OF T0  ISEQUALTO convertRep    [synthesized  MaxVal OF T0]+       ]+      )+      +tree   = memoize Tree +        (   parser +           (nt tree T1 *> nt tree T2 *> nt num T3)+       [ rule_s   MaxVal OF LHS  ISEQUALTO findMax [  synthesized  MaxVal OF T1, +                                                 synthesized  MaxVal OF T2,+                                                 synthesized  MaxVal OF T3+                                               ],       +        rule_i   RepVal OF T1   ISEQUALTO convertRep    [inherited RepVal OF LHS],+        rule_i   RepVal OF T2   ISEQUALTO convertRep    [inherited RepVal OF LHS],+        rule_i   RepVal OF T3   ISEQUALTO convertRep    [inherited RepVal OF LHS]+       ]+ <|> +            parser +           (nt num N1)+           [ rule_i   RepVal OF N1   ISEQUALTO convertRep    [inherited    RepVal OF LHS],+             rule_s   MaxVal OF LHS  ISEQUALTO findMax       [synthesized  MaxVal OF N1]+           ]           +++  )+  ++num  = memoize Num+       (+        terminal (term "1") [MaxVal 1] <|> +    terminal (term "2") [MaxVal 2] <|>+    terminal (term "3") [MaxVal 3] <|>  +    terminal (term "4") [MaxVal 4] <|>  +    terminal (term "5") [MaxVal 5]  +       )+------------------------------------------------ Arithmetic Expression ------------------------------------------------++eT + = memoize ET+   (+   parser+   (nt expr E1)+   [rule_s VAL OF LHS ISEQUALTO copy [synthesized VAL  OF E1]]+   )+ +expr = memoize Expr+       (+        parser+        (nt expr E1 *> nt op O1 *> nt expr E2)+        [rule_s VAL OF LHS ISEQUALTO applyBiOp [synthesized VAL  OF E1,+                                                synthesized B_OP OF O1,+                                                synthesized VAL  OF E2] +        ]+         +        <|> +        parser+        (nt num N1)+        [rule_s VAL OF LHS  ISEQUALTO copy [synthesized MaxVal OF N1]]+       )++op   = memoize Op+       (+    terminal (term "+") [B_OP (+)] <|> +    terminal (term "-") [B_OP (-)] <|>  +    terminal (term "*") [B_OP (*)] <|>   +    terminal (term "/") [B_OP (div)]    +       )++------------------------------------------------ Arithmetic Expression ------------------------------------------------++----------- PrettyPrint ------------------------+po :: (PP' a) => (String -> IO ()) -> a -> IO ()+po act x = do+    stuff <- pp' x+    act $ render80 stuff+    +render80 = renderStyle (style{lineLength = 80})+++class PP' a where+      pp' :: a -> IO Doc++instance PP' Doc where+      pp' c = return c++instance PP' Char where+      pp' c = return $ text $ show c+instance PP' AttValue where+      pp' (VAL i) = showio (VAL i) >>= return . text+      pp' (B_OP i)= showio (B_OP i) >>= return .text+      +      +instance PP' Int where+      pp' i = return $ text $ show i+    +instance PP' Id where+      pp' i = return $ text $ show i       ++instance PP' a => PP' (Maybe a) where+      pp' Nothing  = return $ text "Nothing"+      pp' (Just x) = pp' x >>= (\y -> return $ parens $ text "Just" PPH.<+> y)++instance (PP' a, PP' b) => PP' (a,b) where+      -- pp' (a,b) = parens $ pp' a PPH.<+> text "->" PPH.<+> pp' b+      pp' (a,b) =  pp' a >>= \z -> (pp' b >>= (\y -> return $ z PPH.<+> text "->" PPH.<+> y))+instance PP' a => PP' [a] where+      pp' []     = return $ brackets $ text ""+      pp' (x:xs) = liftM sep $ (liftM2 (:)) (pp' x) (sequence [ pp' y | y <- xs ])+                      +instance (Show t) => PP' (Tree t) where+      -- pp' Empty             = text "{_}"+      pp' (Leaf x)          = return $ text "Leaf" PPH.<+> text (show x)+      pp' (Branch ts)       = liftM2 (PPH.<+>) (return $ text "Branch") (liftM brackets $ liftM sep $ liftM (punctuate comma) $ sequence $ map pp' ts)+      --pp' (SubNode (x,(s,e))) = return $ text "SubNode" PPH.<+> text (show x) PPH.<+> text (show (s,e)) +      -- PPH.<+> pp' ts++{-TODO:+format :: Mtable -> Doc+format t+ = vcat+   [ text (show s) +     $$                                          +     nest 3 (pp' [text "START at:" PPH.<+> pp' i PPH.<+>  text "; Inherited atts:" PPH.<+>  vcat [vcat [text (showID id0) PPH.<+> vcat [text (show ty0v0) |ty0v0 <-val0]|(id0,val0)<-inAt1]] PPH.<+>+                  text "" $$ vcat [{-    text "Inherited Atts. -" +                                   +                                   $$   +                                       vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-(nub inAtt2)]] +                                   +                                   $$-}  nest 3+                                   (   text "END at:" PPH.<+> pp' end                                    +                                   $$  text "Synthesized Atts. -"+                                   +                                   $$  vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]] +                                   +                                   $$  text "Packed Tree -"+                                   +                                   $$  pp' ts)+                                       |(((st,inAtt2),(end,synAtts)), ts)<-rs] +                                   +                | ((i,inAt1),((cs,ct),rs)) <- sr ])+   +   +   | (s,sr) <- t ]+-}+   ++showID (x,y) = show y -- only the instance+++--- ** printing ony own atts ** ---+{-TODO:+formatAtts :: MemoL -> Mtable -> Doc+formatAtts key t+ = vcat+   [ text (show s) +     $$                                          +     nest 3 (pp' [text "START at:" PPH.<+> pp' i PPH.<+>  text "; Inherited atts:" PPH.<+>  vcat [vcat [text (showID id0) PPH.<+> vcat [text (show ty0v0) |ty0v0 <-val0]|(id0,val0)<-inAt1]] PPH.<+>+                  text "" $$ vcat [nest 3+                                   (   text "END at:" PPH.<+> pp' end                                    +                                   $$  text "Synthesized Atts. -"+                                   +                                   $$  vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]] +                                   +                                   -- $$  text "Packed Tree -"+                                   +                                   {- $$  pp' ts -} )+                                       |(((st,inAtt2),(end,synAtts)), ts)<-rs] +                                   +                | ((i,inAt1),((cs,ct),rs)) <- sr ])+   +   +   | (s,sr) <- t, s == key ]+-}+ +formatAttsFinalAlt :: MemoL -> Int -> State -> IO [Doc]+formatAttsFinalAlt  key e t  = +    --return [pp' [vcat [(vcat [vcat [vcat [text (show ty1v1)  |ty1v1<-val1]+    sequence [(sequence [liftM vcat $ sequence [(liftM vcat $ sequence [liftM vcat $ sequence [liftM vcat $ sequence [liftM text (showio ty1v1) | ty1v1<-val1]+                            |(id1,val1)<-synAtts]] )+                            |(((st,inAtt2),(end,synAtts)), ts)<-rs, end == e]                 +        | ((i,inAt1),((cs,ct),rs)) <- sr ]) >>= pp' | (s,sr) <- t, s == key ]++{-formatAttsFinal  key t  = +   [(pp' [vcat [(vcat [vcat [vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]] )|(((st,inAtt2),(end,synAtts)), ts)<-rs] +                                   +                | ((i,inAt1),((cs,ct),rs)) <- sr ]) | (s,sr) <- t, s == key ]-}+                    +-- *************** for printing the fist element of the return pair ***************+{-TODO:+formatForFst ::Result -> Doc+formatForFst res = vcat +                 -- [text (show ty0v0) |ty0v0 <-val0]|(id0,val0)<-inAt1]] PPH.PPH.<+> text "" $$ vcat +                 +                 [   text "START at:" PPH.<+> pp' st +                 +                 {-+                 $$  text "Inherited Atts. -" +                 $$  vcat [vcat [text (showID id1) PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-inAtt2]] +                 -}+                 +                 PPH.<+> text "END at:" PPH.<+> pp' end +                 $$  nest 3 +                     (text "Synthesized Atts. of"+                 +                 PPH.<+> vcat [vcat [text (showID id1) PPH.<+> text "::" PPH.<+> vcat [text (show ty1v1)  |ty1v1<-val1]|(id1,val1)<-synAtts]]+                 +                 $$  pp' ts)+                    |(((st,inAtt2),(end,synAtts)), ts)<-res] +++-}+-- *************** for printing the fist element of the return pair ***************++----------- PrettyPrint --------------------------+
+ XSaiga/Getts.hs view
@@ -0,0 +1,279 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoMonomorphismRestriction #-}++module XSaiga.Getts where+import Data.List+import Control.Monad+import Debug.Trace++--For endpoint query+import Data.RDF hiding (triple, Triple)+import Database.HSparql.Connection+import Database.HSparql.QueryGenerator+import Data.Text hiding (head, concat, map, zip, drop, length)++import qualified Data.Map as M+import Data.IORef+import System.IO.Unsafe++addUri namespace_uri = (namespace_uri ++)++--getts returns all triples in the triple store that match the given parameters+class TripleStore m where+    getts_1 :: m -> (Event, String, String) -> IO [String]+    getts_2 :: m -> (Event, String, String) -> IO [String]+    getts_3 :: m -> (Event, String, String) -> IO [String]+    --getts_image computes the relation [(x,e)] such that e is an event of type ev_type+    --and x is a subject of that event.  This is a default implementation that can be overridden+    --in instances.  Output is expected to be sorted. TODO: Update this +    getts_image :: m -> String -> String -> IO Image+    getts_image ev_data ev_type entity_type = do+        evs <- getts_1 ev_data ("?", "type", ev_type)+        getts_inverse ev_data entity_type evs+        +    --getts_inverse returns the entities of entity_type of the events in the list evs+    getts_inverse :: m -> String -> [Event] -> IO Image+    getts_inverse ev_data entity_type evs = do+        pairs <- liftM concat $ mapM (\ev -> do+            ents <- getts_3 ev_data (ev, entity_type,"?")+            return $ zip ents (repeat ev)) evs+        return $ condense $ sortFirst pairs+    +    --getts_members returns+    getts_members :: m -> String -> IO Image+    getts_members ev_data set = do+        evs_with_set_as_object <- getts_1 ev_data ("?", "object", set)+        evs_with_type_membership <- getts_1 ev_data ("?", "type", "membership")+        getts_inverse ev_data "subject" $ intersect evs_with_set_as_object evs_with_type_membership+            ++sortFirst = sortBy (\x y -> compare (fst x) (fst y))++type Event = String+type Triple = (Event, String, String)+type Image = [(String,[Event])]++--For the "In Program" triple store+instance TripleStore [Triple] where+    getts_1 ev_data ("?", b, c) = return [x | (x,y,z) <- ev_data, b == y, c == z]+    getts_2 ev_data (a, "?", c) = return [y | (x,y,z) <- ev_data, a == x, c == z]+    getts_3 ev_data (a, b, "?") = return [z | (x,y,z) <- ev_data, a == x, b == y]++data SPARQLBackend = SPARQL String String deriving (Ord, Eq)+    +--the String in this instance is to be the endpoint that you wish to query+instance TripleStore SPARQLBackend where+    --getts_1 =  getts_1''+    getts_1 = memoIO getts_1''+        where+        getts_1'' (SPARQL endpoint namespace_uri) ("?", b, c) = preprocess namespace_uri $ getts_1'(pack "?", pack (addUri namespace_uri b), pack (addUri namespace_uri c))+            where+            getts_1' :: (t, Text, Text) -> IO [[BindingValue]]+            getts_1' (a, b, c) = do+                 (Just s) <- selectQuery endpoint getts_1_query+                 return s+                 where+                   getts_1_query = do +                      x <- var+                      triple x (iriRef b) (iriRef c)+                      distinct+                      return SelectQuery { queryVars = [x] }+    --getts_2 =  getts_2''+    getts_2 = memoIO getts_2''+        where+        getts_2'' (SPARQL endpoint namespace_uri) (a, "?", c) = preprocess namespace_uri $ getts_2'(pack (addUri namespace_uri a), pack "?", pack (addUri namespace_uri c))+            where+                getts_2' :: (Text, Text, Text) -> IO [[BindingValue]]+                getts_2' (a, b, c) = do+                     (Just s) <- selectQuery endpoint getts_2_query  +                     return s+                     where+                       getts_2_query = do +                          x <- var+                          triple  (iriRef a) x (iriRef c)+                          distinct+                          return SelectQuery { queryVars = [x] }+    --getts_3 =  getts_3''+    getts_3 = memoIO getts_3''+        where+        getts_3'' (SPARQL endpoint namespace_uri) (a, b, "?") = preprocess namespace_uri $ getts_3'(pack (addUri namespace_uri a), pack (addUri namespace_uri b), pack "?")+            where+                getts_3' :: (Text, Text, Text) -> IO [[BindingValue]]+                getts_3' (a, b, c) = do+                     (Just s) <- selectQuery endpoint getts_3_query  +                     return s+                     where+                       getts_3_query = do +                          x <- var+                          triple (iriRef a) (iriRef b) x+                          distinct+                          return SelectQuery { queryVars = [x] }+    --Efficient implementation of getts_image for SPARQL backend+    getts_image = memoIO''' getts_image'''+        where+        getts_image''' (SPARQL endpoint namespace_uri) ev_type en_type = do+                m <- selectQuery endpoint query+                case m of+                    (Just res) -> return $ condense $ map (\[x, y] -> (removeUri namespace_uri $ deconstruct x, removeUri namespace_uri $ deconstruct y)) res+                    Nothing -> return []+                where+                    query :: Query SelectQuery+                    query = do+                        sol <- prefix (pack "sol") (iriRef (pack namespace_uri))+                        ev <- var+                        subj <- var+                        triple ev (sol .:. (pack "type")) (sol .:. (pack ev_type))+                        triple ev (sol .:. (pack en_type)) subj+                        orderNext subj+                        distinct+                        return SelectQuery { queryVars = [subj,ev] }+    +    --Efficient implementation of getts_inverse for SPARQL backend+    getts_inverse = memoIO'' getts_inverse''+        where+        getts_inverse'' (SPARQL endpoint namespace_uri) en_type evs = do+            m <- selectQuery endpoint query+            case m of+                (Just res) -> return $ condense $ map (\[x, y] -> (removeUri namespace_uri $ deconstruct x, removeUri namespace_uri $ deconstruct y)) res+                Nothing -> return []+            where+                query = do+                    sol <- prefix (pack "sol") (iriRef (pack namespace_uri))+                    subj <- var+                    ev <- var+                    triple ev (sol .:. (pack en_type)) subj+                    filterExpr $ regex ev $ (pack $ Data.List.intercalate "|" (map (++ "$") evs))+                    --Data.List.foldr1 Database.HSparql.QueryGenerator.union $ map (\ev -> triple (sol .:. pack(ev))  (sol .:. pack("subject")) subj) evs -- UNION nesting problem+                    distinct+                    return SelectQuery { queryVars = [subj,ev] } +                +    --Efficient implementation of getts_members for SPARQL backend+    +    getts_members = memoIO' getts_members'+    --getts_members = getts_members'+        where+        getts_members' (SPARQL endpoint namespace_uri) set = do+            m <- selectQuery endpoint query+            case m of+                (Just res) -> return $ condense $ map (\[x, y] -> (removeUri namespace_uri $ deconstruct x, removeUri namespace_uri $ deconstruct y)) res+                Nothing -> return []+            where+                query :: Query SelectQuery+                query = do+                    sol <- prefix (pack "sol") (iriRef (pack namespace_uri))+                    ev <- var+                    subj <- var+                    triple ev (sol .:. (pack "type")) (sol .:. (pack "membership"))+                    triple ev (sol .:. (pack "subject")) subj+                    triple ev (sol .:. (pack "object")) (sol .:. (pack set))+                    orderNext subj+                    distinct+                    return SelectQuery { queryVars = [subj,ev] }+    +            +removeUri :: String -> String -> String         +removeUri namespace_uri = drop $ length namespace_uri+                      +preprocess :: String -> IO [[BindingValue]] -> IO [String]+preprocess namespace_uri bvals = bvals >>= \x -> return $ map (removeUri namespace_uri . deconstruct) $ concat x+++deconstruct :: BindingValue -> String+deconstruct value = do+    let (Bound node) = value+    case node of+        UNode strURI -> unpack strURI+        LNode (PlainL strLit) -> unpack strLit++++memotable :: IORef (M.Map (SPARQLBackend,(String,String,String)) [String])+memotable = unsafePerformIO $ newIORef M.empty++memoIO ::(SPARQLBackend -> (String, String, String) -> IO [String]) -> SPARQLBackend -> (String, String, String) -> IO [String]+memoIO f a x = do+    m <- readIORef memotable+    case M.lookup (a,x) m of+        Nothing -> f a x >>= \q -> (writeIORef memotable (M.insert (a,x) q m) >> return q)+        Just r -> return r+        +memotable' :: IORef (M.Map (SPARQLBackend,String) Image)+memotable' = unsafePerformIO $ newIORef M.empty++memoIO' ::(SPARQLBackend -> (String) -> IO Image) -> SPARQLBackend -> (String) -> IO Image+memoIO' f a x = do+    m <- readIORef memotable'+    case M.lookup (a,x) m of+        Nothing -> f a x >>= \q -> (writeIORef memotable' (M.insert (a,x) q m) >> return q)+        Just r -> return r+        +memotable'' :: IORef (M.Map (SPARQLBackend,String,[String]) Image)+memotable'' = unsafePerformIO $ newIORef M.empty++memoIO'' ::(SPARQLBackend -> String -> [String] -> IO Image) -> SPARQLBackend -> String -> [String] -> IO Image+memoIO'' f a x y = do+    m <- readIORef memotable''+    case M.lookup (a,x,y) m of+        Nothing -> f a x y >>= \q -> (writeIORef memotable'' (M.insert (a,x,y) q m) >> return q)+        Just r -> return r+        +memotable''' :: IORef (M.Map (SPARQLBackend,String,String) Image)+memotable''' = unsafePerformIO $ newIORef M.empty++memoIO''' ::(SPARQLBackend -> String -> String -> IO Image) -> SPARQLBackend -> String -> String -> IO Image+memoIO''' f a x y = do+    m <- readIORef memotable'''+    case M.lookup (a,x,y) m of+        Nothing -> f a x y >>= \q -> (writeIORef memotable''' (M.insert (a,x,y) q m) >> return q)+        Just r -> return r++        +--Get members of named set+get_members :: (TripleStore m) => m -> String -> IO Image+get_members = getts_members+    +--Get all subjects of a given event type+get_subjs_of_event_type :: (TripleStore m) => m -> String -> IO Image+get_subjs_of_event_type ev_data ev_type = make_image ev_data ev_type "subject"+++{-collect accepts a binary relation as input and computes the image img of each+element x in the projection of the left column of the relation, under the relation,+and returns all of these (x,img) pairs in a list++Note: Since == is an equivalence relation, if multiple elements in the projection+of the left column are in the same equivalence class, only the first member of that+equivalence class that appears in the input list (as the left hand column of a tuple)+will appear in the output (as the left hand column of a tuple).++That is, the first element of that equivalence class that appears in the input list+will be chosen to represent the entire equivalence class in the output.++-}+    +--Faster collect: runs in n lg n time+collect = condense . sortFirst+    +--condense computes the image under a sorted relation+--condense runs in O(n) time and is lazy, also is lazy in the list computed in each tuple+--TODO: Use Map.toList/fromList to simplify?  Benchmark.+--In particular: Should unstableSortBy be used?+condense :: (Eq a, Ord a) => [(a, a)] -> [(a, [a])]+condense [] = []+condense ((x,y):t) = (x, y:a):(condense r)+    where +    (a, r) = findall x t+    findall x [] = ([], [])+    findall x list@((t,y):ts) | x /= t = ([], list)+    findall x ((t,y):ts) | x == t = let (a2, t2) = (findall x ts) in (y:a2, t2)+++--make_image accepts an event type as input, determines all subjects for+--all events of that type, and computes the image under the relation+--for each subject as described in the collect function+--Arguments: triple store, Event type (i.e. join_rel), Entity type (i.e. subject, object)+make_image :: (TripleStore m) => m -> String -> String -> IO Image+make_image = getts_image +    +    
+ XSaiga/Interactive.hs view
@@ -0,0 +1,386 @@+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE NoImplicitPrelude #-}+module XSaiga.Interactive where++import XSaiga.SolarmanTriplestore+import XSaiga.Getts++a $ b = a b+infixr 0 $+a . b = \x -> a (b (x))+infixr 9 .++discover tmph = make_filtered_relation dataStore "discover_ev" [(["object"],tmph)]+discover' tmph preps = make_filtered_relation dataStore "discover_ev" $ (["object"], tmph):preps+discover_ = make_inverted_filtered_relation dataStore "discover_ev"++discovers tmph = make_filtered_relation dataStore "discover_ev" [(["object"],tmph)]+discovers' tmph preps = make_filtered_relation dataStore "discover_ev" $ (["object"], tmph):preps+discovers_ = make_inverted_filtered_relation dataStore "discover_ev"++discovered tmph = make_filtered_relation dataStore "discover_ev" [(["object"],tmph)]+discovered' tmph preps = make_filtered_relation dataStore "discover_ev" $ (["object"], tmph):preps+discovered_ = make_inverted_filtered_relation dataStore "discover_ev"++orbit tmph = make_filtered_relation dataStore "orbit_ev" [(["object"],tmph)]+orbit' tmph preps = make_filtered_relation dataStore "orbit_ev" $ (["object"], tmph):preps+orbit_ = make_inverted_filtered_relation dataStore "orbit_ev"++orbits tmph = make_filtered_relation dataStore "orbit_ev" [(["object"],tmph)]+orbits' tmph preps = make_filtered_relation dataStore "orbit_ev" $ (["object"], tmph):preps+orbits_ = make_inverted_filtered_relation dataStore "orbit_ev"++orbited tmph = make_filtered_relation dataStore "orbit_ev" [(["object"],tmph)]+orbited' tmph preps = make_filtered_relation dataStore "orbit_ev" $ (["object"], tmph):preps+orbited_ = make_inverted_filtered_relation dataStore "orbit_ev"++discoverer = get_subjs_of_event_type dataStore "discover_ev"+discoverers = get_subjs_of_event_type dataStore "discover_ev"+anyone = a person+anything = a thing+anybody = a person+someone = a person+something = a thing+somebody = a person+everyone = every person+everything = every thing+everybody = every person+thing = get_members dataStore "thing"+things = get_members dataStore "thing"+planets = get_members dataStore "planet"+planet = get_members dataStore "planet"+person = get_members dataStore "person"+sun = get_members dataStore "sun"+moon = get_members dataStore "moon"+moons = get_members dataStore "moon"+satellite = get_members dataStore "moon"+satellites = get_members dataStore "moon"+atmospheric = get_members dataStore "atmospheric"+blue = get_members dataStore "blue"+solid = get_members dataStore "solid"+brown = get_members dataStore "brown"+gaseous = get_members dataStore "gaseous"+green = get_members dataStore "green"+red = get_members dataStore "red"+ringed = get_members dataStore "ringed"+vacuumous = get_members dataStore "vacuumous"+exist = get_members dataStore "thing"+exists = get_members dataStore "thing"+spin = get_members dataStore "spin"+spins = get_members dataStore "spin"+bernard = make_pnoun "bernard"+bond = make_pnoun "bond"+venus = make_pnoun "venus"+cassini = make_pnoun "cassini"+dollfus = make_pnoun "dollfus"+galileo = make_pnoun "galileo"+hall = make_pnoun "hall"+herschel = make_pnoun "herschel"+huygens = make_pnoun "huygens"+kowal = make_pnoun "kowal"+kuiper = make_pnoun "kuiper"+larsen = make_pnoun "larsen"+lassell = make_pnoun "lassell"+melotte = make_pnoun "melotte"+nicholson = make_pnoun "nicholson"+perrine = make_pnoun "perrine"+pickering = make_pnoun "pickering"+almathea = make_pnoun "almathea"+ariel = make_pnoun "ariel"+callisto = make_pnoun "callisto"+charon = make_pnoun "charon"+deimos = make_pnoun "deimos"+dione = make_pnoun "dione"+earth = make_pnoun "earth"+enceladus = make_pnoun "enceladus"+europa = make_pnoun "europa"+ganymede = make_pnoun "ganymede"+hyperion = make_pnoun "hyperion"+iapetus = make_pnoun "iapetus"+io = make_pnoun "io"+janus = make_pnoun "janus"+jupiter = make_pnoun "jupiter"+jupitereighth = make_pnoun "jupitereighth"+jupitereleventh = make_pnoun "jupitereleventh"+jupiterfourteenth = make_pnoun "jupiterfourteenth"+jupiterninth = make_pnoun "jupiterninth"+jupiterseventh = make_pnoun "jupiterseventh"+jupitersixth = make_pnoun "jupitersixth"+jupitertenth = make_pnoun "jupitertenth"+jupiterthirteenth = make_pnoun "jupiterthirteenth"+jupitertwelfth = make_pnoun "jupitertwelfth"+luna = make_pnoun "luna"+mars = make_pnoun "mars"+mercury = make_pnoun "mercury"+mimas = make_pnoun "mimas"+miranda = make_pnoun "miranda"+neptune = make_pnoun "neptune"+nereid = make_pnoun "nereid"+oberon = make_pnoun "oberon"+phobos = make_pnoun "phobos"+phoebe = make_pnoun "phoebe"+pluto = make_pnoun "pluto"+rhea = make_pnoun "rhea"+saturn = make_pnoun "saturn"+saturnfirst = make_pnoun "saturnfirst"+sol = make_pnoun "sol"+tethys = make_pnoun "tethys"+titan = make_pnoun "titan"+titania = make_pnoun "titania"+triton = make_pnoun "triton"+umbriel = make_pnoun "umbriel"+uranus = make_pnoun "uranus"+human = get_members dataStore "person"+humans = get_members dataStore "person"+people = get_members dataStore "person"+telescope = get_members dataStore "telescope"+telescopes = get_members dataStore "telescopes"+cassegrain_telescope = make_pnoun "cassegrain_telescope"+hooker_telescope = make_pnoun "hooker_telescope"+schmidt_telescope = make_pnoun "schmidt_telescope"+subaru_reflector_telescope = make_pnoun "subaru_reflector_telescope"+canada_france_hawaii_telescope = make_pnoun "canada-france-hawaii_telescope"+aerial_telescope_1 = make_pnoun "aerial_telescope_1"+bruce_astrograph = make_pnoun "bruce_astrograph"+telescope_1 = make_pnoun "telescope_1"+hale_telescope = make_pnoun "hale_telescope"+hubble_space_telescope = make_pnoun "hubble_space_telescope"+blanco_telescope = make_pnoun "blanco_telescope"+crossley_reflector_telescope = make_pnoun "crossley_reflector_telescope"+refractor_telescope_1 = make_pnoun "refractor_telescope_1"+refractor_telescope_2 = make_pnoun "refractor_telescope_2"+refractor_telescope_3 = make_pnoun "refractor_telescope_3"+refractor_telescope_4 = make_pnoun "refractor_telescope_4"+reflector_telescope_1 = make_pnoun "reflector_telescope_1"+reflector_telescope_2 = make_pnoun "reflector_telescope_2"+reflector_telescope_3 = make_pnoun "reflector_telescope_3"+reflector_telescope_4 = make_pnoun "reflector_telescope_4"+ground_based_telescope_1 = make_pnoun "ground_based_telescope_1"+ground_based_telescope_2 = make_pnoun "ground_based_telescope_2"+ground_based_telescope_3 = make_pnoun "ground_based_telescope_3"+galilean_telescope_1 = make_pnoun "galilean_telescope_1"+team = get_members dataStore "science_team"+teams = get_members dataStore "science_team"+voyager_science_team = make_pnoun "voyager_science_team"+cassini_imaging_science_team = make_pnoun "cassini_imaging_science_team"+science_team_1 = make_pnoun "science_team_1"+science_team_2 = make_pnoun "science_team_2"+science_team_3 = make_pnoun "science_team_3"+science_team_4 = make_pnoun "science_team_4"+science_team_5 = make_pnoun "science_team_5"+science_team_6 = make_pnoun "science_team_6"+science_team_7 = make_pnoun "science_team_7"+science_team_8 = make_pnoun "science_team_8"+science_team_9 = make_pnoun "science_team_9"+science_team_10 = make_pnoun "science_team_10"+science_team_11 = make_pnoun "science_team_11"+science_team_12 = make_pnoun "science_team_12"+science_team_13 = make_pnoun "science_team_13"+science_team_14 = make_pnoun "science_team_14"+science_team_15 = make_pnoun "science_team_15"+science_team_16 = make_pnoun "science_team_16"+science_team_17 = make_pnoun "science_team_17"+science_team_18 = make_pnoun "science_team_18"+science_team_19 = make_pnoun "science_team_19"+science_team_20 = make_pnoun "science_team_20"+science_team_21 = make_pnoun "science_team_21"+larson = make_pnoun "larson"+fountain = make_pnoun "fountain"+scotti = make_pnoun "scotti"+spahr = make_pnoun "spahr"+mcmillan = make_pnoun "mcmillan"+montani = make_pnoun "montani"+gleason = make_pnoun "gleason"+gehrels = make_pnoun "gehrels"+roemer = make_pnoun "roemer"+sheppard = make_pnoun "sheppard"+jewitt = make_pnoun "jewitt"+fernandez = make_pnoun "fernandez"+magnier = make_pnoun "magnier"+kleyna = make_pnoun "kleyna"+gladman = make_pnoun "gladman"+kavelaars = make_pnoun "kavelaars"+petit = make_pnoun "petit"+allen = make_pnoun "allen"+laques = make_pnoun "laques"+lecacheux = make_pnoun "lecacheux"+smith = make_pnoun "smith"+reitsema = make_pnoun "reitsema"+pascu = make_pnoun "pascu"+seidelmann = make_pnoun "seidelmann"+baum = make_pnoun "baum"+currie = make_pnoun "currie"+showalter = make_pnoun "showalter"+scholl = make_pnoun "scholl"+holman = make_pnoun "holman"+marsden = make_pnoun "marsden"+burns = make_pnoun "burns"+milisavljevic = make_pnoun "milisavljevic"+grav = make_pnoun "grav"+karkoschka = make_pnoun "karkoschka"+lissauer = make_pnoun "lissauer"+fraser = make_pnoun "fraser"+christy = make_pnoun "christy"+weaver = make_pnoun "weaver"+stern = make_pnoun "stern"+mutchler = make_pnoun "mutchler"+steffl = make_pnoun "steffl"+buie = make_pnoun "buie"+merline = make_pnoun "merline"+spencer = make_pnoun "spencer"+young_e_f = make_pnoun "young_e_f"+young_l_a = make_pnoun "young_l_a"+hamilton = make_pnoun "hamilton"+soummer = make_pnoun "soummer"+throop = make_pnoun "throop"+spacecraft = get_members dataStore "spacecraft"+spacecrafts = get_members dataStore "spacecrafts"+voyager_1 = make_pnoun "voyager_1"+voyager_2 = make_pnoun "voyager_2"+place = get_members dataStore "place"+places = get_members dataStore "places"+mt_hopkins = make_pnoun "mt_hopkins"+fort_davis = make_pnoun "fort_davis"+cerro_tololo = make_pnoun "cerro_tololo"+us_naval_observatory = make_pnoun "us_naval_observatory"+padua = make_pnoun "padua"+mt_hamilton = make_pnoun "mt_hamilton"+greenwich = make_pnoun "greenwich"+mt_wilson = make_pnoun "mt_wilson"+mt_palomar = make_pnoun "mt_palomar"+kitt_peak = make_pnoun "kitt_peak"+mauna_kea = make_pnoun "mauna_kea"+slough = make_pnoun "slough"+paris = make_pnoun "paris"+the_hague = make_pnoun "the_hague"+cambridge = make_pnoun "cambridge"+liverpool = make_pnoun "liverpool"+arequipa = make_pnoun "arequipa"+pic_du_midi = make_pnoun "pic_du_midi"+flagstaff = make_pnoun "flagstaff"+la_silla = make_pnoun "la_silla"+himalia = make_pnoun "himalia"+elara = make_pnoun "elara"+pasiphae = make_pnoun "pasiphae"+sinope = make_pnoun "sinope"+lysithea = make_pnoun "lysithea"+carme = make_pnoun "carme"+ananke = make_pnoun "ananke"+leda = make_pnoun "leda"+thebe = make_pnoun "thebe"+adrastea = make_pnoun "adrastea"+metis = make_pnoun "metis"+callirrhoe = make_pnoun "callirrhoe"+themisto = make_pnoun "themisto"+megaclite = make_pnoun "megaclite"+taygete = make_pnoun "taygete"+chaldene = make_pnoun "chaldene"+harpalyke = make_pnoun "harpalyke"+kalyke = make_pnoun "kalyke"+iocaste = make_pnoun "iocaste"+erinome = make_pnoun "erinome"+isonoe = make_pnoun "isonoe"+praxidike = make_pnoun "praxidike"+autonoe = make_pnoun "autonoe"+thyone = make_pnoun "thyone"+hermippe = make_pnoun "hermippe"+aitne = make_pnoun "aitne"+eurydome = make_pnoun "eurydome"+euanthe = make_pnoun "euanthe"+euporie = make_pnoun "euporie"+orthosie = make_pnoun "orthosie"+sponde = make_pnoun "sponde"+kale = make_pnoun "kale"+pasithee = make_pnoun "pasithee"+hegemone = make_pnoun "hegemone"+mneme = make_pnoun "mneme"+aoede = make_pnoun "aoede"+thelxinoe = make_pnoun "thelxinoe"+arche = make_pnoun "arche"+kallichore = make_pnoun "kallichore"+helike = make_pnoun "helike"+carpo = make_pnoun "carpo"+eukelade = make_pnoun "eukelade"+cyllene = make_pnoun "cyllene"+kore = make_pnoun "kore"+herse = make_pnoun "herse"+epimetheus = make_pnoun "epimetheus"+helene = make_pnoun "helene"+telesto = make_pnoun "telesto"+calypso = make_pnoun "calypso"+atlas = make_pnoun "atlas"+prometheus = make_pnoun "prometheus"+pandora = make_pnoun "pandora"+pan = make_pnoun "pan"+ymir = make_pnoun "ymir"+paaliaq = make_pnoun "paaliaq"+tarvos = make_pnoun "tarvos"+ijiraq = make_pnoun "ijiraq"+suttungr = make_pnoun "suttungr"+kiviuq = make_pnoun "kiviuq"+mundilfari = make_pnoun "mundilfari"+albiorix = make_pnoun "albiorix"+skathi = make_pnoun "skathi"+erriapus = make_pnoun "erriapus"+siarnaq = make_pnoun "siarnaq"+thrymr = make_pnoun "thrymr"+narvi = make_pnoun "narvi"+methone = make_pnoun "methone"+pallene = make_pnoun "pallene"+polydeuces = make_pnoun "polydeuces"+daphnis = make_pnoun "daphnis"+aegir = make_pnoun "aegir"+bebhionn = make_pnoun "bebhionn"+bergelmir = make_pnoun "bergelmir"+bestla = make_pnoun "bestla"+farbauti = make_pnoun "farbauti"+fenrir = make_pnoun "fenrir"+fornjot = make_pnoun "fornjot"+hati = make_pnoun "hati"+hyrrokkin = make_pnoun "hyrrokkin"+kari = make_pnoun "kari"+loge = make_pnoun "loge"+skoll = make_pnoun "skoll"+surtur = make_pnoun "surtur"+anthe = make_pnoun "anthe"+jarnsaxa = make_pnoun "jarnsaxa"+greip = make_pnoun "greip"+tarqeq = make_pnoun "tarqeq"+aegaeon = make_pnoun "aegaeon"+cordelia = make_pnoun "cordelia"+ophelia = make_pnoun "ophelia"+bianca = make_pnoun "bianca"+cressida = make_pnoun "cressida"+desdemona = make_pnoun "desdemona"+juliet = make_pnoun "juliet"+portia = make_pnoun "portia"+rosalind = make_pnoun "rosalind"+belinda = make_pnoun "belinda"+puck = make_pnoun "puck"+caliban = make_pnoun "caliban"+sycorax = make_pnoun "sycorax"+prospero = make_pnoun "prospero"+setebos = make_pnoun "setebos"+stephano = make_pnoun "stephano"+trinculo = make_pnoun "trinculo"+francisco = make_pnoun "francisco"+margaret = make_pnoun "margaret"+ferdinand = make_pnoun "ferdinand"+perdita = make_pnoun "perdita"+mab = make_pnoun "mab"+cupid = make_pnoun "cupid"+naiad = make_pnoun "naiad"+thalassa = make_pnoun "thalassa"+despina = make_pnoun "despina"+galatea = make_pnoun "galatea"+larissa = make_pnoun "larissa"+proteus = make_pnoun "proteus"+halimede = make_pnoun "halimede"+psamathe = make_pnoun "psamathe"+sao = make_pnoun "sao"+laomedeia = make_pnoun "laomedeia"+neso = make_pnoun "neso"+nix = make_pnoun "nix"+hydra = make_pnoun "hydra"+kerberos = make_pnoun "kerberos"+styx = make_pnoun "styx"
+ XSaiga/LocalData.hs view
@@ -0,0 +1,4133 @@+{-# LANGUAGE Safe #-}++module XSaiga.LocalData where++localData = [("event1000", "object", "sol"), +    ("event1000", "subject", "mercury"), +    ("event1000", "type", "orbit_ev"), +    ("event1001", "object", "sol"), +    ("event1001", "subject", "venus"), +    ("event1001", "type", "orbit_ev"), +    ("event1002", "object", "sol"), +    ("event1002", "subject", "earth"), +    ("event1002", "type", "orbit_ev"), +    ("event1003", "object", "sol"), +    ("event1003", "subject", "mars"), +    ("event1003", "type", "orbit_ev"), +    ("event1004", "object", "sol"), +    ("event1004", "subject", "jupiter"), +    ("event1004", "type", "orbit_ev"), +    ("event1005", "object", "sol"), +    ("event1005", "subject", "saturn"), +    ("event1005", "type", "orbit_ev"), +    ("event1006", "object", "sol"), +    ("event1006", "subject", "uranus"), +    ("event1006", "type", "orbit_ev"), +    ("event1007", "object", "sol"), +    ("event1007", "subject", "neptune"), +    ("event1007", "type", "orbit_ev"), +    ("event1008", "object", "sol"), +    ("event1008", "subject", "pluto"), +    ("event1008", "type", "orbit_ev"), +    ("event1009", "object", "earth"), +    ("event1009", "subject", "luna"), +    ("event1009", "type", "orbit_ev"), +    ("event1010", "object", "mars"), +    ("event1010", "subject", "phobos"), +    ("event1010", "type", "orbit_ev"), +    ("event1011", "object", "mars"), +    ("event1011", "subject", "deimos"), +    ("event1011", "type", "orbit_ev"), +    ("event1012", "object", "jupiter"), +    ("event1012", "subject", "almathea"), +    ("event1012", "type", "orbit_ev"), +    ("event1013", "object", "jupiter"), +    ("event1013", "subject", "io"), +    ("event1013", "type", "orbit_ev"), +    ("event1014", "object", "jupiter"), +    ("event1014", "subject", "europa"), +    ("event1014", "type", "orbit_ev"), +    ("event1015", "object", "jupiter"), +    ("event1015", "subject", "ganymede"), +    ("event1015", "type", "orbit_ev"), +    ("event1016", "object", "jupiter"), +    ("event1016", "subject", "callisto"), +    ("event1016", "type", "orbit_ev"), +    ("event1017", "object", "jupiter"), +    ("event1017", "subject", "leda"), +    ("event1017", "type", "orbit_ev"), +    ("event1018", "object", "jupiter"), +    ("event1018", "subject", "himalia"), +    ("event1018", "type", "orbit_ev"), +    ("event1019", "object", "jupiter"), +    ("event1019", "subject", "lysithea"), +    ("event1019", "type", "orbit_ev"), +    ("event1020", "object", "jupiter"), +    ("event1020", "subject", "elara"), +    ("event1020", "type", "orbit_ev"), +    ("event1021", "object", "jupiter"), +    ("event1021", "subject", "ananke"), +    ("event1021", "type", "orbit_ev"), +    ("event1022", "object", "jupiter"), +    ("event1022", "subject", "carme"), +    ("event1022", "type", "orbit_ev"), +    ("event1023", "object", "jupiter"), +    ("event1023", "subject", "pasiphae"), +    ("event1023", "type", "orbit_ev"), +    ("event1024", "object", "jupiter"), +    ("event1024", "subject", "sinope"), +    ("event1024", "type", "orbit_ev"), +    ("event1025", "object", "jupiter"), +    ("event1025", "subject", "thebe"), +    ("event1025", "type", "orbit_ev"), +    ("event1026", "object", "saturn"), +    ("event1026", "subject", "epimetheus"), +    ("event1026", "type", "orbit_ev"), +    ("event1027", "object", "saturn"), +    ("event1027", "subject", "janus"), +    ("event1027", "type", "orbit_ev"), +    ("event1028", "object", "saturn"), +    ("event1028", "subject", "mimas"), +    ("event1028", "type", "orbit_ev"), +    ("event1029", "object", "saturn"), +    ("event1029", "subject", "enceladus"), +    ("event1029", "type", "orbit_ev"), +    ("event1030", "object", "saturn"), +    ("event1030", "subject", "tethys"), +    ("event1030", "type", "orbit_ev"), +    ("event1031", "object", "saturn"), +    ("event1031", "subject", "dione"), +    ("event1031", "type", "orbit_ev"), +    ("event1032", "object", "saturn"), +    ("event1032", "subject", "rhea"), +    ("event1032", "type", "orbit_ev"), +    ("event1033", "object", "saturn"), +    ("event1033", "subject", "titan"), +    ("event1033", "type", "orbit_ev"), +    ("event1034", "object", "saturn"), +    ("event1034", "subject", "hyperion"), +    ("event1034", "type", "orbit_ev"), +    ("event1035", "object", "saturn"), +    ("event1035", "subject", "iapetus"), +    ("event1035", "type", "orbit_ev"), +    ("event1036", "object", "saturn"), +    ("event1036", "subject", "phoebe"), +    ("event1036", "type", "orbit_ev"), +    ("event1037", "object", "uranus"), +    ("event1037", "subject", "miranda"), +    ("event1037", "type", "orbit_ev"), +    ("event1038", "object", "uranus"), +    ("event1038", "subject", "ariel"), +    ("event1038", "type", "orbit_ev"), +    ("event1039", "object", "uranus"), +    ("event1039", "subject", "umbriel"), +    ("event1039", "type", "orbit_ev"), +    ("event1040", "object", "uranus"), +    ("event1040", "subject", "titania"), +    ("event1040", "type", "orbit_ev"), +    ("event1041", "object", "uranus"), +    ("event1041", "subject", "oberon"), +    ("event1041", "type", "orbit_ev"), +    ("event1042", "object", "neptune"), +    ("event1042", "subject", "triton"), +    ("event1042", "type", "orbit_ev"), +    ("event1043", "object", "neptune"), +    ("event1043", "subject", "nereid"), +    ("event1043", "type", "orbit_ev"), +    ("event1044", "object", "pluto"), +    ("event1044", "subject", "charon"), +    ("event1044", "type", "orbit_ev"), +    ("event1045", "location", "us_naval_observatory"), +    ("event1045", "object", "phobos"), +    ("event1045", "subject", "hall"), +    ("event1045", "type", "discover_ev"), +    ("event1045", "with_implement", "refractor_telescope_1"), +    ("event1045", "year", "1877"), +    ("event1046", "location", "us_naval_observatory"), +    ("event1046", "object", "deimos"), +    ("event1046", "subject", "hall"), +    ("event1046", "type", "discover_ev"), +    ("event1046", "with_implement", "refractor_telescope_1"), +    ("event1046", "year", "1877"), +    ("event1047", "location", "mt_hamilton"), +    ("event1047", "object", "almathea"), +    ("event1047", "subject", "bernard"), +    ("event1047", "type", "discover_ev"), +    ("event1047", "with_implement", "refractor_telescope_2"), +    ("event1047", "year", "1892"), +    ("event1048", "location", "padua"), +    ("event1048", "object", "io"), +    ("event1048", "subject", "galileo"), +    ("event1048", "type", "discover_ev"), +    ("event1048", "with_implement", "galilean_telescope_1"), +    ("event1048", "year", "1610"), +    ("event1049", "location", "padua"), +    ("event1049", "object", "europa"), +    ("event1049", "subject", "galileo"), +    ("event1049", "type", "discover_ev"), +    ("event1049", "with_implement", "galilean_telescope_1"), +    ("event1049", "year", "1610"), +    ("event1050", "location", "padua"), +    ("event1050", "object", "ganymede"), +    ("event1050", "subject", "galileo"), +    ("event1050", "type", "discover_ev"), +    ("event1050", "with_implement", "galilean_telescope_1"), +    ("event1050", "year", "1610"), +    ("event1051", "location", "padua"), +    ("event1051", "object", "callisto"), +    ("event1051", "subject", "galileo"), +    ("event1051", "type", "discover_ev"), +    ("event1051", "with_implement", "galilean_telescope_1"), +    ("event1051", "year", "1610"), +    ("event1052", "location", "mt_palomar"), +    ("event1052", "object", "leda"), +    ("event1052", "subject", "kowal"), +    ("event1052", "type", "discover_ev"), +    ("event1052", "with_implement", "schmidt_telescope"), +    ("event1052", "year", "1974"), +    ("event1053", "object", "thebe"), +    ("event1053", "subject", "voyager_science_team"), +    ("event1053", "type", "discover_ev"), +    ("event1053", "with_implement", "voyager_1"), +    ("event1053", "year", "1979"), +    ("event1054", "location", "mt_hamilton"), +    ("event1054", "object", "himalia"), +    ("event1054", "subject", "perrine"), +    ("event1054", "type", "discover_ev"), +    ("event1054", "with_implement", "crossley_reflector_telescope"), +    ("event1054", "year", "1904"), +    ("event1055", "location", "mt_hamilton"), +    ("event1055", "object", "elara"), +    ("event1055", "subject", "perrine"), +    ("event1055", "type", "discover_ev"), +    ("event1055", "with_implement", "crossley_reflector_telescope"), +    ("event1055", "year", "1905"), +    ("event1056", "location", "mt_wilson"), +    ("event1056", "object", "lysithea"), +    ("event1056", "subject", "nicholson"), +    ("event1056", "type", "discover_ev"), +    ("event1056", "with_implement", "hooker_telescope"), +    ("event1056", "year", "1938"), +    ("event1057", "location", "mt_wilson"), +    ("event1057", "object", "ananke"), +    ("event1057", "subject", "nicholson"), +    ("event1057", "type", "discover_ev"), +    ("event1057", "with_implement", "hooker_telescope"), +    ("event1057", "year", "1951"), +    ("event1058", "location", "mt_wilson"), +    ("event1058", "object", "carme"), +    ("event1058", "subject", "nicholson"), +    ("event1058", "type", "discover_ev"), +    ("event1058", "with_implement", "hooker_telescope"), +    ("event1058", "year", "1938"), +    ("event1059", "location", "mt_hamilton"), +    ("event1059", "object", "sinope"), +    ("event1059", "subject", "nicholson"), +    ("event1059", "type", "discover_ev"), +    ("event1059", "with_implement", "refractor_telescope_2"), +    ("event1059", "year", "1914"), +    ("event1060", "location", "greenwich"), +    ("event1060", "object", "pasiphae"), +    ("event1060", "subject", "melotte"), +    ("event1060", "type", "discover_ev"), +    ("event1060", "with_implement", "cassegrain_telescope"), +    ("event1060", "year", "1908"), +    ("event1061", "location", "kitt_peak"), +    ("event1061", "object", "epimetheus"), +    ("event1061", "subject", "science_team_7"), +    ("event1061", "type", "discover_ev"), +    ("event1061", "year", "1977"), +    ("event1062", "location", "liverpool"), +    ("event1062", "object", "hyperion"), +    ("event1062", "subject", "lassell"), +    ("event1062", "type", "discover_ev"), +    ("event1062", "year", "1848"), +    ("event1063", "location", "pic_du_midi"), +    ("event1063", "object", "janus"), +    ("event1063", "subject", "dollfus"), +    ("event1063", "type", "discover_ev"), +    ("event1063", "with_implement", "telescope_1"), +    ("event1063", "year", "1966"), +    ("event1064", "location", "slough"), +    ("event1064", "object", "mimas"), +    ("event1064", "subject", "herschel"), +    ("event1064", "type", "discover_ev"), +    ("event1064", "with_implement", "reflector_telescope_1"), +    ("event1064", "year", "1789"), +    ("event1065", "location", "slough"), +    ("event1065", "object", "enceladus"), +    ("event1065", "subject", "herschel"), +    ("event1065", "type", "discover_ev"), +    ("event1065", "with_implement", "reflector_telescope_1"), +    ("event1065", "year", "1789"), +    ("event1066", "location", "slough"), +    ("event1066", "object", "titania"), +    ("event1066", "subject", "herschel"), +    ("event1066", "type", "discover_ev"), +    ("event1066", "year", "1787"), +    ("event1067", "location", "slough"), +    ("event1067", "object", "oberon"), +    ("event1067", "subject", "herschel"), +    ("event1067", "type", "discover_ev"), +    ("event1067", "year", "1787"), +    ("event1068", "location", "paris"), +    ("event1068", "object", "tethys"), +    ("event1068", "subject", "cassini"), +    ("event1068", "type", "discover_ev"), +    ("event1068", "with_implement", "aerial_telescope_1"), +    ("event1068", "year", "1684"), +    ("event1069", "location", "paris"), +    ("event1069", "object", "dione"), +    ("event1069", "subject", "cassini"), +    ("event1069", "type", "discover_ev"), +    ("event1069", "with_implement", "aerial_telescope_1"), +    ("event1069", "year", "1684"), +    ("event1070", "location", "paris"), +    ("event1070", "object", "rhea"), +    ("event1070", "subject", "cassini"), +    ("event1070", "type", "discover_ev"), +    ("event1070", "with_implement", "aerial_telescope_1"), +    ("event1070", "year", "1672"), +    ("event1071", "location", "paris"), +    ("event1071", "object", "iapetus"), +    ("event1071", "subject", "cassini"), +    ("event1071", "type", "discover_ev"), +    ("event1071", "with_implement", "aerial_telescope_1"), +    ("event1071", "year", "1671"), +    ("event1072", "location", "the_hague"), +    ("event1072", "object", "titan"), +    ("event1072", "subject", "huygens"), +    ("event1072", "type", "discover_ev"), +    ("event1072", "with_implement", "refractor_telescope_4"), +    ("event1072", "year", "1655"), +    ("event1073", "location", "cambridge"), +    ("event1073", "object", "hyperion"), +    ("event1073", "subject", "bond"), +    ("event1073", "type", "discover_ev"), +    ("event1073", "with_implement", "reflector_telescope_3"), +    ("event1073", "year", "1848"), +    ("event1074", "location", "arequipa"), +    ("event1074", "object", "phoebe"), +    ("event1074", "subject", "pickering"), +    ("event1074", "type", "discover_ev"), +    ("event1074", "with_implement", "bruce_astrograph"), +    ("event1074", "year", "1898"), +    ("event1075", "location", "fort_davis"), +    ("event1075", "object", "miranda"), +    ("event1075", "subject", "kuiper"), +    ("event1075", "type", "discover_ev"), +    ("event1075", "year", "1948"), +    ("event1076", "location", "fort_davis"), +    ("event1076", "object", "nereid"), +    ("event1076", "subject", "kuiper"), +    ("event1076", "type", "discover_ev"), +    ("event1076", "with_implement", "ground_based_telescope_3"), +    ("event1076", "year", "1949"), +    ("event1077", "location", "liverpool"), +    ("event1077", "object", "ariel"), +    ("event1077", "subject", "lassell"), +    ("event1077", "type", "discover_ev"), +    ("event1077", "with_implement", "reflector_telescope_3"), +    ("event1077", "year", "1851"), +    ("event1078", "location", "liverpool"), +    ("event1078", "object", "umbriel"), +    ("event1078", "subject", "lassell"), +    ("event1078", "type", "discover_ev"), +    ("event1078", "with_implement", "reflector_telescope_3"), +    ("event1078", "year", "1851"), +    ("event1079", "type", "discover_ev"), +    ("event1080", "object", "sun"), +    ("event1080", "subject", "sol"), +    ("event1080", "type", "membership"), +    ("event1081", "object", "planet"), +    ("event1081", "subject", "mercury"), +    ("event1081", "type", "membership"), +    ("event1082", "object", "planet"), +    ("event1082", "subject", "venus"), +    ("event1082", "type", "membership"), +    ("event1083", "object", "planet"), +    ("event1083", "subject", "earth"), +    ("event1083", "type", "membership"), +    ("event1084", "object", "planet"), +    ("event1084", "subject", "mars"), +    ("event1084", "type", "membership"), +    ("event1085", "object", "planet"), +    ("event1085", "subject", "jupiter"), +    ("event1085", "type", "membership"), +    ("event1086", "object", "planet"), +    ("event1086", "subject", "saturn"), +    ("event1086", "type", "membership"), +    ("event1087", "object", "planet"), +    ("event1087", "subject", "uranus"), +    ("event1087", "type", "membership"), +    ("event1088", "object", "planet"), +    ("event1088", "subject", "neptune"), +    ("event1088", "type", "membership"), +    ("event1089", "object", "planet"), +    ("event1089", "subject", "pluto"), +    ("event1089", "type", "membership"), +    ("event1090", "object", "moon"), +    ("event1090", "subject", "luna"), +    ("event1090", "type", "membership"), +    ("event1091", "object", "moon"), +    ("event1091", "subject", "phobos"), +    ("event1091", "type", "membership"), +    ("event1092", "object", "moon"), +    ("event1092", "subject", "deimos"), +    ("event1092", "type", "membership"), +    ("event1093", "object", "moon"), +    ("event1093", "subject", "almathea"), +    ("event1093", "type", "membership"), +    ("event1094", "object", "moon"), +    ("event1094", "subject", "io"), +    ("event1094", "type", "membership"), +    ("event1095", "object", "moon"), +    ("event1095", "subject", "europa"), +    ("event1095", "type", "membership"), +    ("event1096", "object", "moon"), +    ("event1096", "subject", "ganymede"), +    ("event1096", "type", "membership"), +    ("event1097", "object", "moon"), +    ("event1097", "subject", "callisto"), +    ("event1097", "type", "membership"), +    ("event1098", "object", "moon"), +    ("event1098", "subject", "leda"), +    ("event1098", "type", "membership"), +    ("event1099", "object", "moon"), +    ("event1099", "subject", "himalia"), +    ("event1099", "type", "membership"), +    ("event1100", "object", "moon"), +    ("event1100", "subject", "lysithea"), +    ("event1100", "type", "membership"), +    ("event1101", "object", "moon"), +    ("event1101", "subject", "elara"), +    ("event1101", "type", "membership"), +    ("event1102", "object", "moon"), +    ("event1102", "subject", "ananke"), +    ("event1102", "type", "membership"), +    ("event1103", "object", "moon"), +    ("event1103", "subject", "carme"), +    ("event1103", "type", "membership"), +    ("event1104", "object", "moon"), +    ("event1104", "subject", "pasiphae"), +    ("event1104", "type", "membership"), +    ("event1105", "object", "moon"), +    ("event1105", "subject", "sinope"), +    ("event1105", "type", "membership"), +    ("event1106", "object", "moon"), +    ("event1106", "subject", "thebe"), +    ("event1106", "type", "membership"), +    ("event1107", "object", "moon"), +    ("event1107", "subject", "epimetheus"), +    ("event1107", "type", "membership"), +    ("event1108", "object", "moon"), +    ("event1108", "subject", "janus"), +    ("event1108", "type", "membership"), +    ("event1109", "object", "moon"), +    ("event1109", "subject", "mimas"), +    ("event1109", "type", "membership"), +    ("event1110", "object", "moon"), +    ("event1110", "subject", "enceladus"), +    ("event1110", "type", "membership"), +    ("event1111", "object", "moon"), +    ("event1111", "subject", "tethys"), +    ("event1111", "type", "membership"), +    ("event1112", "object", "moon"), +    ("event1112", "subject", "dione"), +    ("event1112", "type", "membership"), +    ("event1113", "object", "moon"), +    ("event1113", "subject", "rhea"), +    ("event1113", "type", "membership"), +    ("event1114", "object", "moon"), +    ("event1114", "subject", "titan"), +    ("event1114", "type", "membership"), +    ("event1115", "object", "moon"), +    ("event1115", "subject", "hyperion"), +    ("event1115", "type", "membership"), +    ("event1116", "object", "moon"), +    ("event1116", "subject", "iapetus"), +    ("event1116", "type", "membership"), +    ("event1117", "object", "moon"), +    ("event1117", "subject", "phoebe"), +    ("event1117", "type", "membership"), +    ("event1118", "object", "moon"), +    ("event1118", "subject", "miranda"), +    ("event1118", "type", "membership"), +    ("event1119", "object", "moon"), +    ("event1119", "subject", "ariel"), +    ("event1119", "type", "membership"), +    ("event1120", "object", "moon"), +    ("event1120", "subject", "umbriel"), +    ("event1120", "type", "membership"), +    ("event1121", "object", "moon"), +    ("event1121", "subject", "titania"), +    ("event1121", "type", "membership"), +    ("event1122", "object", "moon"), +    ("event1122", "subject", "oberon"), +    ("event1122", "type", "membership"), +    ("event1123", "object", "moon"), +    ("event1123", "subject", "triton"), +    ("event1123", "type", "membership"), +    ("event1124", "object", "moon"), +    ("event1124", "subject", "nereid"), +    ("event1124", "type", "membership"), +    ("event1125", "object", "moon"), +    ("event1125", "subject", "charon"), +    ("event1125", "type", "membership"), +    ("event1126", "object", "person"), +    ("event1126", "subject", "hall"), +    ("event1126", "type", "membership"), +    ("event1127", "object", "person"), +    ("event1127", "subject", "bernard"), +    ("event1127", "type", "membership"), +    ("event1128", "object", "person"), +    ("event1128", "subject", "galileo"), +    ("event1128", "type", "membership"), +    ("event1129", "object", "person"), +    ("event1129", "subject", "kowal"), +    ("event1129", "type", "membership"), +    ("event1130", "object", "person"), +    ("event1130", "subject", "perrine"), +    ("event1130", "type", "membership"), +    ("event1131", "object", "person"), +    ("event1131", "subject", "nicholson"), +    ("event1131", "type", "membership"), +    ("event1132", "object", "person"), +    ("event1132", "subject", "melotte"), +    ("event1132", "type", "membership"), +    ("event1133", "object", "person"), +    ("event1133", "subject", "larson"), +    ("event1133", "type", "membership"), +    ("event1134", "object", "person"), +    ("event1134", "subject", "fountain"), +    ("event1134", "type", "membership"), +    ("event1135", "object", "person"), +    ("event1135", "subject", "dollfus"), +    ("event1135", "type", "membership"), +    ("event1136", "object", "person"), +    ("event1136", "subject", "herschel"), +    ("event1136", "type", "membership"), +    ("event1137", "object", "person"), +    ("event1137", "subject", "cassini"), +    ("event1137", "type", "membership"), +    ("event1138", "object", "person"), +    ("event1138", "subject", "huygens"), +    ("event1138", "type", "membership"), +    ("event1139", "object", "person"), +    ("event1139", "subject", "bond"), +    ("event1139", "type", "membership"), +    ("event1140", "object", "person"), +    ("event1140", "subject", "pickering"), +    ("event1140", "type", "membership"), +    ("event1141", "object", "person"), +    ("event1141", "subject", "kuiper"), +    ("event1141", "type", "membership"), +    ("event1142", "object", "person"), +    ("event1142", "subject", "lassell"), +    ("event1142", "type", "membership"), +    ("event1143", "object", "atmospheric"), +    ("event1143", "subject", "venus"), +    ("event1143", "type", "membership"), +    ("event1144", "object", "atmospheric"), +    ("event1144", "subject", "earth"), +    ("event1144", "type", "membership"), +    ("event1145", "object", "atmospheric"), +    ("event1145", "subject", "io"), +    ("event1145", "type", "membership"), +    ("event1146", "object", "atmospheric"), +    ("event1146", "subject", "mars"), +    ("event1146", "type", "membership"), +    ("event1147", "object", "atmospheric"), +    ("event1147", "subject", "titan"), +    ("event1147", "type", "membership"), +    ("event1148", "object", "atmospheric"), +    ("event1148", "subject", "venus"), +    ("event1148", "type", "membership"), +    ("event1149", "object", "blue"), +    ("event1149", "subject", "earth"), +    ("event1149", "type", "membership"), +    ("event1150", "object", "blue"), +    ("event1150", "subject", "neptune"), +    ("event1150", "type", "membership"), +    ("event1151", "object", "blue"), +    ("event1151", "subject", "saturn"), +    ("event1151", "type", "membership"), +    ("event1152", "object", "blue"), +    ("event1152", "subject", "uranus"), +    ("event1152", "type", "membership"), +    ("event1153", "object", "depressed"), +    ("event1153", "subject", "hall"), +    ("event1153", "type", "membership"), +    ("event1154", "object", "solid"), +    ("event1154", "subject", "venus"), +    ("event1154", "type", "membership"), +    ("event1155", "object", "solid"), +    ("event1155", "subject", "almathea"), +    ("event1155", "type", "membership"), +    ("event1156", "object", "solid"), +    ("event1156", "subject", "ariel"), +    ("event1156", "type", "membership"), +    ("event1157", "object", "solid"), +    ("event1157", "subject", "callisto"), +    ("event1157", "type", "membership"), +    ("event1158", "object", "solid"), +    ("event1158", "subject", "charon"), +    ("event1158", "type", "membership"), +    ("event1159", "object", "solid"), +    ("event1159", "subject", "deimos"), +    ("event1159", "type", "membership"), +    ("event1160", "object", "solid"), +    ("event1160", "subject", "dione"), +    ("event1160", "type", "membership"), +    ("event1161", "object", "solid"), +    ("event1161", "subject", "earth"), +    ("event1161", "type", "membership"), +    ("event1162", "object", "solid"), +    ("event1162", "subject", "enceladus"), +    ("event1162", "type", "membership"), +    ("event1163", "object", "solid"), +    ("event1163", "subject", "europa"), +    ("event1163", "type", "membership"), +    ("event1164", "object", "solid"), +    ("event1164", "subject", "ganymede"), +    ("event1164", "type", "membership"), +    ("event1165", "object", "solid"), +    ("event1165", "subject", "hyperion"), +    ("event1165", "type", "membership"), +    ("event1166", "object", "solid"), +    ("event1166", "subject", "iapetus"), +    ("event1166", "type", "membership"), +    ("event1167", "object", "solid"), +    ("event1167", "subject", "io"), +    ("event1167", "type", "membership"), +    ("event1168", "object", "solid"), +    ("event1168", "subject", "janus"), +    ("event1168", "type", "membership"), +    ("event1169", "object", "solid"), +    ("event1169", "subject", "jupiter"), +    ("event1169", "type", "membership"), +    ("event1170", "object", "solid"), +    ("event1170", "subject", "pasiphae"), +    ("event1170", "type", "membership"), +    ("event1171", "object", "solid"), +    ("event1171", "subject", "carme"), +    ("event1171", "type", "membership"), +    ("event1172", "object", "solid"), +    ("event1172", "subject", "thebe"), +    ("event1172", "type", "membership"), +    ("event1173", "object", "solid"), +    ("event1173", "subject", "sinope"), +    ("event1173", "type", "membership"), +    ("event1174", "object", "solid"), +    ("event1174", "subject", "elara"), +    ("event1174", "type", "membership"), +    ("event1175", "object", "solid"), +    ("event1175", "subject", "himalia"), +    ("event1175", "type", "membership"), +    ("event1176", "object", "solid"), +    ("event1176", "subject", "lysithea"), +    ("event1176", "type", "membership"), +    ("event1177", "object", "solid"), +    ("event1177", "subject", "leda"), +    ("event1177", "type", "membership"), +    ("event1178", "object", "solid"), +    ("event1178", "subject", "ananke"), +    ("event1178", "type", "membership"), +    ("event1179", "object", "solid"), +    ("event1179", "subject", "luna"), +    ("event1179", "type", "membership"), +    ("event1180", "object", "solid"), +    ("event1180", "subject", "mars"), +    ("event1180", "type", "membership"), +    ("event1181", "object", "solid"), +    ("event1181", "subject", "mercury"), +    ("event1181", "type", "membership"), +    ("event1182", "object", "solid"), +    ("event1182", "subject", "mimas"), +    ("event1182", "type", "membership"), +    ("event1183", "object", "solid"), +    ("event1183", "subject", "miranda"), +    ("event1183", "type", "membership"), +    ("event1184", "object", "solid"), +    ("event1184", "subject", "neptune"), +    ("event1184", "type", "membership"), +    ("event1185", "object", "solid"), +    ("event1185", "subject", "nereid"), +    ("event1185", "type", "membership"), +    ("event1186", "object", "solid"), +    ("event1186", "subject", "oberon"), +    ("event1186", "type", "membership"), +    ("event1187", "object", "solid"), +    ("event1187", "subject", "phobos"), +    ("event1187", "type", "membership"), +    ("event1188", "object", "solid"), +    ("event1188", "subject", "phoebe"), +    ("event1188", "type", "membership"), +    ("event1189", "object", "solid"), +    ("event1189", "subject", "pluto"), +    ("event1189", "type", "membership"), +    ("event1190", "object", "solid"), +    ("event1190", "subject", "rhea"), +    ("event1190", "type", "membership"), +    ("event1191", "object", "solid"), +    ("event1191", "subject", "saturn"), +    ("event1191", "type", "membership"), +    ("event1192", "object", "solid"), +    ("event1192", "subject", "epimetheus"), +    ("event1192", "type", "membership"), +    ("event1193", "object", "solid"), +    ("event1193", "subject", "tethys"), +    ("event1193", "type", "membership"), +    ("event1194", "object", "solid"), +    ("event1194", "subject", "titan"), +    ("event1194", "type", "membership"), +    ("event1195", "object", "solid"), +    ("event1195", "subject", "titania"), +    ("event1195", "type", "membership"), +    ("event1196", "object", "solid"), +    ("event1196", "subject", "triton"), +    ("event1196", "type", "membership"), +    ("event1197", "object", "solid"), +    ("event1197", "subject", "umbriel"), +    ("event1197", "type", "membership"), +    ("event1198", "object", "solid"), +    ("event1198", "subject", "uranus"), +    ("event1198", "type", "membership"), +    ("event1199", "object", "solid"), +    ("event1199", "subject", "venus"), +    ("event1199", "type", "membership"), +    ("event1200", "object", "brown"), +    ("event1200", "subject", "venus"), +    ("event1200", "type", "membership"), +    ("event1201", "object", "brown"), +    ("event1201", "subject", "mercury"), +    ("event1201", "type", "membership"), +    ("event1202", "object", "brown"), +    ("event1202", "subject", "pluto"), +    ("event1202", "type", "membership"), +    ("event1203", "object", "brown"), +    ("event1203", "subject", "venus"), +    ("event1203", "type", "membership"), +    ("event1204", "object", "gaseous"), +    ("event1204", "subject", "jupiter"), +    ("event1204", "type", "membership"), +    ("event1205", "object", "gaseous"), +    ("event1205", "subject", "neptune"), +    ("event1205", "type", "membership"), +    ("event1206", "object", "gaseous"), +    ("event1206", "subject", "saturn"), +    ("event1206", "type", "membership"), +    ("event1207", "object", "gaseous"), +    ("event1207", "subject", "uranus"), +    ("event1207", "type", "membership"), +    ("event1208", "object", "green"), +    ("event1208", "subject", "earth"), +    ("event1208", "type", "membership"), +    ("event1209", "object", "green"), +    ("event1209", "subject", "neptune"), +    ("event1209", "type", "membership"), +    ("event1210", "object", "green"), +    ("event1210", "subject", "uranus"), +    ("event1210", "type", "membership"), +    ("event1211", "object", "red"), +    ("event1211", "subject", "io"), +    ("event1211", "type", "membership"), +    ("event1212", "object", "red"), +    ("event1212", "subject", "jupiter"), +    ("event1212", "type", "membership"), +    ("event1213", "object", "red"), +    ("event1213", "subject", "mars"), +    ("event1213", "type", "membership"), +    ("event1214", "object", "red"), +    ("event1214", "subject", "saturn"), +    ("event1214", "type", "membership"), +    ("event1215", "object", "ringed"), +    ("event1215", "subject", "jupiter"), +    ("event1215", "type", "membership"), +    ("event1216", "object", "ringed"), +    ("event1216", "subject", "neptune"), +    ("event1216", "type", "membership"), +    ("event1217", "object", "ringed"), +    ("event1217", "subject", "saturn"), +    ("event1217", "type", "membership"), +    ("event1218", "object", "ringed"), +    ("event1218", "subject", "uranus"), +    ("event1218", "type", "membership"), +    ("event1219", "object", "vacuumous"), +    ("event1219", "subject", "venus"), +    ("event1219", "type", "membership"), +    ("event1220", "object", "vacuumous"), +    ("event1220", "subject", "almathea"), +    ("event1220", "type", "membership"), +    ("event1221", "object", "vacuumous"), +    ("event1221", "subject", "ariel"), +    ("event1221", "type", "membership"), +    ("event1222", "object", "vacuumous"), +    ("event1222", "subject", "callisto"), +    ("event1222", "type", "membership"), +    ("event1223", "object", "vacuumous"), +    ("event1223", "subject", "charon"), +    ("event1223", "type", "membership"), +    ("event1224", "object", "vacuumous"), +    ("event1224", "subject", "deimos"), +    ("event1224", "type", "membership"), +    ("event1225", "object", "vacuumous"), +    ("event1225", "subject", "dione"), +    ("event1225", "type", "membership"), +    ("event1226", "object", "vacuumous"), +    ("event1226", "subject", "earth"), +    ("event1226", "type", "membership"), +    ("event1227", "object", "vacuumous"), +    ("event1227", "subject", "enceladus"), +    ("event1227", "type", "membership"), +    ("event1228", "object", "vacuumous"), +    ("event1228", "subject", "europa"), +    ("event1228", "type", "membership"), +    ("event1229", "object", "vacuumous"), +    ("event1229", "subject", "ganymede"), +    ("event1229", "type", "membership"), +    ("event1230", "object", "vacuumous"), +    ("event1230", "subject", "hyperion"), +    ("event1230", "type", "membership"), +    ("event1231", "object", "vacuumous"), +    ("event1231", "subject", "iapetus"), +    ("event1231", "type", "membership"), +    ("event1232", "object", "vacuumous"), +    ("event1232", "subject", "io"), +    ("event1232", "type", "membership"), +    ("event1233", "object", "vacuumous"), +    ("event1233", "subject", "janus"), +    ("event1233", "type", "membership"), +    ("event1234", "object", "vacuumous"), +    ("event1234", "subject", "jupiter"), +    ("event1234", "type", "membership"), +    ("event1235", "object", "vacuumous"), +    ("event1235", "subject", "pasiphae"), +    ("event1235", "type", "membership"), +    ("event1236", "object", "vacuumous"), +    ("event1236", "subject", "carme"), +    ("event1236", "type", "membership"), +    ("event1237", "object", "vacuumous"), +    ("event1237", "subject", "thebe"), +    ("event1237", "type", "membership"), +    ("event1238", "object", "vacuumous"), +    ("event1238", "subject", "sinope"), +    ("event1238", "type", "membership"), +    ("event1239", "object", "vacuumous"), +    ("event1239", "subject", "elara"), +    ("event1239", "type", "membership"), +    ("event1240", "object", "vacuumous"), +    ("event1240", "subject", "himalia"), +    ("event1240", "type", "membership"), +    ("event1241", "object", "vacuumous"), +    ("event1241", "subject", "lysithea"), +    ("event1241", "type", "membership"), +    ("event1242", "object", "vacuumous"), +    ("event1242", "subject", "leda"), +    ("event1242", "type", "membership"), +    ("event1243", "object", "vacuumous"), +    ("event1243", "subject", "ananke"), +    ("event1243", "type", "membership"), +    ("event1244", "object", "vacuumous"), +    ("event1244", "subject", "luna"), +    ("event1244", "type", "membership"), +    ("event1245", "object", "vacuumous"), +    ("event1245", "subject", "mars"), +    ("event1245", "type", "membership"), +    ("event1246", "object", "vacuumous"), +    ("event1246", "subject", "mercury"), +    ("event1246", "type", "membership"), +    ("event1247", "object", "vacuumous"), +    ("event1247", "subject", "mimas"), +    ("event1247", "type", "membership"), +    ("event1248", "object", "vacuumous"), +    ("event1248", "subject", "miranda"), +    ("event1248", "type", "membership"), +    ("event1249", "object", "vacuumous"), +    ("event1249", "subject", "neptune"), +    ("event1249", "type", "membership"), +    ("event1250", "object", "vacuumous"), +    ("event1250", "subject", "nereid"), +    ("event1250", "type", "membership"), +    ("event1251", "object", "vacuumous"), +    ("event1251", "subject", "oberon"), +    ("event1251", "type", "membership"), +    ("event1252", "object", "vacuumous"), +    ("event1252", "subject", "phobos"), +    ("event1252", "type", "membership"), +    ("event1253", "object", "vacuumous"), +    ("event1253", "subject", "phoebe"), +    ("event1253", "type", "membership"), +    ("event1254", "object", "vacuumous"), +    ("event1254", "subject", "pluto"), +    ("event1254", "type", "membership"), +    ("event1255", "object", "vacuumous"), +    ("event1255", "subject", "rhea"), +    ("event1255", "type", "membership"), +    ("event1256", "object", "vacuumous"), +    ("event1256", "subject", "saturn"), +    ("event1256", "type", "membership"), +    ("event1257", "object", "vacuumous"), +    ("event1257", "subject", "epimetheus"), +    ("event1257", "type", "membership"), +    ("event1258", "object", "vacuumous"), +    ("event1258", "subject", "tethys"), +    ("event1258", "type", "membership"), +    ("event1259", "object", "vacuumous"), +    ("event1259", "subject", "titan"), +    ("event1259", "type", "membership"), +    ("event1260", "object", "vacuumous"), +    ("event1260", "subject", "titania"), +    ("event1260", "type", "membership"), +    ("event1261", "object", "vacuumous"), +    ("event1261", "subject", "triton"), +    ("event1261", "type", "membership"), +    ("event1262", "object", "vacuumous"), +    ("event1262", "subject", "umbriel"), +    ("event1262", "type", "membership"), +    ("event1263", "object", "vacuumous"), +    ("event1263", "subject", "uranus"), +    ("event1263", "type", "membership"), +    ("event1264", "object", "thing"), +    ("event1264", "subject", "bernard"), +    ("event1264", "type", "membership"), +    ("event1265", "object", "thing"), +    ("event1265", "subject", "bond"), +    ("event1265", "type", "membership"), +    ("event1266", "object", "thing"), +    ("event1266", "subject", "venus"), +    ("event1266", "type", "membership"), +    ("event1267", "object", "thing"), +    ("event1267", "subject", "cassini"), +    ("event1267", "type", "membership"), +    ("event1268", "object", "thing"), +    ("event1268", "subject", "dollfus"), +    ("event1268", "type", "membership"), +    ("event1269", "object", "thing"), +    ("event1269", "subject", "fountain"), +    ("event1269", "type", "membership"), +    ("event1270", "object", "thing"), +    ("event1270", "subject", "galileo"), +    ("event1270", "type", "membership"), +    ("event1271", "object", "thing"), +    ("event1271", "subject", "hall"), +    ("event1271", "type", "membership"), +    ("event1272", "object", "thing"), +    ("event1272", "subject", "herschel"), +    ("event1272", "type", "membership"), +    ("event1273", "object", "thing"), +    ("event1273", "subject", "huygens"), +    ("event1273", "type", "membership"), +    ("event1274", "object", "thing"), +    ("event1274", "subject", "kowal"), +    ("event1274", "type", "membership"), +    ("event1275", "object", "thing"), +    ("event1275", "subject", "kuiper"), +    ("event1275", "type", "membership"), +    ("event1276", "object", "thing"), +    ("event1276", "subject", "larson"), +    ("event1276", "type", "membership"), +    ("event1277", "object", "thing"), +    ("event1277", "subject", "lassell"), +    ("event1277", "type", "membership"), +    ("event1278", "object", "thing"), +    ("event1278", "subject", "melotte"), +    ("event1278", "type", "membership"), +    ("event1279", "object", "thing"), +    ("event1279", "subject", "nicholson"), +    ("event1279", "type", "membership"), +    ("event1280", "object", "thing"), +    ("event1280", "subject", "perrine"), +    ("event1280", "type", "membership"), +    ("event1281", "object", "thing"), +    ("event1281", "subject", "pickering"), +    ("event1281", "type", "membership"), +    ("event1282", "object", "thing"), +    ("event1282", "subject", "almathea"), +    ("event1282", "type", "membership"), +    ("event1283", "object", "thing"), +    ("event1283", "subject", "ariel"), +    ("event1283", "type", "membership"), +    ("event1284", "object", "thing"), +    ("event1284", "subject", "callisto"), +    ("event1284", "type", "membership"), +    ("event1285", "object", "thing"), +    ("event1285", "subject", "charon"), +    ("event1285", "type", "membership"), +    ("event1286", "object", "thing"), +    ("event1286", "subject", "deimos"), +    ("event1286", "type", "membership"), +    ("event1287", "object", "thing"), +    ("event1287", "subject", "dione"), +    ("event1287", "type", "membership"), +    ("event1288", "object", "thing"), +    ("event1288", "subject", "earth"), +    ("event1288", "type", "membership"), +    ("event1289", "object", "thing"), +    ("event1289", "subject", "enceladus"), +    ("event1289", "type", "membership"), +    ("event1290", "object", "thing"), +    ("event1290", "subject", "europa"), +    ("event1290", "type", "membership"), +    ("event1291", "object", "thing"), +    ("event1291", "subject", "ganymede"), +    ("event1291", "type", "membership"), +    ("event1292", "object", "thing"), +    ("event1292", "subject", "hyperion"), +    ("event1292", "type", "membership"), +    ("event1293", "object", "thing"), +    ("event1293", "subject", "iapetus"), +    ("event1293", "type", "membership"), +    ("event1294", "object", "thing"), +    ("event1294", "subject", "io"), +    ("event1294", "type", "membership"), +    ("event1295", "object", "thing"), +    ("event1295", "subject", "janus"), +    ("event1295", "type", "membership"), +    ("event1296", "object", "thing"), +    ("event1296", "subject", "jupiter"), +    ("event1296", "type", "membership"), +    ("event1297", "object", "thing"), +    ("event1297", "subject", "pasiphae"), +    ("event1297", "type", "membership"), +    ("event1298", "object", "thing"), +    ("event1298", "subject", "carme"), +    ("event1298", "type", "membership"), +    ("event1299", "object", "thing"), +    ("event1299", "subject", "thebe"), +    ("event1299", "type", "membership"), +    ("event1300", "object", "thing"), +    ("event1300", "subject", "sinope"), +    ("event1300", "type", "membership"), +    ("event1301", "object", "thing"), +    ("event1301", "subject", "elara"), +    ("event1301", "type", "membership"), +    ("event1302", "object", "thing"), +    ("event1302", "subject", "himalia"), +    ("event1302", "type", "membership"), +    ("event1303", "object", "thing"), +    ("event1303", "subject", "lysithea"), +    ("event1303", "type", "membership"), +    ("event1304", "object", "thing"), +    ("event1304", "subject", "leda"), +    ("event1304", "type", "membership"), +    ("event1305", "object", "thing"), +    ("event1305", "subject", "ananke"), +    ("event1305", "type", "membership"), +    ("event1306", "object", "thing"), +    ("event1306", "subject", "luna"), +    ("event1306", "type", "membership"), +    ("event1307", "object", "thing"), +    ("event1307", "subject", "mars"), +    ("event1307", "type", "membership"), +    ("event1308", "object", "thing"), +    ("event1308", "subject", "mercury"), +    ("event1308", "type", "membership"), +    ("event1309", "object", "thing"), +    ("event1309", "subject", "mimas"), +    ("event1309", "type", "membership"), +    ("event1310", "object", "thing"), +    ("event1310", "subject", "miranda"), +    ("event1310", "type", "membership"), +    ("event1311", "object", "thing"), +    ("event1311", "subject", "neptune"), +    ("event1311", "type", "membership"), +    ("event1312", "object", "thing"), +    ("event1312", "subject", "nereid"), +    ("event1312", "type", "membership"), +    ("event1313", "object", "thing"), +    ("event1313", "subject", "oberon"), +    ("event1313", "type", "membership"), +    ("event1314", "object", "thing"), +    ("event1314", "subject", "phobos"), +    ("event1314", "type", "membership"), +    ("event1315", "object", "thing"), +    ("event1315", "subject", "phoebe"), +    ("event1315", "type", "membership"), +    ("event1316", "object", "thing"), +    ("event1316", "subject", "pluto"), +    ("event1316", "type", "membership"), +    ("event1317", "object", "thing"), +    ("event1317", "subject", "rhea"), +    ("event1317", "type", "membership"), +    ("event1318", "object", "thing"), +    ("event1318", "subject", "saturn"), +    ("event1318", "type", "membership"), +    ("event1319", "object", "thing"), +    ("event1319", "subject", "epimetheus"), +    ("event1319", "type", "membership"), +    ("event1320", "object", "thing"), +    ("event1320", "subject", "sol"), +    ("event1320", "type", "membership"), +    ("event1321", "object", "thing"), +    ("event1321", "subject", "tethys"), +    ("event1321", "type", "membership"), +    ("event1322", "object", "thing"), +    ("event1322", "subject", "titan"), +    ("event1322", "type", "membership"), +    ("event1323", "object", "thing"), +    ("event1323", "subject", "titania"), +    ("event1323", "type", "membership"), +    ("event1324", "object", "thing"), +    ("event1324", "subject", "triton"), +    ("event1324", "type", "membership"), +    ("event1325", "object", "thing"), +    ("event1325", "subject", "umbriel"), +    ("event1325", "type", "membership"), +    ("event1326", "object", "thing"), +    ("event1326", "subject", "uranus"), +    ("event1326", "type", "membership"), +    ("event1327", "object", "spin"), +    ("event1327", "subject", "venus"), +    ("event1327", "type", "membership"), +    ("event1328", "object", "spin"), +    ("event1328", "subject", "almathea"), +    ("event1328", "type", "membership"), +    ("event1329", "object", "spin"), +    ("event1329", "subject", "ariel"), +    ("event1329", "type", "membership"), +    ("event1330", "object", "spin"), +    ("event1330", "subject", "callisto"), +    ("event1330", "type", "membership"), +    ("event1331", "object", "spin"), +    ("event1331", "subject", "charon"), +    ("event1331", "type", "membership"), +    ("event1332", "object", "spin"), +    ("event1332", "subject", "deimos"), +    ("event1332", "type", "membership"), +    ("event1333", "object", "spin"), +    ("event1333", "subject", "dione"), +    ("event1333", "type", "membership"), +    ("event1334", "object", "spin"), +    ("event1334", "subject", "earth"), +    ("event1334", "type", "membership"), +    ("event1335", "object", "spin"), +    ("event1335", "subject", "enceladus"), +    ("event1335", "type", "membership"), +    ("event1336", "object", "spin"), +    ("event1336", "subject", "europa"), +    ("event1336", "type", "membership"), +    ("event1337", "object", "spin"), +    ("event1337", "subject", "ganymede"), +    ("event1337", "type", "membership"), +    ("event1338", "object", "spin"), +    ("event1338", "subject", "hyperion"), +    ("event1338", "type", "membership"), +    ("event1339", "object", "spin"), +    ("event1339", "subject", "iapetus"), +    ("event1339", "type", "membership"), +    ("event1340", "object", "spin"), +    ("event1340", "subject", "io"), +    ("event1340", "type", "membership"), +    ("event1341", "object", "spin"), +    ("event1341", "subject", "janus"), +    ("event1341", "type", "membership"), +    ("event1342", "object", "spin"), +    ("event1342", "subject", "jupiter"), +    ("event1342", "type", "membership"), +    ("event1343", "object", "spin"), +    ("event1343", "subject", "pasiphae"), +    ("event1343", "type", "membership"), +    ("event1344", "object", "spin"), +    ("event1344", "subject", "carme"), +    ("event1344", "type", "membership"), +    ("event1345", "object", "spin"), +    ("event1345", "subject", "thebe"), +    ("event1345", "type", "membership"), +    ("event1346", "object", "spin"), +    ("event1346", "subject", "sinope"), +    ("event1346", "type", "membership"), +    ("event1347", "object", "spin"), +    ("event1347", "subject", "elara"), +    ("event1347", "type", "membership"), +    ("event1348", "object", "spin"), +    ("event1348", "subject", "himalia"), +    ("event1348", "type", "membership"), +    ("event1349", "object", "spin"), +    ("event1349", "subject", "lysithea"), +    ("event1349", "type", "membership"), +    ("event1350", "object", "spin"), +    ("event1350", "subject", "leda"), +    ("event1350", "type", "membership"), +    ("event1351", "object", "spin"), +    ("event1351", "subject", "ananke"), +    ("event1351", "type", "membership"), +    ("event1352", "object", "spin"), +    ("event1352", "subject", "luna"), +    ("event1352", "type", "membership"), +    ("event1353", "object", "spin"), +    ("event1353", "subject", "mars"), +    ("event1353", "type", "membership"), +    ("event1354", "object", "spin"), +    ("event1354", "subject", "mercury"), +    ("event1354", "type", "membership"), +    ("event1355", "object", "spin"), +    ("event1355", "subject", "mimas"), +    ("event1355", "type", "membership"), +    ("event1356", "object", "spin"), +    ("event1356", "subject", "miranda"), +    ("event1356", "type", "membership"), +    ("event1357", "object", "spin"), +    ("event1357", "subject", "neptune"), +    ("event1357", "type", "membership"), +    ("event1358", "object", "spin"), +    ("event1358", "subject", "nereid"), +    ("event1358", "type", "membership"), +    ("event1359", "object", "spin"), +    ("event1359", "subject", "oberon"), +    ("event1359", "type", "membership"), +    ("event1360", "object", "spin"), +    ("event1360", "subject", "phobos"), +    ("event1360", "type", "membership"), +    ("event1361", "object", "spin"), +    ("event1361", "subject", "phoebe"), +    ("event1361", "type", "membership"), +    ("event1362", "object", "spin"), +    ("event1362", "subject", "pluto"), +    ("event1362", "type", "membership"), +    ("event1363", "object", "spin"), +    ("event1363", "subject", "rhea"), +    ("event1363", "type", "membership"), +    ("event1364", "object", "spin"), +    ("event1364", "subject", "saturn"), +    ("event1364", "type", "membership"), +    ("event1365", "object", "spin"), +    ("event1365", "subject", "epimetheus"), +    ("event1365", "type", "membership"), +    ("event1366", "object", "spin"), +    ("event1366", "subject", "sol"), +    ("event1366", "type", "membership"), +    ("event1367", "object", "spin"), +    ("event1367", "subject", "tethys"), +    ("event1367", "type", "membership"), +    ("event1368", "object", "spin"), +    ("event1368", "subject", "titan"), +    ("event1368", "type", "membership"), +    ("event1369", "object", "spin"), +    ("event1369", "subject", "titania"), +    ("event1369", "type", "membership"), +    ("event1370", "object", "spin"), +    ("event1370", "subject", "triton"), +    ("event1370", "type", "membership"), +    ("event1371", "object", "spin"), +    ("event1371", "subject", "umbriel"), +    ("event1371", "type", "membership"), +    ("event1372", "object", "spin"), +    ("event1372", "subject", "uranus"), +    ("event1372", "type", "membership"), +    ("event1373", "object", "jupiter"), +    ("event1373", "subject", "adrastea"), +    ("event1373", "type", "orbit_ev"), +    ("event1374", "object", "jupiter"), +    ("event1374", "subject", "metis"), +    ("event1374", "type", "orbit_ev"), +    ("event1375", "object", "jupiter"), +    ("event1375", "subject", "callirrhoe"), +    ("event1375", "type", "orbit_ev"), +    ("event1376", "object", "jupiter"), +    ("event1376", "subject", "themisto"), +    ("event1376", "type", "orbit_ev"), +    ("event1377", "object", "jupiter"), +    ("event1377", "subject", "megaclite"), +    ("event1377", "type", "orbit_ev"), +    ("event1378", "object", "jupiter"), +    ("event1378", "subject", "taygete"), +    ("event1378", "type", "orbit_ev"), +    ("event1379", "object", "jupiter"), +    ("event1379", "subject", "chaldene"), +    ("event1379", "type", "orbit_ev"), +    ("event1380", "object", "jupiter"), +    ("event1380", "subject", "harpalyke"), +    ("event1380", "type", "orbit_ev"), +    ("event1381", "object", "jupiter"), +    ("event1381", "subject", "kalyke"), +    ("event1381", "type", "orbit_ev"), +    ("event1382", "object", "jupiter"), +    ("event1382", "subject", "iocaste"), +    ("event1382", "type", "orbit_ev"), +    ("event1383", "object", "jupiter"), +    ("event1383", "subject", "erinome"), +    ("event1383", "type", "orbit_ev"), +    ("event1384", "object", "jupiter"), +    ("event1384", "subject", "isonoe"), +    ("event1384", "type", "orbit_ev"), +    ("event1385", "object", "jupiter"), +    ("event1385", "subject", "praxidike"), +    ("event1385", "type", "orbit_ev"), +    ("event1386", "object", "jupiter"), +    ("event1386", "subject", "autonoe"), +    ("event1386", "type", "orbit_ev"), +    ("event1387", "object", "jupiter"), +    ("event1387", "subject", "thyone"), +    ("event1387", "type", "orbit_ev"), +    ("event1388", "object", "jupiter"), +    ("event1388", "subject", "hermippe"), +    ("event1388", "type", "orbit_ev"), +    ("event1389", "object", "jupiter"), +    ("event1389", "subject", "aitne"), +    ("event1389", "type", "orbit_ev"), +    ("event1390", "object", "jupiter"), +    ("event1390", "subject", "eurydome"), +    ("event1390", "type", "orbit_ev"), +    ("event1391", "object", "jupiter"), +    ("event1391", "subject", "euanthe"), +    ("event1391", "type", "orbit_ev"), +    ("event1392", "object", "jupiter"), +    ("event1392", "subject", "euporie"), +    ("event1392", "type", "orbit_ev"), +    ("event1393", "object", "jupiter"), +    ("event1393", "subject", "orthosie"), +    ("event1393", "type", "orbit_ev"), +    ("event1394", "object", "jupiter"), +    ("event1394", "subject", "sponde"), +    ("event1394", "type", "orbit_ev"), +    ("event1395", "object", "jupiter"), +    ("event1395", "subject", "kale"), +    ("event1395", "type", "orbit_ev"), +    ("event1396", "object", "jupiter"), +    ("event1396", "subject", "pasithee"), +    ("event1396", "type", "orbit_ev"), +    ("event1397", "object", "jupiter"), +    ("event1397", "subject", "hegemone"), +    ("event1397", "type", "orbit_ev"), +    ("event1398", "object", "jupiter"), +    ("event1398", "subject", "mneme"), +    ("event1398", "type", "orbit_ev"), +    ("event1399", "object", "jupiter"), +    ("event1399", "subject", "aoede"), +    ("event1399", "type", "orbit_ev"), +    ("event1400", "object", "jupiter"), +    ("event1400", "subject", "thelxinoe"), +    ("event1400", "type", "orbit_ev"), +    ("event1401", "object", "jupiter"), +    ("event1401", "subject", "arche"), +    ("event1401", "type", "orbit_ev"), +    ("event1402", "object", "jupiter"), +    ("event1402", "subject", "kallichore"), +    ("event1402", "type", "orbit_ev"), +    ("event1403", "object", "jupiter"), +    ("event1403", "subject", "helike"), +    ("event1403", "type", "orbit_ev"), +    ("event1404", "object", "jupiter"), +    ("event1404", "subject", "carpo"), +    ("event1404", "type", "orbit_ev"), +    ("event1405", "object", "jupiter"), +    ("event1405", "subject", "eukelade"), +    ("event1405", "type", "orbit_ev"), +    ("event1406", "object", "jupiter"), +    ("event1406", "subject", "cyllene"), +    ("event1406", "type", "orbit_ev"), +    ("event1407", "object", "jupiter"), +    ("event1407", "subject", "kore"), +    ("event1407", "type", "orbit_ev"), +    ("event1408", "object", "jupiter"), +    ("event1408", "subject", "herse"), +    ("event1408", "type", "orbit_ev"), +    ("event1409", "object", "saturn"), +    ("event1409", "subject", "helene"), +    ("event1409", "type", "orbit_ev"), +    ("event1410", "object", "saturn"), +    ("event1410", "subject", "telesto"), +    ("event1410", "type", "orbit_ev"), +    ("event1411", "object", "saturn"), +    ("event1411", "subject", "calypso"), +    ("event1411", "type", "orbit_ev"), +    ("event1412", "object", "saturn"), +    ("event1412", "subject", "atlas"), +    ("event1412", "type", "orbit_ev"), +    ("event1413", "object", "saturn"), +    ("event1413", "subject", "prometheus"), +    ("event1413", "type", "orbit_ev"), +    ("event1414", "object", "saturn"), +    ("event1414", "subject", "pandora"), +    ("event1414", "type", "orbit_ev"), +    ("event1415", "object", "saturn"), +    ("event1415", "subject", "pan"), +    ("event1415", "type", "orbit_ev"), +    ("event1416", "object", "saturn"), +    ("event1416", "subject", "ymir"), +    ("event1416", "type", "orbit_ev"), +    ("event1417", "object", "saturn"), +    ("event1417", "subject", "paaliaq"), +    ("event1417", "type", "orbit_ev"), +    ("event1418", "object", "saturn"), +    ("event1418", "subject", "tarvos"), +    ("event1418", "type", "orbit_ev"), +    ("event1419", "object", "saturn"), +    ("event1419", "subject", "ijiraq"), +    ("event1419", "type", "orbit_ev"), +    ("event1420", "object", "saturn"), +    ("event1420", "subject", "suttungr"), +    ("event1420", "type", "orbit_ev"), +    ("event1421", "object", "saturn"), +    ("event1421", "subject", "kiviuq"), +    ("event1421", "type", "orbit_ev"), +    ("event1422", "object", "saturn"), +    ("event1422", "subject", "mundilfari"), +    ("event1422", "type", "orbit_ev"), +    ("event1423", "object", "saturn"), +    ("event1423", "subject", "albiorix"), +    ("event1423", "type", "orbit_ev"), +    ("event1424", "object", "saturn"), +    ("event1424", "subject", "skathi"), +    ("event1424", "type", "orbit_ev"), +    ("event1425", "object", "saturn"), +    ("event1425", "subject", "erriapus"), +    ("event1425", "type", "orbit_ev"), +    ("event1426", "object", "saturn"), +    ("event1426", "subject", "siarnaq"), +    ("event1426", "type", "orbit_ev"), +    ("event1427", "object", "saturn"), +    ("event1427", "subject", "thrymr"), +    ("event1427", "type", "orbit_ev"), +    ("event1428", "object", "saturn"), +    ("event1428", "subject", "narvi"), +    ("event1428", "type", "orbit_ev"), +    ("event1429", "object", "saturn"), +    ("event1429", "subject", "methone"), +    ("event1429", "type", "orbit_ev"), +    ("event1430", "object", "saturn"), +    ("event1430", "subject", "pallene"), +    ("event1430", "type", "orbit_ev"), +    ("event1431", "object", "saturn"), +    ("event1431", "subject", "polydeuces"), +    ("event1431", "type", "orbit_ev"), +    ("event1432", "object", "saturn"), +    ("event1432", "subject", "daphnis"), +    ("event1432", "type", "orbit_ev"), +    ("event1433", "object", "saturn"), +    ("event1433", "subject", "aegir"), +    ("event1433", "type", "orbit_ev"), +    ("event1434", "object", "saturn"), +    ("event1434", "subject", "bebhionn"), +    ("event1434", "type", "orbit_ev"), +    ("event1435", "object", "saturn"), +    ("event1435", "subject", "bergelmir"), +    ("event1435", "type", "orbit_ev"), +    ("event1436", "object", "saturn"), +    ("event1436", "subject", "bestla"), +    ("event1436", "type", "orbit_ev"), +    ("event1437", "object", "saturn"), +    ("event1437", "subject", "farbauti"), +    ("event1437", "type", "orbit_ev"), +    ("event1438", "object", "saturn"), +    ("event1438", "subject", "fenrir"), +    ("event1438", "type", "orbit_ev"), +    ("event1439", "object", "saturn"), +    ("event1439", "subject", "fornjot"), +    ("event1439", "type", "orbit_ev"), +    ("event1440", "object", "saturn"), +    ("event1440", "subject", "hati"), +    ("event1440", "type", "orbit_ev"), +    ("event1441", "object", "saturn"), +    ("event1441", "subject", "hyrrokkin"), +    ("event1441", "type", "orbit_ev"), +    ("event1442", "object", "saturn"), +    ("event1442", "subject", "kari"), +    ("event1442", "type", "orbit_ev"), +    ("event1443", "object", "saturn"), +    ("event1443", "subject", "loge"), +    ("event1443", "type", "orbit_ev"), +    ("event1444", "object", "saturn"), +    ("event1444", "subject", "skoll"), +    ("event1444", "type", "orbit_ev"), +    ("event1445", "object", "saturn"), +    ("event1445", "subject", "surtur"), +    ("event1445", "type", "orbit_ev"), +    ("event1446", "object", "saturn"), +    ("event1446", "subject", "anthe"), +    ("event1446", "type", "orbit_ev"), +    ("event1447", "object", "saturn"), +    ("event1447", "subject", "jarnsaxa"), +    ("event1447", "type", "orbit_ev"), +    ("event1448", "object", "saturn"), +    ("event1448", "object", "thing"), +    ("event1448", "subject", "greip"), +    ("event1448", "type", "membership"), +    ("event1448", "type", "orbit_ev"), +    ("event1449", "object", "saturn"), +    ("event1449", "subject", "tarqeq"), +    ("event1449", "type", "orbit_ev"), +    ("event1450", "object", "saturn"), +    ("event1450", "subject", "aegaeon"), +    ("event1450", "type", "orbit_ev"), +    ("event1451", "object", "uranus"), +    ("event1451", "subject", "cordelia"), +    ("event1451", "type", "orbit_ev"), +    ("event1452", "object", "uranus"), +    ("event1452", "subject", "ophelia"), +    ("event1452", "type", "orbit_ev"), +    ("event1453", "object", "uranus"), +    ("event1453", "subject", "bianca"), +    ("event1453", "type", "orbit_ev"), +    ("event1454", "object", "uranus"), +    ("event1454", "subject", "cressida"), +    ("event1454", "type", "orbit_ev"), +    ("event1455", "object", "uranus"), +    ("event1455", "subject", "desdemona"), +    ("event1455", "type", "orbit_ev"), +    ("event1456", "object", "uranus"), +    ("event1456", "subject", "juliet"), +    ("event1456", "type", "orbit_ev"), +    ("event1457", "object", "uranus"), +    ("event1457", "subject", "portia"), +    ("event1457", "type", "orbit_ev"), +    ("event1458", "object", "uranus"), +    ("event1458", "subject", "rosalind"), +    ("event1458", "type", "orbit_ev"), +    ("event1459", "object", "uranus"), +    ("event1459", "subject", "belinda"), +    ("event1459", "type", "orbit_ev"), +    ("event1460", "object", "uranus"), +    ("event1460", "subject", "puck"), +    ("event1460", "type", "orbit_ev"), +    ("event1461", "object", "uranus"), +    ("event1461", "subject", "caliban"), +    ("event1461", "type", "orbit_ev"), +    ("event1462", "object", "uranus"), +    ("event1462", "subject", "sycorax"), +    ("event1462", "type", "orbit_ev"), +    ("event1463", "object", "uranus"), +    ("event1463", "subject", "prospero"), +    ("event1463", "type", "orbit_ev"), +    ("event1464", "object", "uranus"), +    ("event1464", "subject", "setebos"), +    ("event1464", "type", "orbit_ev"), +    ("event1465", "object", "uranus"), +    ("event1465", "subject", "stephano"), +    ("event1465", "type", "orbit_ev"), +    ("event1466", "object", "uranus"), +    ("event1466", "subject", "trinculo"), +    ("event1466", "type", "orbit_ev"), +    ("event1467", "object", "uranus"), +    ("event1467", "subject", "francisco"), +    ("event1467", "type", "orbit_ev"), +    ("event1468", "object", "uranus"), +    ("event1468", "subject", "margaret"), +    ("event1468", "type", "orbit_ev"), +    ("event1469", "object", "uranus"), +    ("event1469", "subject", "ferdinand"), +    ("event1469", "type", "orbit_ev"), +    ("event1470", "object", "uranus"), +    ("event1470", "subject", "perdita"), +    ("event1470", "type", "orbit_ev"), +    ("event1471", "object", "uranus"), +    ("event1471", "subject", "mab"), +    ("event1471", "type", "orbit_ev"), +    ("event1472", "object", "uranus"), +    ("event1472", "subject", "cupid"), +    ("event1472", "type", "orbit_ev"), +    ("event1474", "object", "neptune"), +    ("event1474", "subject", "naiad"), +    ("event1474", "type", "orbit_ev"), +    ("event1475", "object", "neptune"), +    ("event1475", "subject", "thalassa"), +    ("event1475", "type", "orbit_ev"), +    ("event1476", "object", "neptune"), +    ("event1476", "subject", "despina"), +    ("event1476", "type", "orbit_ev"), +    ("event1477", "object", "neptune"), +    ("event1477", "subject", "galatea"), +    ("event1477", "type", "orbit_ev"), +    ("event1478", "object", "neptune"), +    ("event1478", "subject", "larissa"), +    ("event1478", "type", "orbit_ev"), +    ("event1479", "object", "neptune"), +    ("event1479", "subject", "proteus"), +    ("event1479", "type", "orbit_ev"), +    ("event1480", "object", "neptune"), +    ("event1480", "subject", "halimede"), +    ("event1480", "type", "orbit_ev"), +    ("event1481", "object", "neptune"), +    ("event1481", "subject", "psamathe"), +    ("event1481", "type", "orbit_ev"), +    ("event1482", "object", "neptune"), +    ("event1482", "subject", "sao"), +    ("event1482", "type", "orbit_ev"), +    ("event1483", "object", "neptune"), +    ("event1483", "subject", "laomedeia"), +    ("event1483", "type", "orbit_ev"), +    ("event1484", "object", "neptune"), +    ("event1484", "subject", "neso"), +    ("event1484", "type", "orbit_ev"), +    ("event1485", "object", "pluto"), +    ("event1485", "subject", "nix"), +    ("event1485", "type", "orbit_ev"), +    ("event1486", "object", "pluto"), +    ("event1486", "subject", "hydra"), +    ("event1486", "type", "orbit_ev"), +    ("event1487", "object", "pluto"), +    ("event1487", "subject", "kerberos"), +    ("event1487", "type", "orbit_ev"), +    ("event1488", "object", "pluto"), +    ("event1488", "subject", "styx"), +    ("event1488", "type", "orbit_ev"), +    ("event1489", "object", "adrastea"), +    ("event1489", "subject", "voyager_science_team"), +    ("event1489", "type", "discover_ev"), +    ("event1489", "with_implement", "voyager_2"), +    ("event1489", "year", "1979"), +    ("event1490", "object", "metis"), +    ("event1490", "subject", "voyager_science_team"), +    ("event1490", "type", "discover_ev"), +    ("event1490", "with_implement", "voyager_1"), +    ("event1490", "year", "1979"), +    ("event1491", "location", "kitt_peak"), +    ("event1491", "object", "callirrhoe"), +    ("event1491", "subject", "science_team_1"), +    ("event1491", "type", "discover_ev"), +    ("event1491", "with_implement", "refractor_telescope_3"), +    ("event1491", "year", "1999"), +    ("event1492", "location", "mauna_kea"), +    ("event1492", "object", "themisto"), +    ("event1492", "subject", "science_team_2"), +    ("event1492", "type", "discover_ev"), +    ("event1492", "with_implement", "canada-france-hawaii_telescope"), +    ("event1492", "with_implement", "subaru_reflector_telescope"), +    ("event1492", "year", "1975"), +    ("event1493", "location", "mauna_kea"), +    ("event1493", "object", "megaclite"), +    ("event1493", "subject", "science_team_3"), +    ("event1493", "type", "discover_ev"), +    ("event1493", "year", "2000"), +    ("event1494", "location", "mauna_kea"), +    ("event1494", "object", "taygete"), +    ("event1494", "subject", "science_team_3"), +    ("event1494", "type", "discover_ev"), +    ("event1494", "year", "2000"), +    ("event1495", "location", "mauna_kea"), +    ("event1495", "object", "chaldene"), +    ("event1495", "subject", "science_team_3"), +    ("event1495", "type", "discover_ev"), +    ("event1495", "year", "2000"), +    ("event1496", "location", "mauna_kea"), +    ("event1496", "object", "harpalyke"), +    ("event1496", "subject", "science_team_3"), +    ("event1496", "type", "discover_ev"), +    ("event1496", "year", "2000"), +    ("event1497", "location", "mauna_kea"), +    ("event1497", "object", "kalyke"), +    ("event1497", "subject", "science_team_3"), +    ("event1497", "type", "discover_ev"), +    ("event1497", "year", "2000"), +    ("event1498", "location", "mauna_kea"), +    ("event1498", "object", "iocaste"), +    ("event1498", "subject", "science_team_3"), +    ("event1498", "type", "discover_ev"), +    ("event1498", "year", "2000"), +    ("event1499", "location", "mauna_kea"), +    ("event1499", "object", "erinome"), +    ("event1499", "subject", "science_team_3"), +    ("event1499", "type", "discover_ev"), +    ("event1499", "year", "2000"), +    ("event1500", "location", "mauna_kea"), +    ("event1500", "object", "isonoe"), +    ("event1500", "subject", "science_team_3"), +    ("event1500", "type", "discover_ev"), +    ("event1500", "year", "2000"), +    ("event1501", "location", "mauna_kea"), +    ("event1501", "object", "praxidike"), +    ("event1501", "subject", "science_team_3"), +    ("event1501", "type", "discover_ev"), +    ("event1501", "year", "2000"), +    ("event1502", "location", "mauna_kea"), +    ("event1502", "object", "autonoe"), +    ("event1502", "subject", "science_team_4"), +    ("event1502", "type", "discover_ev"), +    ("event1502", "year", "2001"), +    ("event1503", "location", "mauna_kea"), +    ("event1503", "object", "thyone"), +    ("event1503", "subject", "science_team_4"), +    ("event1503", "type", "discover_ev"), +    ("event1503", "year", "2001"), +    ("event1504", "location", "mauna_kea"), +    ("event1504", "object", "hermippe"), +    ("event1504", "subject", "science_team_4"), +    ("event1504", "type", "discover_ev"), +    ("event1504", "year", "2001"), +    ("event1505", "location", "mauna_kea"), +    ("event1505", "object", "aitne"), +    ("event1505", "subject", "science_team_4"), +    ("event1505", "type", "discover_ev"), +    ("event1505", "year", "2001"), +    ("event1506", "location", "mauna_kea"), +    ("event1506", "object", "eurydome"), +    ("event1506", "subject", "science_team_4"), +    ("event1506", "type", "discover_ev"), +    ("event1506", "year", "2001"), +    ("event1507", "location", "mauna_kea"), +    ("event1507", "object", "euanthe"), +    ("event1507", "subject", "science_team_4"), +    ("event1507", "type", "discover_ev"), +    ("event1507", "year", "2001"), +    ("event1508", "location", "mauna_kea"), +    ("event1508", "object", "euporie"), +    ("event1508", "subject", "science_team_4"), +    ("event1508", "type", "discover_ev"), +    ("event1508", "year", "2001"), +    ("event1509", "location", "mauna_kea"), +    ("event1509", "object", "orthosie"), +    ("event1509", "subject", "science_team_4"), +    ("event1509", "type", "discover_ev"), +    ("event1509", "year", "2001"), +    ("event1510", "location", "mauna_kea"), +    ("event1510", "object", "sponde"), +    ("event1510", "subject", "science_team_4"), +    ("event1510", "type", "discover_ev"), +    ("event1510", "year", "2001"), +    ("event1511", "location", "mauna_kea"), +    ("event1511", "object", "kale"), +    ("event1511", "subject", "science_team_4"), +    ("event1511", "type", "discover_ev"), +    ("event1511", "year", "2001"), +    ("event1512", "location", "mauna_kea"), +    ("event1512", "object", "pasithee"), +    ("event1512", "subject", "science_team_4"), +    ("event1512", "type", "discover_ev"), +    ("event1512", "year", "2001"), +    ("event1513", "location", "mauna_kea"), +    ("event1513", "object", "hegemone"), +    ("event1513", "subject", "sheppard"), +    ("event1513", "type", "discover_ev"), +    ("event1513", "year", "2003"), +    ("event1514", "location", "mauna_kea"), +    ("event1514", "object", "mneme"), +    ("event1514", "subject", "science_team_5"), +    ("event1514", "type", "discover_ev"), +    ("event1514", "year", "2003"), +    ("event1515", "location", "mauna_kea"), +    ("event1515", "object", "aoede"), +    ("event1515", "subject", "sheppard"), +    ("event1515", "type", "discover_ev"), +    ("event1515", "year", "2003"), +    ("event1516", "location", "mauna_kea"), +    ("event1516", "object", "thelxinoe"), +    ("event1516", "subject", "sheppard"), +    ("event1516", "type", "discover_ev"), +    ("event1516", "year", "2003"), +    ("event1517", "location", "mauna_kea"), +    ("event1517", "object", "arche"), +    ("event1517", "subject", "sheppard"), +    ("event1517", "type", "discover_ev"), +    ("event1517", "year", "2002"), +    ("event1518", "location", "mauna_kea"), +    ("event1518", "object", "kallichore"), +    ("event1518", "subject", "sheppard"), +    ("event1518", "type", "discover_ev"), +    ("event1518", "year", "2003"), +    ("event1519", "location", "mauna_kea"), +    ("event1519", "object", "helike"), +    ("event1519", "subject", "sheppard"), +    ("event1519", "type", "discover_ev"), +    ("event1519", "year", "2003"), +    ("event1520", "location", "mauna_kea"), +    ("event1520", "object", "carpo"), +    ("event1520", "subject", "sheppard"), +    ("event1520", "type", "discover_ev"), +    ("event1520", "year", "2003"), +    ("event1521", "location", "mauna_kea"), +    ("event1521", "object", "eukelade"), +    ("event1521", "subject", "sheppard"), +    ("event1521", "type", "discover_ev"), +    ("event1521", "year", "2003"), +    ("event1522", "location", "mauna_kea"), +    ("event1522", "object", "cyllene"), +    ("event1522", "subject", "sheppard"), +    ("event1522", "type", "discover_ev"), +    ("event1522", "year", "2003"), +    ("event1523", "location", "mauna_kea"), +    ("event1523", "object", "kore"), +    ("event1523", "subject", "science_team_4"), +    ("event1523", "type", "discover_ev"), +    ("event1523", "year", "2003"), +    ("event1524", "location", "mauna_kea"), +    ("event1524", "object", "herse"), +    ("event1524", "subject", "science_team_6"), +    ("event1524", "type", "discover_ev"), +    ("event1524", "year", "2003"), +    ("event1525", "location", "pic_du_midi"), +    ("event1525", "object", "helene"), +    ("event1525", "subject", "science_team_8"), +    ("event1525", "type", "discover_ev"), +    ("event1525", "year", "1980"), +    ("event1526", "location", "kitt_peak"), +    ("event1526", "object", "telesto"), +    ("event1526", "subject", "science_team_9"), +    ("event1526", "type", "discover_ev"), +    ("event1526", "with_implement", "ground_based_telescope_1"), +    ("event1526", "year", "1980"), +    ("event1527", "location", "flagstaff"), +    ("event1527", "object", "calypso"), +    ("event1527", "subject", "science_team_10"), +    ("event1527", "type", "discover_ev"), +    ("event1527", "with_implement", "ground_based_telescope_2"), +    ("event1527", "year", "1980"), +    ("event1528", "object", "atlas"), +    ("event1528", "subject", "voyager_science_team"), +    ("event1528", "type", "discover_ev"), +    ("event1528", "with_implement", "voyager_1"), +    ("event1528", "year", "1980"), +    ("event1529", "object", "prometheus"), +    ("event1529", "subject", "voyager_science_team"), +    ("event1529", "type", "discover_ev"), +    ("event1529", "with_implement", "voyager_1"), +    ("event1529", "year", "1980"), +    ("event1530", "object", "pandora"), +    ("event1530", "subject", "voyager_science_team"), +    ("event1530", "type", "discover_ev"), +    ("event1530", "with_implement", "voyager_1"), +    ("event1530", "year", "1980"), +    ("event1531", "object", "pan"), +    ("event1531", "subject", "showalter"), +    ("event1531", "type", "discover_ev"), +    ("event1531", "with_implement", "voyager_2"), +    ("event1531", "year", "1990"), +    ("event1532", "location", "la_silla"), +    ("event1532", "object", "ymir"), +    ("event1532", "subject", "science_team_11"), +    ("event1532", "type", "discover_ev"), +    ("event1532", "year", "2000"), +    ("event1533", "location", "la_silla"), +    ("event1533", "object", "paaliaq"), +    ("event1533", "subject", "science_team_11"), +    ("event1533", "type", "discover_ev"), +    ("event1533", "year", "2000"), +    ("event1534", "location", "mauna_kea"), +    ("event1534", "object", "tarvos"), +    ("event1534", "subject", "science_team_11"), +    ("event1534", "type", "discover_ev"), +    ("event1534", "with_implement", "canada-france-hawaii_telescope"), +    ("event1534", "year", "2000"), +    ("event1535", "location", "mauna_kea"), +    ("event1535", "object", "ijiraq"), +    ("event1535", "subject", "science_team_11"), +    ("event1535", "type", "discover_ev"), +    ("event1535", "with_implement", "canada-france-hawaii_telescope"), +    ("event1535", "year", "2000"), +    ("event1536", "location", "mauna_kea"), +    ("event1536", "object", "suttungr"), +    ("event1536", "subject", "science_team_11"), +    ("event1536", "type", "discover_ev"), +    ("event1536", "with_implement", "canada-france-hawaii_telescope"), +    ("event1536", "year", "2000"), +    ("event1537", "location", "la_silla"), +    ("event1537", "object", "kiviuq"), +    ("event1537", "subject", "science_team_11"), +    ("event1537", "type", "discover_ev"), +    ("event1537", "year", "2000"), +    ("event1538", "location", "mauna_kea"), +    ("event1538", "object", "mundilfari"), +    ("event1538", "subject", "science_team_11"), +    ("event1538", "type", "discover_ev"), +    ("event1538", "with_implement", "canada-france-hawaii_telescope"), +    ("event1538", "year", "2000"), +    ("event1539", "location", "mt_hopkins"), +    ("event1539", "object", "albiorix"), +    ("event1539", "subject", "holman"), +    ("event1539", "type", "discover_ev"), +    ("event1539", "with_implement", "reflector_telescope_2"), +    ("event1539", "year", "2000"), +    ("event1540", "location", "mauna_kea"), +    ("event1540", "object", "skathi"), +    ("event1540", "subject", "science_team_11"), +    ("event1540", "type", "discover_ev"), +    ("event1540", "with_implement", "canada-france-hawaii_telescope"), +    ("event1540", "year", "2000"), +    ("event1541", "location", "mauna_kea"), +    ("event1541", "object", "erriapus"), +    ("event1541", "subject", "science_team_11"), +    ("event1541", "type", "discover_ev"), +    ("event1541", "with_implement", "canada-france-hawaii_telescope"), +    ("event1541", "year", "2000"), +    ("event1542", "location", "mauna_kea"), +    ("event1542", "object", "siarnaq"), +    ("event1542", "subject", "science_team_11"), +    ("event1542", "type", "discover_ev"), +    ("event1542", "with_implement", "canada-france-hawaii_telescope"), +    ("event1542", "year", "2000"), +    ("event1543", "location", "mauna_kea"), +    ("event1543", "object", "thrymr"), +    ("event1543", "subject", "science_team_11"), +    ("event1543", "type", "discover_ev"), +    ("event1543", "with_implement", "canada-france-hawaii_telescope"), +    ("event1543", "year", "2000"), +    ("event1544", "location", "mauna_kea"), +    ("event1544", "object", "narvi"), +    ("event1544", "subject", "science_team_4"), +    ("event1544", "type", "discover_ev"), +    ("event1544", "year", "2003"), +    ("event1545", "object", "methone"), +    ("event1545", "subject", "cassini_imaging_science_team"), +    ("event1545", "type", "discover_ev"), +    ("event1545", "with_implement", "cassini"), +    ("event1545", "year", "2004"), +    ("event1546", "object", "pallene"), +    ("event1546", "subject", "cassini_imaging_science_team"), +    ("event1546", "type", "discover_ev"), +    ("event1546", "with_implement", "cassini"), +    ("event1546", "year", "2004"), +    ("event1547", "object", "polydeuces"), +    ("event1547", "subject", "cassini_imaging_science_team"), +    ("event1547", "type", "discover_ev"), +    ("event1547", "with_implement", "cassini"), +    ("event1547", "year", "2004"), +    ("event1548", "object", "daphnis"), +    ("event1548", "subject", "cassini_imaging_science_team"), +    ("event1548", "type", "discover_ev"), +    ("event1548", "with_implement", "cassini"), +    ("event1548", "year", "2005"), +    ("event1549", "location", "mauna_kea"), +    ("event1549", "object", "aegir"), +    ("event1549", "subject", "science_team_4"), +    ("event1549", "type", "discover_ev"), +    ("event1549", "with_implement", "subaru_reflector_telescope"), +    ("event1549", "year", "2004"), +    ("event1550", "location", "mauna_kea"), +    ("event1550", "object", "bebhionn"), +    ("event1550", "subject", "science_team_4"), +    ("event1550", "type", "discover_ev"), +    ("event1550", "with_implement", "subaru_reflector_telescope"), +    ("event1550", "year", "2004"), +    ("event1551", "location", "mauna_kea"), +    ("event1551", "object", "bergelmir"), +    ("event1551", "subject", "science_team_4"), +    ("event1551", "type", "discover_ev"), +    ("event1551", "with_implement", "subaru_reflector_telescope"), +    ("event1551", "year", "2004"), +    ("event1552", "location", "mauna_kea"), +    ("event1552", "object", "bestla"), +    ("event1552", "subject", "science_team_4"), +    ("event1552", "type", "discover_ev"), +    ("event1552", "with_implement", "subaru_reflector_telescope"), +    ("event1552", "year", "2004"), +    ("event1553", "location", "mauna_kea"), +    ("event1553", "object", "farbauti"), +    ("event1553", "subject", "science_team_4"), +    ("event1553", "type", "discover_ev"), +    ("event1553", "with_implement", "subaru_reflector_telescope"), +    ("event1553", "year", "2004"), +    ("event1554", "location", "mauna_kea"), +    ("event1554", "object", "fenrir"), +    ("event1554", "subject", "science_team_4"), +    ("event1554", "type", "discover_ev"), +    ("event1554", "with_implement", "subaru_reflector_telescope"), +    ("event1554", "year", "2004"), +    ("event1555", "location", "mauna_kea"), +    ("event1555", "object", "fornjot"), +    ("event1555", "subject", "science_team_4"), +    ("event1555", "type", "discover_ev"), +    ("event1555", "with_implement", "subaru_reflector_telescope"), +    ("event1555", "year", "2004"), +    ("event1556", "location", "mauna_kea"), +    ("event1556", "object", "hati"), +    ("event1556", "subject", "science_team_4"), +    ("event1556", "type", "discover_ev"), +    ("event1556", "with_implement", "subaru_reflector_telescope"), +    ("event1556", "year", "2004"), +    ("event1557", "location", "mauna_kea"), +    ("event1557", "object", "hyrrokkin"), +    ("event1557", "subject", "science_team_4"), +    ("event1557", "type", "discover_ev"), +    ("event1557", "with_implement", "subaru_reflector_telescope"), +    ("event1557", "year", "2004"), +    ("event1558", "location", "mauna_kea"), +    ("event1558", "object", "kari"), +    ("event1558", "subject", "science_team_4"), +    ("event1558", "type", "discover_ev"), +    ("event1558", "with_implement", "subaru_reflector_telescope"), +    ("event1558", "year", "2006"), +    ("event1559", "location", "mauna_kea"), +    ("event1559", "object", "loge"), +    ("event1559", "subject", "science_team_4"), +    ("event1559", "type", "discover_ev"), +    ("event1559", "with_implement", "subaru_reflector_telescope"), +    ("event1559", "year", "2006"), +    ("event1560", "location", "mauna_kea"), +    ("event1560", "object", "skoll"), +    ("event1560", "subject", "science_team_4"), +    ("event1560", "type", "discover_ev"), +    ("event1560", "with_implement", "subaru_reflector_telescope"), +    ("event1560", "year", "2006"), +    ("event1561", "location", "mauna_kea"), +    ("event1561", "object", "surtur"), +    ("event1561", "subject", "science_team_4"), +    ("event1561", "type", "discover_ev"), +    ("event1561", "with_implement", "subaru_reflector_telescope"), +    ("event1561", "year", "2006"), +    ("event1562", "object", "anthe"), +    ("event1562", "subject", "cassini_imaging_science_team"), +    ("event1562", "type", "discover_ev"), +    ("event1562", "with_implement", "cassini"), +    ("event1562", "year", "2007"), +    ("event1563", "location", "mauna_kea"), +    ("event1563", "object", "jarnsaxa"), +    ("event1563", "subject", "science_team_4"), +    ("event1563", "type", "discover_ev"), +    ("event1563", "with_implement", "subaru_reflector_telescope"), +    ("event1563", "year", "2006"), +    ("event1564", "location", "mauna_kea"), +    ("event1564", "object", "greip"), +    ("event1564", "subject", "science_team_4"), +    ("event1564", "type", "discover_ev"), +    ("event1564", "with_implement", "subaru_reflector_telescope"), +    ("event1564", "year", "2006"), +    ("event1565", "location", "mauna_kea"), +    ("event1565", "object", "tarqeq"), +    ("event1565", "subject", "science_team_4"), +    ("event1565", "type", "discover_ev"), +    ("event1565", "with_implement", "subaru_reflector_telescope"), +    ("event1565", "year", "2007"), +    ("event1566", "object", "aegaeon"), +    ("event1566", "subject", "cassini_imaging_science_team"), +    ("event1566", "type", "discover_ev"), +    ("event1566", "with_implement", "cassini"), +    ("event1566", "year", "2008"), +    ("event1567", "object", "cordelia"), +    ("event1567", "subject", "voyager_science_team"), +    ("event1567", "type", "discover_ev"), +    ("event1567", "with_implement", "voyager_2"), +    ("event1567", "year", "1986"), +    ("event1568", "object", "ophelia"), +    ("event1568", "subject", "voyager_science_team"), +    ("event1568", "type", "discover_ev"), +    ("event1568", "with_implement", "voyager_2"), +    ("event1568", "year", "1986"), +    ("event1569", "object", "bianca"), +    ("event1569", "subject", "voyager_science_team"), +    ("event1569", "type", "discover_ev"), +    ("event1569", "with_implement", "voyager_2"), +    ("event1569", "year", "1986"), +    ("event1570", "object", "cressida"), +    ("event1570", "subject", "voyager_science_team"), +    ("event1570", "type", "discover_ev"), +    ("event1570", "with_implement", "voyager_2"), +    ("event1570", "year", "1986"), +    ("event1571", "object", "desdemona"), +    ("event1571", "subject", "voyager_science_team"), +    ("event1571", "type", "discover_ev"), +    ("event1571", "with_implement", "voyager_2"), +    ("event1571", "year", "1986"), +    ("event1572", "object", "juliet"), +    ("event1572", "subject", "voyager_science_team"), +    ("event1572", "type", "discover_ev"), +    ("event1572", "with_implement", "voyager_2"), +    ("event1572", "year", "1986"), +    ("event1573", "object", "portia"), +    ("event1573", "subject", "voyager_science_team"), +    ("event1573", "type", "discover_ev"), +    ("event1573", "with_implement", "voyager_2"), +    ("event1573", "year", "1986"), +    ("event1574", "object", "rosalind"), +    ("event1574", "subject", "voyager_science_team"), +    ("event1574", "type", "discover_ev"), +    ("event1574", "with_implement", "voyager_2"), +    ("event1574", "year", "1986"), +    ("event1575", "object", "belinda"), +    ("event1575", "subject", "voyager_science_team"), +    ("event1575", "type", "discover_ev"), +    ("event1575", "with_implement", "voyager_2"), +    ("event1575", "year", "1986"), +    ("event1576", "object", "puck"), +    ("event1576", "subject", "voyager_science_team"), +    ("event1576", "type", "discover_ev"), +    ("event1576", "with_implement", "voyager_2"), +    ("event1576", "year", "1985"), +    ("event1577", "location", "mt_palomar"), +    ("event1577", "object", "caliban"), +    ("event1577", "subject", "science_team_12"), +    ("event1577", "type", "discover_ev"), +    ("event1577", "with_implement", "hale_telescope"), +    ("event1577", "year", "1997"), +    ("event1578", "location", "mt_palomar"), +    ("event1578", "object", "sycorax"), +    ("event1578", "subject", "science_team_12"), +    ("event1578", "type", "discover_ev"), +    ("event1578", "with_implement", "hale_telescope"), +    ("event1578", "year", "1997"), +    ("event1579", "location", "mauna_kea"), +    ("event1579", "object", "prospero"), +    ("event1579", "subject", "science_team_13"), +    ("event1579", "type", "discover_ev"), +    ("event1579", "with_implement", "canada-france-hawaii_telescope"), +    ("event1579", "year", "1999"), +    ("event1580", "location", "mauna_kea"), +    ("event1580", "object", "setebos"), +    ("event1580", "subject", "science_team_13"), +    ("event1580", "type", "discover_ev"), +    ("event1580", "with_implement", "canada-france-hawaii_telescope"), +    ("event1580", "year", "1999"), +    ("event1581", "location", "mauna_kea"), +    ("event1581", "object", "stephano"), +    ("event1581", "subject", "science_team_13"), +    ("event1581", "type", "discover_ev"), +    ("event1581", "with_implement", "canada-france-hawaii_telescope"), +    ("event1581", "year", "1999"), +    ("event1582", "location", "cerro_tololo"), +    ("event1582", "object", "trinculo"), +    ("event1582", "subject", "science_team_14"), +    ("event1582", "type", "discover_ev"), +    ("event1582", "with_implement", "reflector_telescope_4"), +    ("event1582", "year", "2001"), +    ("event1583", "location", "cerro_tololo"), +    ("event1583", "object", "francisco"), +    ("event1583", "subject", "science_team_15"), +    ("event1583", "type", "discover_ev"), +    ("event1583", "with_implement", "reflector_telescope_4"), +    ("event1583", "year", "2001"), +    ("event1584", "location", "mauna_kea"), +    ("event1584", "object", "margaret"), +    ("event1584", "subject", "science_team_16"), +    ("event1584", "type", "discover_ev"), +    ("event1584", "with_implement", "subaru_reflector_telescope"), +    ("event1584", "year", "2003"), +    ("event1585", "location", "cerro_tololo"), +    ("event1585", "object", "ferdinand"), +    ("event1585", "subject", "science_team_15"), +    ("event1585", "type", "discover_ev"), +    ("event1585", "with_implement", "reflector_telescope_4"), +    ("event1585", "year", "2001"), +    ("event1586", "object", "perdita"), +    ("event1586", "subject", "karkoschka"), +    ("event1586", "type", "discover_ev"), +    ("event1586", "with_implement", "voyager_2"), +    ("event1586", "year", "1986"), +    ("event1587", "object", "mab"), +    ("event1587", "subject", "science_team_17"), +    ("event1587", "type", "discover_ev"), +    ("event1587", "with_implement", "hubble_space_telescope"), +    ("event1587", "year", "2003"), +    ("event1588", "object", "cupid"), +    ("event1588", "subject", "science_team_17"), +    ("event1588", "type", "discover_ev"), +    ("event1588", "with_implement", "hubble_space_telescope"), +    ("event1588", "year", "2003"), +    ("event1589", "location", "liverpool"), +    ("event1589", "object", "triton"), +    ("event1589", "subject", "lassell"), +    ("event1589", "type", "discover_ev"), +    ("event1589", "with_implement", "reflector_telescope_3"), +    ("event1589", "year", "1846"), +    ("event1590", "object", "naiad"), +    ("event1590", "subject", "voyager_science_team"), +    ("event1590", "type", "discover_ev"), +    ("event1590", "with_implement", "voyager_2"), +    ("event1590", "year", "1989"), +    ("event1591", "object", "thalassa"), +    ("event1591", "subject", "voyager_science_team"), +    ("event1591", "type", "discover_ev"), +    ("event1591", "with_implement", "voyager_2"), +    ("event1591", "year", "1989"), +    ("event1592", "object", "despina"), +    ("event1592", "subject", "voyager_science_team"), +    ("event1592", "type", "discover_ev"), +    ("event1592", "with_implement", "voyager_2"), +    ("event1592", "year", "1989"), +    ("event1593", "object", "galatea"), +    ("event1593", "subject", "voyager_science_team"), +    ("event1593", "type", "discover_ev"), +    ("event1593", "with_implement", "voyager_2"), +    ("event1593", "year", "1989"), +    ("event1594", "object", "larissa"), +    ("event1594", "subject", "voyager_science_team"), +    ("event1594", "type", "discover_ev"), +    ("event1594", "with_implement", "voyager_2"), +    ("event1594", "year", "1989"), +    ("event1595", "object", "proteus"), +    ("event1595", "subject", "voyager_science_team"), +    ("event1595", "type", "discover_ev"), +    ("event1595", "with_implement", "voyager_2"), +    ("event1595", "year", "1989"), +    ("event1596", "location", "cerro_tololo"), +    ("event1596", "object", "halimede"), +    ("event1596", "subject", "science_team_18"), +    ("event1596", "type", "discover_ev"), +    ("event1596", "with_implement", "blanco_telescope"), +    ("event1596", "with_implement", "canada-france-hawaii_telescope"), +    ("event1596", "year", "2002"), +    ("event1597", "location", "mauna_kea"), +    ("event1597", "object", "psamathe"), +    ("event1597", "subject", "science_team_4"), +    ("event1597", "type", "discover_ev"), +    ("event1597", "with_implement", "subaru_reflector_telescope"), +    ("event1597", "year", "2003"), +    ("event1598", "location", "cerro_tololo"), +    ("event1598", "object", "sao"), +    ("event1598", "subject", "science_team_18"), +    ("event1598", "type", "discover_ev"), +    ("event1598", "with_implement", "blanco_telescope"), +    ("event1598", "with_implement", "canada-france-hawaii_telescope"), +    ("event1598", "year", "2002"), +    ("event1599", "location", "cerro_tololo"), +    ("event1599", "object", "laomedeia"), +    ("event1599", "subject", "science_team_18"), +    ("event1599", "type", "discover_ev"), +    ("event1599", "with_implement", "blanco_telescope"), +    ("event1599", "with_implement", "canada-france-hawaii_telescope"), +    ("event1599", "year", "2002"), +    ("event1600", "location", "cerro_tololo"), +    ("event1600", "object", "neso"), +    ("event1600", "subject", "science_team_18"), +    ("event1600", "type", "discover_ev"), +    ("event1600", "with_implement", "blanco_telescope"), +    ("event1600", "year", "2002"), +    ("event1601", "location", "flagstaff"), +    ("event1601", "object", "charon"), +    ("event1601", "subject", "christy"), +    ("event1601", "type", "discover_ev"), +    ("event1601", "year", "1978"), +    ("event1602", "object", "nix"), +    ("event1602", "subject", "science_team_19"), +    ("event1602", "type", "discover_ev"), +    ("event1602", "with_implement", "hubble_space_telescope"), +    ("event1602", "year", "2005"), +    ("event1603", "object", "hydra"), +    ("event1603", "subject", "science_team_19"), +    ("event1603", "type", "discover_ev"), +    ("event1603", "with_implement", "hubble_space_telescope"), +    ("event1603", "year", "2005"), +    ("event1604", "object", "kerberos"), +    ("event1604", "subject", "science_team_20"), +    ("event1604", "type", "discover_ev"), +    ("event1604", "with_implement", "hubble_space_telescope"), +    ("event1604", "year", "2011"), +    ("event1605", "object", "styx"), +    ("event1605", "subject", "science_team_21"), +    ("event1605", "type", "discover_ev"), +    ("event1605", "with_implement", "hubble_space_telescope"), +    ("event1605", "year", "2012"), +    ("event1606", "object", "moon"), +    ("event1606", "subject", "adrastea"), +    ("event1606", "type", "membership"), +    ("event1607", "object", "moon"), +    ("event1607", "subject", "metis"), +    ("event1607", "type", "membership"), +    ("event1608", "object", "moon"), +    ("event1608", "subject", "callirrhoe"), +    ("event1608", "type", "membership"), +    ("event1609", "object", "moon"), +    ("event1609", "subject", "themisto"), +    ("event1609", "type", "membership"), +    ("event1610", "object", "moon"), +    ("event1610", "subject", "megaclite"), +    ("event1610", "type", "membership"), +    ("event1611", "object", "moon"), +    ("event1611", "subject", "taygete"), +    ("event1611", "type", "membership"), +    ("event1612", "object", "moon"), +    ("event1612", "subject", "chaldene"), +    ("event1612", "type", "membership"), +    ("event1613", "object", "moon"), +    ("event1613", "subject", "harpalyke"), +    ("event1613", "type", "membership"), +    ("event1614", "object", "moon"), +    ("event1614", "subject", "kalyke"), +    ("event1614", "type", "membership"), +    ("event1615", "object", "moon"), +    ("event1615", "subject", "iocaste"), +    ("event1615", "type", "membership"), +    ("event1616", "object", "moon"), +    ("event1616", "subject", "erinome"), +    ("event1616", "type", "membership"), +    ("event1617", "object", "moon"), +    ("event1617", "subject", "isonoe"), +    ("event1617", "type", "membership"), +    ("event1618", "object", "moon"), +    ("event1618", "subject", "praxidike"), +    ("event1618", "type", "membership"), +    ("event1619", "object", "moon"), +    ("event1619", "subject", "autonoe"), +    ("event1619", "type", "membership"), +    ("event1620", "object", "moon"), +    ("event1620", "subject", "thyone"), +    ("event1620", "type", "membership"), +    ("event1621", "object", "moon"), +    ("event1621", "subject", "hermippe"), +    ("event1621", "type", "membership"), +    ("event1622", "object", "moon"), +    ("event1622", "subject", "aitne"), +    ("event1622", "type", "membership"), +    ("event1623", "object", "moon"), +    ("event1623", "subject", "eurydome"), +    ("event1623", "type", "membership"), +    ("event1624", "object", "moon"), +    ("event1624", "subject", "euanthe"), +    ("event1624", "type", "membership"), +    ("event1625", "object", "moon"), +    ("event1625", "subject", "euporie"), +    ("event1625", "type", "membership"), +    ("event1626", "object", "moon"), +    ("event1626", "subject", "orthosie"), +    ("event1626", "type", "membership"), +    ("event1627", "object", "moon"), +    ("event1627", "subject", "sponde"), +    ("event1627", "type", "membership"), +    ("event1628", "object", "moon"), +    ("event1628", "subject", "kale"), +    ("event1628", "type", "membership"), +    ("event1629", "object", "moon"), +    ("event1629", "subject", "pasithee"), +    ("event1629", "type", "membership"), +    ("event1630", "object", "moon"), +    ("event1630", "subject", "hegemone"), +    ("event1630", "type", "membership"), +    ("event1631", "object", "moon"), +    ("event1631", "subject", "mneme"), +    ("event1631", "type", "membership"), +    ("event1632", "object", "moon"), +    ("event1632", "subject", "aoede"), +    ("event1632", "type", "membership"), +    ("event1633", "object", "moon"), +    ("event1633", "subject", "thelxinoe"), +    ("event1633", "type", "membership"), +    ("event1634", "object", "moon"), +    ("event1634", "subject", "arche"), +    ("event1634", "type", "membership"), +    ("event1635", "object", "moon"), +    ("event1635", "subject", "kallichore"), +    ("event1635", "type", "membership"), +    ("event1636", "object", "moon"), +    ("event1636", "subject", "helike"), +    ("event1636", "type", "membership"), +    ("event1637", "object", "moon"), +    ("event1637", "subject", "carpo"), +    ("event1637", "type", "membership"), +    ("event1638", "object", "moon"), +    ("event1638", "subject", "eukelade"), +    ("event1638", "type", "membership"), +    ("event1639", "object", "moon"), +    ("event1639", "subject", "cyllene"), +    ("event1639", "type", "membership"), +    ("event1640", "object", "moon"), +    ("event1640", "subject", "kore"), +    ("event1640", "type", "membership"), +    ("event1641", "object", "moon"), +    ("event1641", "subject", "herse"), +    ("event1641", "type", "membership"), +    ("event1642", "object", "moon"), +    ("event1642", "subject", "helene"), +    ("event1642", "type", "membership"), +    ("event1643", "object", "moon"), +    ("event1643", "subject", "telesto"), +    ("event1643", "type", "membership"), +    ("event1644", "object", "moon"), +    ("event1644", "subject", "calypso"), +    ("event1644", "type", "membership"), +    ("event1645", "object", "moon"), +    ("event1645", "subject", "atlas"), +    ("event1645", "type", "membership"), +    ("event1646", "object", "moon"), +    ("event1646", "subject", "prometheus"), +    ("event1646", "type", "membership"), +    ("event1647", "object", "moon"), +    ("event1647", "subject", "pandora"), +    ("event1647", "type", "membership"), +    ("event1648", "object", "moon"), +    ("event1648", "subject", "pan"), +    ("event1648", "type", "membership"), +    ("event1649", "object", "moon"), +    ("event1649", "subject", "ymir"), +    ("event1649", "type", "membership"), +    ("event1650", "object", "moon"), +    ("event1650", "subject", "paaliaq"), +    ("event1650", "type", "membership"), +    ("event1651", "object", "moon"), +    ("event1651", "subject", "tarvos"), +    ("event1651", "type", "membership"), +    ("event1652", "object", "moon"), +    ("event1652", "subject", "ijiraq"), +    ("event1652", "type", "membership"), +    ("event1653", "object", "moon"), +    ("event1653", "subject", "suttungr"), +    ("event1653", "type", "membership"), +    ("event1654", "object", "moon"), +    ("event1654", "subject", "kiviuq"), +    ("event1654", "type", "membership"), +    ("event1655", "object", "moon"), +    ("event1655", "subject", "mundilfari"), +    ("event1655", "type", "membership"), +    ("event1656", "object", "moon"), +    ("event1656", "subject", "albiorix"), +    ("event1656", "type", "membership"), +    ("event1657", "object", "moon"), +    ("event1657", "subject", "skathi"), +    ("event1657", "type", "membership"), +    ("event1658", "object", "moon"), +    ("event1658", "subject", "erriapus"), +    ("event1658", "type", "membership"), +    ("event1659", "object", "moon"), +    ("event1659", "subject", "siarnaq"), +    ("event1659", "type", "membership"), +    ("event1660", "object", "moon"), +    ("event1660", "subject", "thrymr"), +    ("event1660", "type", "membership"), +    ("event1661", "object", "moon"), +    ("event1661", "subject", "narvi"), +    ("event1661", "type", "membership"), +    ("event1662", "object", "moon"), +    ("event1662", "subject", "methone"), +    ("event1662", "type", "membership"), +    ("event1663", "object", "moon"), +    ("event1663", "subject", "pallene"), +    ("event1663", "type", "membership"), +    ("event1664", "object", "moon"), +    ("event1664", "subject", "polydeuces"), +    ("event1664", "type", "membership"), +    ("event1665", "object", "moon"), +    ("event1665", "subject", "daphnis"), +    ("event1665", "type", "membership"), +    ("event1666", "object", "moon"), +    ("event1666", "subject", "aegir"), +    ("event1666", "type", "membership"), +    ("event1667", "object", "moon"), +    ("event1667", "subject", "bebhionn"), +    ("event1667", "type", "membership"), +    ("event1668", "object", "moon"), +    ("event1668", "subject", "bergelmir"), +    ("event1668", "type", "membership"), +    ("event1669", "object", "moon"), +    ("event1669", "subject", "bestla"), +    ("event1669", "type", "membership"), +    ("event1670", "object", "moon"), +    ("event1670", "subject", "farbauti"), +    ("event1670", "type", "membership"), +    ("event1671", "object", "moon"), +    ("event1671", "subject", "fenrir"), +    ("event1671", "type", "membership"), +    ("event1672", "object", "moon"), +    ("event1672", "subject", "fornjot"), +    ("event1672", "type", "membership"), +    ("event1673", "object", "moon"), +    ("event1673", "subject", "hati"), +    ("event1673", "type", "membership"), +    ("event1674", "object", "moon"), +    ("event1674", "subject", "hyrrokkin"), +    ("event1674", "type", "membership"), +    ("event1675", "object", "moon"), +    ("event1675", "subject", "kari"), +    ("event1675", "type", "membership"), +    ("event1676", "object", "moon"), +    ("event1676", "subject", "loge"), +    ("event1676", "type", "membership"), +    ("event1677", "object", "moon"), +    ("event1677", "subject", "skoll"), +    ("event1677", "type", "membership"), +    ("event1678", "object", "moon"), +    ("event1678", "subject", "surtur"), +    ("event1678", "type", "membership"), +    ("event1679", "object", "moon"), +    ("event1679", "subject", "anthe"), +    ("event1679", "type", "membership"), +    ("event1680", "object", "moon"), +    ("event1680", "subject", "jarnsaxa"), +    ("event1680", "type", "membership"), +    ("event1681", "object", "moon"), +    ("event1681", "subject", "greip"), +    ("event1681", "type", "membership"), +    ("event1682", "object", "moon"), +    ("event1682", "subject", "tarqeq"), +    ("event1682", "type", "membership"), +    ("event1683", "object", "moon"), +    ("event1683", "subject", "aegaeon"), +    ("event1683", "type", "membership"), +    ("event1684", "object", "moon"), +    ("event1684", "subject", "cordelia"), +    ("event1684", "type", "membership"), +    ("event1685", "object", "moon"), +    ("event1685", "subject", "ophelia"), +    ("event1685", "type", "membership"), +    ("event1686", "object", "moon"), +    ("event1686", "subject", "bianca"), +    ("event1686", "type", "membership"), +    ("event1687", "object", "moon"), +    ("event1687", "subject", "cressida"), +    ("event1687", "type", "membership"), +    ("event1688", "object", "moon"), +    ("event1688", "subject", "desdemona"), +    ("event1688", "type", "membership"), +    ("event1689", "object", "moon"), +    ("event1689", "subject", "juliet"), +    ("event1689", "type", "membership"), +    ("event1690", "object", "moon"), +    ("event1690", "subject", "portia"), +    ("event1690", "type", "membership"), +    ("event1691", "object", "moon"), +    ("event1691", "subject", "rosalind"), +    ("event1691", "type", "membership"), +    ("event1692", "object", "moon"), +    ("event1692", "subject", "belinda"), +    ("event1692", "type", "membership"), +    ("event1693", "object", "moon"), +    ("event1693", "subject", "puck"), +    ("event1693", "type", "membership"), +    ("event1694", "object", "moon"), +    ("event1694", "subject", "caliban"), +    ("event1694", "type", "membership"), +    ("event1695", "object", "moon"), +    ("event1695", "subject", "sycorax"), +    ("event1695", "type", "membership"), +    ("event1696", "object", "moon"), +    ("event1696", "subject", "prospero"), +    ("event1696", "type", "membership"), +    ("event1697", "object", "moon"), +    ("event1697", "subject", "setebos"), +    ("event1697", "type", "membership"), +    ("event1698", "object", "moon"), +    ("event1698", "subject", "stephano"), +    ("event1698", "type", "membership"), +    ("event1699", "object", "moon"), +    ("event1699", "subject", "trinculo"), +    ("event1699", "type", "membership"), +    ("event1700", "object", "moon"), +    ("event1700", "subject", "francisco"), +    ("event1700", "type", "membership"), +    ("event1701", "object", "moon"), +    ("event1701", "subject", "margaret"), +    ("event1701", "type", "membership"), +    ("event1702", "object", "moon"), +    ("event1702", "subject", "ferdinand"), +    ("event1702", "type", "membership"), +    ("event1703", "object", "moon"), +    ("event1703", "subject", "perdita"), +    ("event1703", "type", "membership"), +    ("event1704", "object", "moon"), +    ("event1704", "subject", "mab"), +    ("event1704", "type", "membership"), +    ("event1705", "object", "moon"), +    ("event1705", "subject", "cupid"), +    ("event1705", "type", "membership"), +    ("event1707", "object", "moon"), +    ("event1707", "subject", "naiad"), +    ("event1707", "type", "membership"), +    ("event1708", "object", "moon"), +    ("event1708", "subject", "thalassa"), +    ("event1708", "type", "membership"), +    ("event1709", "object", "moon"), +    ("event1709", "subject", "despina"), +    ("event1709", "type", "membership"), +    ("event1710", "object", "moon"), +    ("event1710", "subject", "galatea"), +    ("event1710", "type", "membership"), +    ("event1711", "object", "moon"), +    ("event1711", "subject", "larissa"), +    ("event1711", "type", "membership"), +    ("event1712", "object", "moon"), +    ("event1712", "subject", "proteus"), +    ("event1712", "type", "membership"), +    ("event1713", "object", "moon"), +    ("event1713", "subject", "halimede"), +    ("event1713", "type", "membership"), +    ("event1714", "object", "moon"), +    ("event1714", "subject", "psamathe"), +    ("event1714", "type", "membership"), +    ("event1715", "object", "moon"), +    ("event1715", "subject", "sao"), +    ("event1715", "type", "membership"), +    ("event1716", "object", "moon"), +    ("event1716", "subject", "laomedeia"), +    ("event1716", "type", "membership"), +    ("event1717", "object", "moon"), +    ("event1717", "subject", "neso"), +    ("event1717", "type", "membership"), +    ("event1718", "object", "moon"), +    ("event1718", "subject", "nix"), +    ("event1718", "type", "membership"), +    ("event1719", "object", "moon"), +    ("event1719", "subject", "hydra"), +    ("event1719", "type", "membership"), +    ("event1720", "object", "moon"), +    ("event1720", "subject", "kerberos"), +    ("event1720", "type", "membership"), +    ("event1721", "object", "moon"), +    ("event1721", "subject", "styx"), +    ("event1721", "type", "membership"), +    ("event1722", "object", "spin"), +    ("event1722", "subject", "adrastea"), +    ("event1722", "type", "membership"), +    ("event1723", "object", "spin"), +    ("event1723", "subject", "metis"), +    ("event1723", "type", "membership"), +    ("event1724", "object", "spin"), +    ("event1724", "subject", "callirrhoe"), +    ("event1724", "type", "membership"), +    ("event1725", "object", "spin"), +    ("event1725", "subject", "themisto"), +    ("event1725", "type", "membership"), +    ("event1726", "object", "spin"), +    ("event1726", "subject", "megaclite"), +    ("event1726", "type", "membership"), +    ("event1727", "object", "spin"), +    ("event1727", "subject", "taygete"), +    ("event1727", "type", "membership"), +    ("event1728", "object", "spin"), +    ("event1728", "subject", "chaldene"), +    ("event1728", "type", "membership"), +    ("event1729", "object", "spin"), +    ("event1729", "subject", "harpalyke"), +    ("event1729", "type", "membership"), +    ("event1730", "object", "spin"), +    ("event1730", "subject", "kalyke"), +    ("event1730", "type", "membership"), +    ("event1731", "object", "spin"), +    ("event1731", "subject", "iocaste"), +    ("event1731", "type", "membership"), +    ("event1732", "object", "spin"), +    ("event1732", "subject", "erinome"), +    ("event1732", "type", "membership"), +    ("event1733", "object", "spin"), +    ("event1733", "subject", "isonoe"), +    ("event1733", "type", "membership"), +    ("event1734", "object", "spin"), +    ("event1734", "subject", "praxidike"), +    ("event1734", "type", "membership"), +    ("event1735", "object", "spin"), +    ("event1735", "subject", "autonoe"), +    ("event1735", "type", "membership"), +    ("event1736", "object", "spin"), +    ("event1736", "subject", "thyone"), +    ("event1736", "type", "membership"), +    ("event1737", "object", "spin"), +    ("event1737", "subject", "hermippe"), +    ("event1737", "type", "membership"), +    ("event1738", "object", "spin"), +    ("event1738", "subject", "aitne"), +    ("event1738", "type", "membership"), +    ("event1739", "object", "spin"), +    ("event1739", "subject", "eurydome"), +    ("event1739", "type", "membership"), +    ("event1740", "object", "spin"), +    ("event1740", "subject", "euanthe"), +    ("event1740", "type", "membership"), +    ("event1741", "object", "spin"), +    ("event1741", "subject", "euporie"), +    ("event1741", "type", "membership"), +    ("event1742", "object", "spin"), +    ("event1742", "subject", "orthosie"), +    ("event1742", "type", "membership"), +    ("event1743", "object", "spin"), +    ("event1743", "subject", "sponde"), +    ("event1743", "type", "membership"), +    ("event1744", "object", "spin"), +    ("event1744", "subject", "kale"), +    ("event1744", "type", "membership"), +    ("event1745", "object", "spin"), +    ("event1745", "subject", "pasithee"), +    ("event1745", "type", "membership"), +    ("event1746", "object", "spin"), +    ("event1746", "subject", "hegemone"), +    ("event1746", "type", "membership"), +    ("event1747", "object", "spin"), +    ("event1747", "subject", "mneme"), +    ("event1747", "type", "membership"), +    ("event1748", "object", "spin"), +    ("event1748", "subject", "aoede"), +    ("event1748", "type", "membership"), +    ("event1749", "object", "spin"), +    ("event1749", "subject", "thelxinoe"), +    ("event1749", "type", "membership"), +    ("event1750", "object", "spin"), +    ("event1750", "subject", "arche"), +    ("event1750", "type", "membership"), +    ("event1751", "object", "spin"), +    ("event1751", "subject", "kallichore"), +    ("event1751", "type", "membership"), +    ("event1752", "object", "spin"), +    ("event1752", "subject", "helike"), +    ("event1752", "type", "membership"), +    ("event1753", "object", "spin"), +    ("event1753", "subject", "carpo"), +    ("event1753", "type", "membership"), +    ("event1754", "object", "spin"), +    ("event1754", "subject", "eukelade"), +    ("event1754", "type", "membership"), +    ("event1755", "object", "spin"), +    ("event1755", "subject", "cyllene"), +    ("event1755", "type", "membership"), +    ("event1756", "object", "spin"), +    ("event1756", "subject", "kore"), +    ("event1756", "type", "membership"), +    ("event1757", "object", "spin"), +    ("event1757", "subject", "herse"), +    ("event1757", "type", "membership"), +    ("event1758", "object", "spin"), +    ("event1758", "subject", "helene"), +    ("event1758", "type", "membership"), +    ("event1759", "object", "spin"), +    ("event1759", "subject", "telesto"), +    ("event1759", "type", "membership"), +    ("event1760", "object", "spin"), +    ("event1760", "subject", "calypso"), +    ("event1760", "type", "membership"), +    ("event1761", "object", "spin"), +    ("event1761", "subject", "atlas"), +    ("event1761", "type", "membership"), +    ("event1762", "object", "spin"), +    ("event1762", "subject", "prometheus"), +    ("event1762", "type", "membership"), +    ("event1763", "object", "spin"), +    ("event1763", "subject", "pandora"), +    ("event1763", "type", "membership"), +    ("event1764", "object", "spin"), +    ("event1764", "subject", "pan"), +    ("event1764", "type", "membership"), +    ("event1765", "object", "spin"), +    ("event1765", "subject", "ymir"), +    ("event1765", "type", "membership"), +    ("event1766", "object", "spin"), +    ("event1766", "subject", "paaliaq"), +    ("event1766", "type", "membership"), +    ("event1767", "object", "spin"), +    ("event1767", "subject", "tarvos"), +    ("event1767", "type", "membership"), +    ("event1768", "object", "spin"), +    ("event1768", "subject", "ijiraq"), +    ("event1768", "type", "membership"), +    ("event1769", "object", "spin"), +    ("event1769", "subject", "suttungr"), +    ("event1769", "type", "membership"), +    ("event1770", "object", "spin"), +    ("event1770", "subject", "kiviuq"), +    ("event1770", "type", "membership"), +    ("event1771", "object", "spin"), +    ("event1771", "subject", "mundilfari"), +    ("event1771", "type", "membership"), +    ("event1772", "object", "spin"), +    ("event1772", "subject", "albiorix"), +    ("event1772", "type", "membership"), +    ("event1773", "object", "spin"), +    ("event1773", "subject", "skathi"), +    ("event1773", "type", "membership"), +    ("event1774", "object", "spin"), +    ("event1774", "subject", "erriapus"), +    ("event1774", "type", "membership"), +    ("event1775", "object", "spin"), +    ("event1775", "subject", "siarnaq"), +    ("event1775", "type", "membership"), +    ("event1776", "object", "spin"), +    ("event1776", "subject", "thrymr"), +    ("event1776", "type", "membership"), +    ("event1777", "object", "spin"), +    ("event1777", "subject", "narvi"), +    ("event1777", "type", "membership"), +    ("event1778", "object", "spin"), +    ("event1778", "subject", "methone"), +    ("event1778", "type", "membership"), +    ("event1779", "object", "spin"), +    ("event1779", "subject", "pallene"), +    ("event1779", "type", "membership"), +    ("event1780", "object", "spin"), +    ("event1780", "subject", "polydeuces"), +    ("event1780", "type", "membership"), +    ("event1781", "object", "spin"), +    ("event1781", "subject", "daphnis"), +    ("event1781", "type", "membership"), +    ("event1782", "object", "spin"), +    ("event1782", "subject", "aegir"), +    ("event1782", "type", "membership"), +    ("event1783", "object", "spin"), +    ("event1783", "subject", "bebhionn"), +    ("event1783", "type", "membership"), +    ("event1784", "object", "spin"), +    ("event1784", "subject", "bergelmir"), +    ("event1784", "type", "membership"), +    ("event1785", "object", "spin"), +    ("event1785", "subject", "bestla"), +    ("event1785", "type", "membership"), +    ("event1786", "object", "spin"), +    ("event1786", "subject", "farbauti"), +    ("event1786", "type", "membership"), +    ("event1787", "object", "spin"), +    ("event1787", "subject", "fenrir"), +    ("event1787", "type", "membership"), +    ("event1788", "object", "spin"), +    ("event1788", "subject", "fornjot"), +    ("event1788", "type", "membership"), +    ("event1789", "object", "spin"), +    ("event1789", "subject", "hati"), +    ("event1789", "type", "membership"), +    ("event1790", "object", "spin"), +    ("event1790", "subject", "hyrrokkin"), +    ("event1790", "type", "membership"), +    ("event1791", "object", "spin"), +    ("event1791", "subject", "kari"), +    ("event1791", "type", "membership"), +    ("event1792", "object", "spin"), +    ("event1792", "subject", "loge"), +    ("event1792", "type", "membership"), +    ("event1793", "object", "spin"), +    ("event1793", "subject", "skoll"), +    ("event1793", "type", "membership"), +    ("event1794", "object", "spin"), +    ("event1794", "subject", "surtur"), +    ("event1794", "type", "membership"), +    ("event1795", "object", "spin"), +    ("event1795", "subject", "anthe"), +    ("event1795", "type", "membership"), +    ("event1796", "object", "spin"), +    ("event1796", "subject", "jarnsaxa"), +    ("event1796", "type", "membership"), +    ("event1797", "object", "spin"), +    ("event1797", "subject", "greip"), +    ("event1797", "type", "membership"), +    ("event1798", "object", "spin"), +    ("event1798", "subject", "tarqeq"), +    ("event1798", "type", "membership"), +    ("event1799", "object", "spin"), +    ("event1799", "subject", "aegaeon"), +    ("event1799", "type", "membership"), +    ("event1800", "object", "spin"), +    ("event1800", "subject", "cordelia"), +    ("event1800", "type", "membership"), +    ("event1801", "object", "spin"), +    ("event1801", "subject", "ophelia"), +    ("event1801", "type", "membership"), +    ("event1802", "object", "spin"), +    ("event1802", "subject", "bianca"), +    ("event1802", "type", "membership"), +    ("event1803", "object", "spin"), +    ("event1803", "subject", "cressida"), +    ("event1803", "type", "membership"), +    ("event1804", "object", "spin"), +    ("event1804", "subject", "desdemona"), +    ("event1804", "type", "membership"), +    ("event1805", "object", "spin"), +    ("event1805", "subject", "juliet"), +    ("event1805", "type", "membership"), +    ("event1806", "object", "spin"), +    ("event1806", "subject", "portia"), +    ("event1806", "type", "membership"), +    ("event1807", "object", "spin"), +    ("event1807", "subject", "rosalind"), +    ("event1807", "type", "membership"), +    ("event1808", "object", "spin"), +    ("event1808", "subject", "belinda"), +    ("event1808", "type", "membership"), +    ("event1809", "object", "spin"), +    ("event1809", "subject", "puck"), +    ("event1809", "type", "membership"), +    ("event1810", "object", "spin"), +    ("event1810", "subject", "caliban"), +    ("event1810", "type", "membership"), +    ("event1811", "object", "spin"), +    ("event1811", "subject", "sycorax"), +    ("event1811", "type", "membership"), +    ("event1812", "object", "spin"), +    ("event1812", "subject", "prospero"), +    ("event1812", "type", "membership"), +    ("event1813", "object", "spin"), +    ("event1813", "subject", "setebos"), +    ("event1813", "type", "membership"), +    ("event1814", "object", "spin"), +    ("event1814", "subject", "stephano"), +    ("event1814", "type", "membership"), +    ("event1815", "object", "spin"), +    ("event1815", "subject", "trinculo"), +    ("event1815", "type", "membership"), +    ("event1816", "object", "spin"), +    ("event1816", "subject", "francisco"), +    ("event1816", "type", "membership"), +    ("event1817", "object", "spin"), +    ("event1817", "subject", "margaret"), +    ("event1817", "type", "membership"), +    ("event1818", "object", "spin"), +    ("event1818", "subject", "ferdinand"), +    ("event1818", "type", "membership"), +    ("event1819", "object", "spin"), +    ("event1819", "subject", "perdita"), +    ("event1819", "type", "membership"), +    ("event1820", "object", "spin"), +    ("event1820", "subject", "mab"), +    ("event1820", "type", "membership"), +    ("event1821", "object", "spin"), +    ("event1821", "subject", "cupid"), +    ("event1821", "type", "membership"), +    ("event1823", "object", "spin"), +    ("event1823", "subject", "naiad"), +    ("event1823", "type", "membership"), +    ("event1824", "object", "spin"), +    ("event1824", "subject", "thalassa"), +    ("event1824", "type", "membership"), +    ("event1825", "object", "spin"), +    ("event1825", "subject", "despina"), +    ("event1825", "type", "membership"), +    ("event1826", "object", "spin"), +    ("event1826", "subject", "galatea"), +    ("event1826", "type", "membership"), +    ("event1827", "object", "spin"), +    ("event1827", "subject", "larissa"), +    ("event1827", "type", "membership"), +    ("event1828", "object", "spin"), +    ("event1828", "subject", "proteus"), +    ("event1828", "type", "membership"), +    ("event1829", "object", "spin"), +    ("event1829", "subject", "halimede"), +    ("event1829", "type", "membership"), +    ("event1830", "object", "spin"), +    ("event1830", "subject", "psamathe"), +    ("event1830", "type", "membership"), +    ("event1831", "object", "spin"), +    ("event1831", "subject", "sao"), +    ("event1831", "type", "membership"), +    ("event1832", "object", "spin"), +    ("event1832", "subject", "laomedeia"), +    ("event1832", "type", "membership"), +    ("event1833", "object", "spin"), +    ("event1833", "subject", "neso"), +    ("event1833", "type", "membership"), +    ("event1834", "object", "spin"), +    ("event1834", "subject", "nix"), +    ("event1834", "type", "membership"), +    ("event1835", "object", "spin"), +    ("event1835", "subject", "hydra"), +    ("event1835", "type", "membership"), +    ("event1836", "object", "spin"), +    ("event1836", "subject", "kerberos"), +    ("event1836", "type", "membership"), +    ("event1837", "object", "spin"), +    ("event1837", "subject", "styx"), +    ("event1837", "type", "membership"), +    ("event1838", "object", "thing"), +    ("event1838", "subject", "adrastea"), +    ("event1838", "type", "membership"), +    ("event1839", "object", "thing"), +    ("event1839", "subject", "metis"), +    ("event1839", "type", "membership"), +    ("event1840", "object", "thing"), +    ("event1840", "subject", "callirrhoe"), +    ("event1840", "type", "membership"), +    ("event1841", "object", "thing"), +    ("event1841", "subject", "themisto"), +    ("event1841", "type", "membership"), +    ("event1842", "object", "thing"), +    ("event1842", "subject", "megaclite"), +    ("event1842", "type", "membership"), +    ("event1843", "object", "thing"), +    ("event1843", "subject", "taygete"), +    ("event1843", "type", "membership"), +    ("event1844", "object", "thing"), +    ("event1844", "subject", "chaldene"), +    ("event1844", "type", "membership"), +    ("event1845", "object", "thing"), +    ("event1845", "subject", "harpalyke"), +    ("event1845", "type", "membership"), +    ("event1846", "object", "thing"), +    ("event1846", "subject", "kalyke"), +    ("event1846", "type", "membership"), +    ("event1847", "object", "thing"), +    ("event1847", "subject", "iocaste"), +    ("event1847", "type", "membership"), +    ("event1848", "object", "thing"), +    ("event1848", "subject", "erinome"), +    ("event1848", "type", "membership"), +    ("event1849", "object", "thing"), +    ("event1849", "subject", "isonoe"), +    ("event1849", "type", "membership"), +    ("event1850", "object", "thing"), +    ("event1850", "subject", "praxidike"), +    ("event1850", "type", "membership"), +    ("event1851", "object", "thing"), +    ("event1851", "subject", "autonoe"), +    ("event1851", "type", "membership"), +    ("event1852", "object", "thing"), +    ("event1852", "subject", "thyone"), +    ("event1852", "type", "membership"), +    ("event1853", "object", "thing"), +    ("event1853", "subject", "hermippe"), +    ("event1853", "type", "membership"), +    ("event1854", "object", "thing"), +    ("event1854", "subject", "aitne"), +    ("event1854", "type", "membership"), +    ("event1855", "object", "thing"), +    ("event1855", "subject", "eurydome"), +    ("event1855", "type", "membership"), +    ("event1856", "object", "thing"), +    ("event1856", "subject", "euanthe"), +    ("event1856", "type", "membership"), +    ("event1857", "object", "thing"), +    ("event1857", "subject", "euporie"), +    ("event1857", "type", "membership"), +    ("event1858", "object", "thing"), +    ("event1858", "subject", "orthosie"), +    ("event1858", "type", "membership"), +    ("event1859", "object", "thing"), +    ("event1859", "subject", "sponde"), +    ("event1859", "type", "membership"), +    ("event1860", "object", "thing"), +    ("event1860", "subject", "kale"), +    ("event1860", "type", "membership"), +    ("event1861", "object", "thing"), +    ("event1861", "subject", "pasithee"), +    ("event1861", "type", "membership"), +    ("event1862", "object", "thing"), +    ("event1862", "subject", "hegemone"), +    ("event1862", "type", "membership"), +    ("event1863", "object", "thing"), +    ("event1863", "subject", "mneme"), +    ("event1863", "type", "membership"), +    ("event1864", "object", "thing"), +    ("event1864", "subject", "aoede"), +    ("event1864", "type", "membership"), +    ("event1865", "object", "thing"), +    ("event1865", "subject", "thelxinoe"), +    ("event1865", "type", "membership"), +    ("event1866", "object", "thing"), +    ("event1866", "subject", "arche"), +    ("event1866", "type", "membership"), +    ("event1867", "object", "thing"), +    ("event1867", "subject", "kallichore"), +    ("event1867", "type", "membership"), +    ("event1868", "object", "thing"), +    ("event1868", "subject", "helike"), +    ("event1868", "type", "membership"), +    ("event1869", "object", "thing"), +    ("event1869", "subject", "carpo"), +    ("event1869", "type", "membership"), +    ("event1870", "object", "thing"), +    ("event1870", "subject", "eukelade"), +    ("event1870", "type", "membership"), +    ("event1871", "object", "thing"), +    ("event1871", "subject", "cyllene"), +    ("event1871", "type", "membership"), +    ("event1872", "object", "thing"), +    ("event1872", "subject", "kore"), +    ("event1872", "type", "membership"), +    ("event1873", "object", "thing"), +    ("event1873", "subject", "herse"), +    ("event1873", "type", "membership"), +    ("event1874", "object", "thing"), +    ("event1874", "subject", "helene"), +    ("event1874", "type", "membership"), +    ("event1875", "object", "thing"), +    ("event1875", "subject", "telesto"), +    ("event1875", "type", "membership"), +    ("event1876", "object", "thing"), +    ("event1876", "subject", "calypso"), +    ("event1876", "type", "membership"), +    ("event1877", "object", "thing"), +    ("event1877", "subject", "atlas"), +    ("event1877", "type", "membership"), +    ("event1878", "object", "thing"), +    ("event1878", "subject", "prometheus"), +    ("event1878", "type", "membership"), +    ("event1879", "object", "thing"), +    ("event1879", "subject", "pandora"), +    ("event1879", "type", "membership"), +    ("event1880", "object", "thing"), +    ("event1880", "subject", "pan"), +    ("event1880", "type", "membership"), +    ("event1881", "object", "thing"), +    ("event1881", "subject", "ymir"), +    ("event1881", "type", "membership"), +    ("event1882", "object", "thing"), +    ("event1882", "subject", "paaliaq"), +    ("event1882", "type", "membership"), +    ("event1883", "object", "thing"), +    ("event1883", "subject", "tarvos"), +    ("event1883", "type", "membership"), +    ("event1884", "object", "thing"), +    ("event1884", "subject", "ijiraq"), +    ("event1884", "type", "membership"), +    ("event1885", "object", "thing"), +    ("event1885", "subject", "suttungr"), +    ("event1885", "type", "membership"), +    ("event1886", "object", "thing"), +    ("event1886", "subject", "kiviuq"), +    ("event1886", "type", "membership"), +    ("event1887", "object", "thing"), +    ("event1887", "subject", "mundilfari"), +    ("event1887", "type", "membership"), +    ("event1888", "object", "thing"), +    ("event1888", "subject", "albiorix"), +    ("event1888", "type", "membership"), +    ("event1889", "object", "thing"), +    ("event1889", "subject", "skathi"), +    ("event1889", "type", "membership"), +    ("event1890", "object", "thing"), +    ("event1890", "subject", "erriapus"), +    ("event1890", "type", "membership"), +    ("event1891", "object", "thing"), +    ("event1891", "subject", "siarnaq"), +    ("event1891", "type", "membership"), +    ("event1892", "object", "thing"), +    ("event1892", "subject", "thrymr"), +    ("event1892", "type", "membership"), +    ("event1893", "object", "thing"), +    ("event1893", "subject", "narvi"), +    ("event1893", "type", "membership"), +    ("event1894", "object", "thing"), +    ("event1894", "subject", "methone"), +    ("event1894", "type", "membership"), +    ("event1895", "object", "thing"), +    ("event1895", "subject", "pallene"), +    ("event1895", "type", "membership"), +    ("event1896", "object", "thing"), +    ("event1896", "subject", "polydeuces"), +    ("event1896", "type", "membership"), +    ("event1897", "object", "thing"), +    ("event1897", "subject", "daphnis"), +    ("event1897", "type", "membership"), +    ("event1898", "object", "thing"), +    ("event1898", "subject", "aegir"), +    ("event1898", "type", "membership"), +    ("event1899", "object", "thing"), +    ("event1899", "subject", "bebhionn"), +    ("event1899", "type", "membership"), +    ("event1900", "object", "thing"), +    ("event1900", "subject", "bergelmir"), +    ("event1900", "type", "membership"), +    ("event1901", "object", "thing"), +    ("event1901", "subject", "bestla"), +    ("event1901", "type", "membership"), +    ("event1902", "object", "thing"), +    ("event1902", "subject", "farbauti"), +    ("event1902", "type", "membership"), +    ("event1903", "object", "thing"), +    ("event1903", "subject", "fenrir"), +    ("event1903", "type", "membership"), +    ("event1904", "object", "thing"), +    ("event1904", "subject", "fornjot"), +    ("event1904", "type", "membership"), +    ("event1905", "object", "thing"), +    ("event1905", "subject", "hati"), +    ("event1905", "type", "membership"), +    ("event1906", "object", "thing"), +    ("event1906", "subject", "hyrrokkin"), +    ("event1906", "type", "membership"), +    ("event1907", "object", "thing"), +    ("event1907", "subject", "kari"), +    ("event1907", "type", "membership"), +    ("event1908", "object", "thing"), +    ("event1908", "subject", "loge"), +    ("event1908", "type", "membership"), +    ("event1909", "object", "thing"), +    ("event1909", "subject", "skoll"), +    ("event1909", "type", "membership"), +    ("event1910", "object", "thing"), +    ("event1910", "subject", "surtur"), +    ("event1910", "type", "membership"), +    ("event1911", "object", "thing"), +    ("event1911", "subject", "anthe"), +    ("event1911", "type", "membership"), +    ("event1912", "object", "thing"), +    ("event1912", "subject", "jarnsaxa"), +    ("event1912", "type", "membership"), +    ("event1913", "subject", "greip"), +    ("event1914", "object", "thing"), +    ("event1914", "subject", "tarqeq"), +    ("event1914", "type", "membership"), +    ("event1915", "object", "thing"), +    ("event1915", "subject", "aegaeon"), +    ("event1915", "type", "membership"), +    ("event1916", "object", "thing"), +    ("event1916", "subject", "cordelia"), +    ("event1916", "type", "membership"), +    ("event1917", "object", "thing"), +    ("event1917", "subject", "ophelia"), +    ("event1917", "type", "membership"), +    ("event1918", "object", "thing"), +    ("event1918", "subject", "bianca"), +    ("event1918", "type", "membership"), +    ("event1919", "object", "thing"), +    ("event1919", "subject", "cressida"), +    ("event1919", "type", "membership"), +    ("event1920", "object", "thing"), +    ("event1920", "subject", "desdemona"), +    ("event1920", "type", "membership"), +    ("event1921", "object", "thing"), +    ("event1921", "subject", "juliet"), +    ("event1921", "type", "membership"), +    ("event1922", "object", "thing"), +    ("event1922", "subject", "portia"), +    ("event1922", "type", "membership"), +    ("event1923", "object", "thing"), +    ("event1923", "subject", "rosalind"), +    ("event1923", "type", "membership"), +    ("event1924", "object", "thing"), +    ("event1924", "subject", "belinda"), +    ("event1924", "type", "membership"), +    ("event1925", "object", "thing"), +    ("event1925", "subject", "puck"), +    ("event1925", "type", "membership"), +    ("event1926", "object", "thing"), +    ("event1926", "subject", "caliban"), +    ("event1926", "type", "membership"), +    ("event1927", "object", "thing"), +    ("event1927", "subject", "sycorax"), +    ("event1927", "type", "membership"), +    ("event1928", "object", "thing"), +    ("event1928", "subject", "prospero"), +    ("event1928", "type", "membership"), +    ("event1929", "object", "thing"), +    ("event1929", "subject", "setebos"), +    ("event1929", "type", "membership"), +    ("event1930", "object", "thing"), +    ("event1930", "subject", "stephano"), +    ("event1930", "type", "membership"), +    ("event1931", "object", "thing"), +    ("event1931", "subject", "trinculo"), +    ("event1931", "type", "membership"), +    ("event1932", "object", "thing"), +    ("event1932", "subject", "francisco"), +    ("event1932", "type", "membership"), +    ("event1933", "object", "thing"), +    ("event1933", "subject", "margaret"), +    ("event1933", "type", "membership"), +    ("event1934", "object", "thing"), +    ("event1934", "subject", "ferdinand"), +    ("event1934", "type", "membership"), +    ("event1935", "object", "thing"), +    ("event1935", "subject", "perdita"), +    ("event1935", "type", "membership"), +    ("event1936", "object", "thing"), +    ("event1936", "subject", "mab"), +    ("event1936", "type", "membership"), +    ("event1937", "object", "thing"), +    ("event1937", "subject", "cupid"), +    ("event1937", "type", "membership"), +    ("event1939", "object", "thing"), +    ("event1939", "subject", "naiad"), +    ("event1939", "type", "membership"), +    ("event1940", "object", "thing"), +    ("event1940", "subject", "thalassa"), +    ("event1940", "type", "membership"), +    ("event1941", "object", "thing"), +    ("event1941", "subject", "dethinga"), +    ("event1941", "type", "membership"), +    ("event1942", "object", "thing"), +    ("event1942", "subject", "galatea"), +    ("event1942", "type", "membership"), +    ("event1943", "object", "thing"), +    ("event1943", "subject", "larissa"), +    ("event1943", "type", "membership"), +    ("event1944", "object", "thing"), +    ("event1944", "subject", "proteus"), +    ("event1944", "type", "membership"), +    ("event1945", "object", "thing"), +    ("event1945", "subject", "halimede"), +    ("event1945", "type", "membership"), +    ("event1946", "object", "thing"), +    ("event1946", "subject", "psamathe"), +    ("event1946", "type", "membership"), +    ("event1947", "object", "thing"), +    ("event1947", "subject", "sao"), +    ("event1947", "type", "membership"), +    ("event1948", "object", "thing"), +    ("event1948", "subject", "laomedeia"), +    ("event1948", "type", "membership"), +    ("event1949", "object", "thing"), +    ("event1949", "subject", "neso"), +    ("event1949", "type", "membership"), +    ("event1950", "object", "thing"), +    ("event1950", "subject", "nix"), +    ("event1950", "type", "membership"), +    ("event1951", "object", "thing"), +    ("event1951", "subject", "hydra"), +    ("event1951", "type", "membership"), +    ("event1952", "object", "thing"), +    ("event1952", "subject", "kerberos"), +    ("event1952", "type", "membership"), +    ("event1953", "object", "thing"), +    ("event1953", "subject", "styx"), +    ("event1953", "type", "membership"), +    ("event1954", "object", "science_team"), +    ("event1954", "subject", "voyager_science_team"), +    ("event1954", "type", "membership"), +    ("event1955", "object", "science_team"), +    ("event1955", "subject", "cassini_imaging_science_team"), +    ("event1955", "type", "membership"), +    ("event1956", "object", "science_team"), +    ("event1956", "subject", "science_team_1"), +    ("event1956", "type", "membership"), +    ("event1957", "object", "science_team"), +    ("event1957", "subject", "science_team_2"), +    ("event1957", "type", "membership"), +    ("event1958", "object", "science_team"), +    ("event1958", "subject", "science_team_3"), +    ("event1958", "type", "membership"), +    ("event1959", "object", "science_team"), +    ("event1959", "subject", "science_team_4"), +    ("event1959", "type", "membership"), +    ("event1960", "object", "science_team"), +    ("event1960", "subject", "science_team_5"), +    ("event1960", "type", "membership"), +    ("event1961", "object", "science_team"), +    ("event1961", "subject", "science_team_6"), +    ("event1961", "type", "membership"), +    ("event1962", "object", "science_team"), +    ("event1962", "subject", "science_team_7"), +    ("event1962", "type", "membership"), +    ("event1963", "object", "science_team"), +    ("event1963", "subject", "science_team_8"), +    ("event1963", "type", "membership"), +    ("event1964", "object", "science_team"), +    ("event1964", "subject", "science_team_9"), +    ("event1964", "type", "membership"), +    ("event1965", "object", "science_team"), +    ("event1965", "subject", "science_team_10"), +    ("event1965", "type", "membership"), +    ("event1966", "object", "science_team"), +    ("event1966", "subject", "science_team_11"), +    ("event1966", "type", "membership"), +    ("event1967", "object", "science_team"), +    ("event1967", "subject", "science_team_12"), +    ("event1967", "type", "membership"), +    ("event1968", "object", "science_team"), +    ("event1968", "subject", "science_team_13"), +    ("event1968", "type", "membership"), +    ("event1969", "object", "science_team"), +    ("event1969", "subject", "science_team_14"), +    ("event1969", "type", "membership"), +    ("event1970", "object", "science_team"), +    ("event1970", "subject", "science_team_15"), +    ("event1970", "type", "membership"), +    ("event1971", "object", "science_team"), +    ("event1971", "subject", "science_team_16"), +    ("event1971", "type", "membership"), +    ("event1972", "object", "science_team"), +    ("event1972", "subject", "science_team_17"), +    ("event1972", "type", "membership"), +    ("event1973", "object", "science_team"), +    ("event1973", "subject", "science_team_18"), +    ("event1973", "type", "membership"), +    ("event1974", "object", "science_team"), +    ("event1974", "subject", "science_team_19"), +    ("event1974", "type", "membership"), +    ("event1975", "object", "science_team"), +    ("event1975", "subject", "science_team_20"), +    ("event1975", "type", "membership"), +    ("event1976", "object", "science_team"), +    ("event1976", "subject", "science_team_21"), +    ("event1976", "type", "membership"), +    ("event1977", "object", "science_team_1"), +    ("event1977", "subject", "scotti"), +    ("event1977", "type", "membership"), +    ("event1978", "object", "science_team_1"), +    ("event1978", "subject", "spahr"), +    ("event1978", "type", "membership"), +    ("event1979", "object", "science_team_1"), +    ("event1979", "subject", "mcmillan"), +    ("event1979", "type", "membership"), +    ("event1980", "object", "science_team_1"), +    ("event1980", "subject", "larson"), +    ("event1980", "type", "membership"), +    ("event1981", "object", "science_team_1"), +    ("event1981", "subject", "montani"), +    ("event1981", "type", "membership"), +    ("event1982", "object", "science_team_1"), +    ("event1982", "subject", "gleason"), +    ("event1982", "type", "membership"), +    ("event1983", "object", "science_team_1"), +    ("event1983", "subject", "gehrels"), +    ("event1983", "type", "membership"), +    ("event1984", "object", "science_team_2"), +    ("event1984", "subject", "kowal"), +    ("event1984", "type", "membership"), +    ("event1985", "object", "science_team_2"), +    ("event1985", "subject", "roemer"), +    ("event1985", "type", "membership"), +    ("event1986", "object", "science_team_3"), +    ("event1986", "subject", "sheppard"), +    ("event1986", "type", "membership"), +    ("event1987", "object", "science_team_3"), +    ("event1987", "subject", "jewitt"), +    ("event1987", "type", "membership"), +    ("event1988", "object", "science_team_3"), +    ("event1988", "subject", "fernandez"), +    ("event1988", "type", "membership"), +    ("event1989", "object", "science_team_3"), +    ("event1989", "subject", "magnier"), +    ("event1989", "type", "membership"), +    ("event1990", "object", "science_team_4"), +    ("event1990", "subject", "sheppard"), +    ("event1990", "type", "membership"), +    ("event1991", "object", "science_team_4"), +    ("event1991", "subject", "jewitt"), +    ("event1991", "type", "membership"), +    ("event1992", "object", "science_team_4"), +    ("event1992", "subject", "kleyna"), +    ("event1992", "type", "membership"), +    ("event1993", "object", "science_team_5"), +    ("event1993", "subject", "gladman"), +    ("event1993", "type", "membership"), +    ("event1994", "object", "science_team_5"), +    ("event1994", "subject", "allen"), +    ("event1994", "type", "membership"), +    ("event1995", "object", "science_team_6"), +    ("event1995", "subject", "gladman"), +    ("event1995", "type", "membership"), +    ("event1996", "object", "science_team_6"), +    ("event1996", "subject", "kavelaars"), +    ("event1996", "type", "membership"), +    ("event1997", "object", "science_team_6"), +    ("event1997", "subject", "petit"), +    ("event1997", "type", "membership"), +    ("event1998", "object", "science_team_6"), +    ("event1998", "subject", "allen"), +    ("event1998", "type", "membership"), +    ("event1999", "object", "science_team_7"), +    ("event1999", "subject", "fountain"), +    ("event1999", "type", "membership"), +    ("event2001", "object", "science_team_7"), +    ("event2001", "subject", "larson"), +    ("event2001", "type", "membership"), +    ("event2002", "object", "science_team_8"), +    ("event2002", "subject", "laques"), +    ("event2002", "type", "membership"), +    ("event2003", "object", "science_team_8"), +    ("event2003", "subject", "lecacheux"), +    ("event2003", "type", "membership"), +    ("event2004", "object", "science_team_9"), +    ("event2004", "subject", "smith"), +    ("event2004", "type", "membership"), +    ("event2005", "object", "science_team_9"), +    ("event2005", "subject", "reitsema"), +    ("event2005", "type", "membership"), +    ("event2006", "object", "science_team_9"), +    ("event2006", "subject", "larson"), +    ("event2006", "type", "membership"), +    ("event2007", "object", "science_team_9"), +    ("event2007", "subject", "fountain"), +    ("event2007", "type", "membership"), +    ("event2008", "object", "science_team_10"), +    ("event2008", "subject", "pascu"), +    ("event2008", "type", "membership"), +    ("event2009", "object", "science_team_10"), +    ("event2009", "subject", "seidelmann"), +    ("event2009", "type", "membership"), +    ("event2010", "object", "science_team_10"), +    ("event2010", "subject", "baum"), +    ("event2010", "type", "membership"), +    ("event2011", "object", "science_team_10"), +    ("event2011", "subject", "currie"), +    ("event2011", "type", "membership"), +    ("event2012", "object", "science_team_11"), +    ("event2012", "subject", "gladman"), +    ("event2012", "type", "membership"), +    ("event2013", "object", "science_team_11"), +    ("event2013", "subject", "kavelaars"), +    ("event2013", "type", "membership"), +    ("event2014", "object", "science_team_11"), +    ("event2014", "subject", "petit"), +    ("event2014", "type", "membership"), +    ("event2015", "object", "science_team_11"), +    ("event2015", "subject", "scholl"), +    ("event2015", "type", "membership"), +    ("event2016", "object", "science_team_11"), +    ("event2016", "subject", "holman"), +    ("event2016", "type", "membership"), +    ("event2017", "object", "science_team_11"), +    ("event2017", "subject", "marsden"), +    ("event2017", "type", "membership"), +    ("event2018", "object", "science_team_11"), +    ("event2018", "subject", "nicholson"), +    ("event2018", "type", "membership"), +    ("event2019", "object", "science_team_11"), +    ("event2019", "subject", "burns"), +    ("event2019", "type", "membership"), +    ("event2020", "object", "science_team_12"), +    ("event2020", "subject", "gladman"), +    ("event2020", "type", "membership"), +    ("event2021", "object", "science_team_12"), +    ("event2021", "subject", "nicholson"), +    ("event2021", "type", "membership"), +    ("event2022", "object", "science_team_12"), +    ("event2022", "subject", "burns"), +    ("event2022", "type", "membership"), +    ("event2023", "object", "science_team_12"), +    ("event2023", "subject", "kavelaars"), +    ("event2023", "type", "membership"), +    ("event2024", "object", "science_team_13"), +    ("event2024", "subject", "holman"), +    ("event2024", "type", "membership"), +    ("event2025", "object", "science_team_13"), +    ("event2025", "subject", "kavelaars"), +    ("event2025", "type", "membership"), +    ("event2026", "object", "science_team_13"), +    ("event2026", "subject", "gladman"), +    ("event2026", "type", "membership"), +    ("event2027", "object", "science_team_13"), +    ("event2027", "subject", "petit"), +    ("event2027", "type", "membership"), +    ("event2028", "object", "science_team_13"), +    ("event2028", "subject", "scholl"), +    ("event2028", "type", "membership"), +    ("event2029", "object", "science_team_14"), +    ("event2029", "subject", "holman"), +    ("event2029", "type", "membership"), +    ("event2030", "object", "science_team_14"), +    ("event2030", "subject", "kavelaars"), +    ("event2030", "type", "membership"), +    ("event2031", "object", "science_team_14"), +    ("event2031", "subject", "milisavljevic"), +    ("event2031", "type", "membership"), +    ("event2032", "object", "science_team_15"), +    ("event2032", "subject", "kavelaars"), +    ("event2032", "type", "membership"), +    ("event2033", "object", "science_team_15"), +    ("event2033", "subject", "holman"), +    ("event2033", "type", "membership"), +    ("event2034", "object", "science_team_15"), +    ("event2034", "subject", "milisavljevic"), +    ("event2034", "type", "membership"), +    ("event2035", "object", "science_team_15"), +    ("event2035", "subject", "grav"), +    ("event2035", "type", "membership"), +    ("event2036", "object", "science_team_16"), +    ("event2036", "subject", "sheppard"), +    ("event2036", "type", "membership"), +    ("event2037", "object", "science_team_16"), +    ("event2037", "subject", "jewitt"), +    ("event2037", "type", "membership"), +    ("event2038", "object", "science_team_17"), +    ("event2038", "subject", "showalter"), +    ("event2038", "type", "membership"), +    ("event2039", "object", "science_team_17"), +    ("event2039", "subject", "lissauer"), +    ("event2039", "type", "membership"), +    ("event2040", "object", "science_team_18"), +    ("event2040", "subject", "holman"), +    ("event2040", "type", "membership"), +    ("event2041", "object", "science_team_18"), +    ("event2041", "subject", "kavelaars"), +    ("event2041", "type", "membership"), +    ("event2042", "object", "science_team_18"), +    ("event2042", "subject", "grav"), +    ("event2042", "type", "membership"), +    ("event2043", "object", "science_team_18"), +    ("event2043", "subject", "fraser"), +    ("event2043", "type", "membership"), +    ("event2044", "object", "science_team_18"), +    ("event2044", "subject", "milisavljevic"), +    ("event2044", "type", "membership"), +    ("event2045", "object", "science_team_19"), +    ("event2045", "subject", "weaver"), +    ("event2045", "type", "membership"), +    ("event2046", "object", "science_team_19"), +    ("event2046", "subject", "stern"), +    ("event2046", "type", "membership"), +    ("event2047", "object", "science_team_19"), +    ("event2047", "subject", "mutchler"), +    ("event2047", "type", "membership"), +    ("event2048", "object", "science_team_19"), +    ("event2048", "subject", "steffl"), +    ("event2048", "type", "membership"), +    ("event2049", "object", "science_team_19"), +    ("event2049", "subject", "buie"), +    ("event2049", "type", "membership"), +    ("event2050", "object", "science_team_19"), +    ("event2050", "subject", "merline"), +    ("event2050", "type", "membership"), +    ("event2051", "object", "science_team_19"), +    ("event2051", "subject", "spencer"), +    ("event2051", "type", "membership"), +    ("event2052", "object", "science_team_19"), +    ("event2052", "subject", "young_e_f"), +    ("event2052", "type", "membership"), +    ("event2053", "object", "science_team_19"), +    ("event2053", "subject", "young_l_a"), +    ("event2053", "type", "membership"), +    ("event2054", "object", "science_team_20"), +    ("event2054", "subject", "showalter"), +    ("event2054", "type", "membership"), +    ("event2055", "object", "science_team_20"), +    ("event2055", "subject", "hamilton"), +    ("event2055", "type", "membership"), +    ("event2056", "object", "science_team_20"), +    ("event2056", "subject", "stern"), +    ("event2056", "type", "membership"), +    ("event2057", "object", "science_team_20"), +    ("event2057", "subject", "weaver"), +    ("event2057", "type", "membership"), +    ("event2058", "object", "science_team_20"), +    ("event2058", "subject", "steffl"), +    ("event2058", "type", "membership"), +    ("event2059", "object", "science_team_20"), +    ("event2059", "subject", "young_l_a"), +    ("event2059", "type", "membership"), +    ("event2060", "object", "science_team_21"), +    ("event2060", "subject", "showalter"), +    ("event2060", "type", "membership"), +    ("event2061", "object", "science_team_21"), +    ("event2061", "subject", "weaver"), +    ("event2061", "type", "membership"), +    ("event2062", "object", "science_team_21"), +    ("event2062", "subject", "stern"), +    ("event2062", "type", "membership"), +    ("event2063", "object", "science_team_21"), +    ("event2063", "subject", "steffl"), +    ("event2063", "type", "membership"), +    ("event2064", "object", "science_team_21"), +    ("event2064", "subject", "buie"), +    ("event2064", "type", "membership"), +    ("event2065", "object", "science_team_21"), +    ("event2065", "subject", "merline"), +    ("event2065", "type", "membership"), +    ("event2066", "object", "science_team_21"), +    ("event2066", "subject", "mutchler"), +    ("event2066", "type", "membership"), +    ("event2067", "object", "science_team_21"), +    ("event2067", "subject", "soummer"), +    ("event2067", "type", "membership"), +    ("event2068", "object", "science_team_21"), +    ("event2068", "subject", "throop"), +    ("event2068", "type", "membership"), +    ("event2069", "object", "person"), +    ("event2069", "subject", "scotti"), +    ("event2069", "type", "membership"), +    ("event2070", "object", "person"), +    ("event2070", "subject", "spahr"), +    ("event2070", "type", "membership"), +    ("event2071", "object", "person"), +    ("event2071", "subject", "mcmillan"), +    ("event2071", "type", "membership"), +    ("event2072", "object", "person"), +    ("event2072", "subject", "montani"), +    ("event2072", "type", "membership"), +    ("event2073", "object", "person"), +    ("event2073", "subject", "gleason"), +    ("event2073", "type", "membership"), +    ("event2074", "object", "person"), +    ("event2074", "subject", "gehrels"), +    ("event2074", "type", "membership"), +    ("event2075", "object", "person"), +    ("event2075", "subject", "roemer"), +    ("event2075", "type", "membership"), +    ("event2076", "object", "person"), +    ("event2076", "subject", "sheppard"), +    ("event2076", "type", "membership"), +    ("event2077", "object", "person"), +    ("event2077", "subject", "jewitt"), +    ("event2077", "type", "membership"), +    ("event2078", "object", "person"), +    ("event2078", "subject", "fernandez"), +    ("event2078", "type", "membership"), +    ("event2079", "object", "person"), +    ("event2079", "subject", "magnier"), +    ("event2079", "type", "membership"), +    ("event2080", "object", "person"), +    ("event2080", "subject", "kleyna"), +    ("event2080", "type", "membership"), +    ("event2081", "object", "person"), +    ("event2081", "subject", "gladman"), +    ("event2081", "type", "membership"), +    ("event2082", "object", "person"), +    ("event2082", "subject", "kavelaars"), +    ("event2082", "type", "membership"), +    ("event2083", "object", "person"), +    ("event2083", "subject", "petit"), +    ("event2083", "type", "membership"), +    ("event2084", "object", "person"), +    ("event2084", "subject", "allen"), +    ("event2084", "type", "membership"), +    ("event2085", "object", "person"), +    ("event2085", "subject", "laques"), +    ("event2085", "type", "membership"), +    ("event2086", "object", "person"), +    ("event2086", "subject", "lecacheux"), +    ("event2086", "type", "membership"), +    ("event2087", "object", "person"), +    ("event2087", "subject", "smith"), +    ("event2087", "type", "membership"), +    ("event2088", "object", "person"), +    ("event2088", "subject", "reitsema"), +    ("event2088", "type", "membership"), +    ("event2089", "object", "person"), +    ("event2089", "subject", "pascu"), +    ("event2089", "type", "membership"), +    ("event2090", "object", "person"), +    ("event2090", "subject", "seidelmann"), +    ("event2090", "type", "membership"), +    ("event2091", "object", "person"), +    ("event2091", "subject", "baum"), +    ("event2091", "type", "membership"), +    ("event2092", "object", "person"), +    ("event2092", "subject", "currie"), +    ("event2092", "type", "membership"), +    ("event2093", "object", "person"), +    ("event2093", "subject", "showalter"), +    ("event2093", "type", "membership"), +    ("event2094", "object", "person"), +    ("event2094", "subject", "scholl"), +    ("event2094", "type", "membership"), +    ("event2095", "object", "person"), +    ("event2095", "subject", "holman"), +    ("event2095", "type", "membership"), +    ("event2096", "object", "person"), +    ("event2096", "subject", "marsden"), +    ("event2096", "type", "membership"), +    ("event2097", "object", "person"), +    ("event2097", "subject", "burns"), +    ("event2097", "type", "membership"), +    ("event2098", "object", "person"), +    ("event2098", "subject", "milisavljevic"), +    ("event2098", "type", "membership"), +    ("event2099", "object", "person"), +    ("event2099", "subject", "grav"), +    ("event2099", "type", "membership"), +    ("event2100", "object", "person"), +    ("event2100", "subject", "karkoschka"), +    ("event2100", "type", "membership"), +    ("event2101", "object", "person"), +    ("event2101", "subject", "showalter"), +    ("event2101", "type", "membership"), +    ("event2102", "object", "person"), +    ("event2102", "subject", "lissauer"), +    ("event2102", "type", "membership"), +    ("event2103", "object", "person"), +    ("event2103", "subject", "fraser"), +    ("event2103", "type", "membership"), +    ("event2104", "object", "person"), +    ("event2104", "subject", "christy"), +    ("event2104", "type", "membership"), +    ("event2105", "object", "person"), +    ("event2105", "subject", "weaver"), +    ("event2105", "type", "membership"), +    ("event2106", "object", "person"), +    ("event2106", "subject", "stern"), +    ("event2106", "type", "membership"), +    ("event2107", "object", "person"), +    ("event2107", "subject", "mutchler"), +    ("event2107", "type", "membership"), +    ("event2108", "object", "person"), +    ("event2108", "subject", "steffl"), +    ("event2108", "type", "membership"), +    ("event2109", "object", "person"), +    ("event2109", "subject", "buie"), +    ("event2109", "type", "membership"), +    ("event2110", "object", "person"), +    ("event2110", "subject", "merline"), +    ("event2110", "type", "membership"), +    ("event2111", "object", "person"), +    ("event2111", "subject", "spencer"), +    ("event2111", "type", "membership"), +    ("event2112", "object", "person"), +    ("event2112", "subject", "young_e_f"), +    ("event2112", "type", "membership"), +    ("event2113", "object", "person"), +    ("event2113", "subject", "young_l_a"), +    ("event2113", "type", "membership"), +    ("event2114", "object", "person"), +    ("event2114", "subject", "hamilton"), +    ("event2114", "type", "membership"), +    ("event2115", "object", "person"), +    ("event2115", "subject", "soummer"), +    ("event2115", "type", "membership"), +    ("event2116", "object", "person"), +    ("event2116", "subject", "throop"), +    ("event2116", "type", "membership"), +    ("event2117", "object", "thing"), +    ("event2117", "subject", "scotti"), +    ("event2117", "type", "membership"), +    ("event2118", "object", "thing"), +    ("event2118", "subject", "spahr"), +    ("event2118", "type", "membership"), +    ("event2119", "object", "thing"), +    ("event2119", "subject", "mcmillan"), +    ("event2119", "type", "membership"), +    ("event2120", "object", "thing"), +    ("event2120", "subject", "montani"), +    ("event2120", "type", "membership"), +    ("event2121", "object", "thing"), +    ("event2121", "subject", "gleason"), +    ("event2121", "type", "membership"), +    ("event2122", "object", "thing"), +    ("event2122", "subject", "gehrels"), +    ("event2122", "type", "membership"), +    ("event2123", "object", "thing"), +    ("event2123", "subject", "roemer"), +    ("event2123", "type", "membership"), +    ("event2124", "object", "thing"), +    ("event2124", "subject", "sheppard"), +    ("event2124", "type", "membership"), +    ("event2125", "object", "thing"), +    ("event2125", "subject", "jewitt"), +    ("event2125", "type", "membership"), +    ("event2126", "object", "thing"), +    ("event2126", "subject", "fernandez"), +    ("event2126", "type", "membership"), +    ("event2127", "object", "thing"), +    ("event2127", "subject", "magnier"), +    ("event2127", "type", "membership"), +    ("event2128", "object", "thing"), +    ("event2128", "subject", "kleyna"), +    ("event2128", "type", "membership"), +    ("event2129", "object", "thing"), +    ("event2129", "subject", "gladman"), +    ("event2129", "type", "membership"), +    ("event2130", "object", "thing"), +    ("event2130", "subject", "kavelaars"), +    ("event2130", "type", "membership"), +    ("event2131", "object", "thing"), +    ("event2131", "subject", "petit"), +    ("event2131", "type", "membership"), +    ("event2132", "object", "thing"), +    ("event2132", "subject", "allen"), +    ("event2132", "type", "membership"), +    ("event2133", "object", "thing"), +    ("event2133", "subject", "laques"), +    ("event2133", "type", "membership"), +    ("event2134", "object", "thing"), +    ("event2134", "subject", "lecacheux"), +    ("event2134", "type", "membership"), +    ("event2135", "object", "thing"), +    ("event2135", "subject", "smith"), +    ("event2135", "type", "membership"), +    ("event2136", "object", "thing"), +    ("event2136", "subject", "reitsema"), +    ("event2136", "type", "membership"), +    ("event2137", "object", "thing"), +    ("event2137", "subject", "pascu"), +    ("event2137", "type", "membership"), +    ("event2138", "object", "thing"), +    ("event2138", "subject", "seidelmann"), +    ("event2138", "type", "membership"), +    ("event2139", "object", "thing"), +    ("event2139", "subject", "baum"), +    ("event2139", "type", "membership"), +    ("event2140", "object", "thing"), +    ("event2140", "subject", "currie"), +    ("event2140", "type", "membership"), +    ("event2141", "object", "thing"), +    ("event2141", "subject", "showalter"), +    ("event2141", "type", "membership"), +    ("event2142", "object", "thing"), +    ("event2142", "subject", "scholl"), +    ("event2142", "type", "membership"), +    ("event2143", "object", "thing"), +    ("event2143", "subject", "holman"), +    ("event2143", "type", "membership"), +    ("event2144", "object", "thing"), +    ("event2144", "subject", "marsden"), +    ("event2144", "type", "membership"), +    ("event2145", "object", "thing"), +    ("event2145", "subject", "burns"), +    ("event2145", "type", "membership"), +    ("event2146", "object", "thing"), +    ("event2146", "subject", "milisavljevic"), +    ("event2146", "type", "membership"), +    ("event2147", "object", "thing"), +    ("event2147", "subject", "grav"), +    ("event2147", "type", "membership"), +    ("event2148", "object", "thing"), +    ("event2148", "subject", "karkoschka"), +    ("event2148", "type", "membership"), +    ("event2149", "object", "thing"), +    ("event2149", "subject", "showalter"), +    ("event2149", "type", "membership"), +    ("event2150", "object", "thing"), +    ("event2150", "subject", "lissauer"), +    ("event2150", "type", "membership"), +    ("event2151", "object", "thing"), +    ("event2151", "subject", "fraser"), +    ("event2151", "type", "membership"), +    ("event2152", "object", "thing"), +    ("event2152", "subject", "christy"), +    ("event2152", "type", "membership"), +    ("event2153", "object", "thing"), +    ("event2153", "subject", "weaver"), +    ("event2153", "type", "membership"), +    ("event2154", "object", "thing"), +    ("event2154", "subject", "stern"), +    ("event2154", "type", "membership"), +    ("event2155", "object", "thing"), +    ("event2155", "subject", "mutchler"), +    ("event2155", "type", "membership"), +    ("event2156", "object", "thing"), +    ("event2156", "subject", "steffl"), +    ("event2156", "type", "membership"), +    ("event2157", "object", "thing"), +    ("event2157", "subject", "buie"), +    ("event2157", "type", "membership"), +    ("event2158", "object", "thing"), +    ("event2158", "subject", "merline"), +    ("event2158", "type", "membership"), +    ("event2159", "object", "thing"), +    ("event2159", "subject", "spencer"), +    ("event2159", "type", "membership"), +    ("event2160", "object", "thing"), +    ("event2160", "subject", "young_e_f"), +    ("event2160", "type", "membership"), +    ("event2161", "object", "thing"), +    ("event2161", "subject", "young_l_a"), +    ("event2161", "type", "membership"), +    ("event2162", "object", "thing"), +    ("event2162", "subject", "hamilton"), +    ("event2162", "type", "membership"), +    ("event2163", "object", "thing"), +    ("event2163", "subject", "soummer"), +    ("event2163", "type", "membership"), +    ("event2164", "object", "thing"), +    ("event2164", "subject", "throop"), +    ("event2164", "type", "membership"), +    ("event2165", "object", "telescope"), +    ("event2165", "subject", "refractor_telescope_1"), +    ("event2165", "type", "membership"), +    ("event2166", "object", "telescope"), +    ("event2166", "subject", "refractor_telescope_2"), +    ("event2166", "type", "membership"), +    ("event2167", "object", "telescope"), +    ("event2167", "subject", "refractor_telescope_3"), +    ("event2167", "type", "membership"), +    ("event2168", "object", "telescope"), +    ("event2168", "subject", "refractor_telescope_4"), +    ("event2168", "type", "membership"), +    ("event2169", "object", "telescope"), +    ("event2169", "subject", "reflector_telescope_1"), +    ("event2169", "type", "membership"), +    ("event2170", "object", "telescope"), +    ("event2170", "subject", "reflector_telescope_2"), +    ("event2170", "type", "membership"), +    ("event2171", "object", "telescope"), +    ("event2171", "subject", "reflector_telescope_3"), +    ("event2171", "type", "membership"), +    ("event2172", "object", "telescope"), +    ("event2172", "subject", "reflector_telescope_4"), +    ("event2172", "type", "membership"), +    ("event2173", "object", "telescope"), +    ("event2173", "subject", "ground_based_telescope_1"), +    ("event2173", "type", "membership"), +    ("event2174", "object", "telescope"), +    ("event2174", "subject", "ground_based_telescope_2"), +    ("event2174", "type", "membership"), +    ("event2175", "object", "telescope"), +    ("event2175", "subject", "ground_based_telescope_3"), +    ("event2175", "type", "membership"), +    ("event2176", "object", "telescope"), +    ("event2176", "subject", "galilean_telescope_1"), +    ("event2176", "type", "membership"),+    ("event2177", "object", "telescope"), +    ("event2177", "subject", "crossley_reflector_telescope"), +    ("event2177", "type", "membership"), +    ("event2178", "object", "telescope"), +    ("event2178", "subject", "cassegrain_telescope"), +    ("event2178", "type", "membership"), +    ("event2179", "object", "telescope"), +    ("event2179", "subject", "hooker_telescope"), +    ("event2179", "type", "membership"), +    ("event2180", "object", "telescope"), +    ("event2180", "subject", "schmidt_telescope"), +    ("event2180", "type", "membership"), +    ("event2181", "object", "telescope"), +    ("event2181", "subject", "subaru_reflector_telescope"), +    ("event2181", "type", "membership"), +    ("event2182", "object", "telescope"), +    ("event2182", "subject", "canada-france-hawaii_telescope"), +    ("event2182", "type", "membership"), +    ("event2183", "object", "telescope"), +    ("event2183", "subject", "aerial_telescope_1"), +    ("event2183", "type", "membership"), +    ("event2184", "object", "telescope"), +    ("event2184", "subject", "bruce_astrograph"), +    ("event2184", "type", "membership"), +    ("event2185", "object", "telescope"), +    ("event2185", "subject", "telescope_1"), +    ("event2185", "type", "membership"), +    ("event2186", "object", "telescope"), +    ("event2186", "subject", "hale_telescope"), +    ("event2186", "type", "membership"), +    ("event2187", "object", "telescope"), +    ("event2187", "subject", "hubble_space_telescope"), +    ("event2187", "type", "membership"), +    ("event2188", "object", "telescope"), +    ("event2188", "subject", "blanco_telescope"), +    ("event2188", "type", "membership"), +    ("event2189", "object", "refractor_telescope_1"), +    ("event2189", "subject", "26_inch"), +    ("event2189", "type", "length"), +    ("event2190", "object", "refractor_telescope_2"), +    ("event2190", "subject", "36_inch"), +    ("event2190", "type", "length"), +    ("event2191", "object", "refractor_telescope_3"), +    ("event2191", "subject", "36_inch"), +    ("event2191", "type", "length"), +    ("event2192", "object", "reflector_telescope_1"), +    ("event2192", "subject", "40_foot"), +    ("event2192", "type", "length"), +    ("event2193", "object", "reflector_telescope_2"), +    ("event2193", "subject", "6.5_m"), +    ("event2193", "type", "length"), +    ("event2194", "object", "reflector_telescope_3"), +    ("event2194", "subject", "24_inch"), +    ("event2194", "type", "length"), +    ("event2195", "object", "reflector_telescope_4"), +    ("event2195", "subject", "4_m"), +    ("event2195", "type", "length"), +    ("event2196", "object", "crossley_reflector_telescope"), +    ("event2196", "subject", "36_inch"), +    ("event2196", "type", "length"), +    ("event2197", "object", "cassegrain_telescope"), +    ("event2197", "subject", "30_inch"), +    ("event2197", "type", "length"), +    ("event2198", "object", "hooker_telescope"), +    ("event2198", "subject", "100_inch"), +    ("event2198", "type", "length"), +    ("event2199", "object", "schmidt_telescope"), +    ("event2199", "subject", "122_cm"), +    ("event2199", "type", "length"), +    ("event2200", "object", "subaru_reflector_telescope"), +    ("event2200", "subject", "8.2_m"), +    ("event2200", "type", "length"), +    ("event2201", "object", "canada-france-hawaii_telescope"), +    ("event2201", "subject", "3.6_m"), +    ("event2201", "type", "length"), +    ("event2202", "object", "bruce_astrograph"), +    ("event2202", "subject", "24_inch"), +    ("event2202", "type", "length"), +    ("event2203", "object", "telescope_1"), +    ("event2203", "subject", "106_cm"), +    ("event2203", "type", "length"), +    ("event2204", "object", "hale_telescope"), +    ("event2204", "subject", "200_inch"), +    ("event2204", "type", "length"), +    ("event2205", "object", "blanco_telescope"), +    ("event2205", "subject", "4.0_m"), +    ("event2205", "type", "length"), +    ("event2206", "object", "spacecraft"), +    ("event2206", "subject", "voyager_1"), +    ("event2206", "type", "membership"), +    ("event2207", "object", "spacecraft"), +    ("event2207", "subject", "voyager_2"), +    ("event2207", "type", "membership"), +    ("event2208", "object", "spacecraft"), +    ("event2208", "subject", "cassini"), +    ("event2208", "type", "membership"), +    ("event2209", "object", "thing"), +    ("event2209", "subject", "refractor_telescope_1"), +    ("event2209", "type", "membership"), +    ("event2210", "object", "thing"), +    ("event2210", "subject", "refractor_telescope_2"), +    ("event2210", "type", "membership"), +    ("event2211", "object", "thing"), +    ("event2211", "subject", "refractor_telescope_3"), +    ("event2211", "type", "membership"), +    ("event2212", "object", "thing"), +    ("event2212", "subject", "refractor_telescope_4"), +    ("event2212", "type", "membership"), +    ("event2213", "object", "thing"), +    ("event2213", "subject", "reflector_telescope_1"), +    ("event2213", "type", "membership"), +    ("event2214", "object", "thing"), +    ("event2214", "subject", "reflector_telescope_2"), +    ("event2214", "type", "membership"), +    ("event2215", "object", "thing"), +    ("event2215", "subject", "reflector_telescope_3"), +    ("event2215", "type", "membership"), +    ("event2216", "object", "thing"), +    ("event2216", "subject", "reflector_telescope_4"), +    ("event2216", "type", "membership"), +    ("event2217", "object", "thing"), +    ("event2217", "subject", "ground_based_telescope_1"), +    ("event2217", "type", "membership"), +    ("event2218", "object", "thing"), +    ("event2218", "subject", "ground_based_telescope_2"), +    ("event2218", "type", "membership"), +    ("event2219", "object", "thing"), +    ("event2219", "subject", "ground_based_telescope_3"), +    ("event2219", "type", "membership"), +    ("event2220", "object", "thing"), +    ("event2220", "subject", "galilean_telescope_1"), +    ("event2220", "type", "membership"), +    ("event2221", "object", "thing"), +    ("event2221", "subject", "crossley_reflector_telescope"), +    ("event2221", "type", "membership"), +    ("event2222", "object", "thing"), +    ("event2222", "subject", "cassegrain_telescope"), +    ("event2222", "type", "membership"), +    ("event2223", "object", "thing"), +    ("event2223", "subject", "hooker_telescope"), +    ("event2223", "type", "membership"), +    ("event2224", "object", "thing"), +    ("event2224", "subject", "schmidt_telescope"), +    ("event2224", "type", "membership"), +    ("event2225", "object", "thing"), +    ("event2225", "subject", "subaru_reflector_telescope"), +    ("event2225", "type", "membership"), +    ("event2226", "object", "thing"), +    ("event2226", "subject", "canada-france-hawaii_telescope"), +    ("event2226", "type", "membership"), +    ("event2227", "object", "thing"), +    ("event2227", "subject", "aerial_telescope_1"), +    ("event2227", "type", "membership"), +    ("event2228", "object", "thing"), +    ("event2228", "subject", "bruce_astrograph"), +    ("event2228", "type", "membership"), +    ("event2229", "object", "thing"), +    ("event2229", "subject", "telescope_1"), +    ("event2229", "type", "membership"), +    ("event2230", "object", "thing"), +    ("event2230", "subject", "hale_telescope"), +    ("event2230", "type", "membership"), +    ("event2231", "object", "thing"), +    ("event2231", "subject", "hubble_space_telescope"), +    ("event2231", "type", "membership"), +    ("event2232", "object", "thing"), +    ("event2232", "subject", "blanco_telescope"), +    ("event2232", "type", "membership"), +    ("event2233", "object", "thing"), +    ("event2233", "subject", "voyager_1"), +    ("event2233", "type", "membership"), +    ("event2234", "object", "thing"), +    ("event2234", "subject", "voyager_2"), +    ("event2234", "type", "membership"), +    ("event2235", "object", "thing"), +    ("event2235", "subject", "cassini"), +    ("event2235", "type", "membership"), +    ("event2236", "object", "place"), +    ("event2236", "subject", "us_naval_observatory"), +    ("event2236", "type", "membership"), +    ("event2237", "object", "place"), +    ("event2237", "subject", "padua"), +    ("event2237", "type", "membership"), +    ("event2238", "object", "place"), +    ("event2238", "subject", "mt_hamilton"), +    ("event2238", "type", "membership"), +    ("event2239", "object", "place"), +    ("event2239", "subject", "greenwich"), +    ("event2239", "type", "membership"), +    ("event2240", "object", "place"), +    ("event2240", "subject", "mt_wilson"), +    ("event2240", "type", "membership"), +    ("event2241", "object", "place"), +    ("event2241", "subject", "mt_palomar"), +    ("event2241", "type", "membership"), +    ("event2242", "object", "place"), +    ("event2242", "subject", "kitt_peak"), +    ("event2242", "type", "membership"), +    ("event2243", "object", "place"), +    ("event2243", "subject", "mauna_kea"), +    ("event2243", "type", "membership"), +    ("event2244", "object", "place"), +    ("event2244", "subject", "slough"), +    ("event2244", "type", "membership"), +    ("event2245", "object", "place"), +    ("event2245", "subject", "paris"), +    ("event2245", "type", "membership"), +    ("event2246", "object", "place"), +    ("event2246", "subject", "the_hague"), +    ("event2246", "type", "membership"), +    ("event2247", "object", "place"), +    ("event2247", "subject", "cambridge"), +    ("event2247", "type", "membership"), +    ("event2248", "object", "place"), +    ("event2248", "subject", "liverpool"), +    ("event2248", "type", "membership"), +    ("event2249", "object", "place"), +    ("event2249", "subject", "arequipa"), +    ("event2249", "type", "membership"), +    ("event2250", "object", "place"), +    ("event2250", "subject", "pic_du_midi"), +    ("event2250", "type", "membership"), +    ("event2251", "object", "place"), +    ("event2251", "subject", "flagstaff"), +    ("event2251", "type", "membership"), +    ("event2252", "object", "place"), +    ("event2252", "subject", "la_silla"), +    ("event2252", "type", "membership"), +    ("event2253", "object", "place"), +    ("event2253", "subject", "mt_hopkins"), +    ("event2253", "type", "membership"), +    ("event2254", "object", "place"), +    ("event2254", "subject", "fort_davis"), +    ("event2254", "type", "membership"), +    ("event2255", "object", "place"), +    ("event2255", "subject", "cerro_tololo"), +    ("event2255", "type", "membership")]
+ XSaiga/SolarmanTriplestore.hs view
@@ -0,0 +1,1312 @@+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE Trustworthy #-}+module XSaiga.SolarmanTriplestore where++import Prelude hiding ((*>))+import XSaiga.Getts+import Data.List as List+import qualified Data.Set as Set+import XSaiga.AGParser2+import XSaiga.TypeAg2+import Control.Monad+import Debug.Trace+import qualified XSaiga.LocalData as Local++--change between remoteData and localData+--dataStore = Local.localData+dataStore = remoteData -- selects database++endpoint_uri = "http://speechweb2.cs.uwindsor.ca/sparql"+namespace_uri = "http://solarman.richard.myweb.cs.uwindsor.ca#"+remoteData = SPARQL endpoint_uri namespace_uri+    +--copied from gangster_v4: utility functions for making lists unique+subset s t = (s \\ t) == []++makeset x = Set.toList $ Set.fromList x+    +--copied from gangster_v4: combinators+termor tmph1 tmph2 ents =+        liftM List.nub $ liftM2 (++) (tmph1 ents) (tmph2 ents) --TODO: MERGE IMAGES PROPER++termand tmph1 tmph2 ents = do+        t1 <- tmph1 ents+        t2 <- tmph2 ents+        if t1 /= [] && t2 /= [] then return $ List.nub $ t1 ++ t2 else return []+        --May need to be changed to intersection?  Don't think so:  can't remove anything from nub (t1++t2) because all things are relevant to either t1 or t2+        --TODO: MERGE IMAGES PROPER (or do termphrases always preserve ents)++intersect_entevimages eei1  eei2 +                = [(subj2, evs2) | (subj1, evs1) <- eei1, (subj2, evs2) <- eei2, subj1 == subj2]+        +that = nounand++nounand = liftM2 intersect_entevimages++nounor' s t = List.nub(s ++ t)+nounor = liftM2 nounor'+       +{-a' nph vbph =+    length (intersect  nph vbph) /= 0-}+a = liftM2 intersect_entevimages    +any' = a+the = a+some = a+an = a++every' nph vbph | subset (map fst nph) (map fst vbph) = intersect_entevimages nph vbph+                | otherwise = []++every = liftM2 every'++{- TODO: +no' nph vbph =+    length (intersect nph vbph) == 0+no = liftM2 no'+-}+    +{- TODO:+none' nph vbph =+    no nph vbph+none = liftM2 none'+-}+  +one' nph vbph   | length (res) == 1 = res+                | otherwise = []+    where+    res = intersect_entevimages  nph vbph+    +one = liftM2 one'++two' nph vbph   | length (res) == 2 = res+                | otherwise = []+    where+    res = intersect_entevimages  nph vbph+    +two = liftM2 two'+  ++--which nph vbph = if result /= [] then result else "none."+--  where result = unwords $ intersect nph vbph++which nph vbph = do+    nph_ <- nph+    vbph_ <- vbph+    let result = unwords $ map fst $ intersect_entevimages nph_ vbph_+    return $ if result /= [] then result else "none."+    +how_many' nph vbph =+    show $ length (intersect_entevimages nph vbph)+how_many = liftM2 how_many'++who = which ((get_members dataStore "person") `nounor` (get_members dataStore "science_team"))++--New+what' nph = if result /= [] then result else "nothing."+    where result = unwords $ map fst nph+what = liftM what'++with :: (IO Image -> IO Image) -> ([String], IO Image -> IO Image)+with tmph = (["with_implement"], tmph)++by tmph = (["subject"], tmph)++at tmph = (["location"], tmph)++in' tmph = (["location", "year"], make_pnoun $ show tmph)++make_pnoun noun = liftM $ make_pnoun' noun+make_pnoun' noun image = [(subj, evs) | (subj, evs) <- image, subj == noun]++--New for new new semantics++--TODO: Handle case where nothing is in props (return none)+make_prop_termphrase prop nph = do+    list <- nph+    props <- mapM (\(_,y) -> getts_inverse dataStore prop y >>= \loc -> return (map fst loc)) list+    let finalList = unwords $ List.nub $ concat props+    return $ if finalList /= [] then finalList else "nothing."++where' = make_prop_termphrase "location"+when' = make_prop_termphrase "year"+how' = make_prop_termphrase "with_implement"+whatobj = make_prop_termphrase "object"+++--end of copied from gangster_v4++{-+sun     = get_members dataStore ("sun")+planet  = get_members dataStore ("planet")+moon    = get_members dataStore ("moon")+person  = get_members dataStore ("person")+thing   = get_members dataStore ("thing")+telescope = get_members dataStore ("telescope")+science_team = get_members dataStore ("science_team")+spacecraft = get_members dataStore ("spacecraft")+place = get_members dataStore ("place")++atmospheric = get_members dataStore ("atmospheric")+blue = get_members dataStore ("blue")+depressed = get_members dataStore ("depressed")+solid = get_members dataStore ("solid")+brown   = get_members dataStore ("brown")+gaseous = get_members dataStore ("gaseous")+green   = get_members dataStore ("green")+red     = get_members dataStore ("red")+ringed  = get_members dataStore ("ringed")+vacuumous = get_members dataStore ("vacuumous")+exists = thing+spin   = get_members dataStore ("spin")+-}+++{-+discover_intrans    = get_subjs_of_event_type dataStore ("discover_ev")+orbit_intrans       = get_subjs_of_event_type dataStore ("orbit_ev")+-}++{-discover = make_relation "discover_ev" +discovered = discover++orbit = make_relation "orbit_ev" +orbited = orbit-}++--For prepositional phrases+{-discover' = make_relation "discover_ev"+discovered' = discover'++orbit' = make_relation "orbit_ev" +orbited' = orbit'-}++{-hall = make_pnoun "hall"+phobos = make_pnoun "phobos"+mars = make_pnoun "mars"+refractor_telescope_1 = make_pnoun "refractor_telescope_1"+-}++make_relation ev_type tmph = make_filtered_relation dataStore ev_type [(["object"],tmph)]++                +{-make_inverted_relation :: (TripleStore m) => m -> String -> (IO [String] -> IO Bool) -> IO [String]+make_inverted_relation ev_data rel tmph = do+        images <- make_image ev_data rel "object"+        objPairs <- filterM (\(_, evs) ->+            tmph $ liftM concat $ mapM (\ev -> getts_3 ev_data (ev, "subject", "?")) evs) images+        return $ map fst objPairs-}+        +--Prepositional filtering++--filter_ev takes a list of ([String], IO [String] -> IO Bool) where the [String] is the list of identifiers corresponding+--to the data the preposition predicate needs to evaluate (e.g., for location predicates the list will contain "location",+{-filter_ev :: (TripleStore m) => m -> [([String], IO [String] -> IO Bool)] -> Event -> IO Bool+filter_ev ev_data [] ev = return True+filter_ev ev_data ((names,pred):list) ev = do+    relevant_list <- mapM (\name -> getts_3 ev_data (ev, name, "?")) names+    res <- pred $ return $ concat relevant_list+    if res then filter_ev ev_data list ev else return False-}+    +--Modified filter_ev to accommodate predicates like every, one, two, etc...+--The difference is that it concatenates the data the preposition predicate needs to evaluate across all events and+--applies the preposition predicate to that, so that all data is available to the predicate rather than just the subset+--given by a specific event+--TODO: new filter_Ev+{-filter_ev :: (TripleStore m) => m -> [([String], IO Image -> IO Image)] -> [Event] -> IO Bool+filter_ev _ [] _ = return True+filter_ev ev_data ((names,pred):list) evs = do+    relevant_list <- mapM (\name -> getts_inverse ev_data name evs) names+    res <- pred $ return $ concat $ relevant_list+    if res /= [] then filter_ev ev_data list evs else return False-}+    +--new filter_ev: Handles prepositional phrases (IN TESTING)+filter_ev :: (TripleStore m) => m -> [([String], IO Image -> IO Image)] -> [Event] -> IO Bool+filter_ev _ [] _ = return True+filter_ev ev_data ((names,pred):list) evs = do+    relevant_list <- mapM (\name -> getts_inverse ev_data name evs) names+    res <- pred $ return $ concat $ relevant_list+    --NEW: Merge all events in predicate result for new query.  Result will be a subset of evs.+    let relevant_evs = List.nub $ concatMap snd res +    if res /= [] then filter_ev ev_data list relevant_evs else return False++{-make_filtered_relation :: (TripleStore m) => m -> String -> (IO [String] -> IO Bool) -> [([String], IO [String] -> IO Bool)] -> IO [String]+make_filtered_relation ev_data rel tmph preps = do+    images <- make_image ev_data rel "subject"+    subPairs <- filterM (\(_, evs) -> do+        filtEvents <- filterM (filter_ev ev_data preps) evs+        tmph $ liftM concat $ mapM (\ev -> getts_3 ev_data (ev, "object", "?")) filtEvents) images+    return $ map fst subPairs-}+    +--Modified version of make_filtered_relation to accomodate new filter_ev+make_filtered_relation :: (TripleStore m) => m -> String -> [([String], IO Image -> IO Image)] -> IO Image+make_filtered_relation ev_data rel preps = do+    images <- make_image ev_data rel "subject"+    filterM (\(_, evs) -> filter_ev ev_data preps evs) images+    +{-make_inverted_filtered_relation :: (TripleStore m) => m -> String -> [([String], IO [String] -> IO Bool)] -> IO [String]+make_inverted_filtered_relation ev_data rel preps = do+    images <- make_image ev_data rel "object"+    objPairs <- filterM (\(_, evs) -> anyM (filter_ev ev_data preps) evs) images+    return $ map fst objPairs+    where+        anyM :: (Monad m) => (a -> m Bool) -> [a] -> m Bool+        anyM pred lst = foldM (\x y -> pred y >>= \res -> return $ x || res) False lst -}++--Modified version of make_inverted_filtered_relation to accomodate new filter_ev+make_inverted_filtered_relation :: (TripleStore m) => m -> String -> [([String], IO Image -> IO Image)] -> IO Image+make_inverted_filtered_relation ev_data rel preps = do+    images <- make_image ev_data rel "object"+    filterM (\(_, evs) -> filter_ev ev_data preps evs) images++--Copied from old solarman:+yesno' x = if x /= [] then "yes." else "no"+yesno = liftM yesno'++does = yesno+did = yesno+do' = yesno+was = yesno+is = yesno+were = yesno+are = yesno++--TODO: is this proper? +sand s1 s2 = do+    r1 <- s1+    r2 <- s2+    return $ if r1 /= [] && r2 /= [] then List.nub $ r1 ++ r2 else []++{-+||-----------------------------------------------------------------------------+||  BASIC INTERPRETERS+||-----------------------------------------------------------------------------+-}+++pnoun           =  pre_processed Pnoun+cnoun           =  pre_processed Cnoun+adj             =  pre_processed Adj+det             =  pre_processed Det+intransvb       =  pre_processed Intransvb+transvb         =  pre_processed Transvb+linkingvb       =  pre_processed Linkingvb+relpron         =  pre_processed Relpron+termphjoin      =  pre_processed Termphjoin+verbphjoin      =  pre_processed Verbphjoin+nounjoin        =  pre_processed Nounjoin+indefpron       =  pre_processed Indefpron+{-+terminator      =  uninterpreted (SPECIAL_SYMBOL_TERM ".")+                   $orelse+                   uninterpreted (SPECIAL_SYMBOL_TERM "?")+                   $orelse+                   uninterpreted (SPECIAL_SYMBOL_TERM "\n")+-}+sentjoin        =  pre_processed Sentjoin+quest1          =  pre_processed Quest1+quest2          =  pre_processed Quest2+quest3          =  pre_processed Quest3+quest4a         =  pre_processed Quest4a+quest4b         =  pre_processed Quest4b+quest5          =  pre_processed Quest5+quest6          =  pre_processed Quest6++--NEW FOR PREPOSITIONAL PHRASES+prep            =  pre_processed Prepn+year            =  pre_processed Year+++pre_processed key + = let formAlts altTerminals  = memoize key (altTerminals) +       formTerminal [x]       = x+       formTerminal (x:xs)    = x <|>  formTerminal xs+       list_of_ters           = [ terminal (term a) z +                                | (a,b,z) <- dictionary+                                , b == key]+   in  formAlts (formTerminal list_of_ters)+++meaning_of p dInp key+ = let dInput     = words dInp+       appParser  = unState (p T0 [] ((1,[]), dInput) ([],[])) [] +       upperBound = (length dInput) + 1+   in  formFinal key upperBound (snd $ appParser)   ++meaning_of_ p dInp key+ = let dInput     = words dInp+       appParser  = unState (p T0 [] ((1,[]), dInput) ([],[])) [] +       upperBound = (length dInput) + 1+   in  (snd $ appParser)   ++formAtts key ePoint t + = concat $ concat $ concat $ concat  +   [[[[  val1 |(id1,val1)<-synAtts]+           |(((st,inAtt2),(end,synAtts)), ts)<-rs, st == 1 && end == ePoint]     +            |((i,inAt1),((cs,ct),rs)) <- sr ]+             |(s,sr) <- t, s == key ]+formFinal key ePoint t + = concat $ concat $ concat $ concat  +   [[[[  val1 |(id1,val1)<-synAtts]+           |(((st,inAtt2),(end,synAtts)), ts)<-rs, st == 1 && end == ePoint]     +            |((i,inAt1),((cs,ct),rs)) <- sr ]+             |(s,sr) <- t, s == key ]            +{-+test p = unState (p ((1,[]),input) ([],[])) [] ++main   = do putStr  $ render80 $ formatAtts Question $ snd $ test (question T0 [])++type Start1   = (Int, InsAttVals)+type Start    = ((Int,InsAttVals), [String])+type End      = (Int, InsAttVals)+type Atts     = [AttValue] -- [(AttType, AttValue)]+type InsAttVals = [(Instance, Atts)]+++                 ,[(Start1,(Context,Result))]+type Mtable   = [(MemoL+                 )+                ] +type Result   = [((Start1, End),[Tree MemoL])]+||-----------------------------------------------------------------------------+|| THE ATTRIBUTE GRAMMAR+||-----------------------------------------------------------------------------+-}++-- public <snouncla> = <cnoun> | <adjs> <cnoun>;+snouncla + = memoize Snouncla+ (parser+  (nt cnoun S3) +  [rule_s NOUNCLA_VAL OF LHS ISEQUALTO copy [synthesized NOUNCLA_VAL OF S3]]+  <|>+  parser (nt adjs S1  *> nt cnoun S2)+  [rule_s NOUNCLA_VAL OF LHS ISEQUALTO intrsct1 [synthesized ADJ_VAL      OF  S1,+                                                 synthesized NOUNCLA_VAL  OF  S2]]+                                               + )++-------------------------------------------------------------------------------+-- public <relnouncla> = <snouncla> <relpron> <joinvbph> | <snouncla>;+relnouncla   + = memoize Relnouncla+   (parser +    (nt snouncla S1  *> nt relpron S2  *> nt joinvbph S3)+    [rule_s NOUNCLA_VAL OF LHS ISEQUALTO apply_middle1[synthesized NOUNCLA_VAL  OF S1,+                                                       synthesized RELPRON_VAL  OF S2,+                                                       synthesized VERBPH_VAL   OF S3]]+    <|>   +    parser+    (nt snouncla S4)+    [rule_s NOUNCLA_VAL OF LHS ISEQUALTO copy [synthesized NOUNCLA_VAL OF S4]]+   )+----------------------------------------------------------------------------+++-- public <nouncla> = <relnouncla> <nounjoin> <nouncla> | <relnouncla> <relpron> <linkingvb> <nouncla> | <relnouncla>;+nouncla + = memoize Nouncla +   (parser (nt relnouncla S1 *> nt nounjoin S2 *> nt nouncla S3)+    [rule_s NOUNCLA_VAL OF LHS ISEQUALTO apply_middle2 [synthesized NOUNCLA_VAL  OF S1,+                                                        synthesized NOUNJOIN_VAL OF S2,+                                                        synthesized NOUNCLA_VAL  OF S3]]+    <|>+    parser (nt relnouncla S1 *> nt relpron S2 *> nt linkingvb S3 *> nt nouncla S4) --Does this make sense?  Allows us to ask "which moon that was discovered by hall that is moon orbits mars"+    [rule_s NOUNCLA_VAL  OF LHS ISEQUALTO apply_middle3 [synthesized NOUNCLA_VAL  OF S1,+                                                         synthesized RELPRON_VAL  OF S2,+                                                         synthesized NOUNCLA_VAL  OF S4]]+    <|>+    parser (nt relnouncla S1)+    [rule_s NOUNCLA_VAL  OF LHS ISEQUALTO copy [synthesized NOUNCLA_VAL  OF S1]]+   )++------------------------------------------------------------------------------+-- public <adjs> = <adj> <adjs> | <adj>;+adjs   + = memoize Adjs      +   (parser (nt adj S1 *> nt adjs S2)+    [rule_s ADJ_VAL  OF LHS ISEQUALTO intrsct2 [synthesized ADJ_VAL  OF S1,+                                                synthesized ADJ_VAL  OF S2]]+    <|>+    parser (nt adj S3)+    [rule_s ADJ_VAL  OF LHS ISEQUALTO copy [synthesized ADJ_VAL  OF S3]]+   )+------------------------------------------------------------------------------+-- public <detph> = <indefpron> | <det> <nouncla>;+detph     + = memoize Detph+   (parser (nt indefpron S3)+    [rule_s TERMPH_VAL OF LHS ISEQUALTO copy [synthesized TERMPH_VAL OF S3]]+    <|>+    parser (nt det S1 *> nt nouncla S2)+    [rule_s TERMPH_VAL OF LHS ISEQUALTO applydet [synthesized DET_VAL      OF S1,+                                                  synthesized NOUNCLA_VAL  OF S2]]+   )                                              ++----------------------------------------------------------------------------------++{-+ 	public <transvbph> = <transvb>+                        | <transvb> <preps>+                        | <transvb> <jointermph>+                        | <transvb> <jointermph> <preps>+                        | <linkingvb> <jointermph> <transvb>+                        | <linkingvb> <jointermph> <transvb> <preps>;+ -}++transvbph + = memoize Transvbph+   (parser (nt transvb S1) --"discovered"+    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvb_no_tmph [synthesized VERB_VAL OF S1]]+    <|>+    parser (nt transvb S1 *> nt preps S2) --"discovered in..."+    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvb_no_tmph [synthesized VERB_VAL OF S1,+                                                              synthesized PREP_VAL OF S2]]+    <|>+    parser (nt transvb S1 *> nt jointermph S2) --"discovered phobos (and blah and blah and blah)"+    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvbprep [synthesized VERB_VAL    OF S1,+                                                          synthesized TERMPH_VAL  OF S2]]+    <|>+    parser (nt transvb S1 *> nt jointermph S2 *> nt preps S3) --"discovered phobos in..."+    [rule_s VERBPH_VAL OF LHS ISEQUALTO applytransvbprep [synthesized VERB_VAL OF S1,+                                                          synthesized TERMPH_VAL OF S2,+                                                          synthesized PREP_VAL OF S3]]+    <|>+    parser (nt linkingvb S1 *> nt transvb S2) --"was discovered"+    [rule_s VERBPH_VAL  OF LHS ISEQUALTO drop3rdprep [synthesized LINKINGVB_VAL  OF  S1,+                                                      synthesized VERB_VAL       OF  S2]]+    <|>+    parser (nt linkingvb S1 *> nt transvb S2 *> nt preps S3) --"was discovered by hall in..."+    [rule_s VERBPH_VAL  OF LHS ISEQUALTO drop3rdprep [synthesized LINKINGVB_VAL  OF  S1,+                                                  synthesized VERB_VAL       OF  S2,+                                                  synthesized PREP_VAL       OF  S3]]+    <|>+    parser (nt linkingvb S1  *>  nt jointermph S2 *> nt transvb S3) --"was phobos discovered"+    [rule_s VERBPH_VAL  OF LHS ISEQUALTO apply_quest_transvb_passive [synthesized LINKINGVB_VAL OF  S1,+                                                                      synthesized TERMPH_VAL    OF  S2,+                                                                      synthesized VERB_VAL      OF  S3]]+    <|>+    parser (nt linkingvb S1  *>  nt jointermph S2 *> nt transvb S3 *> nt preps S4) --"was phobos discovered in..."+    [rule_s VERBPH_VAL  OF LHS ISEQUALTO apply_quest_transvb_passive [synthesized LINKINGVB_VAL OF  S1,+                                                                      synthesized TERMPH_VAL    OF  S2,+                                                                      synthesized VERB_VAL      OF  S3,+                                                                      synthesized PREP_VAL      OF  S4]]+   )+   +----------------------------------------------------------------------------------+--NEW FOR PREPOSITIONAL PHRASES++-- public <preps> = <prepph> | <preph> <preps>;+preps+ = memoize Preps+    (parser (nt prepph S1)+     [rule_s PREP_VAL OF LHS ISEQUALTO applyprep [synthesized PREPPH_VAL OF S1]]+     <|>+     parser (nt prepph S1 *> nt preps S2)+     [rule_s PREP_VAL OF LHS ISEQUALTO applypreps [synthesized PREPPH_VAL OF S1,+                                                   synthesized PREP_VAL OF S2]]+    )++-- public <prepph> = <prep> <jointermph>;	+prepph+ = memoize Prepph+    (parser (nt prep S1 *> nt jointermph S2)+     [rule_s PREPPH_VAL OF LHS ISEQUALTO applyprepph [synthesized PREPN_VAL OF S1,+                                                     synthesized TERMPH_VAL OF S2]]+    )++----------------------------------------------------------------------------------++-- public <verbph> = <transvbph> | <intransvb> | <linkingvb> <det> <nouncla>;+verbph + = memoize Verbph+   (+    parser (nt transvbph S4)+    [rule_s VERBPH_VAL OF LHS ISEQUALTO copy [synthesized VERBPH_VAL OF S4]]+   <|>+    parser (nt intransvb S5)+    [rule_s VERBPH_VAL OF LHS ISEQUALTO copy [synthesized VERBPH_VAL OF S5]]+   <|>+    parser (nt linkingvb S1 *> nt det S2 *> nt nouncla S3)+    [rule_s VERBPH_VAL OF LHS ISEQUALTO applyvbph [synthesized NOUNCLA_VAL OF S3]]+   )+------------------------------------------------------------------------------------+-- public <termph> = <pnoun> | <detph> | <year>;+termph    + = memoize Termph  +   (+   parser (nt pnoun S1) +   [rule_s TERMPH_VAL OF LHS ISEQUALTO copy [synthesized TERMPH_VAL OF S1]]+   <|>  +   parser (nt detph S2)+   [rule_s TERMPH_VAL OF LHS ISEQUALTO copy [synthesized TERMPH_VAL OF S2]]+   <|>+   parser (nt year S3)+   [rule_s TERMPH_VAL OF LHS ISEQUALTO applyyear [synthesized YEAR_VAL OF S3]]+   )+             ++------------------------------------------------------------------------------------+-- public <jointermph> = <jointermph> <termphjoin> <jointermph> | <termph>;+jointermph + = memoize Jointermph +   (+{-    parser (nt jointermph S1 *> nt termphjoin S2 *> nt termph S3)+        [rule_s TERMPH_VAL  OF LHS ISEQUALTO appjoin1 [synthesized TERMPH_VAL     OF S1,+                                                       synthesized TERMPHJOIN_VAL OF S2,+                                                       synthesized TERMPH_VAL     OF S3]]+   <|>+-}+    parser (nt jointermph S1 *> nt termphjoin S2 *> nt jointermph S3) --"hall and galileo discovered...?"+    [rule_s TERMPH_VAL  OF LHS ISEQUALTO appjoin1 [synthesized TERMPH_VAL     OF S1,+                                                   synthesized TERMPHJOIN_VAL OF S2,+                                                   synthesized TERMPH_VAL     OF S3]]+   <|>+    parser (nt termph S4)+    [rule_s TERMPH_VAL  OF LHS ISEQUALTO copy [synthesized TERMPH_VAL  OF S4]]+   )+------------------------------------------------------------------------------------+-- public <joinvbph> = <verbph> <verbphjoin> <joinvbph> | <verbph>;+joinvbph  + = memoize Joinvbph   +   (+   parser (nt verbph S1  *> nt verbphjoin S2  *> nt joinvbph S3)+   [rule_s VERBPH_VAL  OF LHS ISEQUALTO appjoin2 [synthesized VERBPH_VAL    OF S1,+                                                  synthesized VBPHJOIN_VAL  OF S2,+                                                  synthesized VERBPH_VAL    OF S3]]+    <|>+    parser (nt verbph S4)+    [rule_s VERBPH_VAL  OF LHS ISEQUALTO copy [synthesized VERBPH_VAL  OF S4]]+   )+---------------------------------------------------------------------------+-- public <sent> = <jointermph> <joinvbph>;+sent  + = memoize Sent+   (+    parser (nt jointermph S1  *> nt joinvbph S2)+    [rule_s SENT_VAL OF LHS ISEQUALTO apply_termphrase [synthesized TERMPH_VAL  OF  S1,+                                                        synthesized VERBPH_VAL  OF  S2]]+   )+-- **************************************************************************** --+-- public <two_sent> = <sent> <sentjoin> <sent>;+two_sent + = memoize Two_sent+   (+    parser (nt sent S1 *> nt sentjoin S2 *> nt sent S3)+    [rule_s SENT_VAL OF LHS ISEQUALTO sent_val_comp [synthesized SENT_VAL      OF  S1,+                                                     synthesized SENTJOIN_VAL  OF  S2,+                                                     synthesized SENT_VAL      OF  S3]] +   )+------------------------------------------------------------------------------------+{-+	public <question> = <quest1> <sent>+                        | <quest6> <quest1> <sent>+                        | <quest5> <quest1> <sent>+                        | <quest2> <joinvbph>+                        | <quest5> <joinvbph>+                        | <quest3> <nouncla>+                        | <quest3> <nouncla> <joinvbph>+                        | <quest4> <nouncla> <joinvbph>+                        | <two_sent>+                        | <sent>;++-}+question   + = memoize Question  +   (+    parser (nt quest1 S1  *> nt sent S2 )+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans1 [synthesized QUEST1_VAL  OF  S1,+                                              synthesized SENT_VAL    OF  S2]]  +    <|>+    parser (nt quest6 S1  *> nt quest1 S2  *>  nt sent S3 )+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans5 [synthesized QUEST2_VAL  OF  S1,+                                              synthesized QUEST1_VAL OF S2,+                                              synthesized SENT_VAL    OF  S3]]  +    <|>+    parser (nt quest5 S1  *> nt quest1 S2  *>  nt sent S3 )+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans5 [synthesized QUEST2_VAL  OF  S1,+                                              synthesized QUEST1_VAL OF S2,+                                              synthesized SENT_VAL    OF  S3]]  +    <|>+    parser (nt quest2 S1 *> nt joinvbph S2)+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans2 [synthesized QUEST2_VAL    OF  S1,+                                              synthesized VERBPH_VAL    OF  S2]] +    <|>+    parser (nt quest5 S1 *> nt joinvbph S2)+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans2 [synthesized QUEST2_VAL    OF  S1,+                                              synthesized VERBPH_VAL    OF  S2]] +    <|>+    parser (nt quest3 S1 *> nt nouncla S2 *> nt joinvbph S3)+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans3 [synthesized QUEST3_VAL  OF S1,+                                              synthesized NOUNCLA_VAL OF S2,+                                              synthesized VERBPH_VAL  OF  S3]]+    <|>+    parser (nt quest4 S1 *> nt nouncla S2 *> nt joinvbph S3)+    [rule_s QUEST_VAL  OF LHS ISEQUALTO ans3 [synthesized QUEST3_VAL  OF  S1,+                                              synthesized NOUNCLA_VAL OF  S2,+                                              synthesized VERBPH_VAL  OF  S3]]+    <|>+    parser (nt two_sent S1)+    [rule_s QUEST_VAL OF LHS ISEQUALTO truefalse [synthesized SENT_VAL OF  S1]]  +    <|>+    parser (nt sent S1)+    [rule_s QUEST_VAL  OF LHS ISEQUALTO truefalse [synthesized SENT_VAL OF  S1]]++   )++-- public <quest4> = <quest4a> <quest4b>;+quest4 = memoize Quest4 +   (+   parser (nt quest4a S1 *> nt quest4b S2) +   [rule_s QUEST3_VAL  OF LHS ISEQUALTO copy [synthesized QUEST3_VAL  OF  S1]] +   )+---------------------------------------------------------------------------------++query = memoize Query+        (+        parser (nt question S1) -- *> nt terminator S2)+        [rule_s QUEST_VAL  OF LHS ISEQUALTO copy [synthesized QUEST_VAL  OF  S1]]+        )++++{-+|| -----------------------------------------------------------------------------+|| THE SEMANTICS - PART I : The attribute evaluation  functions+||-----------------------------------------------------------------------------+applyBiOp [e1,op,e2] +                  = \atts -> VAL ((getAtts getB_OP atts op ) (getAtts getAVAL atts e1 ) (getAtts getAVAL atts e2))++-}+-- getAtts f (y,i) x = f (head (x y i))+-- copy      [b]     = \(atts,i) -> head (b atts i)++intrsct1         [x, y]    + = \atts -> NOUNCLA_VAL (liftM2 intersect_entevimages (getAtts getAVALS atts x) (getAtts getAVALS atts y))++intrsct2         [x, y]         + = \atts -> ADJ_VAL (liftM2 intersect_entevimages (getAtts getAVALS atts x) (getAtts getAVALS atts y))++applydet         [x, y]                 + = \atts -> TERMPH_VAL $ (getAtts getDVAL atts x) (getAtts getAVALS atts y)+ +--make_trans_vb is very similar to make_relation.  getBR must mean "get binary relation"+--getTVAL must mean "get predicate" i.e. what would be "phobos" in "discover phobos"+--Changed to get rid of make_trans_vb, since the getBR attribute was changed to not +--be a binary relation but instead a function that make_relation would give+--I.e., the kind of function that make_trans_vb would have generated, since they were+--nearly identical++--NEW FOR PREPOSITIONAL PHRASES+applytransvbprep [x,y,z] atts = VERBPH_VAL $ make_filtered_relation dataStore reln ((["object"],predicate):preps)+    where +    reln = getAtts getBR atts x+    predicate = getAtts getTVAL atts y+    preps = getAtts getPREPVAL atts z+    +applytransvbprep [x,y] atts = VERBPH_VAL $ make_filtered_relation dataStore reln [(["object"],predicate)]+    where+    reln = getAtts getBR atts x+    predicate = getAtts getTVAL atts y++applytransvb_no_tmph [x,y] atts = VERBPH_VAL $ make_filtered_relation dataStore reln preps+    where+    reln = getAtts getBR atts x+    preps = getAtts getPREPVAL atts y++applytransvb_no_tmph [x] atts = VERBPH_VAL $ make_filtered_relation dataStore reln []+    where+    reln = getAtts getBR atts x++--TODO: modify grammar so you can't ask "what was phobos discover", or if you can, make the answer sensible (e.g. hall, not phobos)+apply_quest_transvb_passive (x2:x3:x4:xs) atts = VERBPH_VAL $ termph $ make_inverted_filtered_relation dataStore reln preps+    where+    linkingvb = getAtts getLINKVAL atts x2+    termph = getAtts getTVAL atts x3+    reln = getAtts getBR atts x4+    preps = case xs of+        [] -> []+        (x5:_) -> getAtts getPREPVAL atts x5+    +applyprepph     [x, y]+ = \atts -> PREPPH_VAL $+        let prep_names = getAtts getPREPNVAL atts x+            termph = getAtts getTVAL atts y in+        (prep_names, termph)+        +applyprep   [x]+ = \atts -> PREP_VAL $ [(getAtts getPREPPHVAL atts x)] --[(["with_implement"], a telescope)]+ +applypreps      [x, y]+ = \atts -> PREP_VAL $ (getAtts getPREPPHVAL atts x):(getAtts getPREPVAL atts y)+ +applyyear [x]+ = \atts -> TERMPH_VAL $ make_pnoun $ show $ getAtts getYEARVAL atts x+ +--END PREPOSITIONAL PHRASES+        +applyvbph        [z]    + = \atts -> VERBPH_VAL (getAtts getAVALS atts z)+ +appjoin1         [x, y, z]     + = \atts -> TERMPH_VAL $ (getAtts getTJVAL atts y) (getAtts getTVAL atts x) (getAtts getTVAL atts z)++appjoin2         [x, y, z]    + = \atts -> VERBPH_VAL ((getAtts getVJVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))++apply_middle1    [x, y, z]    + = \atts -> NOUNCLA_VAL ((getAtts getRELVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))++apply_middle2    [x, y, z]                  + = \atts -> NOUNCLA_VAL ((getAtts getNJVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))++apply_middle3    [x, y, z]    + = \atts -> NOUNCLA_VAL ((getAtts getRELVAL atts y) (getAtts getAVALS atts x) (getAtts getAVALS atts z))++-- Think "a orbited by b" vs "b orbits a"+{-drop3rd          [w, x, y, z]     + = \atts -> VERBPH_VAL $+        let reln = getAtts getBR atts x in+        let predicate = getAtts getTVAL atts z in+        make_inverted_relation dataStore reln predicate-}++--NEW FOR PREPOSITIONAL PHRASES+drop3rdprep (w:x:xs) atts = VERBPH_VAL $ make_inverted_filtered_relation dataStore reln preps+        where+        reln = getAtts getBR atts x+        preps = case xs of +            [] -> []+            (p:ps) -> getAtts getPREPVAL atts p+--END PREPOSITIONAL PHRASES+        +apply_termphrase [x, y]     + = \atts -> SENT_VAL ((getAtts getTVAL atts x) (getAtts getAVALS atts y))+ +sent_val_comp    [s1, f, s2]      + = \atts -> SENT_VAL ((getAtts getSJVAL atts f) (getAtts getSV atts s1) (getAtts getSV atts s2))++ans1             [x, y]       + = \atts -> QUEST_VAL ((getAtts getQU1VAL atts x) (getAtts getSV atts y) )++ans2             [x, y]     + = \atts -> QUEST_VAL ((getAtts getQU2VAL atts x) (getAtts getAVALS atts y))++ans3             [x, y, z]     + = \atts -> QUEST_VAL ((getAtts getQU3VAL atts x) (getAtts getAVALS atts y) (getAtts getAVALS atts z))++ans5             [x, y, z]     + = \atts -> QUEST_VAL ((getAtts getQU2VAL atts x) (getAtts getSV atts z))+ +truefalse        [x]       + = \atts -> QUEST_VAL $ do+        bool <- (getAtts getSV atts x)+        return $ if bool /= [] then "true." else "false."+        +++        +{-+||-----------------------------------------------------------------------------+|| THE SEMANTICS - PART II : Functions used to obtain objects denoted by +||   proper nouns, verbs, etc.+||-----------------------------------------------------------------------------++|| FUNCTION USED TO DEFINE OBJECTS ASSOCIATED WITH PROPER NOUNS+-}+--test_wrt e s = e `elem` s++-- FUNCTION USED TO DEFINE MEANINGS OF VERBS IN TERMS OF RELATIONS+--make_trans_vb rel p = [x | (x, image_x) <- collect rel, p image_x] -- Similar to make_relation++{- TERMINALS IN JSGF FORM++<Prepn> = with | in | at | by;++<Transvb> = discover | discovers | discovered | orbit | orbited | orbits;++<Indefpron> = anyone | anything | anybody | someone | something | somebody | everyone | everything | everybody;++<Quest5> = where | when | how;++<Quest4b> = many;++<Sentjoin> = and;++<Linkingvb> = is | was | are | were;++<Nounjoin> = and | or;++<Verbphjoin> = and | or;++<Quest3> = which | what;++<Det> = the | a | one | an | some | any | every | all | two;++<Termphjoin> = and | or;++<Quest6> = what;++<Intransvb> = exist | exists | spin | spins;++-}++dictionary = [+    ("thing",              Cnoun,     [NOUNCLA_VAL $ get_members dataStore "thing"]),+    ("things",             Cnoun,     [NOUNCLA_VAL $ get_members dataStore "thing"]),+    ("planets",            Cnoun,     [NOUNCLA_VAL $ get_members dataStore "planet"]),+    ("planet",             Cnoun,     [NOUNCLA_VAL $ get_members dataStore "planet"]),+    ("person",             Cnoun,     [NOUNCLA_VAL $ get_members dataStore "person"]),   +    ("sun",                Cnoun,     [NOUNCLA_VAL $ get_members dataStore "sun"]), +    ("moon",               Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]), +    ("moons",              Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]),+    ("satellite",          Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]),+    ("satellites",         Cnoun,     [NOUNCLA_VAL $ get_members dataStore "moon"]),+    ("atmospheric",        Adj,       [ADJ_VAL $ get_members dataStore "atmospheric"]),+    ("blue",               Adj,       [ADJ_VAL $ get_members dataStore "blue"]),+    ("solid",              Adj,       [ADJ_VAL $ get_members dataStore "solid"]),     +    ("brown",              Adj,       [ADJ_VAL $ get_members dataStore "brown"]),   +    ("gaseous",            Adj,       [ADJ_VAL $ get_members dataStore "gaseous"]),  +    ("green",              Adj,       [ADJ_VAL $ get_members dataStore "green"]),  +    ("red",                Adj,       [ADJ_VAL $ get_members dataStore "red"]),  +    ("ringed",             Adj,       [ADJ_VAL $ get_members dataStore "ringed"]),  +    ("vacuumous",          Adj,       [ADJ_VAL $ get_members dataStore "vacuumous"]),+    ("exist",              Intransvb, [VERBPH_VAL $ get_members dataStore "thing"]),+    ("exists",             Intransvb, [VERBPH_VAL $ get_members dataStore "thing"]),+    ("spin",               Intransvb, [VERBPH_VAL $ get_members dataStore "spin"]),+    ("spins",              Intransvb, [VERBPH_VAL $ get_members dataStore "spin"]),+    ("the",                Det,       [DET_VAL $ the]),+    ("a",                  Det,       [DET_VAL $ a]),+    ("one",                Det,       [DET_VAL $ one]), +    ("an",                 Det,       [DET_VAL $ a]), +    ("some",               Det,       [DET_VAL $ a]), +    ("any",                Det,       [DET_VAL $ a]), +    --("no",                 Det,       [DET_VAL $ no]), +    ("every",              Det,       [DET_VAL $ every]), +    ("all",                Det,       [DET_VAL $ every]),  +    ("two",                Det,       [DET_VAL $ two]),+    ("bernard",            Pnoun,     [TERMPH_VAL $ make_pnoun "bernard"]),+    ("bond",               Pnoun,     [TERMPH_VAL $ make_pnoun "bond"]),+    ("venus",              Pnoun,     [TERMPH_VAL $ make_pnoun "venus"]),+    ("cassini",            Pnoun,     [TERMPH_VAL $ make_pnoun "cassini"]),+    ("dollfus",            Pnoun,     [TERMPH_VAL $ make_pnoun "dollfus"]),+    --("fouuntain",          Pnoun,     [TERMPH_VAL $ make_pnoun "Fouuntain"]),+    ("galileo",            Pnoun,     [TERMPH_VAL $ make_pnoun "galileo"]),+    ("hall",               Pnoun,     [TERMPH_VAL $ make_pnoun "hall"]),+    ("herschel",           Pnoun,     [TERMPH_VAL $ make_pnoun "herschel"]),+    ("huygens",            Pnoun,     [TERMPH_VAL $ make_pnoun "huygens"]),+    ("kowal",              Pnoun,     [TERMPH_VAL $ make_pnoun "kowal"]),+    ("kuiper",             Pnoun,     [TERMPH_VAL $ make_pnoun "kuiper"]),+    ("larsen",             Pnoun,     [TERMPH_VAL $ make_pnoun "larsen"]),+    ("lassell",            Pnoun,     [TERMPH_VAL $ make_pnoun "lassell"]),+    ("melotte",            Pnoun,     [TERMPH_VAL $ make_pnoun "melotte"]),+    ("nicholson",          Pnoun,     [TERMPH_VAL $ make_pnoun "nicholson"]),+    ("perrine",            Pnoun,     [TERMPH_VAL $ make_pnoun "perrine"]),+    ("pickering",          Pnoun,     [TERMPH_VAL $ make_pnoun "pickering"]),+    ("almathea",           Pnoun,     [TERMPH_VAL $ make_pnoun "almathea"]),+    ("ariel",              Pnoun,     [TERMPH_VAL $ make_pnoun "ariel"]),+    ("callisto",           Pnoun,     [TERMPH_VAL $ make_pnoun "callisto"]),+    ("charon",             Pnoun,     [TERMPH_VAL $ make_pnoun "charon"]),+    ("deimos",             Pnoun,     [TERMPH_VAL $ make_pnoun "deimos"]),+    ("dione",              Pnoun,     [TERMPH_VAL $ make_pnoun "dione"]),+    ("earth",              Pnoun,     [TERMPH_VAL $ make_pnoun "earth"]),+    ("enceladus",          Pnoun,     [TERMPH_VAL $ make_pnoun "enceladus"]),+    ("europa",             Pnoun,     [TERMPH_VAL $ make_pnoun "europa"]),+    ("ganymede",           Pnoun,     [TERMPH_VAL $ make_pnoun "ganymede"]),+    ("hyperion",           Pnoun,     [TERMPH_VAL $ make_pnoun "hyperion"]),+    ("iapetus",            Pnoun,     [TERMPH_VAL $ make_pnoun "iapetus"]),+    ("io",                 Pnoun,     [TERMPH_VAL $ make_pnoun "io"]),+    ("janus",              Pnoun,     [TERMPH_VAL $ make_pnoun "janus"]),+    ("jupiter",            Pnoun,     [TERMPH_VAL $ make_pnoun "jupiter"]),+    ("jupitereighth",      Pnoun,     [TERMPH_VAL $ make_pnoun "jupitereighth"]),+    ("jupitereleventh",    Pnoun,     [TERMPH_VAL $ make_pnoun "jupitereleventh"]),+    ("jupiterfourteenth",  Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterfourteenth"]),+    ("jupiterninth",       Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterninth"]),+    ("jupiterseventh",     Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterseventh"]),+    ("jupitersixth",       Pnoun,     [TERMPH_VAL $ make_pnoun "jupitersixth"]),+    ("jupitertenth",       Pnoun,     [TERMPH_VAL $ make_pnoun "jupitertenth"]),+    ("jupiterthirteenth",  Pnoun,     [TERMPH_VAL $ make_pnoun "jupiterthirteenth"]),+    ("jupitertwelfth",     Pnoun,     [TERMPH_VAL $ make_pnoun "jupitertwelfth"]),+    ("luna",               Pnoun,     [TERMPH_VAL $ make_pnoun "luna"]),+    ("mars",               Pnoun,     [TERMPH_VAL $ make_pnoun "mars"]),+    ("mercury",            Pnoun,     [TERMPH_VAL $ make_pnoun "mercury"]),+    ("mimas",              Pnoun,     [TERMPH_VAL $ make_pnoun "mimas"]),+    ("miranda",            Pnoun,     [TERMPH_VAL $ make_pnoun "miranda"]),+    ("neptune",            Pnoun,     [TERMPH_VAL $ make_pnoun "neptune"]),+    ("nereid",             Pnoun,     [TERMPH_VAL $ make_pnoun "nereid"]),+    ("oberon",             Pnoun,     [TERMPH_VAL $ make_pnoun "oberon"]),+    ("phobos",             Pnoun,     [TERMPH_VAL $ make_pnoun "phobos"]),+    ("phoebe",             Pnoun,     [TERMPH_VAL $ make_pnoun "phoebe"]),+    ("pluto",              Pnoun,     [TERMPH_VAL $ make_pnoun "pluto"]),+    ("rhea",               Pnoun,     [TERMPH_VAL $ make_pnoun "rhea"]),+    ("saturn",             Pnoun,     [TERMPH_VAL $ make_pnoun "saturn"]),+    ("saturnfirst",        Pnoun,     [TERMPH_VAL $ make_pnoun "saturnfirst"]),+    ("sol",                Pnoun,     [TERMPH_VAL $ make_pnoun "sol"]),+    ("tethys",             Pnoun,     [TERMPH_VAL $ make_pnoun "tethys"]),+    ("titan",              Pnoun,     [TERMPH_VAL $ make_pnoun "titan"]),+    ("titania",            Pnoun,     [TERMPH_VAL $ make_pnoun "titania"]),+    ("triton",             Pnoun,     [TERMPH_VAL $ make_pnoun "triton"]),+    ("umbriel",            Pnoun,     [TERMPH_VAL $ make_pnoun "umbriel"]),+    ("uranus",             Pnoun,     [TERMPH_VAL $ make_pnoun "uranus"]),+    ("venus",              Pnoun,     [TERMPH_VAL $ make_pnoun "venus"]),+    ("discover",           Transvb,   [VERB_VAL ("discover_ev")]),+    ("discovers",          Transvb,   [VERB_VAL ("discover_ev")]),+    ("discovered",         Transvb,   [VERB_VAL ("discover_ev")]),+    ("orbit",              Transvb,   [VERB_VAL ("orbit_ev")]),+    ("orbited",            Transvb,   [VERB_VAL ("orbit_ev")]),+    ("orbits",             Transvb,   [VERB_VAL ("orbit_ev")]),+    ("is",                 Linkingvb, [LINKINGVB_VAL  id]),+    ("was",                Linkingvb, [LINKINGVB_VAL  id]), +    ("are",                Linkingvb, [LINKINGVB_VAL  id]),+    ("were",               Linkingvb, [LINKINGVB_VAL  id]),+    ("that",               Relpron,   [RELPRON_VAL    $ that]),+    ("who",                Relpron,   [RELPRON_VAL    $ that]),+    ("which",              Relpron,   [RELPRON_VAL    $ that]),+    ("and",                Verbphjoin,[VBPHJOIN_VAL   $ nounand]),+    ("or",                 Verbphjoin,[VBPHJOIN_VAL   $ nounor]),+    ("and",                Nounjoin,  [NOUNJOIN_VAL   $ nounand]),+    ("or",                 Nounjoin,  [NOUNJOIN_VAL   $ nounor]),+    ("and",                Termphjoin,[TERMPHJOIN_VAL termand]),+    ("or",                 Termphjoin,[TERMPHJOIN_VAL termor]), +    ("and",                Sentjoin,  [SENTJOIN_VAL   $ sand]),+    ("does",               Quest1,    [QUEST1_VAL     $ yesno]),+    ("did",                Quest1  ,  [QUEST1_VAL     $ yesno]),+    ("do",                 Quest1,    [QUEST1_VAL     $ yesno]),+    ("is",                 Quest1,    [QUEST1_VAL     $ yesno]),+    ("was",                Quest1,    [QUEST1_VAL     $ yesno]),+    ("are",                Quest1,    [QUEST1_VAL     $ yesno]),  +    ("were",               Quest1,    [QUEST1_VAL     $ yesno]),  +    ("what",               Quest2,    [QUEST2_VAL     $ what]),+    ("who",                Quest2,    [QUEST2_VAL     $ who]),+    ("what",               Quest6,    [QUEST2_VAL     $ whatobj]),+    ("where",              Quest5,    [QUEST2_VAL     $ where']),+    ("when",               Quest5,    [QUEST2_VAL     $ when']),+    ("how",                Quest5,    [QUEST2_VAL     $ how']),+    ("which",              Quest3,    [QUEST3_VAL     which]),+    ("what",               Quest3,    [QUEST3_VAL     which]),+    ("how",                Quest4a,   [QUEST3_VAL     $ how_many]),+    ("many",               Quest4b,   [QUEST3_VAL     $ how_many]),+    ("human",       Cnoun,    meaning_of nouncla "person" Nouncla),+    ("discoverer",  Cnoun,            [NOUNCLA_VAL $ get_subjs_of_event_type dataStore "discover_ev"]),+    ("discoverers", Cnoun,            [NOUNCLA_VAL $ get_subjs_of_event_type dataStore "discover_ev"]), +    ("humans",      Cnoun,    meaning_of nouncla "person" Nouncla), +    ("people",      Cnoun,    meaning_of nouncla "person" Nouncla),+    --("orbit",       Intransvb,        [VERBPH_VAL $ get_subjs_of_event_type dataStore "orbit_ev"]), +    --("orbits",      Intransvb,        [VERBPH_VAL $ get_subjs_of_event_type dataStore "orbit_ev"]),+    ("anyone",      Indefpron,meaning_of detph   "a person" Detph),+    ("anything",    Indefpron,meaning_of detph   "a thing" Detph),+    ("anybody",     Indefpron,meaning_of detph   "a person" Detph),+    ("someone",     Indefpron,meaning_of detph   "a person" Detph),+    ("something",   Indefpron,meaning_of detph   "a thing" Detph),+    ("somebody",    Indefpron,meaning_of detph   "a person" Detph),+    ("everyone",    Indefpron,meaning_of detph   "every person" Detph),+    ("everything",  Indefpron,meaning_of detph   "every thing" Detph),+    ("everybody",   Indefpron,meaning_of detph   "every person" Detph),+    --("nobody",      Indefpron,meaning_of detph   "no person" Detph),+    --("noone",       Indefpron,meaning_of detph   "no person" Detph),+    --Begin prepositional stuff--+    ("with",        Prepn, [PREPN_VAL ["with_implement"]]),+    ("in",          Prepn, [PREPN_VAL ["location","year"]]),+    ("at",          Prepn, [PREPN_VAL ["location"]]),+    ("by",          Prepn, [PREPN_VAL ["subject"]]),+    --Begin telescope stuff--+    ("telescope",   Cnoun, [NOUNCLA_VAL $ get_members dataStore "telescope"]),+    ("telescopes",  Cnoun, [NOUNCLA_VAL $ get_members dataStore "telescope"]),+    ("cassegrain_telescope",            Pnoun,[TERMPH_VAL $ make_pnoun "cassegrain_telescope"]),+    ("hooker_telescope",                Pnoun,[TERMPH_VAL $ make_pnoun "hooker_telescope"]),+    ("schmidt_telescope",               Pnoun,[TERMPH_VAL $ make_pnoun "schmidt_telescope"]),+    ("subaru_reflector_telescope",      Pnoun,[TERMPH_VAL $ make_pnoun "subaru_reflector_telescope"]),+    ("canada-france-hawaii_telescope",  Pnoun,[TERMPH_VAL $ make_pnoun "canada-france-hawaii_telescope"]),+    ("aerial_telescope_1",              Pnoun,[TERMPH_VAL $ make_pnoun "aerial_telescope_1"]),+    ("bruce_astrograph",                Pnoun,[TERMPH_VAL $ make_pnoun "bruce_astrograph"]),+    ("telescope_1",                     Pnoun,[TERMPH_VAL $ make_pnoun "telescope_1"]),+    ("hale_telescope",                  Pnoun,[TERMPH_VAL $ make_pnoun "hale_telescope"]),+    ("hubble_space_telescope",          Pnoun,[TERMPH_VAL $ make_pnoun "hubble_space_telescope"]),+    ("blanco_telescope",                Pnoun,[TERMPH_VAL $ make_pnoun "blanco_telescope"]),+    ("crossley_reflector_telescope",    Pnoun,[TERMPH_VAL $ make_pnoun "crossley_reflector_telescope"]),+    ("refractor_telescope_1",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_1"]),+    ("refractor_telescope_2",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_2"]),+    ("refractor_telescope_3",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_3"]),+    ("refractor_telescope_4",           Pnoun,[TERMPH_VAL $ make_pnoun "refractor_telescope_4"]),+    ("reflector_telescope_1",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_1"]),+    ("reflector_telescope_2",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_2"]),+    ("reflector_telescope_3",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_3"]),+    ("reflector_telescope_4",           Pnoun,[TERMPH_VAL $ make_pnoun "reflector_telescope_4"]),+    ("ground_based_telescope_1",        Pnoun,[TERMPH_VAL $ make_pnoun "ground_based_telescope_1"]),+    ("ground_based_telescope_2",        Pnoun,[TERMPH_VAL $ make_pnoun "ground_based_telescope_2"]),+    ("ground_based_telescope_3",        Pnoun,[TERMPH_VAL $ make_pnoun "ground_based_telescope_3"]),+    ("galilean_telescope_1",            Pnoun,[TERMPH_VAL $ make_pnoun "galilean_telescope_1"]),+    --Begin science team stuff+    ("team",                            Cnoun, [NOUNCLA_VAL $ get_members dataStore "science_team"]),+    ("teams",                           Cnoun, [NOUNCLA_VAL $ get_members dataStore "science_team"]),+    ("voyager_science_team",            Pnoun,[TERMPH_VAL $ make_pnoun "voyager_science_team"]),+    ("cassini_imaging_science_team",    Pnoun,[TERMPH_VAL $ make_pnoun "cassini_imaging_science_team"]),+    ("science_team_1",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_1"]),+    ("science_team_2",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_2"]),+    ("science_team_3",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_3"]),+    ("science_team_4",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_4"]),+    ("science_team_5",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_5"]),+    ("science_team_6",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_6"]),+    ("science_team_7",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_7"]),+    ("science_team_8",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_8"]),+    ("science_team_9",                  Pnoun,[TERMPH_VAL $ make_pnoun "science_team_9"]),+    ("science_team_10",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_10"]),+    ("science_team_11",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_11"]),+    ("science_team_12",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_12"]),+    ("science_team_13",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_13"]),+    ("science_team_14",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_14"]),+    ("science_team_15",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_15"]),+    ("science_team_16",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_16"]),+    ("science_team_17",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_17"]),+    ("science_team_18",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_18"]),+    ("science_team_19",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_19"]),+    ("science_team_20",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_20"]),+    ("science_team_21",                 Pnoun,[TERMPH_VAL $ make_pnoun "science_team_21"]),+    --Begin new people stuff--+    ("larson", Pnoun, [TERMPH_VAL $ make_pnoun "larson"]),+    ("fountain", Pnoun, [TERMPH_VAL $ make_pnoun "fountain"]),+    ("scotti", Pnoun, [TERMPH_VAL $ make_pnoun "scotti"]),+    ("spahr", Pnoun, [TERMPH_VAL $ make_pnoun "spahr"]),+    ("mcmillan", Pnoun, [TERMPH_VAL $ make_pnoun "mcmillan"]),+    ("montani", Pnoun, [TERMPH_VAL $ make_pnoun "montani"]),+    ("gleason", Pnoun, [TERMPH_VAL $ make_pnoun "gleason"]),+    ("gehrels", Pnoun, [TERMPH_VAL $ make_pnoun "gehrels"]),+    ("roemer", Pnoun, [TERMPH_VAL $ make_pnoun "roemer"]),+    ("sheppard", Pnoun, [TERMPH_VAL $ make_pnoun "sheppard"]),+    ("jewitt", Pnoun, [TERMPH_VAL $ make_pnoun "jewitt"]),+    ("fernandez", Pnoun, [TERMPH_VAL $ make_pnoun "fernandez"]),+    ("magnier", Pnoun, [TERMPH_VAL $ make_pnoun "magnier"]),+    ("kleyna", Pnoun, [TERMPH_VAL $ make_pnoun "kleyna"]),+    ("gladman", Pnoun, [TERMPH_VAL $ make_pnoun "gladman"]),+    ("kavelaars", Pnoun, [TERMPH_VAL $ make_pnoun "kavelaars"]),+    ("petit", Pnoun, [TERMPH_VAL $ make_pnoun "petit"]),+    ("allen", Pnoun, [TERMPH_VAL $ make_pnoun "allen"]),+    ("laques", Pnoun, [TERMPH_VAL $ make_pnoun "laques"]),+    ("lecacheux", Pnoun, [TERMPH_VAL $ make_pnoun "lecacheux"]),+    ("smith", Pnoun, [TERMPH_VAL $ make_pnoun "smith"]),+    ("reitsema", Pnoun, [TERMPH_VAL $ make_pnoun "reitsema"]),+    ("pascu", Pnoun, [TERMPH_VAL $ make_pnoun "pascu"]),+    ("seidelmann", Pnoun, [TERMPH_VAL $ make_pnoun "seidelmann"]),+    ("baum", Pnoun, [TERMPH_VAL $ make_pnoun "baum"]),+    ("currie", Pnoun, [TERMPH_VAL $ make_pnoun "currie"]),+    ("showalter", Pnoun, [TERMPH_VAL $ make_pnoun "showalter"]),+    ("scholl", Pnoun, [TERMPH_VAL $ make_pnoun "scholl"]),+    ("holman", Pnoun, [TERMPH_VAL $ make_pnoun "holman"]),+    ("marsden", Pnoun, [TERMPH_VAL $ make_pnoun "marsden"]),+    ("burns", Pnoun, [TERMPH_VAL $ make_pnoun "burns"]),+    ("milisavljevic", Pnoun, [TERMPH_VAL $ make_pnoun "milisavljevic"]),+    ("grav", Pnoun, [TERMPH_VAL $ make_pnoun "grav"]),+    ("karkoschka", Pnoun, [TERMPH_VAL $ make_pnoun "karkoschka"]),+    ("lissauer", Pnoun, [TERMPH_VAL $ make_pnoun "lissauer"]),+    ("fraser", Pnoun, [TERMPH_VAL $ make_pnoun "fraser"]),+    ("christy", Pnoun, [TERMPH_VAL $ make_pnoun "christy"]),+    ("weaver", Pnoun, [TERMPH_VAL $ make_pnoun "weaver"]),+    ("stern", Pnoun, [TERMPH_VAL $ make_pnoun "stern"]),+    ("mutchler", Pnoun, [TERMPH_VAL $ make_pnoun "mutchler"]),+    ("steffl", Pnoun, [TERMPH_VAL $ make_pnoun "steffl"]),+    ("buie", Pnoun, [TERMPH_VAL $ make_pnoun "buie"]),+    ("merline", Pnoun, [TERMPH_VAL $ make_pnoun "merline"]),+    ("spencer", Pnoun, [TERMPH_VAL $ make_pnoun "spencer"]),+    ("young_e_f", Pnoun, [TERMPH_VAL $ make_pnoun "young_e_f"]),+    ("young_l_a", Pnoun, [TERMPH_VAL $ make_pnoun "young_l_a"]),+    ("hamilton", Pnoun, [TERMPH_VAL $ make_pnoun "hamilton"]),+    ("soummer", Pnoun, [TERMPH_VAL $ make_pnoun "soummer"]),+    ("throop", Pnoun, [TERMPH_VAL $ make_pnoun "throop"]),+    --Begin new spacecraft stuff--+    ("spacecraft",  Cnoun, [NOUNCLA_VAL $ get_members dataStore "spacecraft"]),+    ("spacecrafts", Cnoun, [NOUNCLA_VAL $ get_members dataStore "spacecraft"]),+    ("voyager_1",   Pnoun, [TERMPH_VAL $ make_pnoun "voyager_1"]),+    ("voyager_2",   Pnoun, [TERMPH_VAL $ make_pnoun "voyager_2"]),+    ("cassini", Pnoun, [TERMPH_VAL $ make_pnoun "voyager_2"]),+    --Begin new places stuff--+    ("place",   Cnoun, [NOUNCLA_VAL $ get_members dataStore "place"]),+    ("places",  Cnoun, [NOUNCLA_VAL $ get_members dataStore "place"]),+    ("mt_hopkins", Pnoun, [TERMPH_VAL $ make_pnoun "mt_hopkins"]),+    ("fort_davis", Pnoun, [TERMPH_VAL $ make_pnoun "fort_davis"]),+    ("cerro_tololo", Pnoun, [TERMPH_VAL $ make_pnoun "cerro_tololo"]),+    ("us_naval_observatory", Pnoun, [TERMPH_VAL $ make_pnoun "us_naval_observatory"]),+    ("padua", Pnoun, [TERMPH_VAL $ make_pnoun "padua"]),+    ("mt_hamilton", Pnoun, [TERMPH_VAL $ make_pnoun "mt_hamilton"]),+    ("greenwich", Pnoun, [TERMPH_VAL $ make_pnoun "greenwich"]),+    ("mt_wilson", Pnoun, [TERMPH_VAL $ make_pnoun "mt_wilson"]),+    ("mt_palomar", Pnoun, [TERMPH_VAL $ make_pnoun "mt_palomar"]),+    ("kitt_peak", Pnoun, [TERMPH_VAL $ make_pnoun "kitt_peak"]),+    ("mauna_kea", Pnoun, [TERMPH_VAL $ make_pnoun "mauna_kea"]),+    ("slough", Pnoun, [TERMPH_VAL $ make_pnoun "slough"]),+    ("paris", Pnoun, [TERMPH_VAL $ make_pnoun "paris"]),+    ("the_hague", Pnoun, [TERMPH_VAL $ make_pnoun "the_hague"]),+    ("cambridge", Pnoun, [TERMPH_VAL $ make_pnoun "cambridge"]),+    ("liverpool", Pnoun, [TERMPH_VAL $ make_pnoun "liverpool"]),+    ("arequipa", Pnoun, [TERMPH_VAL $ make_pnoun "arequipa"]),+    ("pic_du_midi", Pnoun, [TERMPH_VAL $ make_pnoun "pic_du_midi"]),+    ("flagstaff", Pnoun, [TERMPH_VAL $ make_pnoun "flagstaff"]),+    ("la_silla", Pnoun, [TERMPH_VAL $ make_pnoun "la_silla"]),+    --Begin new moons stuff--+    ("himalia",            Pnoun,     [TERMPH_VAL $ make_pnoun "himalia"]),+    ("elara",              Pnoun,     [TERMPH_VAL $ make_pnoun "elara"]),+    ("pasiphae",           Pnoun,     [TERMPH_VAL $ make_pnoun "pasiphae"]),+    ("sinope",             Pnoun,     [TERMPH_VAL $ make_pnoun "sinope"]),+    ("lysithea",           Pnoun,     [TERMPH_VAL $ make_pnoun "lysithea"]),+    ("carme",              Pnoun,     [TERMPH_VAL $ make_pnoun "carme"]),+    ("ananke",             Pnoun,     [TERMPH_VAL $ make_pnoun "ananke"]),+    ("leda",               Pnoun,     [TERMPH_VAL $ make_pnoun "leda"]),+    ("thebe",              Pnoun,     [TERMPH_VAL $ make_pnoun "thebe"]),+    ("adrastea",           Pnoun,     [TERMPH_VAL $ make_pnoun "adrastea"]),+    ("metis",              Pnoun,     [TERMPH_VAL $ make_pnoun "metis"]),+    ("callirrhoe",         Pnoun,     [TERMPH_VAL $ make_pnoun "callirrhoe"]),+    ("themisto",           Pnoun,     [TERMPH_VAL $ make_pnoun "themisto"]),+    ("megaclite",          Pnoun,     [TERMPH_VAL $ make_pnoun "megaclite"]),+    ("taygete",            Pnoun,     [TERMPH_VAL $ make_pnoun "taygete"]),+    ("chaldene",           Pnoun,     [TERMPH_VAL $ make_pnoun "chaldene"]),+    ("harpalyke",          Pnoun,     [TERMPH_VAL $ make_pnoun "harpalyke"]),+    ("kalyke",             Pnoun,     [TERMPH_VAL $ make_pnoun "kalyke"]),+    ("iocaste",            Pnoun,     [TERMPH_VAL $ make_pnoun "iocaste"]),+    ("erinome",            Pnoun,     [TERMPH_VAL $ make_pnoun "erinome"]),+    ("isonoe",             Pnoun,     [TERMPH_VAL $ make_pnoun "isonoe"]),+    ("praxidike",          Pnoun,     [TERMPH_VAL $ make_pnoun "praxidike"]),+    ("autonoe",            Pnoun,     [TERMPH_VAL $ make_pnoun "autonoe"]),+    ("thyone",             Pnoun,     [TERMPH_VAL $ make_pnoun "thyone"]),+    ("hermippe",           Pnoun,     [TERMPH_VAL $ make_pnoun "hermippe"]),+    ("aitne",              Pnoun,     [TERMPH_VAL $ make_pnoun "aitne"]),+    ("eurydome",           Pnoun,     [TERMPH_VAL $ make_pnoun "eurydome"]),+    ("euanthe",            Pnoun,     [TERMPH_VAL $ make_pnoun "euanthe"]),+    ("euporie",            Pnoun,     [TERMPH_VAL $ make_pnoun "euporie"]),+    ("orthosie",           Pnoun,     [TERMPH_VAL $ make_pnoun "orthosie"]),+    ("sponde",             Pnoun,     [TERMPH_VAL $ make_pnoun "sponde"]),+    ("kale",               Pnoun,     [TERMPH_VAL $ make_pnoun "kale"]),+    ("pasithee",           Pnoun,     [TERMPH_VAL $ make_pnoun "pasithee"]),+    ("hegemone",           Pnoun,     [TERMPH_VAL $ make_pnoun "hegemone"]),+    ("mneme",              Pnoun,     [TERMPH_VAL $ make_pnoun "mneme"]),+    ("aoede",              Pnoun,     [TERMPH_VAL $ make_pnoun "aoede"]),+    ("thelxinoe",          Pnoun,     [TERMPH_VAL $ make_pnoun "thelxinoe"]),+    ("arche",              Pnoun,     [TERMPH_VAL $ make_pnoun "arche"]),+    ("kallichore",         Pnoun,     [TERMPH_VAL $ make_pnoun "kallichore"]),+    ("helike",             Pnoun,     [TERMPH_VAL $ make_pnoun "helike"]),+    ("carpo",              Pnoun,     [TERMPH_VAL $ make_pnoun "carpo"]),+    ("eukelade",           Pnoun,     [TERMPH_VAL $ make_pnoun "eukelade"]),+    ("cyllene",            Pnoun,     [TERMPH_VAL $ make_pnoun "cyllene"]),+    ("kore",               Pnoun,     [TERMPH_VAL $ make_pnoun "kore"]),+    ("herse",              Pnoun,     [TERMPH_VAL $ make_pnoun "herse"]),+    ("epimetheus",         Pnoun,     [TERMPH_VAL $ make_pnoun "epimetheus"]),+    ("helene",             Pnoun,     [TERMPH_VAL $ make_pnoun "helene"]),+    ("telesto",            Pnoun,     [TERMPH_VAL $ make_pnoun "telesto"]),+    ("calypso",            Pnoun,     [TERMPH_VAL $ make_pnoun "calypso"]),+    ("atlas",              Pnoun,     [TERMPH_VAL $ make_pnoun "atlas"]),+    ("prometheus",         Pnoun,     [TERMPH_VAL $ make_pnoun "prometheus"]),+    ("pandora",            Pnoun,     [TERMPH_VAL $ make_pnoun "pandora"]),+    ("pan",                Pnoun,     [TERMPH_VAL $ make_pnoun "pan"]),+    ("ymir",               Pnoun,     [TERMPH_VAL $ make_pnoun "ymir"]),+    ("paaliaq",            Pnoun,     [TERMPH_VAL $ make_pnoun "paaliaq"]),+    ("tarvos",             Pnoun,     [TERMPH_VAL $ make_pnoun "tarvos"]),+    ("ijiraq",             Pnoun,     [TERMPH_VAL $ make_pnoun "ijiraq"]),+    ("suttungr",           Pnoun,     [TERMPH_VAL $ make_pnoun "suttungr"]),+    ("kiviuq",             Pnoun,     [TERMPH_VAL $ make_pnoun "kiviuq"]),+    ("mundilfari",         Pnoun,     [TERMPH_VAL $ make_pnoun "mundilfari"]),+    ("albiorix",           Pnoun,     [TERMPH_VAL $ make_pnoun "albiorix"]),+    ("skathi",             Pnoun,     [TERMPH_VAL $ make_pnoun "skathi"]),+    ("erriapus",           Pnoun,     [TERMPH_VAL $ make_pnoun "erriapus"]),+    ("siarnaq",            Pnoun,     [TERMPH_VAL $ make_pnoun "siarnaq"]),+    ("thrymr",             Pnoun,     [TERMPH_VAL $ make_pnoun "thrymr"]),+    ("narvi",              Pnoun,     [TERMPH_VAL $ make_pnoun "narvi"]),+    ("methone",            Pnoun,     [TERMPH_VAL $ make_pnoun "methone"]),+    ("pallene",            Pnoun,     [TERMPH_VAL $ make_pnoun "pallene"]),+    ("polydeuces",         Pnoun,     [TERMPH_VAL $ make_pnoun "polydeuces"]),+    ("daphnis",            Pnoun,     [TERMPH_VAL $ make_pnoun "daphnis"]),+    ("aegir",              Pnoun,     [TERMPH_VAL $ make_pnoun "aegir"]),+    ("bebhionn",           Pnoun,     [TERMPH_VAL $ make_pnoun "bebhionn"]),+    ("bergelmir",          Pnoun,     [TERMPH_VAL $ make_pnoun "bergelmir"]),+    ("bestla",             Pnoun,     [TERMPH_VAL $ make_pnoun "bestla"]),+    ("farbauti",           Pnoun,     [TERMPH_VAL $ make_pnoun "farbauti"]),+    ("fenrir",             Pnoun,     [TERMPH_VAL $ make_pnoun "fenrir"]),+    ("fornjot",            Pnoun,     [TERMPH_VAL $ make_pnoun "fornjot"]),+    ("hati",               Pnoun,     [TERMPH_VAL $ make_pnoun "hati"]),+    ("hyrrokkin",          Pnoun,     [TERMPH_VAL $ make_pnoun "hyrrokkin"]),+    ("kari",               Pnoun,     [TERMPH_VAL $ make_pnoun "kari"]),+    ("loge",               Pnoun,     [TERMPH_VAL $ make_pnoun "loge"]),+    ("skoll",              Pnoun,     [TERMPH_VAL $ make_pnoun "skoll"]),+    ("surtur",             Pnoun,     [TERMPH_VAL $ make_pnoun "surtur"]),+    ("anthe",              Pnoun,     [TERMPH_VAL $ make_pnoun "anthe"]),+    ("jarnsaxa",           Pnoun,     [TERMPH_VAL $ make_pnoun "jarnsaxa"]),+    ("greip",              Pnoun,     [TERMPH_VAL $ make_pnoun "greip"]),+    ("tarqeq",             Pnoun,     [TERMPH_VAL $ make_pnoun "tarqeq"]),+    ("aegaeon",            Pnoun,     [TERMPH_VAL $ make_pnoun "aegaeon"]),+    ("cordelia",           Pnoun,     [TERMPH_VAL $ make_pnoun "cordelia"]),+    ("ophelia",            Pnoun,     [TERMPH_VAL $ make_pnoun "ophelia"]),+    ("bianca",             Pnoun,     [TERMPH_VAL $ make_pnoun "bianca"]),+    ("cressida",           Pnoun,     [TERMPH_VAL $ make_pnoun "cressida"]),+    ("desdemona",          Pnoun,     [TERMPH_VAL $ make_pnoun "desdemona"]),+    ("juliet",             Pnoun,     [TERMPH_VAL $ make_pnoun "juliet"]),+    ("portia",             Pnoun,     [TERMPH_VAL $ make_pnoun "portia"]),+    ("rosalind",           Pnoun,     [TERMPH_VAL $ make_pnoun "rosalind"]),+    ("belinda",            Pnoun,     [TERMPH_VAL $ make_pnoun "belinda"]),+    ("puck",               Pnoun,     [TERMPH_VAL $ make_pnoun "puck"]),+    ("caliban",            Pnoun,     [TERMPH_VAL $ make_pnoun "caliban"]),+    ("sycorax",            Pnoun,     [TERMPH_VAL $ make_pnoun "sycorax"]),+    ("prospero",           Pnoun,     [TERMPH_VAL $ make_pnoun "prospero"]),+    ("setebos",            Pnoun,     [TERMPH_VAL $ make_pnoun "setebos"]),+    ("stephano",           Pnoun,     [TERMPH_VAL $ make_pnoun "stephano"]),+    ("trinculo",           Pnoun,     [TERMPH_VAL $ make_pnoun "trinculo"]),+    ("francisco",          Pnoun,     [TERMPH_VAL $ make_pnoun "francisco"]),+    ("margaret",           Pnoun,     [TERMPH_VAL $ make_pnoun "margaret"]),+    ("ferdinand",          Pnoun,     [TERMPH_VAL $ make_pnoun "ferdinand"]),+    ("perdita",            Pnoun,     [TERMPH_VAL $ make_pnoun "perdita"]),+    ("mab",                Pnoun,     [TERMPH_VAL $ make_pnoun "mab"]),+    ("cupid",              Pnoun,     [TERMPH_VAL $ make_pnoun "cupid"]),+    ("triton",             Pnoun,     [TERMPH_VAL $ make_pnoun "triton"]),+    ("naiad",              Pnoun,     [TERMPH_VAL $ make_pnoun "naiad"]),+    ("thalassa",           Pnoun,     [TERMPH_VAL $ make_pnoun "thalassa"]),+    ("despina",            Pnoun,     [TERMPH_VAL $ make_pnoun "despina"]),+    ("galatea",            Pnoun,     [TERMPH_VAL $ make_pnoun "galatea"]),+    ("larissa",            Pnoun,     [TERMPH_VAL $ make_pnoun "larissa"]),+    ("proteus",            Pnoun,     [TERMPH_VAL $ make_pnoun "proteus"]),+    ("halimede",           Pnoun,     [TERMPH_VAL $ make_pnoun "halimede"]),+    ("psamathe",           Pnoun,     [TERMPH_VAL $ make_pnoun "psamathe"]),+    ("sao",                Pnoun,     [TERMPH_VAL $ make_pnoun "sao"]),+    ("laomedeia",          Pnoun,     [TERMPH_VAL $ make_pnoun "laomedeia"]),+    ("neso",               Pnoun,     [TERMPH_VAL $ make_pnoun "neso"]),+    ("nix",                Pnoun,     [TERMPH_VAL $ make_pnoun "nix"]),+    ("hydra",              Pnoun,     [TERMPH_VAL $ make_pnoun "hydra"]),+    ("kerberos",           Pnoun,     [TERMPH_VAL $ make_pnoun "kerberos"]),+    ("styx",               Pnoun,     [TERMPH_VAL $ make_pnoun "styx"])++    ] ++ list_of_years+    +{-Major hack: Since the basic unit that the parser understands is strings (not characters), we have to manually add all years that we can query into the dictionary...+That is, we can't make the parser understand "1984" and "1245" by having it recognize four numbers, instead it must recognize the entire string of numbers at once+as a terminal (i.e., "1984" would be a terminal, not a non-terminal composed of "1", "9", "8", and "4").  Therefore, all possible strings must be added to the dictionary so that the parser can match them.++**this might need to be altered**+-}++list_of_years = map (\n -> (show n, Year, [YEAR_VAL n])) $ concat [[1000 + x, 2000 + x] | x <- [0..999]]+    +--test1 p p_ inp = do putStr  $ render80 $ format{-Atts p_-} $ snd $ unState (p T0 [] ((1,[]),words inp) ([],[])) [] +test p input = unState (p ((1,[]),input) ([],[])) [] ++++parse i = formatAttsFinalAlt Question  ((length (words i))+1) $ snd $ test (question T0 []) (words i)+    +findStart st ((s,ss):rest) | s == st   = [(s,ss)]+                           | otherwise = findStart st rest+findStart st []                        = []     ++input = words i1++i1 = "which moons that were discovered by hall orbit mars" -- OK+i2 = "who discovered a moon that orbits mars" -- OK+i3 = "did hall discover every moon that orbits mars" -- OK+i4 = "how many moons were discovered by hall and kuiper" -- OK+i5 = "how many moons were discovered by hall or kuiper" -- OK+i6 = "every moon was discovered by a person" -- OK+i7 = "which planets are orbited by a moon that was discovered by galileo" -- OK+i8 = "which moons were discovered by nobody" -- OK+i9 = "is every planet orbited by a moon" -- Broken in original too+i10 = "which planets are orbited by two moons" -- OK+i11 = "who was the discoverer of phobos" -- Broken in original too+i12 = "hall discovered a moon that orbits mars" -- OK+i13 = "which moons that orbit mars were discovered by hall" -- OK+i14 = "every moon orbits every planet" -- OK+i15 = "every planet is orbited by a moon" -- OK+i16 = "a planet is orbited by a moon" -- OK+i17 = "does phobos orbit mars" -- OK+--+i18 = "did hall discover deimos or phobos and miranda" -- Broken in original too+i19 = "did hall discover deimos or phobos and miranda or deimos and deimos" -- Broken in original too
+ XSaiga/TypeAg2.hs view
@@ -0,0 +1,192 @@+{-# LANGUAGE Trustworthy #-}+module XSaiga.TypeAg2 where++import XSaiga.Getts++data AttValue = VAL             {getAVAL    ::   Int} +              | MaxVal          {getAVAL    ::   Int} +              | SubVal          {getAVAL    ::   Int}+              | RepVal          {getAVAL    ::   Int}+              | Res             {getRVAL    ::   DisplayTree}+              | B_OP            {getB_OP    ::   (Int -> Int -> Int)} +              | U_OP            {getU_OP    ::   (Int -> Int)} +              | SENT_VAL        {getSV      ::   IO ES}+              | ErrorVal        {getEVAL    ::   String}    +          | NOUNCLA_VAL     {getAVALS   ::   IO ES} +          | VERBPH_VAL      {getAVALS   ::   IO ES}  +          | ADJ_VAL         {getAVALS   ::   IO ES} +          | TERMPH_VAL      {getTVAL    ::   (IO ES -> IO ES)}     +          | DET_VAL         {getDVAL    ::   (IO ES -> IO ES -> IO ES)} +          | VERB_VAL        {getBR      ::   Relation}      +          | RELPRON_VAL     {getRELVAL  ::   (IO ES -> IO ES -> IO ES)}    +          | NOUNJOIN_VAL    {getNJVAL   ::   (IO ES -> IO ES -> IO ES)}+          | VBPHJOIN_VAL    {getVJVAL   ::   (IO ES -> IO ES -> IO ES)}    +          | TERMPHJOIN_VAL  {getTJVAL   ::   ((IO ES -> IO ES) -> (IO ES -> IO ES) -> (IO ES -> IO ES)) }+          | PREP_VAL        {getPREPVAL ::  ([([String], IO ES -> IO ES)])} -- used in "hall discovered phobos with a telescope" as "with".  +          | PREPN_VAL       {getPREPNVAL :: [String]} --used for mapping between prepositions and their corresponding identifiers in the database.  I.e., "in" -> ["location", "year"]+          | PREPPH_VAL      {getPREPPHVAL :: ([String], IO ES -> IO ES)}+          | LINKINGVB_VAL   {getLINKVAL ::   (IO ES -> IO ES)}+          | SENTJOIN_VAL    {getSJVAL   ::   (IO ES -> IO ES -> IO ES)}+          | DOT_VAL         {getDOTVAL  ::   IO String}+          | QM_VAL          {getQMVAL   ::   IO String}+          | QUEST_VAL       {getQUVAL   ::   IO String}+          | QUEST1_VAL      {getQU1VAL  ::   (IO ES -> IO String)}+          | QUEST2_VAL      {getQU2VAL  ::   (IO ES -> IO String)}+          | QUEST3_VAL      {getQU3VAL  ::   (IO ES -> IO ES -> IO String)}+          | YEAR_VAL        {getYEARVAL ::   Int}++--            | RESULT [sys_message]+data MemoL    = Start | Tree | Num | Emp | ALeaf String | Expr | Op  | ET+              | Pnoun|Cnoun|Adj|Det|Intransvb|Transvb|Linkingvb|Relpron|Termphjoin|Verbphjoin|Nounjoin|Preps|Prepph|Prepn|Indefpron|Sentjoin|Quest1|Quest2|Quest3|Quest4a|Quest4b+              | Snouncla|Relnouncla|Nouncla|Adjs|Detph|Transvbph|Verbph|Termph|Jointermph|Joinvbph|Sent|Two_sent|Question|Quest4|Query|Year|Quest5|Quest6+                deriving (Eq,Ord,Show)++data Id       = O0|S0 |S1|S2|S3|S4|S5|S6|S7|S8|S9|T0|T1 | T2 | T3 |T4 | N1| N2 | N3 | E0 |E1 |E2 | O1| LHS  deriving (Eq,Ord,Show, Enum)+                -- basic IDs for identifying each NT  ++{-++attFunc + = [+    (VAL,getAVAL), (MaxVal,getAVAL), (SubVal,getAVAL), (RepVal,getAVAL), (Res,getRVAL), (B_OP,getB_OP),(U_OP,getU_OP),(SENT_VAL,getSV),(ErrorVal,getEVAL),+    (NOUNCLA_VAL,getAVALS),(VERBPH_VAL,getAVALS),(ADJ_VAL,getAVALS),(TERMPH_VAL,getTVAL),(DET_VAL,getDVAL),(VERB_VAL,getBR),(RELPRON_VAL,getRELVAL),(NOUNJOIN_VAL,getNJVAL),+    (VBPHJOIN_VAL,getVJVAL),(TERMPHJOIN_VAL,getTJVAL),(PREP_VAL,getPREPVAL),(LINKINGVB_VAL,getLINKVAL),(SENTJOIN_VAL,getSJVAL),(DOT_VAL,getDOTVAL),(QM_VAL,getQMVAL),(QUEST1_VAL,getQU1VAL),+    (QUEST2_VAL,getQU2VAL),(QUEST3_VAL,getQU3VAL)   +   ]+-}+type Entity         =  String  +type ES             =  Image -- [Int]+--type Bin_Rel        =  [(Entity,Entity)] -- [(Int, Int)]+--type Relation     = (ES -> Bool) -> ES+type Relation = String++data DisplayTree = B [DisplayTree]+                 | N Int+                   deriving (Show, Eq)+++--instance Show AttValue where++showio :: AttValue -> IO String+showio (VAL  j)     = return $ "VAL "    ++ show j+showio (MaxVal j)   = return $ "MaxVal " ++ show j+showio (SubVal j)   = return $ "SubVal " ++ show j+showio (RepVal j)   = return $ "RepVal " ++ show j+showio (Res j)      = return $ "Tree: "  ++ show j+showio (B_OP j)     = return $ "B_OP"+showio (U_OP j)     = return $ "U_OP"+showio (SENT_VAL j) = j >>= return . show +showio (ErrorVal j) = return j+showio (NOUNCLA_VAL j) = j >>= return . (++) "NOUNCLA_VAL " . unwords . map fst+showio (VERBPH_VAL j)  = j >>= return . (++) "VERBPH_VAL " . unwords . map fst+showio (ADJ_VAL    j)  = j >>= return . (++) "ADJ_VAL " . unwords . map fst+showio (TERMPH_VAL j)  = return "TERMPH_VAL "      +showio (DET_VAL j)     = return "DET_VAL " +showio (VERB_VAL j)    = return $ "VERB_VAL " ++ j+showio (RELPRON_VAL j)  = return "RELPRON_VAL "+showio (NOUNJOIN_VAL j)  = return "NOUNJOIN_VAL "+showio (VBPHJOIN_VAL j)  = return "VBPHJOIN_VAL "+showio (TERMPHJOIN_VAL j)  = return "TERMPHJOIN_VAL "+showio (PREP_VAL j)  = return "PREP_VAL "+showio (LINKINGVB_VAL j)  = return "LINKINGVB_VAL "+showio (SENTJOIN_VAL j)  = return "SENTJOIN_VAL "+showio (DOT_VAL j) = j +showio (QM_VAL j) = j +showio (QUEST_VAL j) = j +showio (QUEST1_VAL j)  = return "QUEST1_VAL"+showio (QUEST2_VAL j)  = return "QUEST2_VAL"+showio (QUEST3_VAL j)  = return "SENTJOIN_VAL"++instance Eq AttValue where+    (VAL  j)           == (VAL  j')     = True+    (MaxVal j)         == (MaxVal j')   = True+    (SubVal j)         == (SubVal j')   = True+    (RepVal j)         == (RepVal j')   = True+    (Res j)            == (Res j')      = True+    (B_OP j)           == (B_OP j')     = True+    (U_OP j)           == (U_OP j')     = True+    (SENT_VAL j)       == (SENT_VAL j') = True+    (NOUNCLA_VAL j)    == (NOUNCLA_VAL j') = True+    (VERBPH_VAL j)     == (VERBPH_VAL j') = True+    (ADJ_VAL j)        == (ADJ_VAL j') = True+    (TERMPH_VAL j)     == (TERMPH_VAL j') = True+    (DET_VAL j)        == (DET_VAL j') = True+    (VERB_VAL j)       == (VERB_VAL j') = True+    (RELPRON_VAL j)    == (RELPRON_VAL j') = True+    (NOUNJOIN_VAL j)   == (NOUNJOIN_VAL j') = True+    (VBPHJOIN_VAL j)   == (VBPHJOIN_VAL j') = True+    (TERMPHJOIN_VAL j) == (TERMPHJOIN_VAL j') = True+    (LINKINGVB_VAL j)  == (LINKINGVB_VAL j') = True+    (SENTJOIN_VAL j)   == (SENTJOIN_VAL j') = True+    (DOT_VAL j)        == (DOT_VAL j') = True+    (QM_VAL j)         == (QM_VAL j') = True+    (QUEST_VAL j)      == (QUEST_VAL j') = True+    (QUEST1_VAL j)     == (QUEST1_VAL j') = True+    (QUEST2_VAL j)     == (QUEST2_VAL j') = True+    (QUEST3_VAL j)     == (QUEST3_VAL j') = True+    (PREP_VAL s1)      == (PREP_VAL s) = True+    (PREPN_VAL s1)     == (PREPN_VAL s) = True+    (PREPPH_VAL s1)    == (PREPPH_VAL s) = True+    (YEAR_VAL s1)      == (YEAR_VAL s) = True+    _                  == _              = False+++++++--------- *********************** --------------+-- needs to be simplified --+setAtt (MaxVal s1)   (MaxVal s)       = [MaxVal s] +setAtt (MaxVal s1)   (SubVal s)       = [MaxVal s] +setAtt (MaxVal s1)   (RepVal s)       = [MaxVal s] +setAtt (MaxVal s1)   (VAL s)          = [MaxVal s] +setAtt (MaxVal s1)   (ErrorVal s)     = [ErrorVal s] ++setAtt (SubVal s1)   (MaxVal s)       = [SubVal s] +setAtt (SubVal s1)   (SubVal s)       = [SubVal s] +setAtt (SubVal s1)   (RepVal s)       = [SubVal s]+setAtt (SubVal s1)   (VAL s)          = [SubVal s]+setAtt (SubVal s1)   (ErrorVal s)     = [ErrorVal s] ++setAtt (RepVal s1)   (MaxVal s)       = [RepVal s] +setAtt (RepVal s1)   (SubVal s)       = [RepVal s] +setAtt (RepVal s1)   (RepVal s)       = [RepVal s]+setAtt (RepVal s1)   (VAL s)          = [RepVal s]+setAtt (RepVal s1)   (ErrorVal s)     = [ErrorVal s] ++setAtt (VAL s1)   (VAL s)          = [VAL s] +setAtt (VAL s1)   (MaxVal s)       = [VAL s] +setAtt (VAL s1)   (SubVal s)       = [VAL s] +setAtt (VAL s1)   (RepVal s)       = [VAL s] +setAtt (VAL s1)   (ErrorVal s)     = [ErrorVal s] +++setAtt (Res s1)      (Res s)        = [Res s] +setAtt (Res s1)      (ErrorVal s)   = [ErrorVal s] +setAtt (ErrorVal s1) (ErrorVal s)   = [ErrorVal s] ++setAtt (NOUNCLA_VAL s1)  (NOUNCLA_VAL s)    = [NOUNCLA_VAL s] +setAtt (ADJ_VAL s1)      (ADJ_VAL s)        = [ADJ_VAL s] +setAtt (TERMPH_VAL s1)   (TERMPH_VAL s)     = [TERMPH_VAL s] +setAtt (VERBPH_VAL s1)   (VERBPH_VAL s)     = [VERBPH_VAL s] +setAtt (SENT_VAL   s1)   (SENT_VAL   s)     = [SENT_VAL s] +setAtt (QUEST_VAL  s1)   (QUEST_VAL  s)     = [QUEST_VAL s]+setAtt (QUEST1_VAL  s1)   (QUEST1_VAL  s)     = [QUEST1_VAL s]+setAtt (QUEST2_VAL  s1)   (QUEST2_VAL  s)     = [QUEST2_VAL s]+setAtt (QUEST3_VAL  s1)   (QUEST3_VAL  s)     = [QUEST3_VAL s]++setAtt (PREP_VAL s1) (PREP_VAL s) = [PREP_VAL s]+setAtt (PREPN_VAL s1) (PREPN_VAL s) = [PREPN_VAL s]+setAtt (PREPPH_VAL s1) (PREPPH_VAL s) = [PREPPH_VAL s]+setAtt (YEAR_VAL s1) (YEAR_VAL s) = [YEAR_VAL s]+++--------- *********************** --------------+++++++