Exemple #1
0
 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")
Exemple #2
0
 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")
Exemple #3
0
 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")
Exemple #4
0
 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")
Exemple #5
0
 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")
Exemple #6
0
 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")
Exemple #7
0
 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")
Exemple #8
0
 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'")
Exemple #9
0
 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")
Exemple #10
0
 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')
Exemple #11
0
 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")
Exemple #12
0
 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')
Exemple #13
0
 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'")
Exemple #14
0
 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")
Exemple #15
0
 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")
Exemple #16
0
 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")