Data model config
AnnotationConfig
- class src.config.data_models.annotation.AnnotationConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, uri_base: str = 'https://lblod.data.gift/concepts/ml2grow/annotations/', insert_graph: str = '<http://mu.semte.ch/application>', probe_model_relation: str = 'ext:withModel', taxonomy_relation: str = 'ext:withTaxonomy', label_relation: str = 'ext:hasLabel', date_relation: str = 'ext:creationDate', user_relation: str = 'ext:withUser', query_annotation_info: str = ' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n SELECT ?date ?taxonomy_uri ?model_uri ?user_uri ?label_uris \n WHERE {{\n VALUES ?annotation {{ <{annotation_uri}> }}\n ?annotation ext:creationDate ?date ;\n ext:withTaxonomy ?taxonomy_uri .\n OPTIONAL {{ ?annotation ext:withModel ?model_uri }}\n OPTIONAL {{ ?annotation ext:withUser ?user_uri }}\n }}\n ', query_linked_labels: str = ' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n SELECT * WHERE\n {{\n <{annotation_uri}> ext:hasLabel ?label_uri\n }}\n ', sub_query: str = ' {uri} ext:withTaxonomy {taxonomy} .\n {uri} ext:creationDate {timestamp} .\n {uri} ext:hasLabel {label_uris} .\n {user_reference}\n {model_reference}\n {labels}\n ')[source]
Bases:
Settings- _abc_impl = <_abc._abc_data object>
- date_relation: str
- insert_graph: str
- label_relation: str
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'data_models_annotation_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'date_relation': FieldInfo(annotation=str, required=False, default='ext:creationDate'), 'insert_graph': FieldInfo(annotation=str, required=False, default='<http://mu.semte.ch/application>'), 'label_relation': FieldInfo(annotation=str, required=False, default='ext:hasLabel'), 'probe_model_relation': FieldInfo(annotation=str, required=False, default='ext:withModel'), 'query_annotation_info': FieldInfo(annotation=str, required=False, default=' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n SELECT ?date ?taxonomy_uri ?model_uri ?user_uri ?label_uris \n WHERE {{\n VALUES ?annotation {{ <{annotation_uri}> }}\n ?annotation ext:creationDate ?date ;\n ext:withTaxonomy ?taxonomy_uri .\n OPTIONAL {{ ?annotation ext:withModel ?model_uri }}\n OPTIONAL {{ ?annotation ext:withUser ?user_uri }}\n }}\n '), 'query_linked_labels': FieldInfo(annotation=str, required=False, default=' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n SELECT * WHERE\n {{\n <{annotation_uri}> ext:hasLabel ?label_uri\n }}\n '), 'sub_query': FieldInfo(annotation=str, required=False, default=' {uri} ext:withTaxonomy {taxonomy} .\n {uri} ext:creationDate {timestamp} .\n {uri} ext:hasLabel {label_uris} .\n {user_reference}\n {model_reference}\n {labels}\n '), 'taxonomy_relation': FieldInfo(annotation=str, required=False, default='ext:withTaxonomy'), 'uri_base': FieldInfo(annotation=str, required=False, default='https://lblod.data.gift/concepts/ml2grow/annotations/'), 'user_relation': FieldInfo(annotation=str, required=False, default='ext:withUser')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- probe_model_relation: str
- query_annotation_info: str
- query_linked_labels: str
- sub_query: str
- taxonomy_relation: str
- uri_base: str
- user_relation: str
DecisionConfig
- class src.config.data_models.decision.DecisionConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, annotation_relation: str = 'ext:hasAnnotation', besluit_relation: str = 'besluit:Besluit', description_relation: str = 'eli:description', short_title_relation: str = 'eli:title_short', motivation_relation: str = 'besluit:motivering', publication_date_relation: str = 'eli:date_publication', langauge_relation: str = 'eli:language', generated_relation: str = 'prov:wasGeneratedBy', subject_relation: str = 'dct:subject', haspart_relation: str = 'eli:has_part', article_value_relation: str = 'prov:value', query_all_decisions: str = ' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n \n \n SELECT ?_besluit WHERE {{\n ?_besluit a besluit:Besluit. \n FILTER (!STRSTARTS(STR(?_besluit), "http://srv"))\n }}\n ', query_all_decisions_with_specified_taxonomy: str = ' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n \n \n SELECT ?_besluit ?date ?anno WHERE {{\n ?_besluit a besluit:Besluit. \n \n {{\n SELECT * WHERE {{\n ?_besluit ext:hasAnnotation ?anno.\n ?anno ext:creationDate ?date ; ext:withUser ?user ; ext:withTaxonomy ?taxonomy .\n \n FILTER (?taxonomy = <{taxonomy_uri}>)\n \n }} ORDER BY DESC (?date)\n }} \n }}\n ', query_latest_annotations: str = ' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n \n \n SELECT * WHERE {{\n VALUES ?_besluit ?date {{ <{decision_uri}> }}\n ?_besluit ext:hasAnnotation ?anno .\n ?anno ext:creationDate ?date.\n ?anno ext:withUser ?user .\n ?anno ext:withTaxonomy ?taxonomy .\n \n FILTER (?taxonomy = <{taxonomy_uri}>)\n \n }} ORDER BY DESC (?date) LIMIT 1\n ', query_all_annotations: str = ' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n SELECT * WHERE {{\n <{decision_uri}> ext:hasAnnotation ?annotation_uri .\n }}\n ', query_decision_information: str = ' PREFIX eli: <http://data.europa.eu/eli/ontology#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n \n SELECT * WHERE {{\n VALUES ?_besluit {{ <{decision_uri}> }}\n ?_besluit prov:wasGeneratedBy ?_behandeling.\n ?_behandeling dct:subject ?_agendapunt.\n OPTIONAL {{?_besluit eli:description ?description.}}\n OPTIONAL {{?_besluit eli:title_short ?short_title.}}\n OPTIONAL {{?_besluit besluit:motivering ?motivation.}}\n OPTIONAL {{?_besluit eli:date_publication ?publication_date.}}\n OPTIONAL {{?_besluit eli:language ?language.}}\n }}\n ', query_all_articles: str = ' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX eli: <http://data.europa.eu/eli/ontology#>\n \n SELECT * WHERE {{\n ?_besluit a besluit:Besluit.\n ?_besluit eli:has_part ?_artikel.\n OPTIONAL {{ ?_artikel eli:has_part ?number. }}\n OPTIONAL {{ ?_artikel prov:value ?content. }}\n FILTER (?_besluit = <{decision_uri}>)\n }}\n ORDER BY ?number\n ', insert_query: str = ' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n INSERT DATA {{\n GRAPH {graph_uri} {{\n <{uri}> ext:hasAnnotation {annotation_uri} .\n {annotation_subquery}\n }}\n }}\n ', create_decision_from_uri: str = ' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX eli: <http://data.europa.eu/eli/ontology#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/> \n \n SELECT * WHERE\n {{\n VALUES ?besluit {{ <{decision_uri}> }}\n ?besluit ext:hasAnnotation ?anno .\n ?anno ext:creationDate ?date ; ext:withTaxonomy ?taxonomy_uri .\n OPTIONAL \n {{\n ?anno ext:withModel ?model_uri .\n {{\n SELECT * WHERE \n {{\n ?model_uri ext:modelCategory ?category;\n ext:registeredMlflowModel ?mlflow_model;\n ext:modelName ?model_name;\n ext:mlflowLink ?mlflow_link;\n ext:creationDate ?create_data .\n }}\n }}\n }}\n OPTIONAL \n {{\n ?anno ext:withUser ?user_uri .\n # {{\n # SELECT * WHERE \n # {{\n # }}\n # }}\n }}\n OPTIONAL\n {{\n SELECT DISTINCT ?anno (GROUP_CONCAT(?label_uri;separator="|") AS ?label_uris) (GROUP_CONCAT(?taxonomy_node;separator="|") AS ?taxonomy_node_uris) (GROUP_CONCAT(?score;separator="|") AS ?scores) WHERE \n {{\n ?anno ext:hasLabel ?label_uri .\n ?label_uri ext:hasScore ?score ; ext:isTaxonomy ?taxonomy_node .\n \n }} GROUP BY ?anno\n }}\n }}\n ', query_all_content: str = ' PREFIX eli: <http://data.europa.eu/eli/ontology#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n \n \n SELECT * WHERE {{\n VALUES ?_besluit {{ <{decision_uri}> }}\n ?_besluit prov:wasGeneratedBy ?_behandeling.\n ?_behandeling dct:subject ?_agendapunt.\n OPTIONAL {{?_besluit eli:description ?description.}}\n OPTIONAL {{?_besluit eli:title_short ?short_title.}}\n OPTIONAL {{?_besluit besluit:motivering ?motivation.}}\n OPTIONAL {{?_besluit eli:date_publication ?publication_date.}}\n OPTIONAL {{?_besluit eli:language ?language.}}\n \n OPTIONAL {{\n SELECT DISTINCT ?_besluit (GROUP_CONCAT(?_artikel;separator="|") AS ?artikels) (GROUP_CONCAT(?number;separator="|") AS ?numbers) (GROUP_CONCAT(?waarde;separator="|") AS ?waardes) WHERE {{\n ?_besluit eli:has_part ?_artikel.\n OPTIONAL {{ ?_artikel eli:number ?number. }}\n OPTIONAL {{ ?_artikel prov:value ?waarde. }}\n }} GROUP BY ?_besluit\n }}\n }}\n ')[source]
Bases:
Settings- _abc_impl = <_abc._abc_data object>
- _creation_date_relation: str = ModelPrivateAttr(default='ext:creationDate')
- _with_taxonomy_relation: str = ModelPrivateAttr(default='ext:withTaxonomy')
- _with_user_relation: str = ModelPrivateAttr(default='ext:withUser')
- annotation_relation: str
- article_value_relation: str
- besluit_relation: str
- create_decision_from_uri: str
- description_relation: str
- generated_relation: str
- haspart_relation: str
- insert_query: str
- langauge_relation: str
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'data_models_decision_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'annotation_relation': FieldInfo(annotation=str, required=False, default='ext:hasAnnotation'), 'article_value_relation': FieldInfo(annotation=str, required=False, default='prov:value'), 'besluit_relation': FieldInfo(annotation=str, required=False, default='besluit:Besluit'), 'create_decision_from_uri': FieldInfo(annotation=str, required=False, default=' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX eli: <http://data.europa.eu/eli/ontology#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/> \n \n SELECT * WHERE\n {{\n VALUES ?besluit {{ <{decision_uri}> }}\n ?besluit ext:hasAnnotation ?anno .\n ?anno ext:creationDate ?date ; ext:withTaxonomy ?taxonomy_uri .\n OPTIONAL \n {{\n ?anno ext:withModel ?model_uri .\n {{\n SELECT * WHERE \n {{\n ?model_uri ext:modelCategory ?category;\n ext:registeredMlflowModel ?mlflow_model;\n ext:modelName ?model_name;\n ext:mlflowLink ?mlflow_link;\n ext:creationDate ?create_data .\n }}\n }}\n }}\n OPTIONAL \n {{\n ?anno ext:withUser ?user_uri .\n # {{\n # SELECT * WHERE \n # {{\n # }}\n # }}\n }}\n OPTIONAL\n {{\n SELECT DISTINCT ?anno (GROUP_CONCAT(?label_uri;separator="|") AS ?label_uris) (GROUP_CONCAT(?taxonomy_node;separator="|") AS ?taxonomy_node_uris) (GROUP_CONCAT(?score;separator="|") AS ?scores) WHERE \n {{\n ?anno ext:hasLabel ?label_uri .\n ?label_uri ext:hasScore ?score ; ext:isTaxonomy ?taxonomy_node .\n \n }} GROUP BY ?anno\n }}\n }}\n '), 'description_relation': FieldInfo(annotation=str, required=False, default='eli:description'), 'generated_relation': FieldInfo(annotation=str, required=False, default='prov:wasGeneratedBy'), 'haspart_relation': FieldInfo(annotation=str, required=False, default='eli:has_part'), 'insert_query': FieldInfo(annotation=str, required=False, default=' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n INSERT DATA {{\n GRAPH {graph_uri} {{\n <{uri}> ext:hasAnnotation {annotation_uri} .\n {annotation_subquery}\n }}\n }}\n '), 'langauge_relation': FieldInfo(annotation=str, required=False, default='eli:language'), 'motivation_relation': FieldInfo(annotation=str, required=False, default='besluit:motivering'), 'publication_date_relation': FieldInfo(annotation=str, required=False, default='eli:date_publication'), 'query_all_annotations': FieldInfo(annotation=str, required=False, default=' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n SELECT * WHERE {{\n <{decision_uri}> ext:hasAnnotation ?annotation_uri .\n }}\n '), 'query_all_articles': FieldInfo(annotation=str, required=False, default=' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX eli: <http://data.europa.eu/eli/ontology#>\n \n SELECT * WHERE {{\n ?_besluit a besluit:Besluit.\n ?_besluit eli:has_part ?_artikel.\n OPTIONAL {{ ?_artikel eli:has_part ?number. }}\n OPTIONAL {{ ?_artikel prov:value ?content. }}\n FILTER (?_besluit = <{decision_uri}>)\n }}\n ORDER BY ?number\n '), 'query_all_content': FieldInfo(annotation=str, required=False, default=' PREFIX eli: <http://data.europa.eu/eli/ontology#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n \n \n SELECT * WHERE {{\n VALUES ?_besluit {{ <{decision_uri}> }}\n ?_besluit prov:wasGeneratedBy ?_behandeling.\n ?_behandeling dct:subject ?_agendapunt.\n OPTIONAL {{?_besluit eli:description ?description.}}\n OPTIONAL {{?_besluit eli:title_short ?short_title.}}\n OPTIONAL {{?_besluit besluit:motivering ?motivation.}}\n OPTIONAL {{?_besluit eli:date_publication ?publication_date.}}\n OPTIONAL {{?_besluit eli:language ?language.}}\n \n OPTIONAL {{\n SELECT DISTINCT ?_besluit (GROUP_CONCAT(?_artikel;separator="|") AS ?artikels) (GROUP_CONCAT(?number;separator="|") AS ?numbers) (GROUP_CONCAT(?waarde;separator="|") AS ?waardes) WHERE {{\n ?_besluit eli:has_part ?_artikel.\n OPTIONAL {{ ?_artikel eli:number ?number. }}\n OPTIONAL {{ ?_artikel prov:value ?waarde. }}\n }} GROUP BY ?_besluit\n }}\n }}\n '), 'query_all_decisions': FieldInfo(annotation=str, required=False, default=' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n \n \n SELECT ?_besluit WHERE {{\n ?_besluit a besluit:Besluit. \n FILTER (!STRSTARTS(STR(?_besluit), "http://srv"))\n }}\n '), 'query_all_decisions_with_specified_taxonomy': FieldInfo(annotation=str, required=False, default=' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n \n \n SELECT ?_besluit ?date ?anno WHERE {{\n ?_besluit a besluit:Besluit. \n \n {{\n SELECT * WHERE {{\n ?_besluit ext:hasAnnotation ?anno.\n ?anno ext:creationDate ?date ; ext:withUser ?user ; ext:withTaxonomy ?taxonomy .\n \n FILTER (?taxonomy = <{taxonomy_uri}>)\n \n }} ORDER BY DESC (?date)\n }} \n }}\n '), 'query_decision_information': FieldInfo(annotation=str, required=False, default=' PREFIX eli: <http://data.europa.eu/eli/ontology#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n PREFIX dct: <http://purl.org/dc/terms/>\n PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n \n SELECT * WHERE {{\n VALUES ?_besluit {{ <{decision_uri}> }}\n ?_besluit prov:wasGeneratedBy ?_behandeling.\n ?_behandeling dct:subject ?_agendapunt.\n OPTIONAL {{?_besluit eli:description ?description.}}\n OPTIONAL {{?_besluit eli:title_short ?short_title.}}\n OPTIONAL {{?_besluit besluit:motivering ?motivation.}}\n OPTIONAL {{?_besluit eli:date_publication ?publication_date.}}\n OPTIONAL {{?_besluit eli:language ?language.}}\n }}\n '), 'query_latest_annotations': FieldInfo(annotation=str, required=False, default=' PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n \n \n SELECT * WHERE {{\n VALUES ?_besluit ?date {{ <{decision_uri}> }}\n ?_besluit ext:hasAnnotation ?anno .\n ?anno ext:creationDate ?date.\n ?anno ext:withUser ?user .\n ?anno ext:withTaxonomy ?taxonomy .\n \n FILTER (?taxonomy = <{taxonomy_uri}>)\n \n }} ORDER BY DESC (?date) LIMIT 1\n '), 'short_title_relation': FieldInfo(annotation=str, required=False, default='eli:title_short'), 'subject_relation': FieldInfo(annotation=str, required=False, default='dct:subject')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(__context: Any) None
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Args:
self: The BaseModel instance. __context: The context.
- motivation_relation: str
- publication_date_relation: str
- query_all_annotations: str
- query_all_articles: str
- query_all_content: str
- query_all_decisions: str
- query_all_decisions_with_specified_taxonomy: str
- query_decision_information: str
- query_latest_annotations: str
- short_title_relation: str
- subject_relation: str
LabelConfig
- class src.config.data_models.label.LabelConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, uri_base: str = 'https://lblod.data.gift/concepts/ml2grow/label/', taxonomy_relation: str = 'ext:isTaxonomy', score_relation: str = 'ext:hasScore', query: str = ' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n SELECT * WHERE\n {{\n <{uri}> ext:hasScore ?score ; ext:isTaxonomy ?taxonomy_node_uri .\n }}\n ', sub_query: str = '\n {uri} ext:isTaxonomy {taxonomy_node_uri} .\n {uri} ext:hasScore {score}.\n ')[source]
Bases:
Settings- _abc_impl = <_abc._abc_data object>
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'data_models_label_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'query': FieldInfo(annotation=str, required=False, default=' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n\n SELECT * WHERE\n {{\n <{uri}> ext:hasScore ?score ; ext:isTaxonomy ?taxonomy_node_uri .\n }}\n '), 'score_relation': FieldInfo(annotation=str, required=False, default='ext:hasScore'), 'sub_query': FieldInfo(annotation=str, required=False, default='\n {uri} ext:isTaxonomy {taxonomy_node_uri} .\n {uri} ext:hasScore {score}.\n '), 'taxonomy_relation': FieldInfo(annotation=str, required=False, default='ext:isTaxonomy'), 'uri_base': FieldInfo(annotation=str, required=False, default='https://lblod.data.gift/concepts/ml2grow/label/')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- query: str
- score_relation: str
- sub_query: str
- taxonomy_relation: str
- uri_base: str
ModelConfig
- class src.config.data_models.model.ModelConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, uri_base: str = 'https://lblod.data.gift/concepts/ml2grow/model/', date_relation: str = 'ext:creationDate', name_relation: str = 'ext:modelName', category_relation: str = 'ext:modelCategory', mlflow_url_relation: str = 'ext:mlflowLink', mlflow_registered_model_relation: str = 'ext:registeredMlflowModel', query: str = ' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n SELECT * {{\n <{uri}> ext:modelCategory ?category; \n ext:registeredMlflowModel ?mlflow_model; \n ext:modelName ?model_name;\n ext:mlflowLink ?mlflow_link;\n ext:creationDate ?create_data . \n }}\n ', sub_query: str = ' {uri} ext:creationDate {date} .\n {uri} ext:modelName "{name}".\n {uri} ext:modelCategory "{category}" .\n {uri} ext:mlflowLink """{mlflow_reference}""" .\n {uri} ext:registeredMlflowModel "{registered_model}" .\n ')[source]
Bases:
Settings- _abc_impl = <_abc._abc_data object>
- category_relation: str
- date_relation: str
- mlflow_registered_model_relation: str
- mlflow_url_relation: str
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'data_models_annotation_model_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'category_relation': FieldInfo(annotation=str, required=False, default='ext:modelCategory'), 'date_relation': FieldInfo(annotation=str, required=False, default='ext:creationDate'), 'mlflow_registered_model_relation': FieldInfo(annotation=str, required=False, default='ext:registeredMlflowModel'), 'mlflow_url_relation': FieldInfo(annotation=str, required=False, default='ext:mlflowLink'), 'name_relation': FieldInfo(annotation=str, required=False, default='ext:modelName'), 'query': FieldInfo(annotation=str, required=False, default=' PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n SELECT * {{\n <{uri}> ext:modelCategory ?category; \n ext:registeredMlflowModel ?mlflow_model; \n ext:modelName ?model_name;\n ext:mlflowLink ?mlflow_link;\n ext:creationDate ?create_data . \n }}\n '), 'sub_query': FieldInfo(annotation=str, required=False, default=' {uri} ext:creationDate {date} .\n {uri} ext:modelName "{name}".\n {uri} ext:modelCategory "{category}" .\n {uri} ext:mlflowLink """{mlflow_reference}""" .\n {uri} ext:registeredMlflowModel "{registered_model}" .\n '), 'uri_base': FieldInfo(annotation=str, required=False, default='https://lblod.data.gift/concepts/ml2grow/model/')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- name_relation: str
- query: str
- sub_query: str
- uri_base: str
SparqlConfig
- class src.config.data_models.sparql.SparqlConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, testing_graph: str = '<http://mu.semte.ch/application/probe/testing>', user_annotations_graph: str = '<http://mu.semte.ch/application/probe/user-annotations>', probe_model_annotations_graph: str = '<http://mu.semte.ch/application/probe/model-annotations>', model_information: str = '<http://mu.semte.ch/application/probe/model-information>')[source]
Bases:
Settings- _abc_impl = <_abc._abc_data object>
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'sparql_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'model_information': FieldInfo(annotation=str, required=False, default='<http://mu.semte.ch/application/probe/model-information>'), 'probe_model_annotations_graph': FieldInfo(annotation=str, required=False, default='<http://mu.semte.ch/application/probe/model-annotations>'), 'testing_graph': FieldInfo(annotation=str, required=False, default='<http://mu.semte.ch/application/probe/testing>'), 'user_annotations_graph': FieldInfo(annotation=str, required=False, default='<http://mu.semte.ch/application/probe/user-annotations>')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_information: str
- probe_model_annotations_graph: str
- testing_graph: str
- user_annotations_graph: str
TaxonomyConfig
- class src.config.data_models.taxonomy.TaxonomyConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, master_node_uri: str = 'http://stad.gent/id/datasets/probe_taxonomies', master_child_relation: str = 'void:vocabulary', ghent_base_uri: str = 'http://stad.gent/id/concepts/gent_words', ghent_replace_uri: str = 'http://stad.gent/id/concepts/gent_words/328', inschema_relation: str = 'skos:inScheme', pref_label_relation: str = 'skos:prefLabel', broader_relation: str = 'skos:broader', query_master_nodes: str = ' PREFIX void: <http://rdfs.org/ns/void#>\n\n SELECT ?uri\n WHERE {{\n <{master_node_uri}> void:vocabulary ?uri\n }}\n ', query_all_children: str = ' PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\n SELECT DISTINCT ?concept ?label ?broaderConcept ?broaderConceptLabel\n WHERE {{\n ?concept a skos:Concept ;\n skos:prefLabel ?label ;\n skos:inScheme <{taxonomy_schema}> .\n OPTIONAL {{\n ?concept skos:broader ?broaderConcept .\n ?broaderConcept skos:prefLabel ?broaderConceptLabel .\n }}\n }}\n ORDER BY ?broaderConceptLabel ?concept\n ')[source]
Bases:
SettingsThe relation here is not defined yet, this is something that District09 has to define
- _abc_impl = <_abc._abc_data object>
- broader_relation: str
- ghent_base_uri: str
- ghent_replace_uri: str
- inschema_relation: str
- master_child_relation: str
- master_node_uri: str
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'data_models_taxonomy_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'broader_relation': FieldInfo(annotation=str, required=False, default='skos:broader'), 'ghent_base_uri': FieldInfo(annotation=str, required=False, default='http://stad.gent/id/concepts/gent_words'), 'ghent_replace_uri': FieldInfo(annotation=str, required=False, default='http://stad.gent/id/concepts/gent_words/328'), 'inschema_relation': FieldInfo(annotation=str, required=False, default='skos:inScheme'), 'master_child_relation': FieldInfo(annotation=str, required=False, default='void:vocabulary'), 'master_node_uri': FieldInfo(annotation=str, required=False, default='http://stad.gent/id/datasets/probe_taxonomies'), 'pref_label_relation': FieldInfo(annotation=str, required=False, default='skos:prefLabel'), 'query_all_children': FieldInfo(annotation=str, required=False, default=' PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\n SELECT DISTINCT ?concept ?label ?broaderConcept ?broaderConceptLabel\n WHERE {{\n ?concept a skos:Concept ;\n skos:prefLabel ?label ;\n skos:inScheme <{taxonomy_schema}> .\n OPTIONAL {{\n ?concept skos:broader ?broaderConcept .\n ?broaderConcept skos:prefLabel ?broaderConceptLabel .\n }}\n }}\n ORDER BY ?broaderConceptLabel ?concept\n '), 'query_master_nodes': FieldInfo(annotation=str, required=False, default=' PREFIX void: <http://rdfs.org/ns/void#>\n\n SELECT ?uri\n WHERE {{\n <{master_node_uri}> void:vocabulary ?uri\n }}\n ')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- pref_label_relation: str
- query_all_children: str
- query_master_nodes: str
UserConfig
- class src.config.data_models.user.UserConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, uri_base: str = 'https://classifications.ghent.com/ml2grow/user/')[source]
Bases:
Settings- _abc_impl = <_abc._abc_data object>
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_nested_delimiter': None, 'env_prefix': 'data_models_user_', 'extra': 'ignore', 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'uri_base': FieldInfo(annotation=str, required=False, default='https://classifications.ghent.com/ml2grow/user/')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uri_base: str