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))
def _create_literal(self, p, s, dt=None, nor=True): return create_literal(self.g, self.res, p, s, dt, nor)
def create_keyword(self, g, res, string): return create_literal(g, res, self.keyword, string)
def create_byte_size(self, g, res, string): return create_literal(g, res, self.byte_size, string, XSD.decimal)
def create_description(self, g, res, string): return create_literal(g, res, self.description, string)
def create_title(self, g, res, string): return create_literal(g, res, self.title, string)
def update_modification_date(self, g, res, string): g.remove((res, self.modified, None)) return create_literal(g, res, self.modified, string, XSD.dateTime)
def create_publication_date(self, g, res, string): return create_literal(g, res, self.issued, string, XSD.dateTime)
def create_label(self, g, res, string): return create_literal(g, res, RDFS.label, string)