#!/usr/bin/env python

import rdflib

g = rdflib.Graph()
g.parse('sdu_gtc.ttl', format='n3')

r = g.query(
    """SELECT DISTINCT ?temp ?rel ?hx_prim
       WHERE {
          ?temp a bs:Temperature,bs:Sensor .
          ?hx_prim a bs:Coil .
          ?temp ?rel ?hx_prim .
       }""")

print('How do temperature sensors relate to coils?')
for pair in r:
    print(' - %s -(%s)-> %s' % pair)

