def clusterBackward(self, seed, Cluster=None): """ Cluster the triple store: from a seed, transitively get all properties and objects 'backward', ie, following the link back in the graph. :param seed: RDFLib Resource :param Cluster: another :class:`~rdfextras.sparql2sql.sql.sparqlGraph` instance; if None, a new one will be created. The subgraph will be added to this graph. :returns: The triple store containing the cluster :rtype: :class:`~rdfextras.sparql2sql.sql.sparqlGraph` """ if Cluster == None: Cluster = SPARQLGraph() # This will raise an exception if not kosher... check_object(seed) # print "Wrong type for clustering: %s" % seed self._clusterBackward(seed, Cluster) return Cluster
def clusterBackward(self, seed, Cluster=None): """ Cluster the triple store: from a seed, transitively get all properties and objects 'backward', ie, following the link back in the graph. :param seed: RDFLib Resource :param Cluster: another sparqlGraph instance; if None, a new one will be created. The subgraph will be added to this graph. :return: The :class:`~rdfextras.sparql.graph.SPARQLGraph` triple store containing the cluster """ if Cluster == None: Cluster = SPARQLGraph() # This will raise an exception if not kosher... check_object(seed) # print "Wrong type for clustering: %s" % seed self._clusterBackward(seed, Cluster) return Cluster
def test_util_check_object(self): res = util.check_object(self.o) self.assertTrue(res == None)
def test_util_check_object(self): res = util.check_object(self.o) self.assert_(res == None)