public static void reset() { shortName2LongName.clear(); providers.clear(); } }
private void validateVersionNotInUse(Version version) { if ( idToVersion.inverse().containsKey(version) ) // Internal consistency error. FleStore was supposed to make it unique. throw new InternalErrorException("Version already in-use: "+version); }
NodeIdType type = derivedTypeMap.inverse().getOrDefault(lit.getDatatype(), NodeIdType.XSD_INTEGER);
@Override public Version find(Id id) { Version x = idToVersion.get(id); if ( x == null ) return Version.UNSET; return x; }
public static void registerShortName(String shortName, String providerName) { shortName2LongName.put(shortName, providerName); }
@Override public boolean contains(Id patchId) { return idToVersion.containsKey(patchId) ; }
RDFDatatype dt = derivedTypeMap.getOrDefault(type, XSDDatatype.XSDinteger); Node n = NodeFactory.createLiteral(Long.toString(val), dt); return n;
/** Short name to full provider name. * A return of null means "don't know". */ public static String shortName2LongName(String shortName) { if ( shortName == null ) return null; return shortName2LongName.get(shortName); }
idToVersion.put(id, ver); latestId = id; latestVersion = ver;
@Override public RDFPatch fetch(Id patchId) { Version version = idToVersion.get(patchId); if ( version == null ) return null; return fetch(version) ; }
idToVersion.put(patchId, version); headers.put(patchId, patch.header()); latestId = patchId;
@Override public Stream<RDFPatch> range(Id start, Id finish) { Version startVersion = idToVersion.get(start); Version finishVersion = idToVersion.get(finish); if ( startVersion == null ) {} if ( finishVersion == null ) {} // Isolation not necessary. Patch files are immutable once written. return LongStream .rangeClosed(startVersion.value(), finishVersion.value()) .mapToObj(v->fetch(fileStore, v)); }