@Override public boolean equals(Object o) { if (o == null || (!(o instanceof StatementWrapper))) return false; StatementWrapper w = (StatementWrapper)o; return wrapHash == w.wrapHash && statement.contextualEquals(AnonResource.this,w.statement,w.asAnonR()); } @Override public int hashCode() {
boolean contextualEquals(AnonResource v,AnonStatement sB,AnonResource vB) { int vX = varPos(v); if ( vX != sB.varPos(vB) ) return false; return ((vX & S) != 0 || subj.mightBeEqual(sB.subj)) && ((vX & P) != 0 || pred.mightBeEqual(sB.pred)) && ((vX & O) != 0 || obj.mightBeEqual(sB.obj)); } }
private boolean isPlainLiteralSameValueAsOther( LiteralLabel other ) { return other.getDatatype() == null || looksLikePlainString( other ) ? sameByFormAndLanguage( other ) : false; }
/** Answer a transaction handler bound to this graph. The default is SimpleTransactionHandler, which handles <i>no</i> transactions. */ public TransactionHandler getTransactionHandler() { return new SimpleTransactionHandler(); }
/** Answer the event manager for this graph; allocate a new one if required. Subclasses may override if they have a more specialised event handler. The default is a SimpleEventManager. */ @Override public GraphEventManager getEventManager() { if (gem == null) gem = new SimpleEventManager( this ); return gem; }
/** Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable). */ public Capabilities getCapabilities() { if (capabilities == null) capabilities = new AllCapabilities(); return capabilities; }
/** Need to support comparison of ill-formed literals in order for the WG tests on ill formed literals to be testable using isIsomorphic to. "same value as" on ill-formed literals is defined to mean "same lexical form and same [ignoring case] language code". <p> precondition: at least one of <i>this</i> and <i>other</i> is ill-formed. */ private boolean areIllFormedLiteralsSameValueAs( LiteralLabel other ) { return !other.isWellFormedRaw() && sameByFormAndLanguage( other ); }
/** Answer <code>true</code> iff <code>t</code> is in the graph as revealed by <code>find(t)</code> being non-empty. <code>t</code> may contain ANY wildcards. Sub-classes may over-ride reifierContains and graphBaseContains for efficiency. */ @Override public final boolean contains( Triple t ) { checkOpen(); return graphBaseContains( t ); }
/** Answer the size of this graph (ie the number of exposed triples). Defined as the size of the triple store plus the size of the reification store. Subclasses must override graphBaseSize() to reimplement (and reifierSize if they have some special reason for redefined that). */ @Override public final int size() { checkOpen() ; return graphBaseSize() ; }
boolean bind(AnonResource mine,Bucket other,AnonResource binding) { if ( mine.checkBinding(binding) ) { mine.bind(binding); return true; } else { return false; } }
public SimpleBulkUpdateHandler( GraphWithPerform graph ) { this.graph = graph; this.manager = graph.getEventManager(); }
/** Answer the PrefixMapping object for this graph, the same one each time. */ @Override public PrefixMapping getPrefixMapping() { if ( pm == null ) pm = createPrefixMapping() ; return pm; }
@Override public boolean accept(Triple t) { return tripleContained(tMatch, t) ; }
/** Default implementation of getHashCode() delegates to the default from the literal label. */ @Override public int getHashCode( LiteralLabel lit ) { return lit.getDefaultHashcode(); }
/** * Build a typed literal label from its value form. If the value is a string we * assume this is inteded to be a lexical form after all. * * @param value the value of the literal * @param lang the optional language tag, only relevant for plain literals * @param dtype the type of the literal, null for old style "plain" literals */ public static LiteralLabel create(Object value, String lang, RDFDatatype dtype) throws DatatypeFormatException { return new LiteralLabelImpl(value, lang, dtype) ; }
/** Answer a new, anonynous FileGraph. See FileGraph.create(). @return a new anonymous FileGraph */ @Override public Graph createGraph() { return FileGraph.create(); }
/** Answer a transaction handler bound to this graph. The default is SimpleTransactionHandler, which handles <i>no</i> transactions. */ @Override public TransactionHandler getTransactionHandler() { return new SimpleTransactionHandler(); }
@Override public GraphEventManager getEventManager() { if (eventManager == null) { eventManager = new SimpleEventManager(this); } return eventManager; }
/** Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable). */ @Override public Capabilities getCapabilities() { if (capabilities == null) capabilities = new AllCapabilities(); return capabilities; }