@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)); }
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 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))); final RDFDataset.Node predicate = new RDFDataset.IRI(unescape(match.group(3))); object = new RDFDataset.IRI(unescape(match.group(4))); } else if (match.group(5) != null) { object = new RDFDataset.BlankNode(unescape(match.group(5)));
return new IRI(id);
object = new RDFDataset.IRI(sObject); }else{ object = new RDFDataset.BlankNode(sObject); String value = RDFDatasetUtils.unescape(obj.getString("rdf:about")); if(JsonLdUtils.isAbsoluteIri(value)){ object = new RDFDataset.IRI(value); }else{ object = new RDFDataset.BlankNode(value);
return new RDFDataset.IRI(((IRI) term).getIRIString());
JsonLdIRIImpl(final String iri) { super(new RDFDataset.IRI(iri)); }
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 iriDifferentLiteral() throws Exception { final Node iri = new IRI("http://example.com/"); final Node literal = new Literal("http://example.com/", null, null); assertNotEquals(iri, literal); assertNotEquals(0, iri.compareTo(literal)); assertNotEquals(0, literal.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)); } }
@Test public void iriDifferentNull() throws Exception { final Node iri = new IRI("http://example.com/"); assertNotEquals(0, iri.compareTo(null)); }
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 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)); } }