def test_label_for_foaf_workplaceHomepage(self): """check we can get the label for foaf's workplaceHomepage property""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT,uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() l = foaf_spec.lookup('http://xmlns.com/foaf/0.1/workplaceHomepage').label # print "Label for foaf workplaceHomepage is "+l self.assertEqual(l,"workplace homepage")
def test_label_for_foaf_Person(self): """check we can get the label for foaf's Person class""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() l = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person').label # print "Label for foaf Person is "+l self.assertEqual(l,"Person")
def test_lookup_Person(self): """find a term given it's uri""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() p = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person') # print "lookup for Person: ",p self.assertNotEqual(p.uri, None, "Couldn't find person class in FOAF")
def test_status_for_foaf_Person(self): """check we can get the status for foaf's Person class""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() s = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person').status self.assertEqual(s, "stable")
def test_label_for_foaf_Person(self): """check we can get the label for foaf's Person class""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() l = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person').label # print "Label for foaf Person is "+l self.assertEqual(l, "Person")
def test_lookup_Wombat(self): """fail to a bogus term given it's uri""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() p = foaf_spec.lookup( 'http://xmlns.com/foaf/0.1/Wombat') # No Wombats in FOAF yet. self.assertEqual(p, None, "lookup for Wombat should return None")
def test_lookup_Person(self): """find a term given it's uri""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() p = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person') # print "lookup for Person: ",p self.assertNotEqual(p.uri, None, "Couldn't find person class in FOAF")
def test_status_for_doap_Repository(self): """check we can get the computed 'unknown' status for doap's Repository class""" doap_spec = Vocab(dir=DOAPSNAPSHOTDIR, f=DOAPSNAPSHOT, uri='http://usefulinc.com/ns/doap#') doap_spec.index() s = doap_spec.lookup('http://usefulinc.com/ns/doap#Repository').status self.assertEqual( s, "unknown", "if vs:term_status isn't used, we set t.status to 'unknown'")
def test_label_for_foaf_workplaceHomepage(self): """check we can get the label for foaf's workplaceHomepage property""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() l = foaf_spec.lookup( 'http://xmlns.com/foaf/0.1/workplaceHomepage').label # print "Label for foaf workplaceHomepage is "+l self.assertEqual(l, "workplace homepage")
def test_got_sioc(self): sioc_spec = Vocab(SIOCSNAPSHOTDIR, SIOCSNAPSHOT, uri=SIOC) sioc_spec.index() cr = sioc_spec.lookup('http://rdfs.org/sioc/ns#creator_of')
def test_label_for_sioc_Community(self): """check we can get the label for sioc's Community class""" sioc_spec = Vocab(dir=SIOCSNAPSHOTDIR, f=SIOCSNAPSHOT, uri=SIOC) sioc_spec.index() l = sioc_spec.lookup(SIOC + 'Community').label self.assertEqual(l, "Community")
def test_got_sioc(self): sioc_spec = Vocab(SIOCSNAPSHOTDIR,SIOCSNAPSHOT, uri = SIOC) sioc_spec.index() cr = sioc_spec.lookup('http://rdfs.org/sioc/ns#creator_of')
def test_status_for_doap_Repository(self): """check we can get the computed 'unknown' status for doap's Repository class""" doap_spec = Vocab(dir=DOAPSNAPSHOTDIR,f=DOAPSNAPSHOT, uri='http://usefulinc.com/ns/doap#') doap_spec.index() s = doap_spec.lookup('http://usefulinc.com/ns/doap#Repository').status self.assertEqual(s,"unknown", "if vs:term_status isn't used, we set t.status to 'unknown'")
def test_status_for_foaf_Person(self): """check we can get the status for foaf's Person class""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() s = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person').status self.assertEqual(s,"stable")
def test_label_for_sioc_Community(self): """check we can get the label for sioc's Community class""" sioc_spec = Vocab(dir=SIOCSNAPSHOTDIR,f=SIOCSNAPSHOT, uri=SIOC) sioc_spec.index() l = sioc_spec.lookup(SIOC+'Community').label self.assertEqual(l,"Community")
def test_lookup_Wombat(self): """fail to a bogus term given it's uri""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') foaf_spec.index() p = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Wombat') # No Wombats in FOAF yet. self.assertEqual(p, None, "lookup for Wombat should return None")