Beispiel #1
0
    def test_create_literal(self):
        input_g = rdflib.Graph()
        input_res = rdflib.URIRef("http://www.test.net/resource")
        input_p = rdflib.URIRef("http://www.test.net/hasName")
        input_s = "John Doe C¥èal"
        input_datatype = rdflib.XSD["string"]

        self.assertTrue(create_literal(input_g, input_res, input_p, input_s))
        self.assertTrue(
            create_literal(input_g, input_res, input_p, input_s,
                           input_datatype))
Beispiel #2
0
 def _create_literal(self, p, s, dt=None, nor=True):
     return create_literal(self.g, self.res, p, s, dt, nor)
Beispiel #3
0
 def create_keyword(self, g, res, string):
     return create_literal(g, res, self.keyword, string)
Beispiel #4
0
 def create_byte_size(self, g, res, string):
     return create_literal(g, res, self.byte_size, string, XSD.decimal)
Beispiel #5
0
 def create_description(self, g, res, string):
     return create_literal(g, res, self.description, string)
Beispiel #6
0
 def create_title(self, g, res, string):
     return create_literal(g, res, self.title, string)
Beispiel #7
0
 def update_modification_date(self, g, res, string):
     g.remove((res, self.modified, None))
     return create_literal(g, res, self.modified, string, XSD.dateTime)
Beispiel #8
0
 def create_publication_date(self, g, res, string):
     return create_literal(g, res, self.issued, string, XSD.dateTime)
Beispiel #9
0
 def create_label(self, g, res, string):
     return create_literal(g, res, RDFS.label, string)