-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiotcrawler.graphqls
163 lines (135 loc) · 6.23 KB
/
iotcrawler.graphqls
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
scalar Object
#scalar Date
schema {
query: Query
}
directive @resource(class : String, subClassOf : [String]) on OBJECT | INPUT_OBJECT
directive @attribute(uri : String!) on FIELD_DEFINITION
directive @context(rules: [Rule]) on FIELD_DEFINITION
directive @exclude on INPUT_OBJECT
input Rule @exclude{
if : String!,
then : String!
}
input SystemInput {
id: String
label: String
location: String
isHostedBy: PlatformInput
alternativeType: String
}
input IoTStreamInput{
id: [String]
label: String
generatedBy: [SensorInput]
observes: ObservablePropertyInput
alternativeType: String
}
input SensorInput{
id: String
label: String
location: String
isHostedBy: PlatformInput
observes: ObservablePropertyInput
madeObservation: StreamObservationInput
alternativeType: String
}
input PlatformInput {
id: String
label: String
hosts: SensorInput
location: String
alternativeType: String
}
input ObservablePropertyInput {
id: String
label: String
isObservedBy: SensorInput
alternativeType: String
}
input StreamObservationInput {
id: String
belongsTo: IoTStreamInput
madeBySensor: SensorInput
alternativeType: String
dataProvider: String
hasSimpleResult: SimpleResultFilter
}
input RankingCriteria {
name: String
value: Float
}
input SimpleResultFilter {
eq: Int
neq: Int
gt: Int
gte: Int
lt: Int
lte: Int
}
type Query {
streams(id: String, filter: IoTStreamInput, alternativeType: String, ranking: [RankingCriteria], label: String, generatedBy: SensorInput, dataProvider: String, offset: Int = 0, limit: Int = 0): [IoTStream]
sensors(id: String, alternativeType: String, label: String, madeObservation: StreamObservationInput, isHostedBy: PlatformInput, observes: ObservablePropertyInput, offset: Int = 0, limit: Int = 0): [Sensor]
systems(id: String, alternativeType: String, label: String, isHostedBy: PlatformInput, offset: Int = 0, limit: Int = 0): [System]
platforms(id: String, alternativeType: String, label: String, hosts: SensorInput, offset: Int = 0, limit: Int = 0): [Platform]
observableProperties(id: String, alternativeType: String, label: String, offset: Int = 0, limit: Int = 0): [ObservableProperty]
streamObservations(id: String, hasSimpleResult: SimpleResultFilter, alternativeType: String, madeBySensor: SensorInput, belongsTo: IoTStreamInput, offset: Int = 0, limit: Int = 0): [StreamObservation]
}
type IoTStream @resource(class : "http://purl.org/iot/ontology/iot-stream#IotStream"){
id: String!
type: String!
generatedBy: Sensor @attribute(uri : "http://purl.org/iot/ontology/iot-stream#generatedBy")
observes: ObservableProperty @attribute(uri : "http://purl.org/iot/ontology/iot-stream#observes")
alternativeType: String @attribute(uri : "http://www.agtinternational.com/ontologies/ngsi-ld#alternativeType")
dataProvider: String @attribute(uri : "http://www.agtinternational.com/ontologies/RichIoTStream#DataProvider")
}
type System @resource(class : "http://www.w3.org/ns/ssn/System"){
id: String!
type: String!
label: String @attribute(uri : "http://www.w3.org/2000/01/rdf-schema#label")
isHostedBy: Platform @attribute(uri : "http://www.w3.org/ns/sosa/isHostedBy")
}
type Sensor @resource(class : "http://www.w3.org/ns/sosa/Sensor", subClassOf: ["System"]){
madeObservation: StreamObservation @attribute(uri : "http://www.w3.org/ns/sosa/madeObservation")
observes: ObservableProperty @attribute(uri : "http://www.w3.org/ns/sosa/observes")
alternativeType: String @attribute(uri : "http://www.agtinternational.com/ontologies/ngsi-ld#alternativeType")
name: String @attribute(uri : "http://schema.org/name")
location: String @attribute(uri : "http://www.agtinternational.com/ontologies/devices/locations")
}
type Actuator @resource(class : "http://www.w3.org/ns/sosa/Actuator", subClassOf: ["System"]){
id: String!
}
type Platform @resource(class : "http://www.w3.org/ns/sosa/Platform") {
id: String!
type: String!
label: String @attribute(uri : "http://www.w3.org/2000/01/rdf-schema#label")
hosts: [Sensor] @attribute(uri : "http://www.w3.org/ns/sosa/hosts")
name: String @attribute(uri : "http://schema.org/name")
location: String @attribute(uri : "http://www.agtinternational.com/ontologies/devices/locations")
alternativeType: String @attribute(uri : "http://www.agtinternational.com/ontologies/ngsi-ld#alternativeType")
includes: [Sensor] @attribute(uri : "http://www.w3.org/ns/sosa/includes")
inferredHosts: [Sensor] @attribute(uri : "http://www.w3.org/ns/sosa/inferredHosts") @context(rules: [{ if: "Platform.alternativeType=http://www.agtinternational.com/ontologies/devices#Device", then: "Platform.hosts*.observes=urn:ngsi-ld:ThermodynamicTemperature"} ])
}
type ObservableProperty @resource(class : "http://www.w3.org/ns/sosa/ObservableProperty"){
id: String!
type: String!
label: String @attribute(uri : "http://www.w3.org/2000/01/rdf-schema#label")
isObservedBy: [Sensor] @attribute(uri : "http://www.w3.org/ns/sosa/isObservedBy")
alternativeType: String @attribute(uri : "http://www.agtinternational.com/ontologies/ngsi-ld#alternativeType")
}
type StreamObservation @resource(class : "http://purl.org/iot/ontology/iot-stream#StreamObservation"){
id: String!
type: String!
madeBySensor: Sensor @attribute(uri : "http://www.w3.org/ns/sosa/madeBySensor")
belongsTo: IoTStream @attribute(uri : "http://purl.org/iot/ontology/iot-stream#belongsTo")
alternativeType: String @attribute(uri : "http://www.agtinternational.com/ontologies/ngsi-ld#alternativeType")
hasSimpleResult: String @attribute(uri : "http://www.w3.org/ns/sosa/hasSimpleResult")
resultTime: String @attribute(uri : "http://www.w3.org/ns/sosa/resultTime")
}
#type Event @resource(class : "http://purl.org/iot/ontology/iot-stream#Event"){
# id: String!
# type: String!
# label: String! @attribute(uri : "http://www.w3.org/2000/01/rdf-schema#label")
# windowStart: Date @attribute(uri : "http://purl.org/iot/ontology/iot-stream#windowStart")
# windowEnd: Date @attribute(uri : "http://purl.org/iot/ontology/iot-stream#windowEnd")
#}