{-# OPTIONS -w -O0 #-}
{-# LANGUAGE CPP, StandaloneDeriving, DeriveDataTypeable, DeriveGeneric #-}
{- |
Module      :  RDF/ATC_RDF.der.hs
Description :  generated ShATermConvertible, Json instances
Copyright   :  (c) DFKI GmbH 2012
License     :  GPLv2 or higher, see LICENSE.txt

Maintainer  :  Christian.Maeder@dfki.de
Stability   :  provisional
Portability :  non-portable(derive Typeable instances)

Automatic derivation of instances via DrIFT-rule ShATermConvertible, Json
  for the type(s):
'RDF.AS.TurtleDocument'
'RDF.AS.Statement'
'RDF.AS.Prefix'
'RDF.AS.Base'
'RDF.AS.Triples'
'RDF.AS.Subject'
'RDF.AS.Predicate'
'RDF.AS.Object'
'RDF.AS.PredicateObjectList'
'RDF.AS.RDFLiteral'
'RDF.AS.Term'
'RDF.AS.Axiom'
'RDF.AS.RDFEntityType'
'RDF.AS.RDFEntity'
'RDF.Symbols.SymbItems'
'RDF.Symbols.SymbMapItems'
'RDF.Symbols.RawSymb'
'RDF.Sign.Sign'
'RDF.Morphism.RDFMorphism'
-}

{-
Generated by 'genRules' (automatic rule generation for DrIFT). Don't touch!!
  dependency files:
RDF/AS.hs
RDF/Symbols.hs
RDF/Sign.hs
RDF/Morphism.hs
RDF/Sublogic.hs
-}

module RDF.ATC_RDF () where

import ATC.Result
import ATerm.Lib
import Common.Doc
import Common.DocUtils
import Common.IRI
import Common.Id
import Common.Json.Instances
import Common.Result
import Data.Aeson(ToJSON, FromJSON)
import Data.Data
import Data.List
import GHC.Generics(Generic)
import OWL2.ATC_OWL2 ()
import RDF.AS
import RDF.Function
import RDF.Morphism
import RDF.Print ()
import RDF.Sign
import RDF.Sublogic
import RDF.Symbols
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified OWL2.AS as AS

{-! for RDF.AS.TurtleDocument derive : ShATermConvertible !-}
{-! for RDF.AS.Statement derive : ShATermConvertible !-}
{-! for RDF.AS.Prefix derive : ShATermConvertible !-}
{-! for RDF.AS.Base derive : ShATermConvertible !-}
{-! for RDF.AS.Triples derive : ShATermConvertible !-}
{-! for RDF.AS.Subject derive : ShATermConvertible !-}
{-! for RDF.AS.Predicate derive : ShATermConvertible !-}
{-! for RDF.AS.Object derive : ShATermConvertible !-}
{-! for RDF.AS.PredicateObjectList derive : ShATermConvertible !-}
{-! for RDF.AS.RDFLiteral derive : ShATermConvertible !-}
{-! for RDF.AS.Term derive : ShATermConvertible !-}
{-! for RDF.AS.Axiom derive : ShATermConvertible !-}
{-! for RDF.AS.RDFEntityType derive : ShATermConvertible !-}
{-! for RDF.AS.RDFEntity derive : ShATermConvertible !-}
{-! for RDF.Symbols.SymbItems derive : ShATermConvertible !-}
{-! for RDF.Symbols.SymbMapItems derive : ShATermConvertible !-}
{-! for RDF.Symbols.RawSymb derive : ShATermConvertible !-}
{-! for RDF.Sign.Sign derive : ShATermConvertible !-}
{-! for RDF.Morphism.RDFMorphism derive : ShATermConvertible !-}

{-! for RDF.AS.TurtleDocument derive : Json !-}
{-! for RDF.AS.Statement derive : Json !-}
{-! for RDF.AS.Prefix derive : Json !-}
{-! for RDF.AS.Base derive : Json !-}
{-! for RDF.AS.Triples derive : Json !-}
{-! for RDF.AS.Subject derive : Json !-}
{-! for RDF.AS.Predicate derive : Json !-}
{-! for RDF.AS.Object derive : Json !-}
{-! for RDF.AS.PredicateObjectList derive : Json !-}
{-! for RDF.AS.RDFLiteral derive : Json !-}
{-! for RDF.AS.Term derive : Json !-}
{-! for RDF.AS.Axiom derive : Json !-}
{-! for RDF.AS.RDFEntityType derive : Json !-}
{-! for RDF.AS.RDFEntity derive : Json !-}
{-! for RDF.Symbols.SymbItems derive : Json !-}
{-! for RDF.Symbols.SymbMapItems derive : Json !-}
{-! for RDF.Symbols.RawSymb derive : Json !-}
{-! for RDF.Sign.Sign derive : Json !-}
{-! for RDF.Morphism.RDFMorphism derive : Json !-}

-- Generated by DrIFT, look but don't touch!

instance ShATermConvertible RDF.AS.TurtleDocument where
  toShATermAux :: ATermTable -> TurtleDocument -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: TurtleDocument
xv = case TurtleDocument
xv of
    TurtleDocument a :: IRI
a b :: RDFPrefixMap
b c :: [Statement]
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> RDFPrefixMap -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 RDFPrefixMap
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [Statement] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [Statement]
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "TurtleDocument" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, TurtleDocument)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "TurtleDocument" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      case Int -> ATermTable -> (ATermTable, RDFPrefixMap)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: RDFPrefixMap
b') ->
      case Int -> ATermTable -> (ATermTable, [Statement])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [Statement]
c') ->
      (ATermTable
att3, IRI -> RDFPrefixMap -> [Statement] -> TurtleDocument
TurtleDocument IRI
a' RDFPrefixMap
b' [Statement]
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, TurtleDocument)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.TurtleDocument" ShATerm
u

instance ShATermConvertible RDF.AS.Statement where
  toShATermAux :: ATermTable -> Statement -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Statement
xv = case Statement
xv of
    Statement a :: Triples
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Triples -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Triples
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Statement" [Int
a'] []) ATermTable
att1
    PrefixStatement a :: Prefix
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Prefix -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Prefix
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "PrefixStatement" [Int
a'] []) ATermTable
att1
    BaseStatement a :: Base
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Base -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Base
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "BaseStatement" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Statement)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Statement" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Triples)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Triples
a') ->
      (ATermTable
att1, Triples -> Statement
Statement Triples
a') }
    ShAAppl "PrefixStatement" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Prefix)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Prefix
a') ->
      (ATermTable
att1, Prefix -> Statement
PrefixStatement Prefix
a') }
    ShAAppl "BaseStatement" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Base)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Base
a') ->
      (ATermTable
att1, Base -> Statement
BaseStatement Base
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Statement)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Statement" ShATerm
u

instance ShATermConvertible RDF.AS.Prefix where
  toShATermAux :: ATermTable -> Prefix -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Prefix
xv = case Prefix
xv of
    PrefixR a :: String
a b :: IRI
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 IRI
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "PrefixR" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Prefix)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "PrefixR" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: IRI
b') ->
      (ATermTable
att2, String -> IRI -> Prefix
PrefixR String
a' IRI
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Prefix)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Prefix" ShATerm
u

