我一直在尝试运行一个能够关联Orion的设置。
我一直在遵循关于FIWARE wiki的“用户和程序员指南”,其中的功能解释如下:
首先注册"Room1“和"Room2”实体,如下所述:operation
这如预期的那样起作用。然后,我在这里遵循关联的步骤:Guide#Associations
所有注册都按预期进行,但是,当我尝试"discoverContextAvailability“时,我得到了一个"NGSI 404”,它看起来如下:
请求:
<?xml version="1.0"?>
<discoverContextAvailabilityRequest>
<entityIdList>
<entityId type="Room" isPattern="false">
<id>Room2</id>
</entityId>
</entityIdList>
<attributeList>
<attribute>temperature</attribute>
</attributeList>
<restriction>
<scope>
<operationScope>
<scopeType>IncludeAssociations</scopeType>
<scopeValue>SOURCES</scopeValue>
</operationScope>
</scope>
</restriction>
</discoverContextAvailabilityRequest>答复:
<discoverContextAvailabilityResponse>
<errorCode>
<code>404</code>
<reasonPhrase>No context element found</reasonPhrase>
<details>Could not query association with combination of entity/attribute</details>
</errorCode>
</discoverContextAvailabilityResponse>作为附带说明,我想提到的是,我试图将猎户座配置管理器与NEC IoT代理集成,并且当IoT代理向猎户座发送discoverContextAvailability时,它还包括告诉猎户座“包含关联”的限制,这将导致下面描述的相同错误(即使在本例中没有注册关联)。
我真的需要帮助。
更新1回显‘db.registrations.find()_ mongo的结果:
{ "_id" : ObjectId("54d4acdfa85d6301365b7240"), "expiration" : NumberLong(1423310431), "contextRegistration" : [ { "entities" : [ { "id" : "Filtered000D6F000277BCC0", "type" : "FilteredSmartPlug" } ], "attrs" : [ { "name" : "currentPower", "type" : "float", "isDomain" : "false" } ], "providingApplication" : "http://localhost/EspR4FastData/" } ] }
{ "_id" : ObjectId("54e1c2e7a85d6301365b7314"), "expiration" : NumberLong(1424513639), "contextRegistration" : [ { "entities" : [ { "id" : "30DE8600002001C4", "type" : "SmartPlug" } ], "attrs" : [ { "name" : "name", "type" : "xs:string", "isDomain" : "false" }, { "name" : "manufacturer", "type" : "xs:string", "isDomain" : "false" }, { "name" : "model", "type" : "xs:string", "isDomain" : "false" }, { "name" : "protocol", "type" : "xs:string", "isDomain" : "false" }, { "name" : "currentPower", "type" : "xs:float", "isDomain" : "false" }, { "name" : "currentState", "type" : "xs:integer", "isDomain" : "false" } ], "providingApplication" : "http://10.42.82.127:8080/zpa/ngsi" } ] }
{ "_id" : ObjectId("54e1c2f9a85d6301365b7315"), "expiration" : NumberLong(1424513657), "contextRegistration" : [ { "entities" : [ { "id" : "30DE8600002001C4", "type" : "SmartPlug" } ], "attrs" : [ { "name" : "name", "type" : "xs:string", "isDomain" : "false" }, { "name" : "manufacturer", "type" : "xs:string", "isDomain" : "false" }, { "name" : "model", "type" : "xs:string", "isDomain" : "false" }, { "name" : "protocol", "type" : "xs:string", "isDomain" : "false" }, { "name" : "currentPower", "type" : "xs:float", "isDomain" : "false" }, { "name" : "currentState", "type" : "xs:integer", "isDomain" : "false" } ], "providingApplication" : "http://10.42.82.127:8080/zpa/ngsi" } ] }
{ "_id" : ObjectId("54e1c3aaa85d6301365b7316"), "expiration" : NumberLong(1424513834), "contextRegistration" : [ { "entities" : [ { "id" : "30DE8600002001C4", "type" : "SmartPlug" } ], "attrs" : [ { "name" : "name", "type" : "xs:string", "isDomain" : "false" }, { "name" : "manufacturer", "type" : "xs:string", "isDomain" : "false" }, { "name" : "model", "type" : "xs:string", "isDomain" : "false" }, { "name" : "protocol", "type" : "xs:string", "isDomain" : "false" }, { "name" : "currentPower", "type" : "xs:float", "isDomain" : "false" }, { "name" : "currentState", "type" : "xs:integer", "isDomain" : "false" } ], "providingApplication" : "http://10.42.82.127:8080/zpa/ngsi" } ] }
{ "_id" : ObjectId("54e1c416a85d6301365b7317"), "expiration" : NumberLong(1424513942), "contextRegistration" : [ { "entities" : [ { "id" : "30DE8600002001C5", "type" : "SmartPlug" } ], "attrs" : [ { "name" : "name", "type" : "xs:string", "isDomain" : "false" }, { "name" : "manufacturer", "type" : "xs:string", "isDomain" : "false" }, { "name" : "model", "type" : "xs:string", "isDomain" : "false" }, { "name" : "protocol", "type" : "xs:string", "isDomain" : "false" }, { "name" : "currentPower", "type" : "xs:float", "isDomain" : "false" }, { "name" : "currentState", "type" : "xs:integer", "isDomain" : "false" } ], "providingApplication" : "http://10.42.82.127:8080/zpa/ngsi" } ] }
{ "_id" : ObjectId("54e1ce41a85d6301365b7318"), "expiration" : NumberLong(1424084605), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d2eda85d6301365b7319"), "expiration" : NumberLong(1424085801), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d333a85d6301365b731a"), "expiration" : NumberLong(1424085871), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d334a85d6301365b731b"), "expiration" : NumberLong(1424085872), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d56ea85d6301365b731c"), "expiration" : NumberLong(1424086442), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d922a85d6301365b731d"), "expiration" : NumberLong(1426679330), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d92da85d6301365b731e"), "expiration" : NumberLong(1426679341), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1d97ba85d6301365b731f"), "expiration" : NumberLong(1426679419), "contextRegistration" : [ { "entities" : [ { "id" : "Room1", "type" : "Room" }, { "id" : "Room2", "type" : "Room" } ], "attrs" : [ { "name" : "temperature", "type" : "float", "isDomain" : "false" }, { "name" : "pressure", "type" : "integer", "isDomain" : "false" } ], "providingApplication" : "http://mysensors.com/Rooms" } ] }
{ "_id" : ObjectId("54e1d9afa85d6301365b7320"), "expiration" : NumberLong(1426679471), "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1dd0fa85d6369180b7c49"), "expiration" : NumberLong(1426680335), "servicePath" : "/", "contextRegistration" : [ { "entities" : [ { "id" : "Room1", "type" : "Room" }, { "id" : "Room2", "type" : "Room" } ], "attrs" : [ { "name" : "temperature", "type" : "float", "isDomain" : "false" }, { "name" : "pressure", "type" : "integer", "isDomain" : "false" } ], "providingApplication" : "http://mysensors.com/Rooms" } ] }
{ "_id" : ObjectId("54e1dd47a85d6369180b7c4a"), "expiration" : NumberLong(1426680391), "servicePath" : "/", "contextRegistration" : [ { "entities" : [ { "id" : "Room1", "type" : "Room" }, { "id" : "Room2", "type" : "Room" } ], "attrs" : [ { "name" : "temperature", "type" : "float", "isDomain" : "false" }, { "name" : "pressure", "type" : "integer", "isDomain" : "false" } ], "providingApplication" : "http://mysensors.com/Rooms" } ] }
{ "_id" : ObjectId("54e1ddc1a85d6369180b7c4d"), "expiration" : NumberLong(1426680513), "servicePath" : "/", "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1ddc2a85d6369180b7c4e"), "expiration" : NumberLong(1426680514), "servicePath" : "/", "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1ddc2a85d6369180b7c4f"), "expiration" : NumberLong(1426680514), "servicePath" : "/", "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }
{ "_id" : ObjectId("54e1ddc3a85d6369180b7c50"), "expiration" : NumberLong(1426680515), "servicePath" : "/", "contextRegistration" : [ { "entities" : [ ], "attrs" : [ ], "providingApplication" : "http://www.fi-ware.eu/NGSI/association" } ] }更新2
删除数据库后,指南中描述的过程现在开始工作。当一个实体有一个位置时,我会得到回复。另一方面,如果实体没有关联,查询仍然返回错误“无法查询与实体/属性组合的关联”。
然而。我最初的问题是,NEC IoT Broker向Configuration提出了这个请求(始终包括对关联的限制),这意味着每当我查询没有关联的IoT代理上的数据时,它都会失败。这行为真的正确吗?
发布于 2015-02-26 08:43:14
这个问题似乎与猎户座数据库中的重叠登记有关。在清理DB并重复测试之后,它工作了(根据用户的报告)。
https://stackoverflow.com/questions/28542208
复制相似问题