示例#1
0
 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
示例#2
0
    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')
示例#3
0
    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'))
示例#5
0
    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
示例#6
0
 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')
示例#7
0
 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')
示例#8
0
 def point_tpq_date_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(POINT_TPQ_DATE_TYPE_IRI), '_point_tpq_date_type')
示例#9
0
 def property_assertion_certainty_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(PROPERTY_ASSERTION_CERTAINTY_TYPE_IRI),
         '_property_assertion_certainty_type')
示例#10
0
 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')
示例#11
0
 def existence_assertion_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(EXISTENCE_ASSERTION_TYPE_IRI), '_existence_assertion_type')
示例#12
0
 def script_role_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(SCRIPT_ROLE_TYPE_IRI), '_script_role_type')
示例#13
0
 def start_tpq_date_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(START_TPQ_DATE_TYPE_IRI), '_start_tpq_date_type')
示例#14
0
 def property_role_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(PROPERTY_ROLE_TYPE_IRI), '_property_role_type')
示例#15
0
 def reverse_relationship_name_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(REVERSE_RELATIONSHIP_NAME_TYPE_IRI),
         '_reverse_relationship_name_type')
示例#16
0
 def language_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(LANGUAGE_TYPE_IRI), '_language_type')
示例#17
0
 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')
示例#18
0
 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)
示例#19
0
 def is_in_script_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(IS_IN_SCRIPT_TYPE_IRI), '_is_in_script_type')
示例#20
0
 def infrastructure_role_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(INFRASTRUCTURE_ROLE_TYPE_IRI), '_infrastructure_role_type')
示例#21
0
 def range_entity_role_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(RANGE_ENTITY_ROLE_TYPE_IRI), '_range_entity_role_type')
示例#22
0
 def name_part_order_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(NAME_PART_ORDER_TYPE_IRI), '_name_part_order_type')
示例#23
0
 def script_separator_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(SCRIPT_SEPARATOR_TYPE_IRI), '_script_separator_type')
示例#24
0
 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')
示例#25
0
 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')
示例#26
0
 def name_type_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(NAME_TYPE_TYPE_IRI), '_name_type_type')
示例#27
0
 def subject_identifier_assertion_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(SUBJECT_IDENTIFIER_ASSERTION_TYPE_IRI),
         '_subject_identifier_assertion_type')
示例#28
0
 def normalised_date_form_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(NORMALISED_DATE_FORM_TYPE_IRI),
         '_normalised_date_form_type')
示例#29
0
 def authority_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(AUTHORITY_TYPE_IRI), '_authority_type')
示例#30
0
 def note_assertion_type(self):
     return self.create_topic_by_subject_identifier(
         Locator(NOTE_ASSERTION_TYPE_IRI), '_note_assertion_type')