1. A computer-executed method comprising: receiving a first query over a Resource Description Framework (RDF) database hosted by a database management system; wherein the first query is in an RDF query format; wherein the first query includes a triple with an RDF user-defined predicate, the range of which is an RDF user-defined data type; wherein the first query selects objects of the RDF user-defined predicate; wherein the RDF user-defined data type is defined based on definition information for the RDF user-defined data type stored within the RDF database; wherein the definition information includes a mapping between first one or more attributes of the RDF user-defined data type and second one or more attributes of a base data structure defined by the database management system; wherein the database management system is configured to store instances of the base data structure in a database managed by the database management system; wherein a particular instance of said base data structure has said one or more attributes; wherein the second one or more attributes of the particular instance of the base data structure holds data from which values of the first one or more attributes of the RDF user-defined data type are generated; evaluating the first query, to generate a result for the first query, comprising: retrieving data for the second one or more attributes for said particular instance of the base data structure, generating, as part of the result, a representation of an instance of the RDF user-defined data type that includes a particular value that is generated from the data for the second one or more attributes of the particular instance of the base data structure; and wherein the method is performed by one or more computing devices.