private BNode bnode(String id) { return new BNodeImpl(id); }
@Override public String getID() { if (!_has_data) { load(); } return super.getID(); }
/** * Creates a new blank node with the supplied identifier. * * @param id * The identifier for this blank node, must not be <tt>null</tt>. */ public BNodeImpl(String id) { this(); setID(id); }
@Override public String stringValue() { if (!_has_data) { load(); } return super.stringValue(); }
@Override public boolean equals(final Object object) { if (this == object) { return true; } if (!(object instanceof BNode)) { return false; } if (object instanceof NativeCumulusBNode && !Arrays.equals(_internalID, INativeCumulusValue.UNKNOWN_ID)) { NativeCumulusBNode other = (NativeCumulusBNode) object; if (!Arrays.equals(other._internalID, INativeCumulusValue.UNKNOWN_ID)) { return Arrays.equals(_internalID, other._internalID); } } // this should not happen -> _internalID should be used only! if (!_has_data) { load(); } return super.equals(object); }
@Override public String stringValue() { if (!_has_data) { load(); } return super.stringValue(); }
@Override public boolean equals(final Object object) { if (this == object) { return true; } if (!(object instanceof BNode)) { return false; } if (object instanceof NativeCumulusBNode && !Arrays.equals(_internalID, INativeCumulusValue.UNKNOWN_ID)) { NativeCumulusBNode other = (NativeCumulusBNode) object; if (!Arrays.equals(other._internalID, INativeCumulusValue.UNKNOWN_ID)) { return Arrays.equals(_internalID, other._internalID); } } // this should not happen -> _internalID should be used only! if (!_has_data) { load(); } return super.equals(object); }
public BNode createBNode(String nodeID) { return new BNodeImpl(nodeID); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof BNode) { BNode otherNode = (BNode)o; return this.getID().equals(otherNode.getID()); } return false; }
/** * Loads data associated with this blank node. */ private synchronized void load() { if (_has_data) { return; } // load data ... try { final BNode bnode = (BNode) _dict.getValue(_internalID, false); super.setID(bnode.getID()); } catch (final Exception exception) { _log.error(MessageCatalog._00075_COULDNT_LOAD_NODE, exception, Arrays.toString(_internalID)); super.setID("cumulus/internal/" + Arrays.toString(_internalID)); } _has_data = true; }
public BNode createBNode() { return new BNodeImpl(BNODE_PREFIX + _lastBNodeId++); }
public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof BNode) { BNode otherNode = (BNode)o; return this.getID().equals(otherNode.getID()); } return false; }
/** * Loads data associated with this blank node. */ private synchronized void load() { if (_has_data) { return; } // load data ... try { final BNode bnode = (BNode) _dict.getValue(_internalID, false); super.setID(bnode.getID()); } catch (final Exception exception) { _log.error(MessageCatalog._00075_COULDNT_LOAD_NODE, exception, Arrays.toString(_internalID)); super.setID("cumulus/internal/" + Arrays.toString(_internalID)); } _has_data = true; }
public BNode createBNode(String nodeId) { return new BNodeImpl(nodeId); }
@Override public String getID() { if (!_has_data) { load(); } return super.getID(); }
/** * Parses a string representing a blank node URI (i.e. <tt>_:node1</tt>) and * creates a BNode object for it. **/ protected BNode _parseBNode(String bnode) throws ParseException { return new BNodeImpl( bnode.substring(2) ); }
/** * Compares this BNode with the supplied object. * * @throws ClassCastException if o is not of type BNode * @see java.lang.Comparable */ public int compareTo(Object other) { if (this == other) { return 0; } if (other instanceof BNode) { return this.getID().compareTo( ((BNode)other).getID() ); } else if (other instanceof URI) { // BNode > URI return 1; } else { // BNode < Literal return -1; } }
public BNode createBNode() { return new BNodeImpl(Constants.BNODE_PREFIX + (UUID.randomUUID().toString())); }
private Map<String, BNode> getBNodeMap() { Map<String, BNode> bNodeMap = new HashMap<>(); for(String name: bNodeNames) { bNodeMap.put(name, new BNodeImpl(UUID.randomUUID().toString())); } return bNodeMap; }
public BNode createBNode(String id) { id=new String(id);//new StringBuffer().append(id).toString(); BNode result = bNodes.get(id); if (result == null) { bcacheMiss++; if (id.startsWith("node")) { result = new BNodeImpl(id); } else { result = new BNodeImpl(Constants.BNODE_PREFIX + id.replaceAll(":", "_").replaceAll("\\-", "_")); } bNodes.put(id, result); } else { bcacheHit++; } return result; }