protected Key valueToKey ( Value value ) { if ( value instanceof Resource ) { return pFactory . newKey ( convertResourceToQualifiedName ( ( Resource ) value ) , name . PROV_QUALIFIED_NAME ) ; } else if ( value instanceof Literal ) { Literal lit = ( Literal ) value ; QualifiedName type ; QualifiedName xsdtype ; if ( lit . getDatatype ( ) != null ) { xsdtype = convertURIToQualifiedName ( lit . getDatatype ( ) ) ; } else { xsdtype = name . PROV_LANG_STRING ; } Object o = decodeLiteral ( lit ) ; if ( o instanceof QualifiedName ) { return pFactory . newKey ( o , name . PROV_QUALIFIED_NAME ) ; } // Was old code, relying on converter //return pFactory.newKey(o, this.valueConverter.getXsdType(o)); return pFactory . newKey ( o , xsdtype ) ; } else if ( value instanceof URI ) { URI uri = ( URI ) ( value ) ; return pFactory . newKey ( uri . toString ( ) , name . PROV_QUALIFIED_NAME ) ; } else if ( value instanceof BNode ) { return pFactory . newKey ( bnodeToQualifiedName ( ( BNode ) value ) , name . PROV_QUALIFIED_NAME ) ; } else { return null ; } }
code replicated from valueToObject