Hets - the Heterogeneous Tool Set

Copyright(c) Uni Bremen 2004-2007
LicenseGPLv2 or higher, see LICENSE.txt
Portabilitynon-portable (imports Control.Monad.Error)
Safe HaskellSafe-Inferred



MMiSSOntology provides the abstract data type for an Ontology



weither :: (String -> b) -> (a -> b) -> WithError a -> b

like either

fromWithError :: Monad m => WithError a -> m a

convert to another monad

insertBaseRelation :: MMiSSOntology -> RelName -> DefaultText -> Maybe SuperRel -> Maybe Cardinality -> WithError MMiSSOntology

inserts a new Relation into the Ontology. It throws an error if the relation name already exists.

insertRelationType :: MMiSSOntology -> RelName -> ClassName -> ClassName -> WithError MMiSSOntology

inserts a new RelationType declaration into the Ontology. It throws an error if the relation name doesn't exist.

insertLink :: MMiSSOntology -> String -> String -> String -> WithError MMiSSOntology

inserts a new link of type RelationName between the two given objects. Throws an error if RelationName, SourceObject or TargetObject doesn't exist.

isComplete :: MMiSSOntology -> [String]

is checking ontologies which have been created in AutoInsert mode. For these ontologies there could be classes and relations that were inserted automatically rather than defined properly via insertClass or insertRelation. If the InsertMode of the provided ontology is ThrowError returns an empty list. If there are no classes or relations with AutoInserted mark returns also an empty list, otherwise it returns a list of error messages stating, which class or which relation definition is missing.