1. A metadata database adaptor for use with a surveillance and/or sensor system, comprising: an adaptor interface connecting with one or more applications and receiving metadata messages from the applications; a metadata database interface connecting with a metadata database; and one or more functional modules adapting metadata messages of varying formats according to needs of the metadata database, wherein at least one of the modules employs a metadata data model template that allows a user to define a data definition that is used to map user defined data with the metadata data model template and form XML data schema so that template mapping knowledge can then be applied for fast XML data schema to non-XML database schema generation without translation processing, and wherein at least one of the modules employs an application domain template to allow a user to define a query definition that can then be processed with a mapping of the application domain template to translate a query of a first query language to a database query of a second query language.