Mercurial > code > home > repos > homeauto
view service/mqtt_to_rdf/inference/lhs_evaluation_test.py @ 1745:d90cb7c06f15
try to crash if mqtt doesn't connect
author | drewp@bigasterisk.com |
---|---|
date | Thu, 09 Nov 2023 17:21:59 -0800 |
parents | 23e6154e6c11 |
children |
line wrap: on
line source
import unittest from rdflib import RDF, ConjunctiveGraph, Literal, Namespace from rdflib.parser import StringInputSource EX = Namespace('http://example.com/') def N3(txt: str): g = ConjunctiveGraph() prefix = """ @prefix : <http://example.com/> . """ g.parse(StringInputSource((prefix + txt).encode('utf8')), format='n3') return g