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

How to import OpenMath ontologies #3

Open
aljoshakoecher opened this issue May 4, 2023 · 14 comments
Open

How to import OpenMath ontologies #3

aljoshakoecher opened this issue May 4, 2023 · 14 comments

Comments

@aljoshakoecher
Copy link

Hi! First of all, thank you for your OpenMath ontologies! I'm interested in using them but I couldn't find a proper way to import them. Am I missing something?

  1. Imports shown in your examples / ontologies, e.g., http://openmath.org/vocab/math don't seem to resolve.
  2. Same for URLs like http://numerateweb.org/vocab/math or http://www.openmath.org/cd/arith1
  3. There are no releases / versioning on Github so I cannot use Github URLs
  4. There doesn't seem to be a W3ID either

What is your proposed way of importing your ontologies?

@kenwenzel
Copy link
Collaborator

The ontologies are currently not hosted as web resources. As Github pages does not support redirects and the definition of MIME types for arbitrary files it is also not possible to host the files directly from there.

Currently, the best option is to simply download the files and import them locally.
@davidcarlisle Do you see any option to serve a file at http://openmath.org/vocab/math with MIME type text/turtle?

@kenwenzel
Copy link
Collaborator

BTW, I am currently working on something like:

@prefix :       <http://example.org/vocab#> .
@prefix mathrl: <http://numerateweb.org/vocab/math/rules#> .
@prefix sh:     <http://www.w3.org/ns/shacl#> .

: sh:declare [
  sh:prefix "" ; sh:namespace "http://example.org/vocab#"^^xsd:anyURI ;
] .

:Triangle a owl:Class ; mathrl:constraint
[ a mathrl:Constraint ; sh:prefixes : ;
  mathrl:onProperty :area ; 
  mathrl:expressionString "$s := @semiPerimeter; root($s * ($s - @a) * ($s - @b) * ($s - @c), 2)" ],
[ a mathrl:Constraint ; sh:prefixes : ;
  mathrl:onProperty :semiPerimeter ; mathrl:expressionString  "(@a + @b + @c) / 2" ] .

This allows to directly use POPCORN-LD instead of serializing all expressions in OpenMath-RDF.

@aljoshakoecher
Copy link
Author

Thank you for your quick response. Have you considered using W3ID? It's free, supports content negotitation and you can do versioning using Github. All you need to do is create a .htaccess file with some redirect commands.

Here is an example of such a file that we created in order to publish one of our ontologies: https://github.com/hsu-aut/w3id.org/blob/master/hsu-aut/VDI3682/.htaccess

The ontology IRI for this example is http://www.w3id.org/hsu-aut/VDI3682 and can be resolved in a browser as well as by ontology tools such as Protege. Let me know if you want to go this route and need help.

@davidcarlisle
Copy link
Member

@kenwenzel
https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#mime-types-on-github-pages

says mime types listed at mime-db should work, and

https://github.com/jshttp/mime-db/search?q=turtle

seems to imply text/turtle is there so it's not impossible but I can't trace this until later

@kenwenzel
Copy link
Collaborator

@davidcarlisle Thank you for investigating this. Now the open challenge is that we can't redirect http://openmath.org/vocab/math to http://openmath.org/vocab/math.ttl.

@aljoshakoecher Thank you for bringing up W3ID. It could be a good solution - but we have to rename the ontologies to something like http://www.w3id.org/openmath/vocab/math and http://www.w3id.org/openmath/vocab/math/meta?

@davidcarlisle
Copy link
Member

davidcarlisle commented May 4, 2023

@kenwenzel I just had a quick look at the om-rdf repo

it publishes gh-pages branch to http://openmath.org/om-rdf/ but the only .ttl I see is only in main branch at

./examples/openmath-cds.ttl
./ontologies/math.ttl
./ontologies/meta.ttl

so these are not currently on openmath.org at all, unless I missed something?

(we could, I guess, switch to making gh-pages from main?)

