def test_convert(): from clld.lib.rdf import ClldGraph, convert, FORMATS g = ClldGraph() for from_ in FORMATS: for to_ in list(FORMATS.keys()) + [None]: convert(g.serialize(format=from_), from_, to_)
def test_convert(self): from clld.lib.rdf import ClldGraph, convert, FORMATS g = ClldGraph() for from_ in FORMATS: for to_ in FORMATS: convert(g.serialize(format=from_), from_, to_)
def render(self, ctx, req): if req.params.get("sEcho"): # triggered from a datatable, thus potentially filtered and sorted items = [item.id for item in ctx.get_query(limit=1000)] else: # triggered without any filter parameters items = [row[0] for row in req.db.query(ctx.model.id)] return convert(super(RdfIndex, self).render(items, req), "xml", self.rdflibname)
def render(self, ctx, req): if req.params.get('sEcho'): # triggered from a datatable, thus potentially filtered and sorted items = [item.id for item in ctx.get_query(limit=1000)] else: # triggered without any filter parameters items = [row[0] for row in req.db.query(ctx.model.id)] return convert( super(RdfIndex, self).render(items, req), 'xml', self.rdflibname)
def render(self, ctx, req): if req.params.get('sEcho'): # triggered from a datatable, thus potentially filtered and sorted items = ctx.get_query(limit=1000) else: # triggered without any filter parameters items = ctx.rdf_index_query(req.db.query(ctx.db_model()).order_by(ctx.db_model().pk)) if isinstance(ctx.model.name, property): items = [(item.id, None) for item in items.options(load_only('id'))] else: items = [(item.id, item.name) for item in items.options(load_only('id', 'name'))] return convert(super(RdfIndex, self).render(items, req), 'xml', self.rdflibname)
def render(self, ctx, req): if req.params.get('sEcho'): # triggered from a datatable, thus potentially filtered and sorted items = ctx.get_query(limit=1000) else: # triggered without any filter parameters items = req.db.query(ctx.model).order_by(ctx.model.pk) if isinstance(ctx.model.name, property): items = [(item.id, None) for item in items.options(load_only('id'))] else: items = [(item.id, item.name) for item in items.options(load_only('id', 'name'))] return convert(super(RdfIndex, self).render(items, req), 'xml', self.rdflibname)
def render(self, ctx, req): return convert( super(RdfIndex, self).render(ctx, req), 'xml', self.rdflibname)
def render(self, ctx, req): return convert(xmlchars(super(Rdf, self).render(ctx, req)), 'xml', self.rdflibname)
def render(self, ctx, req): return convert(xmlchars(super(Rdf, self).render(ctx, req)), "xml", self.rdflibname)
def render(self, ctx, req): return convert(super(RdfIndex, self).render(ctx, req), 'xml', self.rdflibname)