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

Add cop config #4244

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions cop/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Turn off MultiViews
Options -MultiViews

# Directive to ensure *.rdf files served as appropriate content type,
# if not present in main apache config
AddType application/rdf+xml .rdf
AddType application/rdf+xml .owl
AddType text/turtle .ttl
AddType application/n-triples .n3
AddType application/ld+json .json

RewriteEngine on

# Rewrite rule for latest version.
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
RewriteRule ^$ https://onto-med.github.io/COP/release/latest/index-en.html [R=303,L]

# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^$ https://github.com/Onto-Med/COP/releases/latest/download/cop.json [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 ^$ https://github.com/Onto-Med/COP/releases/latest/download/cop.owl [R=303,L]

# Rewrite rule to serve N-Triples content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/n-triples
RewriteRule ^$ https://github.com/Onto-Med/COP/releases/latest/download/cop.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 ^$ https://github.com/Onto-Med/COP/releases/latest/download/cop.ttl [R=303,L]


# Rewrite rules for any other version.
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
RewriteRule ^release/(.+)$ https://onto-med.github.io/COP/release/$1/index-en.html [R=303,L]

# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^release/(.+)$ https://github.com/Onto-Med/COP/releases/download/$1/cop.json [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 ^release/(.+)$ https://github.com/Onto-Med/COP/releases/download/$1/cop.owl [R=303,L]

# Rewrite rule to serve N-Triples content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/n-triples
RewriteRule ^release/(.+)$ https://github.com/Onto-Med/COP/releases/download/$1/cop.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 ^release/(.+)$ https://github.com/Onto-Med/COP/releases/download/$1/cop.ttl [R=303,L]

# Default response
# ---------------------------
# Rewrite rule to serve the RDF/XML content from the vocabulary URI by default
RewriteRule ^release/(.+)$ https://github.com/Onto-Med/COP/releases/download/$1/cop.owl [R=303,L]
RewriteRule ^release/?$ https://github.com/Onto-Med/COP/releases/latest/download/cop.owl [R=303,L]
RewriteRule ^$ https://github.com/Onto-Med/COP/releases/latest/download/cop.owl [R=303,L]


# Rewrite rule to serve classes and properties via RDF browser Rickview
RewriteRule ^(.+)$ https://top.imise.uni-leipzig.de/ontology/cop/$1 [R=303,L]
19 changes: 19 additions & 0 deletions cop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Core Ontology of Phenotyping

The Core Ontology of Phenotyping (COP) defines core entities and their relationships
that are relevant for modelling phenotypic knowledge and developing phenotyping software.

## Redirects

https://w3id.org/cop redirects to https://github.com/Onto-Med/COP/releases/latest/download/cop.owl

https://w3id.org/cop/releases/_ redirects to https://github.com/Onto-Med/COP/releases/download/_/cop.owl

https://w3id.org/cop/_ redirects to https://top.imise.uni-leipzig.de/ontology/cop/_
(RDF browser [Rickview](https://github.com/KonradHoeffner/rickview))

## Maintainer

Christoph Beger (https://github.com/ChristophB)

Institute for Medical Informatics, Statistics and Epidemiology, Leipzig University