-
Notifications
You must be signed in to change notification settings - Fork 5
Added IRIs as extra field properties in datamodels #434
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
base: master
Are you sure you want to change the base?
Changes from all commits
c05eb23
8fb9de3
70c113b
c7d1974
f00b31e
37551c7
216d717
3f9b721
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The suggested properties for the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are absolutely right about the IRIs being a bit random for certain properties, but I would much rather go to more generic concepts in established ontologies, than making up our own concepts in a custom ontology that nobody has adopted. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,15 +15,18 @@ class MappingConfig(GenericConfig): | |
| mappingType: str = Field( | ||
| ..., | ||
| description="Type of registered mapping strategy.", | ||
| IRI="http://purl.org/dc/terms/type", # type: ignore | ||
| ) | ||
| prefixes: Optional[Dict[str, str]] = Field( | ||
| None, | ||
| description=( | ||
| "Dictionary of shortnames that expands to an IRI given as local " | ||
| "value/IRI-expansion-pairs." | ||
| ), | ||
| IRI="http://www.w3.org/2004/02/skos/core#notation", # type: ignore | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If using However, I think it would be simpler to define our own |
||
| ) | ||
| triples: Optional[Set[RDFTriple]] = Field( | ||
| None, | ||
| description="Set of RDF triples given as (subject, predicate, object).", | ||
| IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement", # type: ignore | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,5 +8,13 @@ | |
| class ParserConfig(GenericConfig): | ||
| """Parser Strategy Data Configuration.""" | ||
|
|
||
| parserType: str = Field(..., description="Type of registered parser strategy.") | ||
| entity: AnyHttpUrl = Field(..., description="IRI to the entity or collection.") | ||
| parserType: str = Field( | ||
| ..., | ||
| description="Type of registered parser strategy.", | ||
| IRI="http://purl.org/dc/terms/type", | ||
| ) # type: ignore | ||
| entity: AnyHttpUrl = Field( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Entity is a difficult name. It can mean anything. I am not found of freely mixing different vocabularies, but if we really want to identify this with |
||
| ..., | ||
| description="IRI to the metadata (entity) or collection of entities.", | ||
| IRI="http://schema.org/URL", | ||
| ) # type: ignore | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,9 @@ class ResourceConfig(GenericConfig, SecretConfig): | |
| """ | ||
|
|
||
| resourceType: Optional[str] = Field( | ||
| None, description="Type of registered resource strategy." | ||
| None, | ||
| description="Type of registered resource strategy.", | ||
| IRI="http://purl.org/dc/terms/type", # type: ignore | ||
| ) | ||
|
|
||
| downloadUrl: Optional[HostlessAnyUrl] = Field( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please spell the field name as |
||
|
|
@@ -32,6 +34,7 @@ class ResourceConfig(GenericConfig, SecretConfig): | |
| " which this distribution is available directly, typically through a HTTPS" | ||
| " GET request or SFTP." | ||
| ), | ||
| IRI="http://www.w3.org/ns/dcat#downloadURL", # type: ignore | ||
| ) | ||
| mediaType: Optional[str] = Field( | ||
| None, | ||
|
|
@@ -42,6 +45,7 @@ class ResourceConfig(GenericConfig, SecretConfig): | |
| " type of the distribution is defined in IANA " | ||
| "[[IANA-MEDIA-TYPES](https://www.w3.org/TR/vocab-dcat-2/#bib-iana-media-types)]." | ||
| ), | ||
| IRI="http://www.w3.org/ns/dcat#mediaType", # type: ignore | ||
| ) | ||
| accessUrl: Optional[HostlessAnyUrl] = Field( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please spell the field name as |
||
| None, | ||
|
|
@@ -53,28 +57,33 @@ class ResourceConfig(GenericConfig, SecretConfig): | |
| "query or API call.\n`downloadURL` is preferred for direct links to " | ||
| "downloadable resources." | ||
| ), | ||
| IRI="http://www.w3.org/ns/dcat#accessURL", # type: ignore | ||
| ) | ||
| accessService: Optional[str] = Field( | ||
| None, | ||
| description=( | ||
| "A data service that gives access to the distribution of the dataset." | ||
| ), | ||
| IRI="http://www.w3.org/ns/dcat#accessService", # type: ignore | ||
| ) | ||
| license: Optional[str] = Field( | ||
| None, | ||
| description=( | ||
| "A legal document under which the distribution is made available." | ||
| ), | ||
| IRI="http://purl.org/dc/terms/license", # type: ignore | ||
| ) | ||
| accessRights: Optional[str] = Field( | ||
| None, | ||
| description=( | ||
| "A rights statement that concerns how the distribution is accessed." | ||
| ), | ||
| IRI="http://purl.org/dc/terms/accessRights", # type: ignore | ||
| ) | ||
| publisher: Optional[str] = Field( | ||
| None, | ||
| description="The entity responsible for making the resource/item available.", | ||
| IRI="http://purl.org/dc/terms/publisher", # type: ignore | ||
| ) | ||
|
|
||
| @model_validator(mode="after") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,40 +39,58 @@ class TransformationConfig(GenericConfig, SecretConfig): | |
| description=( | ||
| "Type of registered transformation strategy. E.g., `celery/remote`." | ||
| ), | ||
| IRI="http://purl.org/dc/terms/type", # type: ignore | ||
| ) | ||
| name: Optional[str] = Field( | ||
| None, description="Human-readable name of the transformation strategy." | ||
| None, | ||
| description="Human-readable name of the transformation strategy.", | ||
| IRI="http://purl.org/dc/terms/title", # type: ignore | ||
| ) | ||
| due: Optional[datetime] = Field( | ||
| None, | ||
| description=( | ||
| "Optional field to indicate a due data/time for when a transformation " | ||
| "should finish." | ||
| ), | ||
| IRI="http://purl.org/dc/terms/date", # type: ignore | ||
| ) | ||
| priority: Optional[ProcessPriority] = Field( | ||
| ProcessPriority.MEDIUM, | ||
| description="Define the process priority of the transformation execution.", | ||
| IRI="http://www.w3.org/ns/adms#status", # type: ignore | ||
| ) | ||
|
|
||
|
|
||
| class TransformationStatus(BaseModel): | ||
| """Return from transformation status.""" | ||
|
|
||
| id: str = Field(..., description="ID for the given transformation process.") | ||
| id: str = Field( | ||
| ..., | ||
| description="ID for the given transformation process.", | ||
| IRI="http://purl.org/dc/terms/identifier", # type: ignore | ||
| ) | ||
| status: Optional[str] = Field( | ||
| None, description="Status for the transformation process." | ||
| None, | ||
| description="Status for the transformation process.", | ||
| IRI="http://www.w3.org/ns/adms#status", # type: ignore | ||
| ) | ||
| messages: Optional[List[str]] = Field( | ||
| None, description="Messages related to the transformation process." | ||
| None, | ||
| description="Messages related to the transformation process.", | ||
| IRI="http://purl.org/dc/terms/description", # type: ignore | ||
| ) | ||
| created: Optional[datetime] = Field( | ||
| None, | ||
| description="Time of creation for the transformation process. Given in UTC.", | ||
| IRI="http://purl.org/dc/terms/created", # type: ignore | ||
| ) | ||
| startTime: Optional[datetime] = Field( | ||
| None, description="Time when the transformation process started. Given in UTC." | ||
| None, | ||
| description="Time when the transformation process started. Given in UTC.", | ||
| IRI="http://purl.org/dc/terms/date", # type: ignore | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The only issue with :transformation_status1
dcat:startTime "2024-02-29 08:45" ;
dcat:endTime "2024-02-29 09:00" .but has to has to be expressed as: :transformation_status1
dcterms:temporal [
a dcterms:PeriodOfTime ;
dcat:startTime "2024-02-29 08:45" ;
dcat:endTime "2024-02-29 09:00" ;
] . |
||
| ) | ||
| finishTime: Optional[datetime] = Field( | ||
| None, description="Time when the tranformation process finished. Given in UTC." | ||
| None, | ||
| description="Time when the tranformation process finished. Given in UTC.", | ||
| IRI="http://purl.org/dc/terms/date", # type: ignore | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ahead to the PEP8 Python conventions. Max line length is 80 characters.