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

Imports with sub-folders not loading fully #1251

Open
danielbakas opened this issue Dec 31, 2024 · 3 comments
Open

Imports with sub-folders not loading fully #1251

danielbakas opened this issue Dec 31, 2024 · 3 comments

Comments

@danielbakas
Copy link

danielbakas commented Dec 31, 2024

Hi there!

I'm having issues loading the files to my project.

How would I need to declare my catalog-v001.xml for Protegé to load all files inside mex?

Thanks!!

P.S. The file structure looks like this:

mex
├── cat
│   ├── cucag
│   │   └── main.ttl
│   └── main.ttl
├── core
│   ├── data
│   │   └── main.ttl
│   ├── main.ttl
│   ├── onto
│   │   └── main.ttl
│   └── voc
│       └── main.ttl
├── catalog-v001.xml
├── fed
│   ├── ef
│   │   ├── cod
│   │   │   └── main.ttl
│   │   ├── gob
│   │   │   ├── ap
│   │   │   │   ├── cen
│   │   │   │   │   ├── main.ttl
│   │   │   │   │   └── sec
│   │   │   │   │       └── main.ttl
│   │   │   │   ├── main.ttl
│   │   │   │   └── par
│   │   │   │       └── main.ttl
│   │   │   ├── main.ttl
│   │   │   └── pow
│   │   │       ├── main.ttl
│   │   │       └── pe
│   │   │           └── main.ttl
│   │   ├── law
│   │   │   ├── cp
│   │   │   │   └── main.ttl
│   │   │   ├── lo
│   │   │   │   └── main.ttl
│   │   │   └── main.ttl
│   │   ├── main.ttl
│   │   ├── pob
│   │   │   └── main.ttl
│   │   └── ter
│   │       └── main.ttl
│   ├── gob
│   │   ├── ap
│   │   │   ├── cen
│   │   │   │   ├── main.ttl
│   │   │   │   └── sec
│   │   │   │       └── main.ttl
│   │   │   ├── main.ttl
│   │   │   └── par
│   │   │       └── main.ttl
│   │   ├── main.ttl
│   │   └── pow
│   │       ├── main.ttl
│   │       ├── pe
│   │       │   └── main.ttl
│   │       ├── pj
│   │       │   └── main.ttl
│   │       └── pl
│   │           └── main.ttl
│   ├── loc
│   │   ├── cod
│   │   │   └── main.ttl
│   │   └── main.ttl
│   ├── main.ttl
│   └── mun
│       ├── cod
│       │   └── main.ttl
│       ├── gob
│       │   └── main.ttl
│       ├── main.ttl
│       ├── pob
│       │   └── main.ttl
│       └── ter
│           └── main.ttl
├── main.ttl
└── org
    └── main.ttl
@vChavezB
Copy link

vChavezB commented Jan 6, 2025

You can use relative imports in the catalog xml file

<uri id="User Entered Import Resolution" name="http://w3id.org/iaam/i40fd/protocol/canopen" uri="../schema/protocol/canopen.rdf"/>

@danielbakas
Copy link
Author

danielbakas commented Jan 7, 2025

Right! But that works (I think) just for immediate files.

Imagine, for example, we have this file structure:

root/
└── main.ttl
└── catalog-v001.xml
├── example/
│   └── main.ttl
│   └── catalog-v001.xml
│   ├── another/
│   │   └── main.ttl

And root/main.ttl imports root/example/main.ttl, while in turn imports root/example/another/main.ttl.

I can succesfully open/load the root/main.ttl ontology, and that will successfully load, in turn, root/example/main.ttl given root/catalog-v001.xml looks something like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public"
    xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <uri id="Imports Wizard Entry" name="http://datos.gob.mx/example/" uri="example/main.ttl"/>
</catalog>

But root/example/another/main.ttl is not loaded as its parent is, even though it has an import statement and root/example/catalog-v001.xml looks something like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public"
    xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <uri id="Imports Wizard Entry" name="http://datos.gob.mx/example/another/" uri="another/main.ttl"/>
</catalog>

So, what I infer from this is, that ontologies that are inside immediate sub-folders are indeed loaded, but ontologies inside sub-folders of those sub-folders are not.

I'm sure I must be missing something.

Hope this makes sense. Looking forward to your thoughts.

Thanks again!

@vChavezB
Copy link

vChavezB commented Jan 7, 2025

If I remember correctly you would need to add to your root/catalog-v001.xml the same imports you mentioned for root/example/another/main.ttl but relative to root.

Internally only the catalog located at the root of the main ontology you open is used. This means you do not need more than one catalog in your root directory. However, if you also plan to open the other ontologies directly with Protege, each one needs a catalog.

You can look at a research project I am working on where I load local ontologies and copies of other ontologies (qudt, skos, bfo,etc)

https://git.fh-aachen.de/iaam/semantics/i40fd-ontology

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