def property_assertion_no_certainty(self): if not hasattr(self, '_property_assertion_no_certainty'): self._property_assertion_no_certainty = \ self.create_topic_by_subject_identifier( Locator(PROPERTY_ASSERTION_NO_CERTAINTY_IRI)) self._property_assertion_no_certainty.add_type( self.property_assertion_certainty_type) return self._property_assertion_no_certainty
def existence(self): """Returns the existence topic, that serves as the property topic for all existences. :rtype: `Topic` """ return self.create_topic_by_subject_identifier(Locator(EXISTENCE_IRI), '_existence')
def is_preferred(self): """Returns the is_preferred topic, that is used as a scoping topic for all preferred property assertions. :rtype: `Topic` """ return self.create_topic_by_subject_identifier( Locator(IS_PREFERRED_IRI), '_is_preferred')
def update(self, subject_identifier): """Updates this property assertion. :param subject_identifier: subject_identifier URL :type subject_identifier: unicode string URL """ if self.get_value() != subject_identifier: self.set_value(subject_identifier, Locator('http://www.w3.org/2001/XMLSchema#anyURI'))
def create_entity (self, authority=None): """Creates a new entity. If `authority` is specified, create an accompanying existence property assertion. :param authority: authority used in the existence property assertion :type authority: `Topic` :rtype: `Entity` """ entity = self.create_topic(proxy=Entity) view_url = reverse('entity-view', kwargs={'entity_id': entity.get_id()}) url = 'http://%s%s' % (Site.objects.get_current().domain, view_url) entity.add_subject_identifier(Locator(url)) entity.add_type(self.entity_type) if authority is not None: entity.create_existence_property_assertion(authority) return entity
def authority_has_language_association_type(self): return self.create_topic_by_subject_identifier( Locator(AUTHORITY_HAS_LANGUAGE_ASSOCIATION_TYPE_IRI), '_authority_has_language_association_type')
def name_has_name_part_association_type(self): return self.create_topic_by_subject_identifier( Locator(NAME_HAS_NAME_PART_ASSOCIATION_TYPE_IRI), '_name_has_name_part_association_type')
def point_tpq_date_type(self): return self.create_topic_by_subject_identifier( Locator(POINT_TPQ_DATE_TYPE_IRI), '_point_tpq_date_type')
def property_assertion_certainty_type(self): return self.create_topic_by_subject_identifier( Locator(PROPERTY_ASSERTION_CERTAINTY_TYPE_IRI), '_property_assertion_certainty_type')
def authority_has_script_association_type(self): return self.create_topic_by_subject_identifier( Locator(AUTHORITY_HAS_SCRIPT_ASSOCIATION_TYPE_IRI), '_authority_has_script_association_type')
def existence_assertion_type(self): return self.create_topic_by_subject_identifier( Locator(EXISTENCE_ASSERTION_TYPE_IRI), '_existence_assertion_type')
def script_role_type(self): return self.create_topic_by_subject_identifier( Locator(SCRIPT_ROLE_TYPE_IRI), '_script_role_type')
def start_tpq_date_type(self): return self.create_topic_by_subject_identifier( Locator(START_TPQ_DATE_TYPE_IRI), '_start_tpq_date_type')
def property_role_type(self): return self.create_topic_by_subject_identifier( Locator(PROPERTY_ROLE_TYPE_IRI), '_property_role_type')
def reverse_relationship_name_type(self): return self.create_topic_by_subject_identifier( Locator(REVERSE_RELATIONSHIP_NAME_TYPE_IRI), '_reverse_relationship_name_type')
def language_type(self): return self.create_topic_by_subject_identifier( Locator(LANGUAGE_TYPE_IRI), '_language_type')
def authority_has_entity_relationship_type_association_type(self): return self.create_topic_by_subject_identifier( Locator( AUTHORITY_HAS_ENTITY_RELATIONSHIP_TYPE_ASSOCIATION_TYPE_IRI), '_authority_has_entity_relationship_type_association_type')
def get_entity_subject_identifier(self, entity_id): view_url = reverse('entity-view', kwargs={'entity_id': entity_id}) url = 'http://%s%s' % (Site.objects.get_current().domain, view_url) return Locator(url)
def is_in_script_type(self): return self.create_topic_by_subject_identifier( Locator(IS_IN_SCRIPT_TYPE_IRI), '_is_in_script_type')
def infrastructure_role_type(self): return self.create_topic_by_subject_identifier( Locator(INFRASTRUCTURE_ROLE_TYPE_IRI), '_infrastructure_role_type')
def range_entity_role_type(self): return self.create_topic_by_subject_identifier( Locator(RANGE_ENTITY_ROLE_TYPE_IRI), '_range_entity_role_type')
def name_part_order_type(self): return self.create_topic_by_subject_identifier( Locator(NAME_PART_ORDER_TYPE_IRI), '_name_part_order_type')
def script_separator_type(self): return self.create_topic_by_subject_identifier( Locator(SCRIPT_SEPARATOR_TYPE_IRI), '_script_separator_type')
def name_part_type_order_in_language_type(self): return self.create_topic_by_subject_identifier( Locator(NAME_PART_TYPE_ORDER_IN_LANGUAGE_TYPE_IRI), '_name_part_type_order_in_language_type')
def authority_has_name_part_type_association_type(self): return self.create_topic_by_subject_identifier( Locator(AUTHORITY_HAS_NAME_PART_TYPE_ASSOCIATION_TYPE_IRI), '_authority_has_name_part_type_association_type')
def name_type_type(self): return self.create_topic_by_subject_identifier( Locator(NAME_TYPE_TYPE_IRI), '_name_type_type')
def subject_identifier_assertion_type(self): return self.create_topic_by_subject_identifier( Locator(SUBJECT_IDENTIFIER_ASSERTION_TYPE_IRI), '_subject_identifier_assertion_type')
def normalised_date_form_type(self): return self.create_topic_by_subject_identifier( Locator(NORMALISED_DATE_FORM_TYPE_IRI), '_normalised_date_form_type')
def authority_type(self): return self.create_topic_by_subject_identifier( Locator(AUTHORITY_TYPE_IRI), '_authority_type')
def note_assertion_type(self): return self.create_topic_by_subject_identifier( Locator(NOTE_ASSERTION_TYPE_IRI), '_note_assertion_type')