JoelBender / BACpypes3

BACnet communications library
33 stars 7 forks source link

RDF Device Pieces #13

Closed JoelBender closed 8 months ago

JoelBender commented 9 months ago

These two queries:

find_device_by_address = bacnet_query(
    """
    select ?s where { ?s bacnet:hasAddress [
        bacnet::network-number ?net ;
        bacnet:mac-address ?addr
        ] }
    """
)
find_device_by_instance = bacnet_query(
    "select ?s where { ?s bacnet:deviceInstance ?device_instance .}"
)

should match the JSON element names from a DeviceAddress:

>>> ab = AddressBinding(deviceObjectIdentifier="device,999", deviceAddress="1235:12")
>>> sequence_to_json(ab)
{'device-object-identifier': 'device,999', 'device-address': {'network-number': 1235, 'mac-address': '0c'}}

So bacnet::network-number is a typo, bacnet:hasAddress should be bacnet:device-address, and bacnet:deviceInstance and should be bacnet:device-instance to be consistent.

JoelBender commented 9 months ago

bacnet:hasObject is the last remaining lowerCamelCase predicate name, maybe that should change.

JoelBender commented 8 months ago

Note that the network number is unsigned, not sure if that's useful.