:- use_module(bio(ontol_db)). :- use_module(bio(io)). % find all superclasses of a particular class demo:- load_bioresource(go), class(ID,'transcription factor activity'), setof(Parent,subclassRT(ID,Parent),Parents), writeln(parents=Parents).
This module is part of the blipkit ontol package. See README.txt
This module contains defines extensional and intensional data predicates that model ontology and instance data. The data model is obo-like, and can easily be mapped to an OWL ontology (see bridge)
The basic querying is such things as transitive relationships and detecting illegal cycles or redundant relationships. It requires ontology prolog fact files containing at least the following facts:
Any cycles over subclass/2 or restriction/3 will cause non-terminating behavior
This is a data module. Facts can be imported and exported from both prolog fact databases and other formats
The following file formats can be read in using load_biofile/2 and load_bioresource/1
The following database schemas have adapters:
The following file formats can be written using write_biofile/2
This is a format commonly used for bio-ontologies See http://www.geneontology.org GO
Blip contains an experimental pure-prolog parser (see parser_obo), which can be invoked by using the file format atom 'obo_native'. For now the default is to invoke the go-perl go2prolog script which generates prolog fact files. This should all happen behind the scenes, just specifify the file format 'obo'
The data predicates defined in this module map fairly well to OWL. As well as loading the data predicates directly from an OBO-formatted file (as is common in the bio-ontologies world), the data predicates can map to predicates defined in the SWI-Prolog rdb_db module - see <ontol_bridge_from_owl.html> ontol_bridge_from_owl
As well as modeling ontologies consisting purely of class data, this module also handles instance data. A generic free model is used to store instances, similar to most frame-based systems, RDF and OWL. In principle, any kind of data can be modeled as instances belong to a particular class. This means that the ontol module can provide an object system for modeling data. See inst/2, inst_rel/3 and inst_sv/4 for details
Typically the modes of the inference predicates are defined such that parents are infered from children, rather than vice versa
This module is part of blip. For more details, see http://www.blipkit.org
notes: this will loop forever if there are subclass/2 cycles
eliminates redundancy; for example, if X part_of organelle, and nucleus is_a+ organelle, and X can be inferred to be part_of a nucleus, then X part_of organelle is redundant
X --[p]--> nucleus --[is_a]--> organelle | ^ | | +----------[p]---------------------+
declares that Slot is a relation that links instances to datatype equivalent to owl:DatatypeProperty
takes into account the rule:
if X is_a* Y and Y part_of Z then X part_of Z
(substitute part_of for any other relation T here)
PID1 must be a direct part_of ID, but PID2 can be an indirect part
does not report if PID1 is_a* PID2 (because they are not distinct parts)
Note that this will unify with duplicate results as PID1 and PID2 are symmeryical. When PID1 and PID2 are unground, you can de-duplicate like this:
multiple_parent(ID,part_of,PID1,PID2), PID1@<PID2.
PID1 is always a direct part_of ID
(substitute part_of for any other relation T here)
subclass cycles are always illegal, and will cause non-terminating behaviour
parent cycles will cause non-terminating behavior example: parent_cycle(X,Y1),!,reverse(Y1,Y),writeln(Y),member(A-R-B,Y),class(A,AN),class(B,BN),writeln(A-AN-R-B-BN),fail.
The following predicates are exported, but not or incorrectly documented.