ckan / ckanext-dcat

CKAN ♥ DCAT
164 stars 142 forks source link

Making a new profile for Dcat v.2.0 #221

Closed sparsons808 closed 1 year ago

sparsons808 commented 2 years ago

My organization is looking to make use of some of the optional fields that are now available with Dcat v.2.0.

For example: Add dct:creator (Optional property) Add dct:isReferencedBy (Optional property) Add prov:qualifiedAttribution (Optional property) Add dcat:spatialResolutionInMeters (Optional property) Add dcat:temporalResolution (Optional property) Add adms:versionNotes (Optional property) Add prov:wasGeneratedBy (Optional property)

Could you all give some insight on how to create a new profile to make us of these fields? Or give me an idea on how to add to an existing profile. For example could I just add dct:creator to the parse_dataset function within the EuropeanDCATAPProfile class? Thank you for any help you all may offer.

metaodi commented 2 years ago

@sparsons808 you find everything you need in the README: https://github.com/ckan/ckanext-dcat#writing-custom-profiles

If you only want to add fields you could simply extend the existing class.

sparsons808 commented 2 years ago

@metaodi ok so say we create a new profile to utilize Dcatv.2.0 fields. Is that going to be automatically compatible with the RDFProfile? I'm trying to figure out how all the working parts work here so i can make a informed decision to either create a new profile or extend the current default. Another question, do you know if the harvester is pulling out these new fields? And do we need to update to Dcatv.2.0 to actually get those fields? I hope this is clear, let me know if you need more clarity, I really appreciate your quick response.

metaodi commented 2 years ago

You should extend the ckanext.dcat.profiles.RDFProfile class, then your code should be compatible.

I would highly recommend to create a new profile to have more freedom unless it's really only to add a couple of fields.

As for the harvester: you can use the profile to parse datasets from a remote site (using the RDF harvester of this extension). But it's recommended to add the new fields to your CKAN instance using something like ckanext-scheming. Hope this helps.

sparsons808 commented 2 years ago

thank you, this helps.

metaodi commented 2 years ago

Btw: make sure to check issue #168 and PR #220

sparsons808 commented 1 year ago

I wrote a custom profile and when i run the parse command I get an unknow rdf profiles error. does anyone know why this may bet. I have my custom profile in setup.py and in my ckan ini file as well as in the the default rdf profiles list. I have also tried to put it directly in the profiles list given to the init method. Any help is helpful, thank you.

sparsons808 commented 1 year ago

also I put some breakpoints in profiles.py and when I run the parse command it seems to not be hitting profiles.py at all yet still parsing my jsonld file.

amercader commented 1 year ago

@sparsons808 can you open a new issue, making sure to include the full error you are getting? cheers

Closing this in favour of #168