Skip to content

Commit

Permalink
regexp didnt work as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
rapw3k committed Sep 11, 2020
1 parent d7758b4 commit beb4713
Showing 1 changed file with 47 additions and 27 deletions.
74 changes: 47 additions & 27 deletions demeter/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,53 @@ AddType application/ld+json .jsonld
# Documentation
RewriteRule ^$ https://h2020-demeter.eu/ [R=302,L]

# main entry in OGC

### METADATA LAYER #####
# Ontology
RewriteRule ^metadata$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/metadata.ttl [R=302,L]
# JSON-LD context
RewriteRule ^metadata-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/metadata-context.jsonld [R=302,L]

### AIM CORE METAMODEL LAYER #####
# Ontology
RewriteRule ^core$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/demeterCore.ttl [R=302,L]
# JSON-LD context
RewriteRule ^core-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/core-context.jsonld [R=302,L]

### AIM CROSS-DOMAIN LAYER #####
# Ontology
RewriteRule ^crossDomain$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/cross-domain.ttl [R=302,L]
# JSON-LD context
RewriteRule ^crossDomain-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/crossDomain-context.jsonld [R=302,L]


### AIM DOMAIN LAYER #####

## Root level
# Ontology
RewriteCond %{HTTP_ACCEPT} text/html
RewriteRule ^agri$ https://defs-dev.opengis.net/def/w3id.org/demeter/agri [R=303,L]
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.*
RewriteRule ^agri$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/rdf/demeterAgriProfile.rdf [R=303,L]
#RewriteCond %{HTTP_ACCEPT} ^.*text/turtle.*
RewriteRule ^agri$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/demeterAgriProfile.ttl [R=303,L]
# JSON-LD context
RewriteRule ^agri-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/demeterAgriProfile-context.jsonld [R=302,L]

## Modules
# JSON-LD contexts
RewriteRule ^agri/(.*)-context(.*)$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/$1-context.jsonld [R=302,L]

#RewriteRule ^agri/agriFeature-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriFeature-context.jsonld [R=302,L]
#RewriteRule ^agri/agriCrop-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriCrop-context.jsonld [R=302,L]
#RewriteRule ^agri/agriCommon-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriCommon-context.jsonld [R=302,L]
#RewriteRule ^agri/agriIntervention-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriIntervention-context.jsonld [R=302,L]
#RewriteRule ^agri/agriAlert-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriAlert-context.jsonld [R=302,L]
#RewriteRule ^agri/agriProduct-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriProduct-context.jsonld [R=302,L]
#RewriteRule ^agri/agriProperty-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriProperty-context.jsonld [R=302,L]
#RewriteRule ^agri/agriSystem-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriSystem-context.jsonld [R=302,L]
#RewriteRule ^agri/agriPest-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriPest-context.jsonld [R=302,L]
#RewriteRule ^agri/farmAnimal-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/farmAnimal-context.jsonld [R=302,L]


# Ontologies
Expand All @@ -27,14 +67,11 @@ RewriteCond %{HTTP_ACCEPT} ^.*text/turtle.*
RewriteRule ^agri/(.*)$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/$1.ttl [R=303,L]
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.*
RewriteRule ^agri/(.*)$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/rdf/$1.rdf [R=303,L]
#RewriteRule ^agri/(.*)$ https://defs-dev.opengis.net/def/w3id.org/demeter/agri/$1 [R=303,L]
RewriteRule ^agri/(?!.*context).*$ https://defs-dev.opengis.net/def/w3id.org/demeter/agri/$1 [R=303,L]
RewriteRule ^agri/(.*)$ https://defs-dev.opengis.net/def/w3id.org/demeter/agri/$1 [R=303,L]
#RewriteRule ^agri/(?!.*context).*$ https://defs-dev.opengis.net/def/w3id.org/demeter/agri/$1 [R=303,L]


#RewriteCond %{HTTP_ACCEPT} ^.*text/turtle.*
#RewriteRule ^agri/agriCrop$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/agriCrop.ttl [R=303,L]
#RewriteRule ^agri/agriCrop$ https://defs-dev.opengis.net/def/w3id.org/demeter/agri/agriCrop [R=303,L]

#RewriteRule ^agri/agriFeature$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/agriFeature.ttl [R=302,L]
#RewriteRule ^agri/agriCommon$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/agriCommon.ttl [R=302,L]
#RewriteRule ^agri/agriIntervention$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/agriIntervention.ttl [R=302,L]
Expand All @@ -45,28 +82,11 @@ RewriteRule ^agri/(?!.*context).*$ https://defs-dev.opengis.net/def/w3id.org/de
#RewriteRule ^agri/agriPest$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/agriPest.ttl [R=302,L]
#RewriteRule ^agri/farmAnimal$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/farmAnimal.ttl [R=302,L]

### CROSS-DOMAIN LAYER #####
RewriteRule ^crossDomain$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/cross-domain.ttl [R=302,L]

### CORE LAYER #####
RewriteRule ^core$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/demeterCore.ttl [R=302,L]

### METADATA LAYER #####
RewriteRule ^metadata$ https://gitlab.com/demeterproject/wp2/agriculturalinformationmodel/metadataschema/-/raw/master/metadata.ttl [R=302,L]

# JSON-LD contexts
RewriteRule ^agri/agriFeature-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriFeature-context.jsonld [R=302,L]
RewriteRule ^agri/agriCrop-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriCrop-context.jsonld [R=302,L]
RewriteRule ^agri/agriCommon-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriCommon-context.jsonld [R=302,L]
RewriteRule ^agri/agriIntervention-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriIntervention-context.jsonld [R=302,L]
RewriteRule ^agri/agriAlert-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriAlert-context.jsonld [R=302,L]
RewriteRule ^agri/agriProduct-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriProduct-context.jsonld [R=302,L]
RewriteRule ^agri/agriProperty-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriProperty-context.jsonld [R=302,L]
RewriteRule ^agri/agriSystem-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriSystem-context.jsonld [R=302,L]
RewriteRule ^agri/agriPest-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/agriPest-context.jsonld [R=302,L]
RewriteRule ^agri/farmAnimal-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/farmAnimal-context.jsonld [R=302,L]
RewriteRule ^agri-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/demeterAgriProfile-context.jsonld [R=302,L]
RewriteRule ^core-context.jsonld$ https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/jsonld/demeter-core-context.jdonld [R=302,L]
RewriteRule ^crossDomain-context.jsonld$ https://gitlab.com/demeterproject/wp2/agriculturalinformationmodel/crossdomainontology/jsonld/-/raw/master/cross-domain-context.jsonld [R=302,L]
RewriteRule ^metadata-context.jsonld$ https://gitlab.com/demeterproject/wp2/agriculturalinformationmodel/metadataschema/jsonld/-/raw/master/metadata-context.jsonld [R=302,L]





0 comments on commit beb4713

Please sign in to comment.