Created
July 9, 2021 21:12
-
-
Save gtfierro/096ccdec0594e3dd976a016f98a71c80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import brickschema | |
from brickschema.namespaces import BRICK, RDFS | |
from rdflib import URIRef | |
g = brickschema.Graph(load_brick_nightly=True) | |
def get_superclass(cls): | |
return [x for x in g.objects(cls, RDFS.subClassOf) if isinstance(x, URIRef)] | |
assert get_superclass(BRICK.Air_Temperature_Sensor) == [BRICK.Temperature_Sensor] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment