OnroerendErfgoed / skosprovider_rdf

Skosprovider implementation backed by RDF
http://skosprovider-rdf.readthedocs.org
MIT License
2 stars 4 forks source link

'This RDF file contains more than one ConceptScheme.' #35

Closed leonqli closed 6 years ago

leonqli commented 6 years ago

'This RDF file contains more than one ConceptScheme.' RuntimeError: This RDF file contains more than one ConceptScheme.

koenedaele commented 6 years ago

I'm not sure what your question is? It's true that our provider expects there to be only one conceptscheme defined in an RDF file. Do you have a use case where mutiple conceptschemes would be needed? Bear in mind that one provider provides for one conceptscheme. The only way I could see that work is by specifying which of the conceptscheme should be used for the provider. But that can just as easily be fixed by preprocessing the file.

leonqli commented 6 years ago

Thanks for your reply! Yes, I did have such a problem when loading NALT (the US National Agricultural Library Thesaurus) (https://agclass.nal.usda.gov/download.shtml). You may reproduce the error using the SKOS version of NALT. Thanks!

koenedaele commented 6 years ago

I looked at the NAL Thesaurus 2018 Edition Files, but there doesn't seem to be a ConceptScheme in there. Is this the same file you used?

koenedaele commented 6 years ago

Sorry, I was too quick. There are 17 conceptschemes in there.

Like I said, the only thing we could try is to make it possible to specify a conceptscheme at instantiation.

koenedaele commented 6 years ago

If you want to use this library short-term, you have to preprocess the file yourself. I'll look into making it possible to define what conceptscheme in a file you want to work with. So, in this case you would have to define 17 provider instances, one per conceptscheme.

leonqli commented 6 years ago

Thanks for your reply! Please keep up with the great work.

koenedaele commented 6 years ago

I'm actually not sure how easy this will be with this file. I see that the concepts do not have a skos:inScheme property. They are linked by broader/narrower relations and the Conceptschemes do provide skos:hasTopConcept links. But that would mean, that we would have to pick a conceptscheme, walk all the top concepts and then follow all links until none are left. Probably doable, but not very performant.

A second, and probably worse problem is that the conceptschems have URI's containing a double / at the end and they refer to skos:hasTopConcept URI's that also have an extra slash. Eg. http://lod.nal.usda.gov/nalt//1182 in stead of http://lod.nal.usda.gov/nalt/1182

Are you in contact with the people providing that file? Could they start by fixing the second issue? And even better, add skos:inScheme predicates?

leonqli commented 6 years ago

I understand that, but thank you anyway! At the same time, I will try to report the issues to them, but not sure how soon they will fix it..