-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates default project to include new mu.semte.ch additions
- Loading branch information
1 parent
9257866
commit 3dd3c63
Showing
4 changed files
with
17 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,12 @@ | ||
defmodule Dispatcher do | ||
use Plug.Router | ||
use Matcher | ||
define_accept_types [ | ||
json: [ "application/json", "application/vnd.api+json" ] | ||
] | ||
|
||
def start(_argv) do | ||
port = 80 | ||
IO.puts "Starting Plug with Cowboy on port #{port}" | ||
Plug.Adapters.Cowboy.http __MODULE__, [], port: port | ||
:timer.sleep(:infinity) | ||
end | ||
|
||
plug Plug.Logger | ||
plug :match | ||
plug :dispatch | ||
@json %{ accept: %{ json: true } } | ||
|
||
# In order to forward the 'themes' resource to the | ||
# resource service, use the following forward rule. | ||
# | ||
# docker-compose stop; docker-compose rm; docker-compose up | ||
# after altering this file. | ||
# | ||
# match "/themes/*path" do | ||
# Proxy.forward conn, path, "http://resource/themes/" | ||
# end | ||
|
||
match _ do | ||
match "/*_", %{ last_call: true } do | ||
send_resp( conn, 404, "Route not found. See config/dispatcher.ex" ) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"version": "0.1", | ||
"prefixes": { | ||
}, | ||
"resources": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,4 @@ | ||
(in-package :mu-cl-resources) | ||
|
||
;;;; | ||
;; NOTE | ||
;; docker-compose stop; docker-compose rm; docker-compose up | ||
;; after altering this file. | ||
|
||
;; Describe your resources here | ||
|
||
;; The general structure could be described like this: | ||
;; | ||
;; (define-resource <name-used-in-this-file> () | ||
;; :class <class-of-resource-in-triplestore> | ||
;; :properties `((<json-property-name-one> <type-one> ,<triplestore-relation-one>) | ||
;; (<json-property-name-two> <type-two> ,<triplestore-relation-two>>)) | ||
;; :has-many `((<name-of-an-object> :via ,<triplestore-relation-to-objects> | ||
;; :as "<json-relation-property>") | ||
;; (<name-of-an-object> :via ,<triplestore-relation-from-objects> | ||
;; :inverse t ; follow relation in other direction | ||
;; :as "<json-relation-property>")) | ||
;; :has-one `((<name-of-an-object :via ,<triplestore-relation-to-object> | ||
;; :as "<json-relation-property>") | ||
;; (<name-of-an-object :via ,<triplestore-relation-from-object> | ||
;; :as "<json-relation-property>")) | ||
;; :resource-base (s-url "<string-to-which-uuid-will-be-appended-for-uri-of-new-items-in-triplestore>") | ||
;; :on-path "<url-path-on-which-this-resource-is-available>") | ||
|
||
|
||
;; An example setup with a catalog, dataset, themes would be: | ||
;; | ||
;; (define-resource catalog () | ||
;; :class (s-prefix "dcat:Catalog") | ||
;; :properties `((:title :string ,(s-prefix "dct:title"))) | ||
;; :has-many `((dataset :via ,(s-prefix "dcat:dataset") | ||
;; :as "datasets")) | ||
;; :resource-base (s-url "http://webcat.tmp.semte.ch/catalogs/") | ||
;; :on-path "catalogs") | ||
|
||
;; (define-resource dataset () | ||
;; :class (s-prefix "dcat:Dataset") | ||
;; :properties `((:title :string ,(s-prefix "dct:title")) | ||
;; (:description :string ,(s-prefix "dct:description"))) | ||
;; :has-one `((catalog :via ,(s-prefix "dcat:dataset") | ||
;; :inverse t | ||
;; :as "catalog")) | ||
;; :has-many `((theme :via ,(s-prefix "dcat:theme") | ||
;; :as "themes")) | ||
;; :resource-base (s-url "http://webcat.tmp.tenforce.com/datasets/") | ||
;; :on-path "datasets") | ||
|
||
;; (define-resource distribution () | ||
;; :class (s-prefix "dcat:Distribution") | ||
;; :properties `((:title :string ,(s-prefix "dct:title")) | ||
;; (:access-url :url ,(s-prefix "dcat:accessURL"))) | ||
;; :resource-base (s-url "http://webcat.tmp.tenforce.com/distributions/") | ||
;; :on-path "distributions") | ||
|
||
;; (define-resource theme () | ||
;; :class (s-prefix "tfdcat:Theme") | ||
;; :properties `((:pref-label :string ,(s-prefix "skos:prefLabel"))) | ||
;; :has-many `((dataset :via ,(s-prefix "dcat:theme") | ||
;; :inverse t | ||
;; :as "datasets")) | ||
;; :resource-base (s-url "http://webcat.tmp.tenforce.com/themes/") | ||
;; :on-path "themes") | ||
|
||
;; | ||
;; reading in the domain.json | ||
(read-domain-file "domain.json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters