module OWL2.Pretty where import OWL2.AS import OWL2.Sign (emptySign) import Common.Doc(Doc) import Common.DocUtils import qualified OWL2.PrintAS as PAS import qualified OWL2.PrintMS as PMS import qualified OWL2.XMLConversion as PXML import Text.XML.Light.Output (ppElement) import Common.Doc (text) instance Pretty OntologyDocument where pretty :: OntologyDocument -> Doc pretty o :: OntologyDocument o@(OntologyDocument m :: OntologyMetadata m _ _) = case OntologyMetadata -> OntologySyntaxType syntaxType OntologyMetadata m of AS -> OntologyDocument -> Doc PAS.printOntologyDocument OntologyDocument o MS -> OntologyDocument -> Doc PMS.printOntologyDocument OntologyDocument o XML -> String -> Doc text (String -> Doc) -> String -> Doc forall a b. (a -> b) -> a -> b $ Element -> String ppElement (Element -> String) -> Element -> String forall a b. (a -> b) -> a -> b $ Sign -> OntologyDocument -> Element PXML.xmlOntologyDoc Sign emptySign OntologyDocument o instance Pretty Axiom where pretty :: Axiom -> Doc pretty = PrefixMap -> Axiom -> Doc PAS.printAxiom PrefixMap forall a. Monoid a => a mempty toDocAsXML :: OntologyDocument -> Doc toDocAsXML :: OntologyDocument -> Doc toDocAsXML = OntologyDocument -> Doc forall a. Pretty a => a -> Doc pretty (OntologyDocument -> Doc) -> (OntologyDocument -> OntologyDocument) -> OntologyDocument -> Doc forall b c a. (b -> c) -> (a -> b) -> a -> c . OntologySyntaxType -> OntologyDocument -> OntologyDocument changeSyntax OntologySyntaxType XML toDocAsAS :: OntologyDocument -> Doc toDocAsAS :: OntologyDocument -> Doc toDocAsAS = OntologyDocument -> Doc forall a. Pretty a => a -> Doc pretty (OntologyDocument -> Doc) -> (OntologyDocument -> OntologyDocument) -> OntologyDocument -> Doc forall b c a. (b -> c) -> (a -> b) -> a -> c . OntologySyntaxType -> OntologyDocument -> OntologyDocument changeSyntax OntologySyntaxType AS toDocAsMS :: OntologyDocument -> Doc toDocAsMS :: OntologyDocument -> Doc toDocAsMS = OntologyDocument -> Doc forall a. Pretty a => a -> Doc pretty (OntologyDocument -> Doc) -> (OntologyDocument -> OntologyDocument) -> OntologyDocument -> Doc forall b c a. (b -> c) -> (a -> b) -> a -> c . OntologySyntaxType -> OntologyDocument -> OntologyDocument changeSyntax OntologySyntaxType MS