def to_json(self, nested=False):
        data = {
            "id": self.pk,
            "object_type": "concept",
            "identifier": self.identifier,
            "name": self.name,
            "query": self.query,
            "lang": self.lang,
        }
        if not nested:
            data["tags"] = [tag.to_json(nested=True) for tag in self.tags.all()]
            data["actions"] = [action.to_json(nested=True) for action in self.actions.all()]

        return data