In the %SYS namespace, you can query the table Security.Applications and check the type column. If you do this in the system management portal in display mode, the Type column will start with "System". In logical mode, though, it will be a number. 1 is System, 2 is CSP Application, 4 is a privileged routine application, and 8 is a client application, and if an application is more than one of those things, the Type column is their sum. For example, if it's a System applcation AND a CSP application, the type will be 3. That complicated things, but fortunately since the 1 is the only odd number and it signified system applications, we can use the modulus function to identify system applications as follows.
select * from security.applications where {fn MOD(type,2)} = 1
Also, at the risk of self-promotion, I wrote an article detailing more about managing applications programatically a while back. You can find it here.
Here's an example of how we use the relationship between namespaces and databases.
My company sells ERP software for the millwork industry. Our customers sell building materials to contractors, distributors, etc. Some of our customers have multiple locations throughout the country. For those customers, we will usually set up a different namespace for each of those locations. Each of those namespaces is set up to have their own database for their data, but the all share the same database for routines because while they all have different data, like customers, orders, invoices, etc., the same set of code is running all of them.







Do you mean the format as in HL7, FHIR, etc.? There are specific ContentType settings for those in the specification, I believe.