{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}
{- |
Module      :  $Header$
Description :  Inclusion comorphism from OWL 2 to NeSyPatterns
Copyright   :  (c) Till Mossakowksi
License     :  GPLv2 or higher, see LICENSE.txt

Stability   :  provisional
Portability :  non-portable (via Logic.Logic)
-}

module OWL2.OWL22NeSyPatterns (OWL22NeSyPatterns (..)) where

import Common.ProofTree
import ATC.ProofTree ()
import Logic.Logic as Logic
import Logic.Comorphism
import Common.AS_Annotation
import Common.Result
import qualified Data.Set as Set


-- OWL = domain
import OWL2.Logic_OWL2
import OWL2.AS as AS
import OWL2.ProfilesAndSublogics
import OWL2.ManchesterPrint ()
import OWL2.Morphism
import OWL2.Symbols
import qualified OWL2.Sign as OS
-- NeSyPatterns = codomain
import NeSyPatterns.Logic_NeSyPatterns
import NeSyPatterns.Sign
import NeSyPatterns.Morphism
import NeSyPatterns.AS
import NeSyPatterns.Symbol as Symbol
import NeSyPatterns.Analysis

data OWL22NeSyPatterns = OWL22NeSyPatterns deriving Int -> OWL22NeSyPatterns -> ShowS
[OWL22NeSyPatterns] -> ShowS
OWL22NeSyPatterns -> String
(Int -> OWL22NeSyPatterns -> ShowS)
-> (OWL22NeSyPatterns -> String)
-> ([OWL22NeSyPatterns] -> ShowS)
-> Show OWL22NeSyPatterns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OWL22NeSyPatterns] -> ShowS
$cshowList :: [OWL22NeSyPatterns] -> ShowS
show :: OWL22NeSyPatterns -> String
$cshow :: OWL22NeSyPatterns -> String
showsPrec :: Int -> OWL22NeSyPatterns -> ShowS
$cshowsPrec :: Int -> OWL22NeSyPatterns -> ShowS
Show

instance Language OWL22NeSyPatterns

instance Comorphism
    OWL22NeSyPatterns        -- comorphism
    OWL2             -- lid domain
    ProfSub          -- sublogics domain
    OntologyDocument    -- Basic spec domain
    Axiom           -- sentence domain
    SymbItems       -- symbol items domain
    SymbMapItems    -- symbol map items domain
    OS.Sign         -- signature domain
    OWLMorphism     -- morphism domain
    Entity          -- symbol domain
    RawSymb         -- rawsymbol domain
    ProofTree       -- proof tree codomain
    NeSyPatterns            -- lid codomain
    ()  -- sublogics codomain
    BASIC_SPEC   -- Basic spec codomain
    ()    -- sentence codomain
    SYMB_ITEMS      -- symbol items codomain
    SYMB_MAP_ITEMS  -- symbol map items codomain
    Sign                          -- sign codomain
    Morphism                  -- morphism codomain
    Symbol                      -- symbol codomain
    Symbol                      -- raw_symbol codomain
    ProofTree                      -- proof_tree codomain
    where
      sourceLogic :: OWL22NeSyPatterns -> OWL2
sourceLogic OWL22NeSyPatterns = OWL2
OWL2
      sourceSublogic :: OWL22NeSyPatterns -> ProfSub
sourceSublogic OWL22NeSyPatterns = ProfSub
topS
      targetLogic :: OWL22NeSyPatterns -> NeSyPatterns
targetLogic OWL22NeSyPatterns = NeSyPatterns
NeSyPatterns
      mapSublogic :: OWL22NeSyPatterns -> ProfSub -> Maybe ()
mapSublogic OWL22NeSyPatterns _ = () -> Maybe ()
forall a. a -> Maybe a
Just ()
      map_theory :: OWL22NeSyPatterns
-> (Sign, [Named Axiom]) -> Result (Sign, [Named ()])
map_theory OWL22NeSyPatterns = (Sign, [Named Axiom]) -> Result (Sign, [Named ()])
mapTheory
      map_morphism :: OWL22NeSyPatterns -> OWLMorphism -> Result Morphism
map_morphism OWL22NeSyPatterns = OWLMorphism -> Result Morphism
mapMorphism
      map_symbol :: OWL22NeSyPatterns -> Sign -> Entity -> Set Symbol
map_symbol OWL22NeSyPatterns _ = Entity -> Set Symbol
mapSymbol
      isInclusionComorphism :: OWL22NeSyPatterns -> Bool
isInclusionComorphism OWL22NeSyPatterns = Bool
True
      isGTC :: OWL22NeSyPatterns -> Bool
isGTC OWL22NeSyPatterns = Bool
True

mapTheory :: (OS.Sign, [Named Axiom]) -> Result (Sign, [Named ()])
mapTheory :: (Sign, [Named Axiom]) -> Result (Sign, [Named ()])
mapTheory (sig :: Sign
sig, sens :: [Named Axiom]
sens) = (Sign, [Named ()]) -> Result (Sign, [Named ()])
forall (m :: * -> *) a. Monad m => a -> m a
return (Sign
emptySig{ owlClasses :: Set IRI
owlClasses = Sign -> Set IRI
OS.concepts Sign
sig
                                        , owlTaxonomy :: Relation IRI IRI
owlTaxonomy = [Axiom] -> Relation IRI IRI
subClassRelation ([Axiom] -> Relation IRI IRI) -> [Axiom] -> Relation IRI IRI
forall a b. (a -> b) -> a -> b
$ (Named Axiom -> Axiom) -> [Named Axiom] -> [Axiom]
forall a b. (a -> b) -> [a] -> [b]
map Named Axiom -> Axiom
forall s a. SenAttr s a -> s
sentence [Named Axiom]
sens}, [])

mapMorphism :: OWLMorphism -> Result Morphism
mapMorphism :: OWLMorphism -> Result Morphism
mapMorphism _ = String -> Result Morphism
forall (m :: * -> *) a. MonadFail m => String -> m a
fail "nyi"

mapSymbol :: Entity -> Set.Set Symbol
mapSymbol :: Entity -> Set Symbol
mapSymbol _ = Set Symbol
forall a. Set a
Set.empty