Query execution component API - AIoTES/DataLayer-DataLake-QueryExecution GitHub Wiki

Each supported sub-service is described in detail below

<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Input</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre> <code>

{ "type": "object", "properties": { "db": { "type": "string", "description": "The name of a DB. Can be empty to return the names of all the DBs and tables." } } }

/getSchema
Returns the tables names defined in a DB created in the Independent Data Storage. If no DB name is specified, the names of all the Dbs defined in the Independent Data Storage and their corresponding tables are returned.
JSON example

{
"db": "my_db"
}
                                    </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "object", "description": "The names of the existing tables in each DB of interest." }

                                </code></pre></td>
                            </tr>
                            <tr>
                                <td>JSON example</td>
                                <td><pre><code>

{ "my_db": { "tables": ["temp-sensors", "presence-sensors"] } }

                                </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Input</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre> <code>

{ "type": "object", "properties": { "deviceID": { "type": "array", "description": "Device types of interest", "items": { "type": "string", "description": "A device type" } }, "deviceType": { "type": "array", "description": "Device identifiers of interest", "items": { "type": "string", "description": "The unique identifier of a device" } }, "startDate": { "type": "string", "description": "Start date" }, "endDate": { "type": "string", "description": "End date" }, "platform": { "type": "array", "description": "Platforms of interest", "items": { "type": "string", "description": "Platform type" } }, "ds": { "type": "array", "description": "DSs of interest", "items": { "type": "string", "description": "DS identifier" } } } }

                                </code></pre></td>
                            </tr>
                            <tr>
                                <td>JSON example</td>
                                <td><pre><code>

{ "deviceType": ["motionSensor"], "startDate": "2018-02-01T00:00:00.000Z", "endDate": "2018-06-01T00:00:00.000Z", "platform": ["universAAL"] }

                                    </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "object", "properties": { "records": { "type": "array", "description": "The array of retrieved records.", "items": { "type": "object", "description": "The data of a single record, according to its schema." } } } }

/query
Submits a query to the Data Lake and retrieves the results.
JSON example

{
"records": [
{
"@graph": [
{
"@graph": [
{
"@id": "msg:meta/42b89c38-75ff-4cfe-bc9a-2d9b3fc6589e",
"msg:SenderPlatformId": {
"@id": "InterIoT:platforms/uaal-greece"
},
"msg:conversationID": "conv495bc434-bf3f-4781-aef6-c11a6c2ccabf",
"msg:dateTimeStamp": "2019-04-03T16:04:20.215+02:00",
"msg:messageID": "msgc0dcc385-fa55-4e6e-b5c0-04d0f9d157ae",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
{
"@id": "msg:meta"
},
{
"@id": "msg:Observation"
}
]
}
],
"@id": "msg:metadata"
},
{
"@graph": [
{
"@id": ":b0",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
"@id": "http://www.w3.org/2006/time#TimePosition"
},
"http://www.w3.org/2006/time#numericPosition": {
"@type": "http://www.w3.org/2001/XMLSchema#decimal",
"@value": "1533115680000"
}
},
{
"@id": ":b1",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
"@id": "http://www.w3.org/2006/time#Instant"
},
"http://www.w3.org/2006/time#inTimePosition": {
"@id": ":b0"
}
},
{
"@id": "http://ontology.universAAL.org/Context.owl#controller",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
"@id": "http://ontology.universAAL.org/Context.owl#ContextProviderType"
}
},
{
"@id": "http://ontology.universAAL.org/Device.owl#Detected",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
{
"@id": "sosa:Sensor"
},
{
"@id": "iiot:IoTDevice"
},
{
"@id": "http://ontology.universAAL.org/Device.owl#MotionValue"
}
]
},
{
"@id": "http://ontology.universAAL.org/InterIoT.owl#2d5960a0-76d2-47e6-837f-5e2897d51b6c",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
"@id": "http://ontology.universAAL.org/Device.owl#MotionSensor"
},
"sosa:isHostedBy": {
"@id": "http://ontology.universaal.org/ActivageOntology.owl#ZWaveContextPublisher"
}
},
{
"@id": "http://ontology.universaal.org/ActivageOntology.owl#ZWaveContextPublisher",
"http://ontology.universAAL.org/Context.owl#hasType": {
"@id": "http://ontology.universAAL.org/Context.owl#controller"
},
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
{
"@id": "sosa:Platform"
},
{
"@id": "InterIoT:medex#Gauge"
}
]
},
{
"@id": "urn:org.universAAL.middleware.context.rdf:ContextEvent#:7f0001013c30a961:eaf",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
"@id": "sosa:Observation"
},
"sosa:hasResult": {
"@id": "http://ontology.universAAL.org/Device.owl#Detected"
},
"sosa:madeBySensor": {
"@id": "http://ontology.universAAL.org/InterIoT.owl#2d5960a0-76d2-47e6-837f-5e2897d51b6c"
},
"sosa:phenomenonTime": {
"@id": "_:b1"
}
}
],
"@id": "msg:payload"
}
],
"@context": {
"msg": "http://inter-iot.eu/message/",
"iiotex": "http://inter-iot.eu/GOIoTPex#",
"geosparql": "http://www.opengis.net/ont/geosparql#",
"iiot": "http://inter-iot.eu/GOIoTP#",
"InterIoT": "http://inter-iot.eu/",
"ssn": "http://www.w3.org/ns/ssn/",
"sosa": "http://www.w3.org/ns/sosa/"
}
}
]
}
                                </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Input</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre> <code>

