comparison 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
comparison
equal deleted inserted replaced
1726:7d3797ed6681 1727:23e6154e6c11
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