@Override public Stream<BlankNodeOrIRI> getGraphNames() { return rdfDataSet.graphNames().parallelStream().filter(Predicate.isEqual("@default").negate()) .map(s -> s.startsWith("_:") ? new RDFDataset.BlankNode(s) : new RDFDataset.IRI(s)) .map(n -> (BlankNodeOrIRI) factory.asRDFTerm(n)); }
@Override public JsonLdBlankNode createBlankNode() { final String id = "_:" + UUID.randomUUID().toString(); return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix); }
public Quad(final String subject, final String predicate, final String object, final String graph) { this(subject, predicate, object.startsWith("_:") ? new BlankNode(object) : new IRI( object), graph); };
subject = new RDFDataset.IRI(unescape(match.group(1))); } else { subject = new RDFDataset.BlankNode(unescape(match.group(2))); object = new RDFDataset.IRI(unescape(match.group(4))); } else if (match.group(5) != null) { object = new RDFDataset.BlankNode(unescape(match.group(5))); } else { final String language = unescape(match.group(8));
return new BlankNode(id); } else { return new IRI(id);
subject = new RDFDataset.IRI(unescape(match.group(1))); } else { subject = new RDFDataset.BlankNode(unescape(match.group(2))); object = new RDFDataset.IRI(unescape(match.group(4))); } else if (match.group(5) != null) { object = new RDFDataset.BlankNode(unescape(match.group(5))); } else { final String language = unescape(match.group(8));
return new BlankNode(id); } else { return new IRI(id);
object = new RDFDataset.IRI(sObject); }else{ object = new RDFDataset.BlankNode(sObject); object = new RDFDataset.IRI(value); }else{ object = new RDFDataset.BlankNode(value); sObject = arr.getString(i); object = new RDFDataset.BlankNode(RDFDatasetUtils.unescape(sObject));
return new RDFDataset.BlankNode(ref.replace(bnodePrefix, "")); return new RDFDataset.BlankNode("_:" + uuid);
@Override public JsonLdBlankNode createBlankNode(final String name) { final String id = "_:" + name; // TODO: Check if name is valid JSON-LD BlankNode identifier return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix); }
private Quad(final String subject, final String predicate, final Node object, final String graph) { this(subject.startsWith("_:") ? new BlankNode(subject) : new IRI(subject), new IRI(predicate), object, graph); };
private Quad(final String subject, final String predicate, final Node object, final String graph) { this(subject.startsWith("_:") ? new BlankNode(subject) : new IRI(subject), new IRI(predicate), object, graph); };
public Quad(final String subject, final String predicate, final String object, final String graph) { this(subject, predicate, object.startsWith("_:") ? new BlankNode(object) : new IRI(object), graph); };
@Test public void iriDifferentBlankNode() throws Exception { // We'll use a relative IRI to avoid :-issues final Node iri = new IRI("b1"); final Node bnode = new BlankNode("b1"); assertNotEquals(iri, bnode); assertNotEquals(bnode, iri); assertNotEquals(0, iri.compareTo(bnode)); assertNotEquals(0, bnode.compareTo(iri)); }
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 String subject, final String predicate, final String object, final String graph) { this(subject, predicate, object.startsWith("_:") ? new BlankNode(object) : new IRI(object), 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)); } }
private Quad(final String subject, final String predicate, final Node object, final String graph) { this(subject.startsWith("_:") ? new BlankNode(subject) : new IRI(subject), new IRI( predicate), object, 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 literalDifferentBlankNode() throws Exception { // We'll use a relative IRI to avoid :-issues final Node literal = new Literal("b1", null, null); final Node bnode = new BlankNode("b1"); assertNotEquals(literal, bnode); assertNotEquals(bnode, literal); assertNotEquals(0, literal.compareTo(bnode)); assertNotEquals(0, bnode.compareTo(literal)); }