Logic_OWL2.hs revision cdcf5d3f1e79d8798d77efa29e6193af94ea0604
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann{-# LANGUAGE CPP, MultiParamTypeClasses, TypeSynonymInstances #-}
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann{-# OPTIONS -w #-}
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannDescription : instance of the class Logic for OWL2
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannCopyright : (c) Christian Maeder, DFKI GmbH 2011
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannLicense : GPLv2 or higher, see LICENSE.txt
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannMaintainer : Christian.Maeder@dfki.de
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannStability : provisional
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannPortability : non-portable
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel HausmannHere is the place where the class Logic is instantiated for OWL2.
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmannimport Data.Char (isAlpha)
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmannimport qualified Data.Map as Map
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmannimport qualified Data.Set as Set
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanndata OWL2 = OWL2
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Show OWL2 where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann show _ = "OWL"
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Language OWL2 where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann description _ =
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann "OWL -- Web Ontology Language http://www.w3.org/TR/owl2-overview/"
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Category Sign OWLMorphism where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann ide sig = inclOWLMorphism sig sig
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann dom = osource
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann cod = otarget
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann legal_mor = legalMor
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann isInclusion = isOWLInclusion
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann composeMorphisms = composeMor
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Monoid Ontology where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann mempty = emptyOntology []
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann mappend (Ontology n i1 a1 f1) (Ontology _ i2 a2 f2) =
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann Ontology n (i1 ++ i2) (a1 ++ a2) $ f1 ++ f2
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Monoid OntologyDocument where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann mempty = emptyOntologyDoc
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann mappend (OntologyDocument p1 o1) (OntologyDocument p2 o2) =
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann OntologyDocument (Map.union p1 p2) $ mappend o1 o2
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Syntax OWL2 OntologyDocument Entity SymbItems SymbMapItems where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann parsersAndPrinters OWL2 = addSyntax "Ship" (basicSpec, ppShipOnt)
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann $ addSyntax "Manchester" (basicSpec, pretty)
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann $ makeDefault (basicSpec, pretty)
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann parseSingleSymbItem OWL2 = Just symbItem
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann parse_symb_items OWL2 = Just symbItems
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann parse_symb_map_items OWL2 = Just symbMapItems
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann symb_items_name OWL2 = symbItemsName
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance Sentences OWL2 Axiom Sign OWLMorphism Entity where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann map_sen OWL2 = mapSen
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann print_named OWL2 = printOneNamed
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann sym_of OWL2 = singletonList . symOf
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann symmap_of OWL2 = symMapOf
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann sym_name OWL2 = entityToId
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann sym_label OWL2 = label
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann fullSymName OWL2 s = let
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann x = expandedIRI i
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann in if null x then getPredefName i else x
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann symKind OWL2 = takeWhile isAlpha . showEntityType . entityKind
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann symsOfSen OWL2 _ = Set.toList . symsOfAxiom
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann pair_symbols OWL2 = pairSymbols
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmanninstance StaticAnalysis OWL2 OntologyDocument Axiom
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann SymbItems SymbMapItems
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann Entity RawSymb where
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann basic_analysis OWL2 = Just basicOWL2Analysis
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann stat_symb_items OWL2 s = return . statSymbItems s
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann stat_symb_map_items OWL2 = statSymbMapItems
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann convertTheory OWL2 = Just convertBasicTheory
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann empty_signature OWL2 = emptySign
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann signature_union OWL2 = uniteSign
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann intersection OWL2 = intersectSign
6a4fa2d53294f484fa8788a75656eff4ad1fd703Daniel Hausmann signatureDiff OWL2 s = return . diffSig s