instance ShATermConvertible RDF.AS.Base where
  toShATermAux :: ATermTable -> Base -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Base
xv = case Base
xv of
    Base a :: IRI
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Base" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Base)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Base" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      (ATermTable
att1, IRI -> Base
Base IRI
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Base)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Base" ShATerm
u

instance ShATermConvertible RDF.AS.Triples where
  toShATermAux :: ATermTable -> Triples -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Triples
xv = case Triples
xv of
    Triples a :: Subject
a b :: [PredicateObjectList]
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Subject -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Subject
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [PredicateObjectList] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [PredicateObjectList]
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Triples" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Triples)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Triples" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, Subject)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Subject
a') ->
      case Int -> ATermTable -> (ATermTable, [PredicateObjectList])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [PredicateObjectList]
b') ->
      (ATermTable
att2, Subject -> [PredicateObjectList] -> Triples
Triples Subject
a' [PredicateObjectList]
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Triples)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Triples" ShATerm
u

instance ShATermConvertible RDF.AS.Subject where
  toShATermAux :: ATermTable -> Subject -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Subject
xv = case Subject
xv of
    Subject a :: IRI
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Subject" [Int
a'] []) ATermTable
att1
    SubjectList a :: [PredicateObjectList]
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [PredicateObjectList] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [PredicateObjectList]
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SubjectList" [Int
a'] []) ATermTable
att1
    SubjectCollection a :: [Object]
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [Object] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [Object]
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SubjectCollection" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Subject)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Subject" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      (ATermTable
att1, IRI -> Subject
Subject IRI
a') }
    ShAAppl "SubjectList" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, [PredicateObjectList])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [PredicateObjectList]
a') ->
      (ATermTable
att1, [PredicateObjectList] -> Subject
SubjectList [PredicateObjectList]
a') }
    ShAAppl "SubjectCollection" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, [Object])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [Object]
a') ->
      (ATermTable
att1, [Object] -> Subject
SubjectCollection [Object]
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Subject)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Subject" ShATerm
u

instance ShATermConvertible RDF.AS.Predicate where
  toShATermAux :: ATermTable -> Predicate -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Predicate
xv = case Predicate
xv of
    Predicate a :: IRI
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Predicate" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Predicate)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Predicate" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      (ATermTable
att1, IRI -> Predicate
Predicate IRI
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Predicate)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Predicate" ShATerm
u

instance ShATermConvertible RDF.AS.Object where
  toShATermAux :: ATermTable -> Object -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Object
xv = case Object
xv of
    Object a :: Subject
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Subject -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Subject
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Object" [Int
a'] []) ATermTable
att1
    ObjectLiteral a :: RDFLiteral
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RDFLiteral -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RDFLiteral
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "ObjectLiteral" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Object)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Object" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Subject)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Subject
a') ->
      (ATermTable
att1, Subject -> Object
Object Subject
a') }
    ShAAppl "ObjectLiteral" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, RDFLiteral)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RDFLiteral
a') ->
      (ATermTable
att1, RDFLiteral -> Object
ObjectLiteral RDFLiteral
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Object)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Object" ShATerm
u

instance ShATermConvertible RDF.AS.PredicateObjectList where
  toShATermAux :: ATermTable -> PredicateObjectList -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: PredicateObjectList
xv = case PredicateObjectList
xv of
    PredicateObjectList a :: Predicate
a b :: [Object]
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Predicate -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Predicate
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [Object] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [Object]
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "PredicateObjectList" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, PredicateObjectList)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "PredicateObjectList" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, Predicate)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Predicate
a') ->
      case Int -> ATermTable -> (ATermTable, [Object])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [Object]
b') ->
      (ATermTable
att2, Predicate -> [Object] -> PredicateObjectList
PredicateObjectList Predicate
a' [Object]
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, PredicateObjectList)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.PredicateObjectList" ShATerm
u

instance ShATermConvertible RDF.AS.RDFLiteral where
  toShATermAux :: ATermTable -> RDFLiteral -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RDFLiteral
xv = case RDFLiteral
xv of
    RDFLiteral a :: Bool
a b :: String
b c :: TypedOrUntyped
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Bool -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Bool
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> TypedOrUntyped -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 TypedOrUntyped
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RDFLiteral" [Int
a', Int
b', Int
c'] []) ATermTable
att3
    RDFNumberLit a :: FloatLit
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> FloatLit -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 FloatLit
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RDFNumberLit" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RDFLiteral)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RDFLiteral" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, Bool)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Bool
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      case Int -> ATermTable -> (ATermTable, TypedOrUntyped)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: TypedOrUntyped
c') ->
      (ATermTable
att3, Bool -> String -> TypedOrUntyped -> RDFLiteral
RDFLiteral Bool
a' String
b' TypedOrUntyped
c') }}}
    ShAAppl "RDFNumberLit" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, FloatLit)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: FloatLit
