-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
133 lines (133 loc) · 5.02 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
basePath: /
consumes:
- application/json
definitions:
BindingAttribute:
properties:
Type:
type: string
Value:
type: string
type: object
x-go-package: github.com/Knox-AAU/DatabaseLayer_Server/pkg/graph
GetTriple:
properties:
o:
$ref: '#/definitions/BindingAttribute'
p:
$ref: '#/definitions/BindingAttribute'
s:
$ref: '#/definitions/BindingAttribute'
title: GetTriple requires the json tags to match with the queries that are used to retrieve it.
type: object
x-go-package: github.com/Knox-AAU/DatabaseLayer_Server/pkg/graph
PostBody:
properties:
triples:
description: |-
Triples is an array of triples.
Each triple's first element is the subject, second is the predicate and third is the object.
Only accepts exactly 3 elements per triple.
items:
items:
type: string
type: array
type: array
x-go-name: Triples
required:
- triples
type: object
x-go-package: github.com/Knox-AAU/DatabaseLayer_Server/pkg/graph
Result:
properties:
query:
type: string
x-go-name: Query
triples:
items:
$ref: '#/definitions/GetTriple'
type: array
x-go-name: Triples
type: object
x-go-package: github.com/Knox-AAU/DatabaseLayer_Server/pkg/http/rest
host: http://knox-proxy01.srv.aau.dk/knox-api
info:
description: REST API for the KNOX database.
title: Database Layer Server API.
paths:
/triples:
get:
description: |-
To query the whole graph, leave parameters empty.
Example: /triples?g=http://knox_database&s=subjekt1&s=subjekt2&o=object1&p=predicate1
operationId: getTriples
parameters:
- description: Target graph of the query. Currently (http://knox_ontology, http://knox_database) are valid graphs, but this could change in the future. Error responses will always contain the valid graphs, so you can just send an empty request to get the valid graphs.
example: http://knox_database
in: query
name: g
required: true
type: string
- description: Subjects
in: query
items:
type: string
name: s
type: array
- description: Objects
in: query
items:
type: string
name: o
type: array
- description: Predicates
in: query
items:
type: string
name: p
type: array
produces:
- application/json
responses:
"200":
description: filtered triples response
schema:
$ref: '#/definitions/Result'
summary: Query graph applying filters.
post:
description: If a new predicate is sent with an existing subject, will the existing subject be updated with the new predicate.
operationId: UpsertTriples
parameters:
- description: Target graph of the query. Only valid graphs will be accepted. If the graph does not exist, the error response will contain the valid graphs.
example: http://knox_database
in: query
name: g
required: true
type: string
- description: Triples to upsert. Each triple must contain a subject, predicate and object, in that order.
example:
triples:
- object: http://knox_database/object1
predicate: http://knox_database/predicate1
subject: http://knox_database/subject1
- object: http://knox_database/object2
predicate: http://knox_database/predicate2
subject: http://knox_database/subject2
in: body
name: triples
required: true
schema:
$ref: '#/definitions/PostBody'
produces:
- application/json
responses:
"200":
description: response with produced query and null value for triples
schema:
$ref: '#/definitions/Result'
summary: This endpoint upserts triples.
produces:
- application/json
schemes:
- http
swagger: "2.0"