marklogic-jena/src/main/java/com/marklogic/semantics/jena/MarkLogicDatasetGraph.java
public static SPARQLQueryDefinition bindObject(SPARQLQueryDefinition qdef,
            String variableName, Node objectNode) {
        SPARQLBindings bindings = qdef.getBindings();
        if (objectNode.isURI()) {
            bindings.bind(variableName, objectNode.getURI());
        } else if (objectNode.isLiteral()) {
            if (! "".equals(objectNode.getLiteralLanguage())) {
              String languageTag = objectNode.getLiteralLanguage();
              bindings.bind(variableName, objectNode.getLiteralLexicalForm(),
                      Locale.forLanguageTag(languageTag));
            } else if (objectNode.getLiteralDatatype() != null) {
                try {
                    String xsdType = objectNode.getLiteralDatatypeURI();
                    String fragment = new URI(xsdType).getFragment();
                    bindings.bind(variableName,
                            objectNode.getLiteralLexicalForm(),
                            RDFTypes.valueOf(fragment.toUpperCase()));
                } catch (URISyntaxException e) {
                    throw new MarkLogicJenaException(
                            "Unrecognized binding type.  Use XSD only.", e);
                }
            } else {
                // is this a hole, no type string?
                bindings.bind(variableName, objectNode.getLiteralLexicalForm(),
                        RDFTypes.STRING);
            }
        }
        qdef.setBindings(bindings);
        return qdef;
    }
public static SPARQLQueryDefinition bindObject(SPARQLQueryDefinition qdef,
            String variableName, Node objectNode) {
        SPARQLBindings bindings = qdef.getBindings();
        if (objectNode.isURI()) {
            bindings.bind(variableName, objectNode.getURI());
        } else if (objectNode.isLiteral()) {
            if (! "".equals(objectNode.getLiteralLanguage())) {
              String languageTag = objectNode.getLiteralLanguage();
              bindings.bind(variableName, objectNode.getLiteralLexicalForm(),
                      Locale.forLanguageTag(languageTag));
            } else if (objectNode.getLiteralDatatype() != null) {
                try {
                    String xsdType = objectNode.getLiteralDatatypeURI();
                    String fragment = new URI(xsdType).getFragment();
                    bindings.bind(variableName,
                            objectNode.getLiteralLexicalForm(),
                            RDFTypes.valueOf(fragment.toUpperCase()));
                } catch (URISyntaxException e) {
                    throw new MarkLogicJenaException(
                            "Unrecognized binding type.  Use XSD only.", e);
                }
            } else {
                // is this a hole, no type string?
                bindings.bind(variableName, objectNode.getLiteralLexicalForm(),
                        RDFTypes.STRING);
            }
        }
        qdef.setBindings(bindings);
        return qdef;
    }
Maps Jena bindings defined by a variable name and a
{@link org.apache.jena.graph.Node} to MarkLogic
{@link com.marklogic.client.semantics.SPARQLQueryDefinition} bindings.

@param qdef
A {@link com.marklogic.client.semantics.SPARQLQueryDefinition}
to decorate with a binding.
@param variableName
Name of the variable
@param objectNode
An RDF node with the value of variableName.
@return The query definition, with binding set.