dipper.models.Model module

class dipper.models.Model.Model(graph)

Bases: object

Utility class to add common triples to a graph (subClassOf, type, label, sameAs)

addBlankNodeAnnotation(node_id)

Add an annotation property to the given `node_id` to be a pseudo blank node. This is a monarchism. :param node_id: :return:

addClassToGraph(class_id, label=None, class_type=None, description=None)

Any node added to the graph will get at least 3 triples: *(node, type, owl:Class) and *(node, label, literal(label)) *if a type is added,

then the node will be an OWL:subclassOf that the type
*if a description is provided,
it will also get added as a dc:description
Parameters:
  • class_id
  • label
  • class_type
  • description
Returns:

addComment(subject_id, comment)
addDefinition(class_id, definition)
addDepiction(subject_id, image_url)
addDeprecatedClass(old_id, new_ids=None)

Will mark the oldid as a deprecated class. if one newid is supplied, it will mark it as replaced by. if >1 newid is supplied, it will mark it with consider properties :param old_id: str - the class id to deprecate :param new_ids: list - the class list that is

the replacement(s) of the old class. Not required.
Returns:None
addDeprecatedIndividual(old_id, new_ids=None)

Will mark the oldid as a deprecated individual. if one newid is supplied, it will mark it as replaced by. if >1 newid is supplied, it will mark it with consider properties :param g: :param oldid: the individual id to deprecate :param newids: the individual idlist that is the replacement(s) of

the old individual. Not required.
Returns:
addDescription(subject_id, description)
addEquivalentClass(sub, obj)
addIndividualToGraph(ind_id, label, ind_type=None, description=None)
addLabel(subject_id, label)
addOWLPropertyClassRestriction(class_id, property_id, property_value)
addOWLVersionIRI(ontology_id, version_iri)
addOWLVersionInfo(ontology_id, version_info)
addOntologyDeclaration(ontology_id)
addPerson(person_id, person_label=None)
addSameIndividual(sub, obj)
addSubClass(child_id, parent_id)
addSynonym(class_id, synonym, synonym_type=None)

Add the synonym as a property of the class cid. Assume it is an exact synonym, unless otherwise specified :param g: :param cid: class id :param synonym: the literal synonym label :param synonym_type: the CURIE of the synonym type (not the URI) :return:

addTriple(subject_id, predicate_id, obj, object_is_literal=False, literal_type=None)
addType(subject_id, subject_type)
addXref(class_id, xref_id, xref_as_literal=False)
annotation_properties = {'clique_leader': 'MONARCH:cliqueLeader', 'comment': 'dc:comment', 'consider': 'OIO:consider', 'definition': 'IAO:0000115', 'depiction': 'foaf:depiction', 'description': 'dc:description', 'hasExactSynonym': 'OIO:hasExactSynonym', 'hasRelatedSynonym': 'OIO:hasRelatedSynonym', 'has_xref': 'OIO:hasDbXref', 'inchi_key': 'CHEBI:InChIKey', 'is_anonymous': 'MONARCH:anonymous', 'label': 'rdfs:label', 'replaced_by': 'IAO:0100001', 'version_info': 'owl:versionInfo'}
datatype_properties = {'has_measurement': 'IAO:0000004', 'position': 'faldo:position'}
makeLeader(node_id)

Add an annotation property to the given `node_id` to be the clique_leader. This is a monarchism. :param node_id: :return:

object_properties = {'causally_influences': 'RO:0002566', 'causally_upstream_of_or_within': 'RO:0002418', 'contributes_to': 'RO:0002326', 'correlates_with': 'RO:0002610', 'dc:evidence': 'dc:evidence', 'dc:source': 'dc:source', 'derives_from': 'RO:0001000', 'enables': 'RO:0002327', 'ends_during': 'RO:0002093', 'ends_with': 'RO:0002230', 'equivalent_class': 'owl:equivalentClass', 'existence_ends_at': 'UBERON:existence_ends_at', 'existence_ends_during': 'RO:0002492', 'existence_starts_at': 'UBERON:existence_starts_at', 'existence_starts_during': 'RO:0002488', 'has disposition': 'RO:0000091', 'has_author': 'ERO:0000232', 'has_begin_stage_qualifier': 'GENO:0000630', 'has_end_stage_qualifier': 'GENO:0000631', 'has_environment_qualifier': 'GENO:0000580', 'has_evidence': 'RO:0002558', 'has_gene_product': 'RO:0002205', 'has_object': ':hasObject', 'has_origin': 'GENO:0000643', 'has_part': 'BFO:0000051', 'has_phenotype': 'RO:0002200', 'has_predicate': ':hasPredicate', 'has_qualifier': 'GENO:0000580', 'has_quality': 'RO:0000086', 'has_sex_specificity': ':has_sex_specificity', 'has_subject': ':hasSubject', 'in_taxon': 'RO:0002162', 'involved_in': 'RO:0002331', 'is_about': 'IAO:0000136', 'is_marker_for': 'RO:0002607', 'mentions': 'IAO:0000142', 'model_of': 'RO:0003301', 'occurs_in': 'BFO:0000066', 'on_property': 'owl:onProperty', 'part_of': 'BFO:0000050', 'same_as': 'owl:sameAs', 'some_values_from': 'owl:someValuesFrom', 'starts_during': 'RO:0002091', 'starts_with': 'RO:0002224', 'subclass_of': 'rdfs:subClassOf', 'substance_that_treats': 'RO:0002606', 'towards': 'RO:0002503', 'type': 'rdf:type', 'version_iri': 'owl:versionIRI'}
types = {'annotation_property': 'owl:AnnotationProperty', 'class': 'owl:Class', 'datatype_property': 'owl:DatatypeProperty', 'deprecated': 'owl:deprecated', 'named_individual': 'owl:NamedIndividual', 'object_property': 'owl:ObjectProperty', 'ontology': 'owl:Ontology', 'person': 'foaf:Person', 'restriction': 'owl:Restriction'}