Mercurial > code > home > repos > homeauto
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/mqtt_to_rdf/inference/lhs_evaluation_test.py Tue Jun 20 23:26:24 2023 -0700 @@ -0,0 +1,16 @@ +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 +