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, class_category=None, class_type_category=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
  • class_category – a biolink category CURIE for class
  • class_type_category – a biolink category CURIE for class type
Returns:

addComment(subject_id, comment, subject_category=None)
addDefinition(class_id, definition, class_category=None)
addDepiction(subject_id, image_url)
addDeprecatedClass(old_id, new_ids=None, old_id_category=None, new_ids_category=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.

:param old_id_category - a biolink category CURIE for old id :param new_ids_category - a biolink category CURIE for new ids :return: None

addDeprecatedIndividual(old_id, new_ids=None, old_id_category=None, new_id_category=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.

:param old_id_category - a biolink category CURIE for old id :param new_ids_category - a biolink category CURIE for new ids :return:

addDescription(subject_id, description, subject_category=None)
addEquivalentClass(sub, obj, subject_category=None, object_category=None)
addIndividualToGraph(ind_id, label, ind_type=None, description=None, ind_category=None, ind_type_category=None)
addLabel(subject_id, label, subject_category=None)
addOWLPropertyClassRestriction(class_id, property_id, property_value, class_category=None, property_id_category=None, property_value_category=None)
addOWLVersionIRI(ontology_id, version_iri)
addOWLVersionInfo(ontology_id, version_info)
addOntologyDeclaration(ontology_id)
addPerson(person_id, person_label=None)
addSameIndividual(sub, obj, subject_category=None, object_category=None)
addSubClass(child_id, parent_id, child_category=None, parent_category=None)
addSynonym(class_id, synonym, synonym_type=None, class_category=None)

Add the synonym as a property of the class cid. Assume it is an exact synonym, unless otherwise specified :param self: :param class_id: class id :param synonym: the literal synonym label :param synonym_type: the CURIE of the synonym type (not the URI) :param class_category: biolink category CURIE for class_id (no biolink category is possible for synonym, since this is added to the triple as a literal) :return:

addTriple(subject_id, predicate_id, obj, object_is_literal=False, literal_type=None, subject_category=None, object_category=None)
addType(subject_id, subject_type, subject_category=None, subject_type_category=None)
addXref(class_id, xref_id, xref_as_literal=False, class_category=None, xref_category=None)
makeLeader(node_id)

Add an annotation property to the given `node_id` to be the clique_leader. This is a monarchism. :param node_id: :param node_category: a biolink category CURIE for node_id :return: