Widely used object-oriented programming languages such as Java or C# include a built-in static type system. Programming language type systems provide a conceptual framework that makes it particularly easy to design, understand, and maintain object-oriented systems. However, with the emergence of a variety of schema and ontology languages such as XML Schema Definition (XSD) or the Web Ontology Language (OWL) conventional built-in programming language type systems have reached their limits. In XSD, atomic types can be derived through the application of value space constraints. In OWL, types are inferred based on ontological reasoning. OWL object properties can be used to declare ad hoc relationships between ontological individuals.
The Zhi# compiler framework is extensible and facilitates the cooperative usage of external type systems such as XSD and OWL, which depend on external classification and deduction engines, with C#. For the resulting programming language Zhi#, XSD and OWL compiler plug-ins were implemented in order to provide static typing and dynamic checking for constrained atomic data types and ontologies. XSD constraining facets and ontological inference rules were integrated with host language features such as method overriding. Zhi# programs are compiled into conventional C# and are interoperable with .NET assemblies. The proposed solution eases the development of Semantic Web applications and facilitates the use and reuse of knowledge in form of ontologies. Further compiler plug-ins may be implemented to provide for additional type systems such as of the Object Constraint Language (OCL).
The Zhi# server can be used via an XML-over-TCP interface that is described by an XML schema.