Examples of BNode


Examples of org.openrdf.model.BNode

    Resource subj1 = st1.getSubject();
    Resource subj2 = st2.getSubject();

    if (subj1 instanceof BNode && subj2 instanceof BNode) {
      BNode mappedBNode = bNodeMapping.get(subj1);

      if (mappedBNode != null) {
        // bNode 'subj1' was already mapped to some other bNode
        if (!subj2.equals(mappedBNode)) {
          // 'subj1' and 'subj2' do not match
          return false;
        }
      }
      else {
        // 'subj1' was not yet mapped. we need to check if 'subj2' is a
        // possible mapping candidate
        if (bNodeMapping.containsValue(subj2)) {
          // 'subj2' is already mapped to some other value.
          return false;
        }
      }
    }
    else {
      // subjects are not (both) bNodes
      if (!subj1.equals(subj2)) {
        return false;
      }
    }

    Value obj1 = st1.getObject();
    Value obj2 = st2.getObject();

    if (obj1 instanceof BNode && obj2 instanceof BNode) {
      BNode mappedBNode = bNodeMapping.get(obj1);

      if (mappedBNode != null) {
        // bNode 'obj1' was already mapped to some other bNode
        if (!obj2.equals(mappedBNode)) {
          // 'obj1' and 'obj2' do not match
View Full Code Here

Examples of org.openrdf.model.BNode

    if (value instanceof URI) {
      URI uri = (URI)value;
      writeAttribute(RDF.NAMESPACE, "about", relativize(uri.stringValue()));
    }
    else {
      BNode bNode = (BNode)value;
      writeAttribute(RDF.NAMESPACE, "nodeID", bNode.getID());
    }
  }
View Full Code Here

Examples of org.openrdf.model.BNode

      if (objRes instanceof URI) {
        URI uri = (URI)objRes;
        writeAttribute(RDF.NAMESPACE, "resource", relativize(uri.stringValue()));
      }
      else {
        BNode bNode = (BNode)objRes;
        writeAttribute(RDF.NAMESPACE, "nodeID", bNode.getID());
      }

      writeEndOfEmptyTag();
    }
    else if (obj instanceof Literal) {
View Full Code Here

Examples of org.openrdf.model.BNode

      // Empty list
      read();
      return RDF.NIL;
    }
    else {
      BNode listRoot = createBNode();

      // Remember current subject and predicate
      Resource oldSubject = subject;
      URI oldPredicate = predicate;

      // generated bNode becomes subject, predicate becomes rdf:first
      subject = listRoot;
      predicate = RDF.FIRST;

      parseObject();

      BNode bNode = listRoot;

      while (skipWSC() != ')') {
        // Create another list node and link it to the previous
        BNode newNode = createBNode();
        reportStatement(bNode, RDF.REST, newNode);

        // New node becomes the current
        subject = bNode = newNode;
View Full Code Here

Examples of org.openrdf.model.BNode

  protected Resource parseImplicitBlank()
    throws IOException, RDFParseException, RDFHandlerException
  {
    verifyCharacter(read(), "[");

    BNode bNode = createBNode();

    int c = read();
    if (c != ']') {
      unread(c);
View Full Code Here

Examples of org.openrdf.model.BNode

  public BNode createBNode() {
    if (queue == null) {
      throw new UnsupportedOperationException();
    }
    synchronized (queue) {
      BNode bnode = queue.poll();
      if (bnode != null) {
        return bnode;
      }
      try {
        return loadBNodes();
View Full Code Here

Examples of org.openrdf.model.BNode

  }

  private BNode loadBNodes()
    throws StoreException, QueryResultParseException, NoCompatibleMediaType
  {
    BNode bnode;
    TupleResult result = client.post(amount *= 2);
    try {
      if (!result.hasNext()) {
        throw new StoreException("No BNodes");
      }
View Full Code Here

Examples of org.openrdf.model.BNode

    return memBNode;
  }

  @Override
  public synchronized BNode createBNode(String nodeID) {
    BNode tempBNode = new BNodeImpl(nodeID);
    MemBNode memBNode = getMemBNode(tempBNode);

    if (memBNode == null) {
      memBNode = createMemBNode(tempBNode);
    }
View Full Code Here

Examples of org.openrdf.model.BNode

  public RdbmsBNode createBNode(String nodeID) {
    RdbmsBNode resource = bnodes.findInCache(nodeID);
    if (resource == null) {
      try {
        BNode impl = vf.createBNode(nodeID);
        resource = new RdbmsBNode(impl);
        bnodes.cache(resource);
      }
      catch (InterruptedException e) {
        throw new RdbmsRuntimeException(e);
View Full Code Here

Examples of org.openrdf.model.BNode

    if (value instanceof URI) {
      URI uri = (URI)value;
      xmlWriter.textElement(URI_TAG, uri.toString());
    }
    else if (value instanceof BNode) {
      BNode bNode = (BNode)value;
      xmlWriter.textElement(BNODE_TAG, bNode.getID());
    }
    else if (value instanceof Literal) {
      Literal literal = (Literal)value;
      URI datatype = literal.getDatatype();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.