Mercurial > code > home > repos > homeauto
view service/mqtt_to_rdf/lhs_evaluation_test.py @ 1671:2b905c07e82b
try a bnode test mode improvement, but it's not so useful if you parse graphs with reused bnodes in them
author | drewp@bigasterisk.com |
---|---|
date | Tue, 21 Sep 2021 23:21:38 -0700 |
parents | 4fd9fdfcf16a |
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