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

Contribution of current work on application_ontologies/tensile_test_ontologies #1

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

MattTJung
Copy link
Member

Hi @MarkusSchilling,

as we discussed I added my current contributions to https://github.com/MattTJung/application-ontologies/tree/develop_tto-3.0.0 to this newer repo. I also aligned the PMDco 3.0.0 miro to the IRIs used in this repo.

See you,
Matthias

@MattTJung
Copy link
Member Author

Hi @MarkusSchilling,

the commits starting from d8941d3 add a publication workflow for TTO.

The workflow consists of 2 parts. When pushing to a development branch (configure it in the workflows yml), a set of checks is run. In case a release published, the workflow also publishes the check results as well as an autogenerated documentation of the ontology to gh-pages (into a dir named according to the release tag, while preserving older releases).

This means, in order to publish a new version a release with a release tag (e.g. v3.0.0 for the current version) should be generated. By this we can keep consistent published versions (in the workflow it is checked if the release tag and the owl:versionInfo in pmd_tto.ttl are consistent; if not the workflow fails and doesn't publish anything to gh-pages; right now the release itself is not stopped/reverted, maybe we can add such a functionality later).

The .htaccess-configuration below should work for this setup and is meant to be placed in https://github.com/perma-id/w3id.org/blob/master/pmd/tto/.htaccess

# .htaccess for platform material digital vocabs
RewriteEngine On

##
## Edit the following two lines accordingly:
##     ^/ont_pub_tmplt/... is the name of your ontology in your name resolver (e.g. for https://w3id.org/pmd/tto it's 'tto')
##     ONT_BASE points to the address that delivers your ontology documentation and files, if you
##       deploy in the materialdigital github community only 'ontology_publication_template' needs to be changed to your repo
##
SetEnvIf Request_URI ^/pmd/tto/(.*)$ ONT_BASE=https://materialdigital.github.io/tensile-test-ontology ONT_ANCHOR=$1
#SetEnvIf Request_URI ^/pmd/tto/(\d+\.\d+\.\d+)/(.*)$ ONT_VERSION=v$1 ONT_ANCHOR=$2

# Rewrite rule to serve HTML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml 
RewriteRule ^(.*)$ %{ENV:ONT_BASE}/index-en.html#%{ENV:ONT_ANCHOR} [R=303,L,NE]

# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^(.*)$ %{ENV:ONT_BASE}/ontology.jsonld [R=303,L]

# Rewrite rule to serve RDF/XML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^(.*)$ %{ENV:ONT_BASE}/ontology.rdf [R=303,L]

# Rewrite rule to serve N-Triples content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/n-triples
RewriteRule ^(.*)$ %{ENV:ONT_BASE}/ontology.nt [R=303,L]

# Rewrite rule to serve TTL content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle [OR]
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
RewriteCond %{HTTP_ACCEPT} \*/turtle
RewriteRule ^(.*)$ %{ENV:ONT_BASE}/ontology.ttl [R=303,L]

RewriteCond %{HTTP_ACCEPT} .+
RewriteRule ^.*$ %{ENV:ONT_BASE}/406.html [R=406,L]

# Default response
# ---------------------------
# Rewrite rule to serve the RDF/XML content from the vocabulary URI by default
RewriteRule ^(.*)$ %{ENV:ONT_BASE}/base_ontology.rdf [R=303,L]

@MattTJung
Copy link
Member Author

PS: the aforementioned "development branch" could in fact be set to main, although I personally would like it more if main was a protected branch.

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

Successfully merging this pull request may close these issues.

1 participant