Ejemplo n.º 1
0
 def testIssue(self):
     i = Issue()
     i.number = 3
     self.assertEqual(2, len(self.graph))
     p = Periodical()
     i.periodical = p
     p.shortTitle = "testTitle"
     self.assertEqual("http://localhost:5000/serials/testTitle/0/3", i.locUrl)
     i.volume = 4
     self.assertEqual("http://localhost:5000/serials/testTitle/4/3", i.locUrl)
     self.assertEqual(6, len(self.graph))
Ejemplo n.º 2
0
    def testTraversal(self):
        a = Article()
        i = Issue()
        p = Periodical()
        pr = Person()
        eg = EditorGroup()

        eg.periodical = p
        pr.name = "John Malcovitshy"
        p.title = "Periodicaltitle"
        eg.members = [pr]

        a.issue = i
        i.periodical = p
        a.makers = [pr]
        self.assertEqual(a.issue.periodical.title, "Periodicaltitle")
        self.assertEqual(a.makers[0].name, "John Malcovitshy")
        self.assertEqual(eg.members[0].name, "John Malcovitshy")
        self.assertEqual(eg.periodical.title, "Periodicaltitle")
        self.assertEqual(12, len(self.graph))
Ejemplo n.º 3
0
#initialize main graph
g = ConjunctiveGraph = rdfSubject.db


    #############
    #   NLR 56  #
    #############

nlr = Periodical("<http://rdf.freebase.com/rdf/en.new_left_review>")
nlr.title = "New Left Review"
nlr.issn = "0028-6060"
nlr.shortTitle = "nlr"
nlr.homepage = URIRef("http://www.newleftreview.org/")

nlr56 = Issue("<tag:new-left-review-issue-56,2009-04-23>")
nlr56.periodical = nlr
nlr56.number = 56
nlr56.volume = 2
nlr56.title = "New Left Review 56 March-April 2009"
nlr56.pubdate = "2009-03-09"
nlr56.coverImg = URIRef("http://www.newleftreview.org/assets/images/NLR56cover.gif")

a1 = Article("<tag:obama-at-manassas,2009-04-23>")
a1.title = "Obama at Manassas"
a1.creators = ["Mike Davis"]
a1.abstract = "Does Obama’s victory signal a political turning point comparable to 1980 or 1932? Mike Davis maps county-level changes, from below—minority-majority demographics, subprime suburbs, white-collar financial worries—catalysed by the 2008 campaign. From above, realignment of American capital behind the Silicon President."
a1.issue = nlr56

a2 = Article("<tag:freedoms-triumph,2009-04-23>")
a2.creators = ["Dylan Riley"]
a2.title = "Freedom's Triumph?"