Example #1
0
 def test_404_remote_tar_gz(self):
     import tarfile
     uri = http_base + 'DOESNOTEXIST.nt.tgz'
     # FIXME this should probably be some different exception
     with self.assertRaises(tarfile.ReadError):
         rdfstats = RDFStats(uri)
         rdfstats.start_statistics()
Example #2
0
 def test_remote_bz2(self):
     uri = http_base + 'heb.rdf.bz2'
     rdfstats = RDFStats(uri)
     #rdfstats.set_callback_function_download(test_callback_download)
     #rdfstats.set_callback_function_extraction(test_callback_extraction)
     rdfstats.start_statistics()
     assert (len(rdfstats.get_stats_results()) > 5)
 def test_owl_subclasses(self):
     uri = 'file://' + testfile_path + 'owl_subclasses.nt'
     rdfstats = RDFStats(uri, format="nt", stats=[A4Subsumption])
     rdfstats.start_statistics()
     self.assertEqual(
         rdfstats.get_stats_results()['a4subsumption']['detectors']
         ['subsumptionDetectorOwlSubClassOf']['results']
         ['restrictionTypeOccurrence']['value'], 4)
 def test_amount_pattern_restrictions(self):
     uri = 'file://' + testfile_path + 'literalPatternMatching.nt'
     rdfstats = RDFStats(uri,
                         format="nt",
                         stats=[A20LiteralPatternMatching])
     rdfstats.start_statistics()
     self.assertEqual(
         rdfstats.get_stats_results()['a20literalpatternmatching']
         ['amount_xsd_patterns'], 2)
Example #5
0
 def test_max(self):
     uri = 'file://' + testfile_path + 'disjointProperties.nt'
     rdfstats = RDFStats(uri, format="nt", stats=[A69DisjointProperties])
     rdfstats.start_statistics()
     self.assertEqual (rdfstats.get_stats_results()['a69disjointproperties']['max_disjoint'], 4.0)
Example #6
0
 def test_remote_not_usual_extension(self):
     uri = "https://data.kingcounty.gov/api/views/jqei-rbgf/rows.rdf?accessType=DOWNLOAD"
     rdfstats = RDFStats(uri, format="rdf")
     rdfstats.start_statistics()
     assert (len(rdfstats.voidify("turtle")) > 5)
Example #7
0
 def test_remote_tar(self):
     uri = http_base + 'heb.nt.tgz'
     rdfstats = RDFStats(uri)
     rdfstats.start_statistics()
     assert (len(rdfstats.get_stats_results()) > 5)
Example #8
0
 def test_local_rdf(self):
     uri = 'file://' + testfile_path + 'heb-original.rdf'
     rdfstats = RDFStats(uri)
     rdfstats.start_statistics()
     assert (len(rdfstats.voidify("turtle")) > 5)