public Quad(final Node subject, final Node predicate, final Node object, final String graph) { super(); put("subject", subject); put("predicate", predicate); put("object", object); if (graph != null && !"@default".equals(graph)) { // TODO: i'm not yet sure if this should be added or if the // graph should only be represented by the keys in the dataset put("name", graph.startsWith("_:") ? new BlankNode(graph) : new IRI(graph)); } }
public Quad(final Node subject, final Node predicate, final Node object, final String graph) { super(); put("subject", subject); put("predicate", predicate); put("object", object); if (graph != null && !"@default".equals(graph)) { // TODO: i'm not yet sure if this should be added or if the // graph should only be represented by the keys in the dataset put("name", graph.startsWith("_:") ? new BlankNode(graph) : new IRI(graph)); } }
public Quad(final Node subject, final Node predicate, final Node object, final String graph) { super(); put("subject", subject); put("predicate", predicate); put("object", object); if (graph != null && !"@default".equals(graph)) { // TODO: i'm not yet sure if this should be added or if the // graph should only be represented by the keys in the dataset put("name", graph.startsWith("_:") ? new BlankNode(graph) : new IRI(graph)); } }
@Test public void compareToSame() throws Exception { final Quad q2 = new Quad("http://example.com/s1", "http://example.com/p1", "http://example.com/o1", "http://example.com/g1"); assertEquals(0, q.compareTo(q2)); // Should still compare equal, even if extra attributes are added q2.put("example", "value"); assertEquals(0, q.compareTo(q2)); }