{ "type": "object", "properties": { "deviceID": { "type": "array", "description": "Device types of interest", "items": { "type": "string", "description": "A device type" } }, "deviceType": { "type": "array", "description": "Device identifiers of interest", "items": { "type": "string", "description": "The unique identifier of a device" } }, "startDate": { "type": "string", "description": "Start date" }, "endDate": { "type": "string", "description": "End date" }, "platform": { "type": "array", "description": "Platforms of interest", "items": { "type": "string", "description": "Platform type" } }, "ds": { "type": "array", "description": "DSs of interest", "items": { "type": "string", "description": "DS identifier" } } } }

                                </code></pre></td>
                            </tr>
                            <tr>
                                <td>JSON example</td>
                                <td><pre><code>

{ "deviceType": ["motionSensor"], "startDate": "2018-02-01T00:00:00.000Z", "endDate": "2018-06-01T00:00:00.000Z", "platform": ["universAAL", "independent"] }

                                    </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "array", "description": "Calls to the the historical data web services", "items": { "type": "object", "properties": { "url": { "type": "string", "description": "URL for calling the web service with the given parameters" }, "headers": { "type": "object", "description": "HTTP headers needed for the web service call" } } } }

                                </code></pre></td>
                            </tr>
                            <tr>
                                <td>JSON example</td>
                                <td><pre><code>

[ { "url": "http://examplewebservice.com/measurements/all?deviceType=motionSensor&startDate=2018-02-01T00%3A00%3A00.000Z&endDate=2018-06-01T00%3A00%3A00.000Z", "headers": { "Authentication": "Basic QWxhZGRpbjpPcGVuU2VzYW1l" } }, { "url": "http://independentdatastorage.com/independentStorage/select?db=independent&table=motionSensor&query=SELECT%2B*%2BFROM%2B%2522independent%2522%2BWHERE%2Btime%2B%253E%253D%2B%2527Thu%2BFeb%2B01%2B00%253A00%253A00%2BCET%2B2018%2527%2BAND%2Btime%2B%253C%253D%2B%2527Fri%2BJun%2B01%2B00%253A00%253A00%2BCEST%2B2018%2527", "headers": {} } ]

                                </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
/querytranslation
Converts a query to the data lake into a series of calls to the historical data webservices.
⚠️ **GitHub.com Fallback** ⚠️