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

Making a new profile for Dcat v.2.0 #221

Closed
sparsons808 opened this issue Jun 16, 2022 · 8 comments
Closed

Making a new profile for Dcat v.2.0 #221

sparsons808 opened this issue Jun 16, 2022 · 8 comments

Comments

@sparsons808
Copy link

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
Copy link
Member

metaodi commented Jun 16, 2022

@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
Copy link
Author

@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
Copy link
Member

metaodi commented Jun 16, 2022

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
Copy link
Author

thank you, this helps.

@metaodi
Copy link
Member

metaodi commented Jun 18, 2022

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

@sparsons808
Copy link
Author

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
Copy link
Author

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
Copy link
Member

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

Closing this in favour of #168

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

3 participants