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

Importing vocabulary raises "Error: SQLITE_CONSTRAINT: CHECK constraint failed: id != '' AND label != ''" #820

Open
mars-f opened this issue Oct 26, 2023 · 4 comments

Comments

@mars-f
Copy link

mars-f commented Oct 26, 2023

I am attempting to import a TTL vocabulary file converted from an RDF file. The file is parsed successfully as N3 by Tropy, but after parsing, before the import completes, Tropy raises the following error:

{"msg":"Failed to import vocabulary.","stack":"Error: SQLITE_CONSTRAINT: CHECK constraint failed: id != '' AND label != ''","system":"Windows_NT 10.0.22621 (x64)","time":1698279332959,"version":"1.15.2"}

Steps to reproduce:

muninn-military-vocabulary-after-edits.ttl.txt is the TTL file I am attempting to import.

Here is the original vocabulary: https://rdf.muninn-project.org/ontologies/military-en.html

muninn-military-vocabulary.ttl.txt is the original converted OWL->TTL file. It was converted with https://www.easyrdf.org/converter. I then edited the converted TTL file to strip the ()+ characters and get it past Tropy's N3 parser.

@inukshuk
Copy link
Member

Can you post the N3 file you're trying to import again? The link above doesn't seem to work.

@mars-f
Copy link
Author

mars-f commented Nov 2, 2023

2nd try:
muninn-military-vocabulary-v2.ttl.txt

@inukshuk
Copy link
Member

inukshuk commented Nov 3, 2023

Thanks and apologies for the cryptic error message!

The issue is that there are 22 empty labels in the file. This is no big deal and we should just ignore blank lables during import instead of raising an error. In the meantime you can work around this by removing all empty ""@de and ""@fr labels. I'm attaching a version of the file here.

muninn-military-vocabulary-v2.n3.txt

@mars-f
Copy link
Author

mars-f commented Nov 17, 2023

Your workaround worked, and the file was imported. Thank you.

Unfortunately the vocabulary file has further issues: only a fraction of the terms were imported. I'll follow up with a separate bug if I can figure out what the new problem is.

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

2 participants