// Path: core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java
// public static final String RDF_LANGSTRING = RDF_SYNTAX_NS + "langString";
// 
// Path: core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java
// public static final String XSD_STRING = XSD_NS + "string";
// 
// Path: core/src/main/java/com/github/jsonldjava/core/Regex.java
// final public static Pattern HEX = Pattern.compile("[0-9A-Fa-f]");


import static com.github.jsonldjava.core.JsonLdConsts.RDF_LANGSTRING;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_STRING;
import static com.github.jsonldjava.core.Regex.HEX;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
            if (RDF_LANGSTRING.equals(o.getDatatype())) {
                output.append("@").append(o.getLanguage());
            } else if (!XSD_STRING.equals(o.getDatatype())) {
                output.append("^^<");
                escape(o.getDatatype(), output);
                output.append(">");
            }
        }

        // graph
        if (graphName != null) {
            if (graphName.indexOf("_:") != 0) {
                output.append(" <");
                escape(graphName, output);
                output.append(">");
            } else if (bnode != null) {
                output.append(" _:g");
            } else {
                output.append(" ").append(graphName);
            }
        }

        output.append(" .\n");
    }

    static String toNQuad(RDFDataset.Quad triple, String graphName) {
        return toNQuad(triple, graphName, null);
    }

    final private static Pattern UCHAR_MATCHED = Pattern
// Path: core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java
// public static final String RDF_LANGSTRING = RDF_SYNTAX_NS + "langString";
// 
// Path: core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java
// public static final String XSD_STRING = XSD_NS + "string";
// 
// Path: core/src/main/java/com/github/jsonldjava/core/Regex.java
// final public static Pattern HEX = Pattern.compile("[0-9A-Fa-f]");


// Path: core/src/main/java/com/github/jsonldjava/core/RDFDatasetUtils.java
import static com.github.jsonldjava.core.JsonLdConsts.RDF_LANGSTRING;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_STRING;
import static com.github.jsonldjava.core.Regex.HEX;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

            if (RDF_LANGSTRING.equals(o.getDatatype())) {
                output.append("@").append(o.getLanguage());
            } else if (!XSD_STRING.equals(o.getDatatype())) {
                output.append("^^<");
                escape(o.getDatatype(), output);
                output.append(">");
            }
        }

        // graph
        if (graphName != null) {
            if (graphName.indexOf("_:") != 0) {
                output.append(" <");
                escape(graphName, output);
                output.append(">");
            } else if (bnode != null) {
                output.append(" _:g");
            } else {
                output.append(" ").append(graphName);
            }
        }

        output.append(" .\n");
    }

    static String toNQuad(RDFDataset.Quad triple, String graphName) {
        return toNQuad(triple, graphName, null);
    }

    final private static Pattern UCHAR_MATCHED = Pattern
            .compile("\\u005C(?:([tbnrf\\\"'])|(?:u(" + HEX + "{4}))|(?:U(" + HEX + "{8})))");