mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 01:01:03 +02:00
22 lines
634 B
Python
22 lines
634 B
Python
|
|
from . defs import *
|
|
from .. schema import Triple, Value
|
|
|
|
class Organization:
|
|
def __init__(self, id, name=None, description=None):
|
|
self.id = id
|
|
self.name = name
|
|
self.description = description
|
|
|
|
def emit(self, emit):
|
|
|
|
emit(Triple(Value(self.id), Value(IS_A), Value(ORGANIZATION)))
|
|
|
|
if self.name:
|
|
emit(Triple(Value(self.id), Value(LABEL), Value(self.name)))
|
|
emit(Triple(Value(self.id), Value(NAME), Value(self.name)))
|
|
|
|
if self.description:
|
|
emit(Triple(
|
|
Value(self.id), Value(DESCRIPTION), Value(self.description)
|
|
))
|