from django.db import models


class Food(models.Model):
    foodon_id = models.CharField(max_length=100)
    foodb_id = models.CharField(max_length=100)
    name = models.CharField(max_length=100)
    synonyms = models.CharField(max_length=100)


# Create your models here.


class Chemical(models.Model):
    foodb_id = models.CharField(max_length=100)
    chebi_id = models.CharField(max_length=100)
    name = models.CharField(max_length=100)
    synonyms = models.CharField(max_length=100)


class FoodPart(models.Model):
    name = models.CharField(max_length=100)
    plant_ontology_id = models.CharField(max_length=100)


class Units(models.Model):
    name = models.CharField(max_length=100)
    # units_ontology_id


class Article(models.Model):
    pmid = models.TextField()
    doi = models.TextField()


class FoodChemicalRelationshipEvidence(models.Model):
    text = models.TextField()  # premise
    article = models.ForeignKey(Article, on_delete=models.DO_NOTHING)


class FoodChemicalRelationship(models.Model):
    food = models.ForeignKey(Food, on_delete=models.DO_NOTHING)
    chemical = models.ForeignKey(Chemical, on_delete=models.DO_NOTHING)
    # food_part = models.ForeignKey(FoodPart, on_delete=models.DO_NOTHING)
    concentration = models.FloatField(null=True)
    # units = models.ForeignKey(Units, on_delete=models.DO_NOTHING)
    # evidences = models.ManyToManyField(FoodChemicalRelationshipEvidence)
    # label = (
    #     models.TextField()
    # )  # human annotated label, entailed or not entailed
    # prediction = (
    #     models.FloatField()
    # )  # model predicted probability of entailment


# class FoodChemicalRelationshipPrediction(models.Model):
#     proba_entails = models.FloatField()
#     relationship = models.ForeignKey(FoodChemicalRelationship, on_delete=models.DO_NOTHING)
#     evidence = models.ForeignKey(FoodChemicalRelationshipEvidence, on_delete=models.DO_NOTHING)


# class FoodChemicalRelationshipAnnotation(models.Model):
#     label = models.CharField(max_length=100)
#     relationship = models.ForeignKey(FoodChemicalRelationship, on_delete=models.DO_NOTHING)
#     evidence = models.ForeignKey(FoodChemicalRelationshipEvidence, on_delete=models.DO_NOTHING)

from django.db import models


class Food(models.Model):
    foodon_id = models.CharField(max_length=100)
    foodb_id = models.CharField(max_length=100)
    name = models.CharField(max_length=100)
    synonyms = models.CharField(max_length=100)


# Create your models here.


class Chemical(models.Model):
    foodb_id = models.CharField(max_length=100)
    chebi_id = models.CharField(max_length=100)
    name = models.CharField(max_length=100)
    synonyms = models.CharField(max_length=100)


class FoodPart(models.Model):
    name = models.CharField(max_length=100)
    plant_ontology_id = models.CharField(max_length=100)


class Units(models.Model):
    name = models.CharField(max_length=100)
    # units_ontology_id


class Article(models.Model):
    pmid = models.TextField()
    doi = models.TextField()


class FoodChemicalRelationshipEvidence(models.Model):
    text = models.TextField()  # premise
    article = models.ForeignKey(Article, on_delete=models.DO_NOTHING)


class FoodChemicalRelationship(models.Model):
    food = models.ForeignKey(Food, on_delete=models.DO_NOTHING)
    chemical = models.ForeignKey(Chemical, on_delete=models.DO_NOTHING)
    # food_part = models.ForeignKey(FoodPart, on_delete=models.DO_NOTHING)
    concentration = models.FloatField(null=True)
    # units = models.ForeignKey(Units, on_delete=models.DO_NOTHING)
    # evidences = models.ManyToManyField(FoodChemicalRelationshipEvidence)
    # label = (
    #     models.TextField()
    # )  # human annotated label, entailed or not entailed
    # prediction = (
    #     models.FloatField()
    # )  # model predicted probability of entailment


# class FoodChemicalRelationshipPrediction(models.Model):
#     proba_entails = models.FloatField()
#     relationship = models.ForeignKey(FoodChemicalRelationship, on_delete=models.DO_NOTHING)
#     evidence = models.ForeignKey(FoodChemicalRelationshipEvidence, on_delete=models.DO_NOTHING)


# class FoodChemicalRelationshipAnnotation(models.Model):
#     label = models.CharField(max_length=100)
#     relationship = models.ForeignKey(FoodChemicalRelationship, on_delete=models.DO_NOTHING)
#     evidence = models.ForeignKey(FoodChemicalRelationshipEvidence, on_delete=models.DO_NOTHING)

# Create your models here. # units_ontology_id # premise # food_part = models.ForeignKey(FoodPart, on_delete=models.DO_NOTHING) # units = models.ForeignKey(Units, on_delete=models.DO_NOTHING) # evidences = models.ManyToManyField(FoodChemicalRelationshipEvidence) # label = ( #     models.TextField() # )  # human annotated label, entailed or not entailed # prediction = ( #     models.FloatField() # )  # model predicted probability of entailment # class FoodChemicalRelationshipPrediction(models.Model): #     proba_entails = models.FloatField() #     relationship = models.ForeignKey(FoodChemicalRelationship, on_delete=models.DO_NOTHING) #     evidence = models.ForeignKey(FoodChemicalRelationshipEvidence, on_delete=models.DO_NOTHING) # class FoodChemicalRelationshipAnnotation(models.Model): #     label = models.CharField(max_length=100) #     relationship = models.ForeignKey(FoodChemicalRelationship, on_delete=models.DO_NOTHING) #     evidence = models.ForeignKey(FoodChemicalRelationshipEvidence, on_delete=models.DO_NOTHING)