comparison service/mqtt_to_rdf/rdf_debug.py @ 1726:7d3797ed6681

rough port to starlette and reactivex
author drewp@bigasterisk.com
date Tue, 20 Jun 2023 23:14:28 -0700
parents 20474ad4968e
children
comparison
equal deleted inserted replaced
1725:55ace62af7f9 1726:7d3797ed6681
20 g2 = Graph() 20 g2 = Graph()
21 g2 += g 21 g2 += g
22 g = g2 22 g = g2
23 g.bind('', ROOM) 23 g.bind('', ROOM)
24 g.bind('ex', Namespace('http://example.com/')) 24 g.bind('ex', Namespace('http://example.com/'))
25 lines = cast(bytes, g.serialize(format='n3')).decode('utf8').splitlines() 25 lines = g.serialize(format='n3').splitlines()
26 lines = [line for line in lines if not line.startswith('@prefix')] 26 lines = [line for line in lines if not line.startswith('@prefix')]
27 if oneLine: 27 if oneLine:
28 lines = [line.strip() for line in lines] 28 lines = [line.strip() for line in lines]
29 return ' '.join(lines) 29 return ' '.join(lines)
30 except TypeError: 30 except TypeError: