Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define class_type property in the model's inner Meta class #3

Open
edmondchuc opened this issue Feb 6, 2023 · 0 comments
Open

Define class_type property in the model's inner Meta class #3

edmondchuc opened this issue Feb 6, 2023 · 0 comments

Comments

@edmondchuc
Copy link
Owner

This should probably be inside the inner Meta class instead of a direct property on the model.

class Concept(Common):
-  class_type = models.IRIField(predicate=RDF.type, value=SKOS.Concept)
   pref_label = models.CharField(predicate=SKOS.prefLabel, lang='en', required=True)
   alt_labels = models.CharField(predicate=SKOS.altLabel, lang='en', many=True)
   definition = models.CharField(predicate=SKOS.definition, lang='en', required=True)
   children = models.IRIField(predicate=SKOS.narrower, many=True, inverse=SKOS.broader)
   other_ids = models.CharField(predicate=SKOS.notation, many=True)
   home_vocab_uri = models.IRIField(predicate=RDFS.isDefinedBy)

+ class Meta:
+     class_type = [SKOS.Concept]

   def __repr__(self):
       return f'<{self.__uri__}>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant