Open mielvds opened 4 months ago
I was able to fix it in my scaffold by specifying a target database. The default database is atramhasis.sqlite. I named my database atramhasis_scaffold.sqlite and I got the same error as you did.
Fixed import for a dabase named atramhasis_scaffold.sqlite: import_file production-method.skos.ttl https://data.hetarchief.be/id/production-method --to sqlite:///atramhasis_scaffold.sqlite
Perhaps we should make the database a required property and not use a default database. Alternatively, there should be a clearer message. Any preference?
/cc @koenedaele @Wim-De-Clercq, @mielvds
Seems like using a default database is more harmful than helpful here, so I'm fine with making it a required property. Open to other suggestions as well.
I would suggest to have a better error message and/or a log message that clarifies what database it's using. If so, it is not really necessary to require this property (and I would do this either way).
So, when importing a skos file, print a message similar to "Importing file {file} to database {database}"
Also, perhaps check if the database actually exists. I wonder if the database exists but is empty (because the migrations haven't run yet) or it doesn't exist and gets created on the fly.
There is one other issue when using import_file production-method.skos.ttl https://data.hetarchief.be/id/production-method --to sqlite:///atramhasis_scaffold.sqlite
.
Due to this validator, it is not possible to address the endpoint /providers/
. The second argument https://data.hetarchief.be/id/production-method
is not a valid uri_pattern
. It would be beneficial to validate the uri_pattern
for a valid input.
A valid import would look like this:
wget https://raw.githubusercontent.com/viaacode/datamodels/main/description/production-method.skos.ttl
import_file production-method.skos.ttl https://data.hetarchief.be/id/production-method/%s --to sqlite:///atramhasis_scaffold.sqlite
Scope:
I tried importing a skosfile with the following script:
However, I get the following database error: