Example usage for org.apache.commons.rdf.api BlankNode uniqueReference

List of usage examples for org.apache.commons.rdf.api BlankNode uniqueReference

Introduction

In this page you can find the example usage for org.apache.commons.rdf.api BlankNode uniqueReference.

Prototype

String uniqueReference();

Source Link

Document

Return a reference for uniquely identifying the blank node.

Usage

From source file:example.UserGuideTest.java

@Test
public void blanknode() throws Exception {
    BlankNode bnode = factory.createBlankNode();
    System.out.println(bnode.equals(bnode));
    System.out.println(bnode.equals(factory.createBlankNode()));

    BlankNode b1 = factory.createBlankNode("b1");

    System.out.println(b1.ntriplesString());

    System.out.println(b1.equals(factory.createBlankNode("b1")));
    System.out.println(b1.equals(new SimpleRDFTermFactory().createBlankNode("b1")));

    System.out.println(bnode.uniqueReference());
}

From source file:org.apache.jena.commonsrdf.impl.JCR_BlankNode.java

@Override
public boolean equals(Object other) {
    if (other == this)
        return true;
    if (other == null)
        return false;
    if (!(other instanceof BlankNode))
        return false;
    BlankNode bNode = (BlankNode) other;
    return uniqueReference().equals(bNode.uniqueReference());
}

From source file:org.semanticweb.owlapi.io.RDFResourceBlankNode.java

@Override
public boolean equals(@Nullable Object obj) {
    if (obj == this) {
        return true;
    }//from w ww .  jav a  2 s. c o m
    if (obj instanceof RDFResourceBlankNode) {
        RDFResourceBlankNode other = (RDFResourceBlankNode) obj;
        return resource.equals(other.resource);
    }
    // Commons RDF BlankNode.equals() contract
    if (obj instanceof BlankNode) {
        BlankNode blankNode = (BlankNode) obj;
        return uniqueReference().equals(blankNode.uniqueReference());
    }
    return false;
}