Mercurial > code > home > repos > homeauto
annotate service/mqtt_to_rdf/lhs_evaluation_test.py @ 1672:23beadd3e83a
split a test
author | drewp@bigasterisk.com |
---|---|
date | Tue, 21 Sep 2021 23:21:59 -0700 |
parents | 4fd9fdfcf16a |
children |
rev | line source |
---|---|
1605 | 1 import unittest |
2 | |
3 from rdflib import RDF, ConjunctiveGraph, Literal, Namespace | |
4 from rdflib.parser import StringInputSource | |
5 | |
6 EX = Namespace('http://example.com/') | |
7 | |
8 | |
9 def N3(txt: str): | |
10 g = ConjunctiveGraph() | |
11 prefix = """ | |
12 @prefix : <http://example.com/> . | |
13 """ | |
14 g.parse(StringInputSource((prefix + txt).encode('utf8')), format='n3') | |
15 return g | |
16 |