Ejemplo n.º 1
0
 def count(self, s, p, o, s_blank, o_l, o_blank, statement):
     # count triples that use some vocabulary (via its base-URI, hope that's not silly)
     s_namespace = get_namespace(s)
     if s_namespace:
         self.results['s'][s_namespace] = self.results['s'].get(s_namespace, 0) + 1
     p_namespace = get_namespace(p)
     if p_namespace:
         self.results['p'][p_namespace] = self.results['p'].get(p_namespace, 0) + 1
     o_namespace = get_namespace(o)
     if o_namespace:
         self.results['o'][o_namespace] = self.results['o'].get(o_namespace, 0) + 1
Ejemplo n.º 2
0
	def count(self, s, p, o, s_blank, o_l, o_blank, statement):
		if not (statement.subject.is_resource and statement.object.is_resource):
			return
        
		subject_ns = get_namespace(s)
		object_ns = get_namespace(o)
        
		if object_ns is None or subject_ns is None:
			return
		global link_properties
		if subject_ns != object_ns and p in link_properties.keys():
			key = LinkSets.LinkSetKey( subject_ns, p, object_ns )
			self.usage_count[key] = self.usage_count.get(key, 0) + 1
Ejemplo n.º 3
0
 def count(self, s, p, o, s_blank, o_l, o_blank, statement):
     # count triples with obj. vocabulary not in subj. vocabulary)
     if not (statement.subject.is_resource and statement.object.is_resource):
         return
     
     subject_uri = get_namespace(s)
     object_uri = get_namespace(o)
     
     if object_uri is None or subject_uri is None:
         return
     
     if subject_uri != object_uri:
         self.results['count'] += 1
         so_uri = subject_uri+object_uri
         self.ns_links[so_uri] = self.ns_links.get(so_uri, 0) + 1
Ejemplo n.º 4
0
    def count(self, s, p, o, s_blank, o_l, o_blank, statement):
        # count triples with obj. vocabulary not in subj. vocabulary)
        if not (statement.subject.is_resource
                and statement.object.is_resource):
            return

        subject_uri = get_namespace(s)
        object_uri = get_namespace(o)

        if object_uri is None or subject_uri is None:
            return

        if subject_uri != object_uri:
            self.results['count'] += 1
            so_uri = subject_uri + object_uri
            self.ns_links[so_uri] = self.ns_links.get(so_uri, 0) + 1
Ejemplo n.º 5
0
 def count(self, s, p, o, s_blank, o_l, o_blank, statement):
     # count triples that use some vocabulary (via its base-URI, hope that's not silly)
     # if not s_blank:
     #     base_uri = get_namespace(s)
     #     if base_uri:
     #         self.results[base_uri] = self.results.get(base_uri, 0) + 1
     base_uri = get_namespace(p)
     if base_uri:
         self.results[base_uri] = self.results.get(base_uri, 0) + 1