<commit_before>package com.github.jsonldjava.core;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;

import org.junit.Test;

import com.github.jsonldjava.core.RDFDataset.IRI;
import com.github.jsonldjava.core.RDFDataset.BlankNode;
import com.github.jsonldjava.core.RDFDataset.Literal;
import com.github.jsonldjava.core.RDFDataset.Node;
import com.github.jsonldjava.core.RDFDataset.Quad;

import junit.framework.Assert;

public class NodeCompareTest {

    @Test
    public void ordered() throws Exception {
        List<Node> expected = Arrays.asList(
                // While this order might not particularly make sense, it
                // is at least documented
                
                new Literal("1", JsonLdConsts.XSD_INTEGER, null),
                new Literal("10", JsonLdConsts.XSD_INTEGER, null),
                new Literal("2", JsonLdConsts.XSD_INTEGER, null), // still ordered by string value
                
                new Literal("a", JsonLdConsts.RDF_LANGSTRING, "en"), 
                new Literal("a", JsonLdConsts.RDF_LANGSTRING, "fr"), 
                new Literal("a", null, null), // equivalent to xsd:string
                new Literal("b", JsonLdConsts.XSD_STRING, null),
                new Literal("false", JsonLdConsts.XSD_BOOLEAN, null),
                new Literal("true", JsonLdConsts.XSD_BOOLEAN, null),

                new Literal("x", JsonLdConsts.XSD_STRING, null),

                new Literal("z", JsonLdConsts.RDF_LANGSTRING, "en"),
                new Literal("z", JsonLdConsts.RDF_LANGSTRING, "fr"),                
                new Literal("z", null, null),

                new BlankNode("a"),
                new BlankNode("f"),
                new BlankNode("z"),

                new IRI("http://example.com/ex1"),
                new IRI("http://example.com/ex2"),<commit_msg>Comment about ordering not being important.<commit_after>package com.github.jsonldjava.core;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;

import org.junit.Test;

import com.github.jsonldjava.core.RDFDataset.BlankNode;
import com.github.jsonldjava.core.RDFDataset.IRI;
import com.github.jsonldjava.core.RDFDataset.Literal;
import com.github.jsonldjava.core.RDFDataset.Node;
import com.github.jsonldjava.core.RDFDataset.Quad;

public class NodeCompareTest {

    /**
     * While this order might not particularly make sense (RDF is unordered),
     * this is at least documented. Feel free to move things around below if the
     * underlying .compareTo() changes.
     */
    @Test
    public void ordered() throws Exception {
        List<Node> expected = Arrays.asList(

                new Literal("1", JsonLdConsts.XSD_INTEGER, null),
                new Literal("10", JsonLdConsts.XSD_INTEGER, null),
                new Literal("2", JsonLdConsts.XSD_INTEGER, null), // still ordered by string value
                
                new Literal("a", JsonLdConsts.RDF_LANGSTRING, "en"), 
                new Literal("a", JsonLdConsts.RDF_LANGSTRING, "fr"), 
                new Literal("a", null, null), // equivalent to xsd:string
                new Literal("b", JsonLdConsts.XSD_STRING, null),
                new Literal("false", JsonLdConsts.XSD_BOOLEAN, null),
                new Literal("true", JsonLdConsts.XSD_BOOLEAN, null),

                new Literal("x", JsonLdConsts.XSD_STRING, null),

                new Literal("z", JsonLdConsts.RDF_LANGSTRING, "en"),
                new Literal("z", JsonLdConsts.RDF_LANGSTRING, "fr"),                
                new Literal("z", null, null),

                new BlankNode("a"),
                new BlankNode("f"),
                new BlankNode("z"),

                new IRI("http://example.com/ex1"),
                new IRI("http://example.com/ex2"),
{'fraction_non_alphanumeric': 0.11527093596059114, 'fraction_numerical': 0.002955665024630542, 'mean_word_length': 2.3645401822700913, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4441541', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1218, 'n_words': 268}