@aljoshakoecher
Copy link
Author

@aljoshakoecher Thank you for bringing up W3ID. It could be a good solution - but we have to rename the ontologies to something like http://www.w3id.org/openmath/vocab/math and http://www.w3id.org/openmath/vocab/math/meta?

Yeah, kind of. You don't technically have to, you could just leave the ontology URIs and just use the W3ID URLs for importing. But if you want to be able to directly dereference the ontology URIs and import the ontologies by their URI, then you have to change them...

@kenwenzel
Copy link
Collaborator

@kenwenzel I just had a quick look at the om-rdf repo

it publishes gh-pages branch to http://openmath.org/om-rdf/ but the only .ttl I see is only in main branch at

./examples/openmath-cds.ttl
./ontologies/math.ttl
./ontologies/meta.ttl

so these are not currently on openmath.org at all, unless I missed something?

(we could, I guess, switch to making gh-pages from main?)

@davidcarlisle Yes, you are right. I thought about directly moving the ontologies into the https://github.com/OpenMath/OpenMath.github.io repo.
But maybe it is easier to use the W3ID approach as suggested by @aljoshakoecher
This could also be a solution for hosting the OpenMath CDs.

@davidcarlisle
Copy link
Member

I don't mind: I'm not really in the loop these days, just have historical oversight over the repos...

But I'd probably go for publishing from main so that
https://openmath.org/om-rdf/ontologies/math.ttl
works and adding some links to /om-rdf in the main openmath.org menu sidebar
If you end up needing more fancy redirect logic, w3id would still be available but you could use openmath.org source URL in the .htaccess rather than relying on raw.githubusercontent.com to pull directly from the repo.

@kenwenzel
Copy link
Collaborator

@aljoshakoecher What W3ID addresses would you propose for the OpenMath-RDF ontology (math.ttl) and the CD ontology (meta.ttl)?

The URIs http://www.w3id.org/openmath/vocab/math and http://www.w3id.org/openmath/vocab/math/meta seem to be a bit long but they leave room for future non-RDF-related addresses.
We could also just use something like http://www.w3id.org/om-rdf/math and http://www.w3id.org/om-rdf/meta.

@aljoshakoecher
Copy link
Author

Well first I have to agree with @davidcarlisle. If you have a domain and can use a corresponding URL, I think it's better to use that instead of the more generic W3ID solution.

If you want to use W3ID, I think both URIs you suggested are fine.
Personally, I like the first one a bit more since it's more descriptive and - as you say - can be used for other uses in the future. And the length is not an issue, they are still quite short.

@aljoshakoecher
Copy link
Author

Any updates on this 🙂 ?

@kenwenzel
Copy link
Collaborator

@davidcarlisle Everything in openmath.org is directly served via GitHub Pages, right? That means we can't control redirections and we have to rely on W3ID if we don't want to include the full file names in the namespaces of the ontologies.

Am I allowed to use http://www.w3id.org/openmath/ as a namespace and/or do we need some kind of approval process to do this?

@davidcarlisle
Copy link
Member

Everything in openmath.org is directly served via GitHub Pages, right?

yes

That means we can't control redirections and we have to rely on W3ID if we don't want to include the full file names in the namespaces of the ontologies.

for web pages you can use a <meta http-equiv

so for example

https://openmath.org/cd/arith1.xhtml

redirects to

https://openmath.org/cd/arith1

which is https://openmath.org/cd/arith1.html

so for URI like namespaces that are not used for transport other than for documentation that would be OK but probably(?) some rdf API want to access the URI directly and not see a html client-side redirect?

Am I allowed to use http://www.w3id.org/openmath/ as a namespace and/or do we need some kind of approval process to do this?

No objection from me but perhaps you should ask on a mailing list as I'm not sure if people are really monitoring github (even if listed as watchers) but let's try a ping @JamesHDavenport @kohlhase

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

3 participants