a') ->
      (ATermTable
att1, FloatLit -> RDFLiteral
RDFNumberLit FloatLit
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RDFLiteral)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.RDFLiteral" ShATerm
u

instance ShATermConvertible RDF.AS.Term where
  toShATermAux :: ATermTable -> Term -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Term
xv = case Term
xv of
    SubjectTerm a :: IRI
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SubjectTerm" [Int
a'] []) ATermTable
att1
    PredicateTerm a :: IRI
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "PredicateTerm" [Int
a'] []) ATermTable
att1
    ObjectTerm a :: Either IRI RDFLiteral
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Either IRI RDFLiteral -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Either IRI RDFLiteral
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "ObjectTerm" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Term)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "SubjectTerm" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      (ATermTable
att1, IRI -> Term
SubjectTerm IRI
a') }
    ShAAppl "PredicateTerm" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      (ATermTable
att1, IRI -> Term
PredicateTerm IRI
a') }
    ShAAppl "ObjectTerm" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Either IRI RDFLiteral)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Either IRI RDFLiteral
a') ->
      (ATermTable
att1, Either IRI RDFLiteral -> Term
ObjectTerm Either IRI RDFLiteral
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Term)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Term" ShATerm
u

instance ShATermConvertible RDF.AS.Axiom where
  toShATermAux :: ATermTable -> Axiom -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Axiom
xv = case Axiom
xv of
    Axiom a :: Term
a b :: Term
b c :: Term
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Term
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Term
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Term
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Axiom" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Axiom)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Axiom" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Term
a') ->
      case Int -> ATermTable -> (ATermTable, Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Term
b') ->
      case Int -> ATermTable -> (ATermTable, Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Term
c') ->
      (ATermTable
att3, Term -> Term -> Term -> Axiom
Axiom Term
a' Term
b' Term
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Axiom)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.Axiom" ShATerm
u

instance ShATermConvertible RDF.AS.RDFEntityType where
  toShATermAux :: ATermTable -> RDFEntityType -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RDFEntityType
xv = case RDFEntityType
xv of
    SubjectEntity -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SubjectEntity" [] []) ATermTable
att0
    PredicateEntity -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "PredicateEntity" [] []) ATermTable
att0
    ObjectEntity -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "ObjectEntity" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RDFEntityType)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "SubjectEntity" [] _ -> (ATermTable
att0, RDFEntityType
SubjectEntity)
    ShAAppl "PredicateEntity" [] _ -> (ATermTable
att0, RDFEntityType
PredicateEntity)
    ShAAppl "ObjectEntity" [] _ -> (ATermTable
att0, RDFEntityType
ObjectEntity)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RDFEntityType)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.RDFEntityType" ShATerm
u

instance ShATermConvertible RDF.AS.RDFEntity where
  toShATermAux :: ATermTable -> RDFEntity -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RDFEntity
xv = case RDFEntity
xv of
    RDFEntity a :: RDFEntityType
