pub mod batch;
pub mod content_neg;
pub mod context;
pub mod converter;
pub mod entities;
pub mod query;
pub mod server_handlers;
pub mod subscriptions;
pub mod temporal;
pub mod types;
pub use types::{
BatchOperationResult, GeoProperty, NgsiAttribute, NgsiContext, NgsiEntity, NgsiError,
NgsiProperty, NgsiQueryParams, NgsiRelationship, NgsiSubscription,
};
pub use batch::{
batch_create_entities, batch_delete_entities, batch_update_entities, batch_upsert_entities,
};
pub use content_neg::{NgsiContentNegotiator, NgsiFormat};
pub use converter::{NgsiRdfConverter, NgsiToRdf, RdfToNgsi};
pub use entities::{
append_entity_attrs, create_entity, delete_entity, get_entity, query_entities,
update_entity_attrs,
};
pub use server_handlers::*;
pub use subscriptions::{
create_subscription, delete_subscription, get_subscription, list_subscriptions,
update_subscription,
};
pub use temporal::{
create_temporal_entity, delete_temporal_entity, get_temporal_entity, query_temporal_entities,
};
pub const NGSI_LD_VERSION: &str = "1.6.1";
pub const NGSI_LD_CORE_CONTEXT: &str =
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld";
pub const NGSI_LD_BASE_PATH: &str = "/ngsi-ld/v1";
pub const NGSI_LD_NS: &str = "https://uri.etsi.org/ngsi-ld/";
pub const NGSI_LD_DEFAULT_TENANT: &str = "default";
pub const NGSI_LD_CONTENT_TYPES: &[&str] = &[
"application/ld+json",
"application/json",
"application/geo+json",
];
pub const MAX_BATCH_SIZE: usize = 1000;
pub const MAX_ATTRIBUTES_PER_ENTITY: usize = 100;
pub const MAX_SUBSCRIPTIONS_PER_TENANT: usize = 10000;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_constants() {
assert_eq!(NGSI_LD_VERSION, "1.6.1");
assert!(NGSI_LD_CORE_CONTEXT.contains("ngsi-ld"));
assert_eq!(NGSI_LD_BASE_PATH, "/ngsi-ld/v1");
}
}