Oxygenase that can act as both a histone lysine demethylase and a ribosomal histidine hydroxylase. Specifically demethylates 'Lys-4' (H3K4me) and 'Lys-36' (H3K36me) of histone H3, thereby playing a central role in histone code. Preferentially demethylates trimethylated H3 'Lys-4' (H3K4me3) and monomethylated H3 'Lys-4' (H3K4me1) residues, while it has weaker activity for dimethylated H3 'Lys-36' (H3K36me2). Also catalyzes the hydroxylation of 60S ribosomal protein L8 on 'His-216'. Acts as a regulator of osteoblast differentiation via its interaction with SP7/OSX by demethylating H3K4me and H3K36me, thereby inhibiting SP7/OSX-mediated promoter activation (By similarity). May also play a role in ribosome biogenesis and in the replication or remodeling of certain heterochromatic region. Participates in MYC-induced transcriptional activation.