How to use the brickschema.brickschema.namespaces.BRICK.hasTag function in brickschema

To help you get started, we’ve selected a few brickschema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrickSchema / Brick / brickschema / brickschema / inference.py View on Github external
?inter rdf:rest*/rdf:first ?node.
          {
              BIND (brick:hasTag as ?p)
              ?node owl:onProperty ?p.
              ?node owl:hasValue ?o.
          } UNION {
              BIND (brick:measures as ?p)
              ?node owl:onProperty ?p.
              ?node owl:hasValue ?o.
          }
        }""")
        class2tag = defaultdict(set)
        for (cname, p, o, rest) in res:
            cname = cname.split('#')[1]
            o = o.split('#')[1]
            if p == BRICK.hasTag:
                class2tag[cname].add(o)
        for cname, tagset in class2tag.items():
            self.lookup[tuple(tagset)].add(cname)