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

Loading non-emmo-related ontologies #811

Open
LorenaH84 opened this issue Nov 29, 2024 · 1 comment
Open

Loading non-emmo-related ontologies #811

LorenaH84 opened this issue Nov 29, 2024 · 1 comment

Comments

@LorenaH84
Copy link

We wanted to load a schema.org schema (https://schema.org/version/latest/schemaorg-current-https.ttl) using get_ontology().load(), but it returns an empty object. If we change the "Class" prefix to "owl" and the "rdfs:label" to "skos:prefLabel" it does load all the classes. The only difference with loading an emmo ontology is that the label has to be retrieved from get_preferred_label() instead of "prefLabel". Would be convenient if other ontologies could also be loaded directly from the original turtle files.

An example on what we had to change:

schema:AMRadioChannel a rdfs:Class ;
rdfs:label "AMRadioChannel" ;

to:

schema:AMRadioChannel a owl:Class ;
skos:prefLabel "AMRadioChannel" ;

@francescalb
Copy link
Collaborator

Hi,

I see that the ontology loads with and that I can fetch the entities. My code:

from ontopy import get_ontology
onto = get_ontology("https://schema.org/version/latest/schemaorg-current-https.ttl").load(emmo_based=False)
print(onto.AMRadioChannel)

However I see the same thing that you do when trying to list all the classes etc.
Some digging into owlready2 shows that there itis hardcoded that it looks for owl:classes.

I have to think a little about how to circumvent that. Hopefully direct access as shown above is useful for you.

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