a b :: Term
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RDFEntityType -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RDFEntityType
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Term
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RDFEntity" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RDFEntity)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RDFEntity" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, RDFEntityType)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RDFEntityType
a') ->
      case Int -> ATermTable -> (ATermTable, Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Term
b') ->
      (ATermTable
att2, RDFEntityType -> Term -> RDFEntity
RDFEntity RDFEntityType
a' Term
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RDFEntity)
forall a. String -> ShATerm -> a
fromShATermError "RDF.AS.RDFEntity" ShATerm
u

deriving instance GHC.Generics.Generic RDF.AS.TurtleDocument
instance Data.Aeson.ToJSON RDF.AS.TurtleDocument where
instance Data.Aeson.FromJSON RDF.AS.TurtleDocument where

deriving instance GHC.Generics.Generic RDF.AS.Statement
instance Data.Aeson.ToJSON RDF.AS.Statement where
instance Data.Aeson.FromJSON RDF.AS.Statement where

deriving instance GHC.Generics.Generic RDF.AS.Prefix
instance Data.Aeson.ToJSON RDF.AS.Prefix where
instance Data.Aeson.FromJSON RDF.AS.Prefix where

deriving instance GHC.Generics.Generic RDF.AS.Base
instance Data.Aeson.ToJSON RDF.AS.Base where
instance Data.Aeson.FromJSON RDF.AS.Base where

deriving instance GHC.Generics.Generic RDF.AS.Triples
instance Data.Aeson.ToJSON RDF.AS.Triples where
instance Data.Aeson.FromJSON RDF.AS.Triples where

deriving instance GHC.Generics.Generic RDF.AS.Subject
instance Data.Aeson.ToJSON RDF.AS.Subject where
instance Data.Aeson.FromJSON RDF.AS.Subject where

deriving instance GHC.Generics.Generic RDF.AS.Predicate
instance Data.Aeson.ToJSON RDF.AS.Predicate where
instance Data.Aeson.FromJSON RDF.AS.Predicate where

deriving instance GHC.Generics.Generic RDF.AS.Object
instance Data.Aeson.ToJSON RDF.AS.Object where
instance Data.Aeson.FromJSON RDF.AS.Object where

deriving instance GHC.Generics.Generic RDF.AS.PredicateObjectList
instance Data.Aeson.ToJSON RDF.AS.PredicateObjectList where
instance Data.Aeson.FromJSON RDF.AS.PredicateObjectList where

deriving instance GHC.Generics.Generic RDF.AS.RDFLiteral
instance Data.Aeson.ToJSON RDF.AS.RDFLiteral where
instance Data.Aeson.FromJSON RDF.AS.RDFLiteral where

deriving instance GHC.Generics.Generic RDF.AS.Term
instance Data.Aeson.ToJSON RDF.AS.Term where
instance Data.Aeson.FromJSON RDF.AS.Term where

deriving instance GHC.Generics.Generic RDF.AS.Axiom
instance Data.Aeson.ToJSON RDF.AS.Axiom where
instance Data.Aeson.FromJSON RDF.AS.Axiom where

deriving instance GHC.Generics.Generic RDF.AS.RDFEntityType
instance Data.Aeson.ToJSON RDF.AS.RDFEntityType where
instance Data.Aeson.FromJSON RDF.AS.RDFEntityType where

deriving instance GHC.Generics.Generic RDF.AS.RDFEntity
instance Data.Aeson.ToJSON RDF.AS.RDFEntity where
instance Data.Aeson.FromJSON RDF.AS.RDFEntity where

instance ShATermConvertible RDF.Morphism.RDFMorphism where
  toShATermAux :: ATermTable -> RDFMorphism -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RDFMorphism
xv = case RDFMorphism
xv of
    RDFMorphism a :: Sign
a b :: Sign
b c :: MorphMap
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Sign -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Sign
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Sign -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Sign
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> MorphMap -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 MorphMap
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RDFMorphism" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RDFMorphism)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RDFMorphism" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, Sign)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Sign
a') ->
      case Int -> ATermTable -> (ATermTable, Sign)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Sign
b') ->
      case Int -> ATermTable -> (ATermTable, MorphMap)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: MorphMap
c') ->
      (ATermTable
att3, Sign -> Sign -> MorphMap -> RDFMorphism
RDFMorphism Sign
a' Sign
b' MorphMap
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RDFMorphism)
forall a. String -> ShATerm -> a
fromShATermError "RDF.Morphism.RDFMorphism" ShATerm
u

deriving instance GHC.Generics.Generic RDF.Morphism.RDFMorphism
instance Data.Aeson.ToJSON RDF.Morphism.RDFMorphism where
instance Data.Aeson.FromJSON RDF.Morphism.RDFMorphism where

instance ShATermConvertible RDF.Sign.Sign where
  toShATermAux :: ATermTable -> Sign -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Sign
xv = case Sign
xv of
    Sign a :: Set Term
a b :: Set Term
b c :: Set Term
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Set Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Set Term
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Set Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Set Term
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Set Term -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Set Term
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Sign" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Sign)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Sign" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, Set Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Set Term
a') ->
      case Int -> ATermTable -> (ATermTable, Set Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Set Term
b') ->
      case Int -> ATermTable -> (ATermTable, Set Term)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Set Term
c') ->
      (ATermTable
att3, Set Term -> Set Term -> Set Term -> Sign
Sign Set Term
a' Set Term
b' Set Term
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Sign)
forall a. String -> ShATerm -> a
fromShATermError "RDF.Sign.Sign" ShATerm
u

deriving instance GHC.Generics.Generic RDF.Sign.Sign
instance Data.Aeson.ToJSON RDF.Sign.Sign where
instance Data.Aeson.FromJSON RDF.Sign.Sign where

instance ShATermConvertible RDF.Symbols.SymbItems where
  toShATermAux :: ATermTable -> SymbItems -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: SymbItems
xv = case SymbItems
xv of
    SymbItems a :: Maybe RDFEntityType
a b :: [IRI]
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Maybe RDFEntityType -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Maybe RDFEntityType
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [IRI] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [IRI]
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SymbItems" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, SymbItems)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "SymbItems" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, Maybe RDFEntityType)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Maybe RDFEntityType
a') ->
      case Int -> ATermTable -> (ATermTable, [IRI])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [IRI]
b') ->
      (ATermTable
att2, Maybe RDFEntityType -> [IRI] -> SymbItems
SymbItems Maybe RDFEntityType
a' [IRI]
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, SymbItems)
forall a. String -> ShATerm -> a
fromShATermError "RDF.Symbols.SymbItems" ShATerm
u

instance ShATermConvertible RDF.Symbols.SymbMapItems where
  toShATermAux :: ATermTable -> SymbMapItems -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: SymbMapItems
xv = case SymbMapItems
xv of
    SymbMapItems a :: Maybe RDFEntityType
a b :: [(IRI, Maybe IRI)]
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Maybe RDFEntityType -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Maybe RDFEntityType
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [(IRI, Maybe IRI)] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [(IRI, Maybe IRI)]
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SymbMapItems" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, SymbMapItems)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "SymbMapItems" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, Maybe RDFEntityType)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Maybe RDFEntityType
a') ->
      case Int -> ATermTable -> (ATermTable, [(IRI, Maybe IRI)])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [(IRI, Maybe IRI)]
b') ->
      (ATermTable
att2, Maybe RDFEntityType -> [(IRI, Maybe IRI)] -> SymbMapItems
SymbMapItems Maybe RDFEntityType
a' [(IRI, Maybe IRI)]
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, SymbMapItems)
forall a. String -> ShATerm -> a
fromShATermError "RDF.Symbols.SymbMapItems" ShATerm
u

instance ShATermConvertible RDF.Symbols.RawSymb where
  toShATermAux :: ATermTable -> RawSymb -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RawSymb
xv = case RawSymb
xv of
    ASymbol a :: RDFEntity
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RDFEntity -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RDFEntity
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "ASymbol" [Int
a'] []) ATermTable
att1
    AnUri a :: IRI
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> IRI -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 IRI
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "AnUri" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RawSymb)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "ASymbol" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, RDFEntity)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RDFEntity
a') ->
      (ATermTable
att1, RDFEntity -> RawSymb
ASymbol RDFEntity
a') }
    ShAAppl "AnUri" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, IRI)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: IRI
a') ->
      (ATermTable
att1, IRI -> RawSymb
AnUri IRI
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RawSymb)
forall a. String -> ShATerm -> a
fromShATermError "RDF.Symbols.RawSymb" ShATerm
u

deriving instance GHC.Generics.Generic RDF.Symbols.SymbItems
instance Data.Aeson.ToJSON RDF.Symbols.SymbItems where
instance Data.Aeson.FromJSON RDF.Symbols.SymbItems where

deriving instance GHC.Generics.Generic RDF.Symbols.SymbMapItems
instance Data.Aeson.ToJSON RDF.Symbols.SymbMapItems where
instance Data.Aeson.FromJSON RDF.Symbols.SymbMapItems where

deriving instance GHC.Generics.Generic RDF.Symbols.RawSymb
instance Data.Aeson.ToJSON RDF.Symbols.RawSymb where
instance Data.Aeson.FromJSON RDF.Symbols.RawSymb where