Mercurial > code > home > repos > homeauto
view service/mqtt_to_rdf/inference/lhs_evaluation_test.py @ 1727:23e6154e6c11
file moves
author | drewp@bigasterisk.com |
---|---|
date | Tue, 20 Jun 2023 23:26:24 -0700 |
parents | service/mqtt_to_rdf/lhs_evaluation_test.py@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