forums.tropy.org

Vocabulary Import Failing

I’m attempting to import a new vocabulary ( Bibliographic Ontology Specification). I’ve downloaded the .n3 file. However, whenever I attempt to import, I get the following message: “Failed to import vocabulary AssertionError [ERR_ASSERTION]: vocabulary is protected
at Object.create (/Applications/Tropy.app/Contents/Resources/app.asar/lib/models/ontology.js:106:9)”
What am I doing wrong?

You can probably ignore this error (we’re considering turning this into warning in the log file instead of an error). It means that the vocabulary you imported likely contains definitions which are part of other vocabularies which Tropy already includes by default. The default vocabularies are protected so this error just says that the import tried to modify a protected vocabulary and that at least that part of the import was ignored. If you check the list of installed vocabularies you will hopefully see BIBO there anyway.

I just realized that I actually do! Thanks for the prompt response. I’m assuming there is no problem with creating a template that uses terms from multiple vocabularies?

Not at all. In fact, it is very common even for vocabularies to share properties (that’s also the cause for the import error) and similarly for Tropy templates.

Hello, I also encounter this problem, but it seems that the problem still exists even I ignored the error prompt, could you please help me out? Thanks a lot💗

Which vocabulary are you trying to import?

I edit a n3 document myself because I need some complementary vocabularies but don’t know how to get them on LOV, that seems a little bit too complicated, so that’s a list of vocabulary I created myself

Some of the vocabularies that are included with Tropy, e.g., dcterms, are protected. If you import an n3 file that includes properties in one of the protected namespaces, you will see this error during import. However, all other properties in your n3 file, which are not part of a protected namespace should import just fine, regardless of that error message. This to say that, unless you’re trying to add properties to a protected namespace, you can most likely just ignore these error messages.

Here is the n3 file I created myself, could you please tell me what’s wrong with it? The situation for me is despite the neglectable prompt, the file cannot be imported properly as well. I would highly highly appreciate it!!
Customization.n3 (1.6 KB)

You’re trying to add new properties to the DCMI: DCMI Metadata Terms namespace, but this is one of the vocabularies that Tropy protects.

If you would like to introduce new properties, you should use an appropriate namespace for the new vocabulary, normally you would use a domain that you control.

Before creating your own vocabulary, however, it’s best to search if there are properties in existing vocabularies which already cover your needs. For example, I see that you’re trying to add a ‘sponsor’ property and I remember there was dm2e:sponsor – though now that I look it seems that this vocabulary is no longer maintained.

Thank you for your kind reply! Actually I have no idea of n3 files and I created it totally by copying and then editing a little bit. So could you please point out what should I do if I’d like these vocabularies to be safely imported into tropy? thanks a lot~

I’ve attached an example custom vocabulary defining those extra properties below. Before using this, I would recommend changing the id to something other than http://www.example.org/custom-vocabulary, ideally to a URL that you own and that is appropriate for the vocabulary.

Customization.n3 (1.6 KB)

1 Like

Thank you so much!!!:heart: