diff --git a/packages/locorda/example/minimal/macos/Podfile.lock b/packages/locorda/example/minimal/macos/Podfile.lock index 3e74fd91..0a5fc2c3 100644 --- a/packages/locorda/example/minimal/macos/Podfile.lock +++ b/packages/locorda/example/minimal/macos/Podfile.lock @@ -1,62 +1,15 @@ PODS: - - file_picker (0.0.1): - - FlutterMacOS - FlutterMacOS (1.0.0) - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - - sqlite3 (3.51.1): - - sqlite3/common (= 3.51.1) - - sqlite3/common (3.51.1) - - sqlite3/dbstatvtab (3.51.1): - - sqlite3/common - - sqlite3/fts5 (3.51.1): - - sqlite3/common - - sqlite3/math (3.51.1): - - sqlite3/common - - sqlite3/perf-threadsafe (3.51.1): - - sqlite3/common - - sqlite3/rtree (3.51.1): - - sqlite3/common - - sqlite3/session (3.51.1): - - sqlite3/common - - sqlite3_flutter_libs (0.0.1): - - Flutter - - FlutterMacOS - - sqlite3 (~> 3.51.1) - - sqlite3/dbstatvtab - - sqlite3/fts5 - - sqlite3/math - - sqlite3/perf-threadsafe - - sqlite3/rtree - - sqlite3/session DEPENDENCIES: - - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`) - -SPEC REPOS: - trunk: - - sqlite3 EXTERNAL SOURCES: - file_picker: - :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos FlutterMacOS: :path: Flutter/ephemeral - shared_preferences_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin - sqlite3_flutter_libs: - :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin SPEC CHECKSUMS: - file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 - shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb - sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b - sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41 PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 diff --git a/packages/locorda/example/minimal/macos/Runner.xcodeproj/project.pbxproj b/packages/locorda/example/minimal/macos/Runner.xcodeproj/project.pbxproj index 7173de98..e34e867a 100644 --- a/packages/locorda/example/minimal/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/locorda/example/minimal/macos/Runner.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 44B30CF9AE704D8658E73FEE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3564F0B778F918BB4F77149 /* Pods_Runner.framework */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; CB0D9823842D3680C7E00CB7 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7130B0473F85BDB8335B3CE8 /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ @@ -79,6 +80,7 @@ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 7130B0473F85BDB8335B3CE8 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; A3564F0B778F918BB4F77149 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -103,6 +105,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 44B30CF9AE704D8658E73FEE /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -164,6 +167,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -240,7 +244,6 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 72687B7DB45054A1116C7B78 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -248,6 +251,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* minimal_task_sync.app */; productType = "com.apple.product-type.application"; @@ -292,6 +298,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -361,23 +370,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 72687B7DB45054A1116C7B78 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; CE2230059E5AE8FA5091C275 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -796,6 +788,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/packages/locorda/example/minimal/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/locorda/example/minimal/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index f132db6c..ad3fc65f 100644 --- a/packages/locorda/example/minimal/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/locorda/example/minimal/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + [] + : mergeContext.metadataGenerator.createPropertyStatement( + documentIri, + subject, + predicate, + (stmt) => [ + Triple(stmt, Crdt.vclk, vclkIri), + ], + ); + + // Garbage-collect stale vclk references on the (s, p) PropertyStatement + // and any vclk subgraphs that become unreachable as a result. + // + // PropertyStatement IRIs are content-addressed over (s, p), so a re-save + // of the same property yields an identical IRI. `_constructCrdtDocument` + // copies the old PropertyStatement subgraph via the sync:hasStatement + // traversal AND re-adds the freshly emitted node — without removing the + // old structural triples (rdf:type, sync:resource, sync:property) and the + // hasStatement edge, the resulting List document buffer would + // accumulate duplicates that trip cardinality validation in + // findSingleObject during subsequent merges. + final triplesToRemove = {}; + if (oldFrameworkGraph != null) { + final newStmtIris = subject.localSubjectIris + .map((s) => mergeContext.metadataGenerator + .propertyStatementIriFor(documentIri, s, predicate)) + .toSet(); + for (final stmtIri in newStmtIris) { + // Remove all old triples that the new emission will re-introduce, + // plus the inbound hasStatement edge. The new emission re-adds them + // via `addNodes(documentIri, sync:hasStatement, ...)`. + triplesToRemove.addAll(oldFrameworkGraph.findTriples(subject: stmtIri)); + triplesToRemove.addAll(oldFrameworkGraph.findTriples( + predicate: SyncManagedDocument.hasStatement, object: stmtIri)); + + // Vclk subgraph GC: if the OLD vclk this stmt pointed to is now + // unreferenced by any OTHER PropertyStatement, drop its subgraph too. + final staleVclks = oldFrameworkGraph + .findTriples(subject: stmtIri, predicate: Crdt.vclk) + .where((t) => t.object != vclkIri) + .toList(); + for (final stale in staleVclks) { + final staleVclkIri = stale.object; + if (staleVclkIri is! IriTerm) continue; + final otherReferences = oldFrameworkGraph + .findTriples(predicate: Crdt.vclk, object: staleVclkIri) + .where((t) => t.subject != stmtIri); + if (otherReferences.isNotEmpty) continue; + triplesToRemove.addAll( + _collectVclkSubgraphTriples(staleVclkIri, oldFrameworkGraph)); + } + } + } + + return ( + statementsToAdd: statements, + triplesToRemove: triplesToRemove, + ); } @override @@ -414,12 +521,31 @@ class LwwRegister implements CrdtType { required OrganizedGraph remote, required RemoteCrdtMergeContext mergeContext, }) { - // LWW-Register: Compare clocks to determine winner - // Per spec: Check logical time dominance first, then physical time for tie-breaking + // LWW-Register property-level resolution (issue #50): + // + // 1. Attempt per-property causality via `sync:PropertyStatement` → + // `crdt:vclk` (a content-addressed `crdt:VersionedClock` snapshot of + // the writer's HLC at save time). When PropertyStatements exist on + // BOTH sides, compare their vclks as proper vector clocks and resolve + // independently from other properties. + // 2. Fall back to the document-wide clock comparison when per-property + // snapshots are missing on either side (legacy documents, properties + // saved before this feature, or non-LWW peers). + // + // Tie-break on `ClockComparison.concurrent` uses the maximum + // `crdt:physicalTime` across the side's vclk entries when available, + // otherwise the document-level `maxPhysicalTime`. + final perPropertyComparison = + _resolvePerPropertyClockComparison(subject, predicate, local, remote); + + final (ClockComparison comparison, int localPhysical, int remotePhysical) = + perPropertyComparison ?? + ( + mergeContext.clockComparison, + local.maxPhysicalTime, + remote.maxPhysicalTime, + ); - final comparison = mergeContext.clockComparison; - - // TODO: what about augmenting the CRDT merge with the property change metadata from DB for more precise merges? final Iterable? winningTriples = switch (comparison) { ClockComparison.localDominates => subject.local != null ? local.fullGraph @@ -438,8 +564,8 @@ class LwwRegister implements CrdtType { ? remote.fullGraph .findTriples(subject: subject.remote!, predicate: predicate) : null, - local.maxPhysicalTime, - remote.maxPhysicalTime, + localPhysical, + remotePhysical, ), ClockComparison.identical => _handleIdenticalClocksTriples( subject.local, @@ -466,13 +592,266 @@ class LwwRegister implements CrdtType { .map((t) => Triple(subject.subject, predicate, t.object)) .toSet(); + final allTriples = addInlineTriples(mergedTriples, local, remote); + + // Preserve per-property causality on the merge result (proposal 028 / + // issue #50): when the winning side carried an explicit + // `sync:PropertyStatement(s,p) → crdt:vclk(V)`, re-emit that PS subgraph + // (structural triples, the vclk subgraph, and the inbound + // `sync:hasStatement` edge) on the merged document. Without this, the + // merged document would lose its per-property vclk and a subsequent peer + // re-pulling this state would fall back to document-clock comparison, + // re-triggering issue #50 (a later concurrent update to a DIFFERENT + // property would be silently dropped by the doc-level tie-break). + // + // PS IRIs are content-addressed over (documentIri, subject, predicate), + // so we can deterministically reconstruct the IRI and look up its + // subgraph in the winning side's framework graph. Absent on that side + // (PS suppression for the appBaseClock-equivalent case, or non-IRI + // subject) → emit nothing; the merged document's `appBaseClock` provides + // the same effective vclk via the resolveVclk fallback chain. + final winningGraph = _selectWinningSide( + comparison: comparison, + subject: subject, + local: local, + remote: remote, + localPhysical: localPhysical, + remotePhysical: remotePhysical, + ); + if (winningGraph != null) { + final winningSubject = + identical(winningGraph, local) ? subject.local : subject.remote; + final psTriples = _collectExplicitPropertyStatementTriples( + winningGraph.documentIri, + winningSubject, + predicate, + winningGraph.fullGraph, + mergeContext.metadataGenerator, + ); + if (psTriples.isNotEmpty) { + allTriples.addAll(psTriples); + } + } + return MergeResults( - mergedTriples: addInlineTriples(mergedTriples, local, remote), + mergedTriples: allTriples, mergedStatements: {}, ); } } +/// Determines which side's data won the per-property merge so that the +/// caller can preserve auxiliary metadata (e.g. `sync:PropertyStatement` +/// subgraphs) from that side onto the merge result. Mirrors the side +/// selection encoded in the `winningTriples` switch in +/// `LwwRegister.remoteMerge` — keep in sync. +OrganizedGraph? _selectWinningSide({ + required ClockComparison comparison, + required MergeSubject subject, + required OrganizedGraph local, + required OrganizedGraph remote, + required int localPhysical, + required int remotePhysical, +}) { + switch (comparison) { + case ClockComparison.localDominates: + return subject.local != null ? local : null; + case ClockComparison.remoteDominates: + return subject.remote != null ? remote : null; + case ClockComparison.concurrent: + if (localPhysical > remotePhysical) { + return subject.local != null ? local : null; + } else if (remotePhysical > localPhysical) { + return subject.remote != null ? remote : null; + } + // Equal physical times → local tie-break (matches + // `_physicalTimeTieBreakTriples`). + return subject.local != null + ? local + : (subject.remote != null ? remote : null); + case ClockComparison.identical: + case ClockComparison.bothEmpty: + // Values are guaranteed equal (or the merge would have thrown); either + // side's PS — if any — encodes equivalent causality. Default to local. + return subject.local != null + ? local + : (subject.remote != null ? remote : null); + } +} + +/// Collects the `sync:PropertyStatement` subgraph (structural triples + +/// `crdt:vclk` subgraph + inbound `sync:hasStatement` edge) for the +/// `(subject, predicate)` slot from [framework], or an empty set when the +/// winning side did not materialise a PS (PS suppression, blank-node +/// subject, or non-IRI predicate). +Set _collectExplicitPropertyStatementTriples( + IriTerm documentIri, + RdfSubject? subject, + RdfPredicate predicate, + RdfGraph framework, + MetadataGenerator metadataGenerator, +) { + if (subject is! IriTerm) return const {}; + if (predicate is! IriTerm) return const {}; + final psIri = metadataGenerator.propertyStatementIriFor( + documentIri, subject, predicate); + final psTriples = framework.findTriples(subject: psIri).toSet(); + if (psTriples.isEmpty) return const {}; + + final result = { + ...psTriples, + // The OR-Set merge of `sync:hasStatement` on the documentIri subject + // already picks up this IRI when it exists on either side, but emitting + // it here makes the LWW path self-contained and tolerant of merge + // orderings. + Triple(documentIri, SyncManagedDocument.hasStatement, psIri), + }; + for (final t in psTriples) { + if (t.predicate == Crdt.vclk) { + final vclkObj = t.object; + if (vclkObj is IriTerm) { + result.addAll(_collectVclkSubgraphTriples(vclkObj, framework)); + } + } + } + return result; +} + +/// Resolves a per-`(subject, predicate)` `ClockComparison` from +/// `sync:PropertyStatement → crdt:vclk` snapshots on both sides, returning +/// `null` when neither an explicit PropertyStatement NOR a document-level +/// `crdt:appBaseClock` fallback resolves on either side (forcing +/// document-wide fallback). Returns the comparison together with the max +/// physicalTime per side for concurrent tie-break. +/// +/// Resolution order per side (proposal 028 `resolveVclk` chain): +/// 1. `sync:PropertyStatement(s,p).crdt:vclk` +/// 2. ` crdt:appBaseClock ` +/// 3. fall through (caller uses document-clock comparison) +(ClockComparison, int, int)? _resolvePerPropertyClockComparison( + MergeSubject subject, + RdfPredicate predicate, + OrganizedGraph local, + OrganizedGraph remote, +) { + final localVclkIri = _resolveEffectiveVclkIri(subject.localKey, predicate, + local.documentIri, local.statements, local.fullGraph); + final remoteVclkIri = _resolveEffectiveVclkIri(subject.remoteKey, predicate, + remote.documentIri, remote.statements, remote.fullGraph); + if (localVclkIri == null || remoteVclkIri == null) return null; + + final localEntries = _resolveVclkEntries(localVclkIri, local.fullGraph); + final remoteEntries = _resolveVclkEntries(remoteVclkIri, remote.fullGraph); + if (localEntries.isEmpty || remoteEntries.isEmpty) return null; + + final logicalLocal = { + for (final e in localEntries.entries) e.key: (e.value.$1, e.value.$2) + }; + final logicalRemote = { + for (final e in remoteEntries.entries) e.key: (e.value.$1, e.value.$2) + }; + + final comparison = + ClockComparison.compareClockMaps(logicalLocal, logicalRemote); + + final localPhysical = localEntries.values + .map((e) => e.$2) + .fold(0, (a, b) => a > b ? a : b); + final remotePhysical = remoteEntries.values + .map((e) => e.$2) + .fold(0, (a, b) => a > b ? a : b); + + return (comparison, localPhysical, remotePhysical); +} + +/// Implements the proposal 028 per-side `resolveVclk` chain: +/// PropertyStatement(s,p).vclk → document.appBaseClock → null +/// +/// `appBaseClock` is a document-scoped triple; per ManagedDocument there is +/// at most one such triple, so a graph-wide `findTriples` lookup is +/// unambiguous and saves us threading the documentIri through the call +/// site. +/// +/// IMPORTANT: the `appBaseClock` fallback is APP-DATA-ONLY. Framework-data +/// predicates whose subject is the `documentIri` itself (e.g. +/// `crdt:clockHash`, `sync:managedResourceType`, `sync:isGovernedBy`, +/// `foaf:primaryTopic`) MUST NOT consult `appBaseClock` — they are never +/// PS-stamped and their merge semantics fall through to document-clock +/// comparison. Without this guard, two installations that share a common +/// `appBaseClock` would resolve identical vclks for framework predicates, +/// triggering a spurious `ClockComparison.identical` and a fatal +/// "different values for predicate" error in `_handleIdenticalClocksTriples`. +IriTerm? _resolveEffectiveVclkIri( + RdfObjectKey? subjectKey, + RdfPredicate predicate, + IriTerm documentIri, + OrganizedStatements statements, + RdfGraph fullGraph, +) { + if (subjectKey != null) { + final stmt = statements.getStatement(subjectKey, predicate, null); + if (stmt != null) { + final vclkIri = _firstVclkIri(stmt); + if (vclkIri != null) return vclkIri; + } + } + // Framework-data subjects (subject == documentIri) never participate in + // the appBaseClock fallback — see method dartdoc. + if (subjectKey is IriSubjectKey && subjectKey.iri == documentIri) { + return null; + } + return fullGraph + .findTriples(predicate: Crdt.appBaseClock) + .map((t) => t.object) + .whereType() + .firstOrNull; +} + +IriTerm? _firstVclkIri(MetadataStatement stmt) { + final objects = stmt.predicateObjectMap[Crdt.vclk]; + if (objects == null || objects.isEmpty) return null; + for (final o in objects) { + if (o is IriTerm) return o; + } + return null; +} + +/// Resolves the vclk subgraph anchored at [vclkIri] into a +/// `forClockEntry → (logicalTime, physicalTime)` map. Returns an empty map +/// when the vclk is unreachable or malformed (treated by the caller as a +/// fallback trigger). +Map _resolveVclkEntries(IriTerm vclkIri, RdfGraph graph) { + final result = {}; + final entryNodes = graph + .findTriples( + subject: vclkIri, predicate: CrdtVersionedClock.hasClockEntry) + .map((t) => t.object) + .whereType(); + for (final entryNode in entryNodes) { + final forEntry = graph + .findTriples(subject: entryNode, predicate: Crdt.forClockEntry) + .map((t) => t.object) + .whereType() + .firstOrNull; + if (forEntry == null) continue; + final logical = graph + .findTriples(subject: entryNode, predicate: CrdtClockEntry.logicalTime) + .map((t) => t.object) + .whereType() + .map((l) => int.tryParse(l.value)) + .firstWhere((v) => v != null, orElse: () => null); + final physical = graph + .findTriples(subject: entryNode, predicate: CrdtClockEntry.physicalTime) + .map((t) => t.object) + .whereType() + .map((l) => int.tryParse(l.value)) + .firstWhere((v) => v != null, orElse: () => null); + if (logical == null || physical == null) continue; + result[forEntry] = (logical, physical); + } + return result; +} + Set addInlineTriples( Set triples, OrganizedGraph local, OrganizedGraph remote) { final localUnidentifiedBlankNodes = {}; @@ -501,6 +880,26 @@ Set addInlineTriples( }; } +/// Collects all triples belonging to a `crdt:VersionedClock` subgraph: +/// the vclk node itself plus the contained `crdt:hasClockEntry` blank nodes +/// (and all triples about those blank nodes). Used by LWW-Register to +/// garbage-collect stale vclk snapshots whose only reference has been +/// replaced. Safe because vclk entry blank nodes are exclusively reachable +/// from their owning vclk (see `<#versioned-clock>` mapping). +Set _collectVclkSubgraphTriples(IriTerm vclkIri, RdfGraph graph) { + final result = {}; + final vclkTriples = graph.findTriples(subject: vclkIri).toList(); + result.addAll(vclkTriples); + final entryBlankNodes = vclkTriples + .where((t) => t.predicate == CrdtVersionedClock.hasClockEntry) + .map((t) => t.object) + .whereType(); + for (final bn in entryBlankNodes) { + result.addAll(graph.findTriples(subject: bn)); + } + return result; +} + class Immutable implements CrdtType { const Immutable(); @@ -756,14 +1155,62 @@ class OrSet implements CrdtType { class CrdtMergeContext { final FrameworkIriGenerator iriGenerator; final MetadataGenerator metadataGenerator; - CrdtMergeContext( - {required this.iriGenerator, required this.metadataGenerator}); + + /// Content-addressed IRI of the `crdt:VersionedClock` snapshot for the + /// current save, pre-computed once per save by the caller. Causality-tracking + /// CRDT types (e.g. LWW-Register) reference this IRI from + /// `sync:PropertyStatement` nodes; the vclk subgraph itself is emitted once + /// per save by the orchestrator, not inline per property, to avoid duplicate + /// triples in `List` document buffers. + /// + /// `null` signals "skip per-property causality stamping for this pass". The + /// caller chooses per pass whether stamping is enabled: + /// * App-data pass: non-null → property-level causality recorded. + /// * Framework-data pass: null → fall back to document-clock comparison + /// during remoteMerge. This avoids stamping framework infrastructure + /// (PropertyStatement / VersionedClock nodes, document-level CRDT + /// plumbing, shard-entry headers) where per-property vclks would + /// either recurse into themselves or be redundant with the document + /// clock derivation. + /// * Raw template / standalone processing: null (no clock context). + final IriTerm? vclkIri; + + /// Content-addressed IRI of the document-wide *implicit default* vclk for + /// app properties (proposal 028, `crdt:appBaseClock`). A property whose + /// effective `crdt:vclk` equals this IRI does NOT need an explicit + /// `sync:PropertyStatement` — the remote-merge `resolveVclk` chain will + /// fall back to this same vclk via the document's `appBaseClock` triple + /// (or, when no `appBaseClock` is set, via the document's `docClock`). + /// + /// Used by causality-tracking CRDT types to suppress PS emission when the + /// stamp would be redundant. `null` is interpreted as "no implicit default + /// is known to the orchestrator" — in that case any non-null `vclkIri` + /// triggers explicit PS emission (the conservative pre-proposal-028 + /// behaviour). + final IriTerm? implicitDefaultVclkIri; + + CrdtMergeContext({ + required this.iriGenerator, + required this.metadataGenerator, + this.vclkIri, + this.implicitDefaultVclkIri, + }); } class RemoteCrdtMergeContext { final ClockComparison clockComparison; - RemoteCrdtMergeContext({required this.clockComparison}); + /// Used by causality-tracking CRDT types (LWW-Register) to deterministically + /// compute `sync:PropertyStatement` IRIs when re-emitting per-property vclk + /// snapshots on the merge result. The content-addressed IRI is identical to + /// the one the winning side originally produced, allowing the framework + /// graph to be looked up via `fullGraph.findTriples(subject: psIri)`. + final MetadataGenerator metadataGenerator; + + RemoteCrdtMergeContext({ + required this.clockComparison, + required this.metadataGenerator, + }); } class CrdtTypeRegistry { diff --git a/packages/locorda_core/lib/src/crdt_document_manager.dart b/packages/locorda_core/lib/src/crdt_document_manager.dart index b9c3ed0a..517922b4 100644 --- a/packages/locorda_core/lib/src/crdt_document_manager.dart +++ b/packages/locorda_core/lib/src/crdt_document_manager.dart @@ -105,7 +105,14 @@ final _defaultManagedDocumentLevelPredicates = { // naturally covers them — no copy-through needed and no tombstones generated. SyncManagedDocument.crdtDeletedAt, SyncManagedDocument.hasBlankNodeMapping, - SyncManagedDocument.hasStatement + SyncManagedDocument.hasStatement, + // crdt:appBaseClock is preserved explicitly by _computeSaveCore (write- + // once invariant) rather than via subgraph traversal. Including it here + // prevents step 10 from re-traversing the appBaseClock → VersionedClock + // subgraph and pulling stale per-installation ClockEntry triples + // (logicalTime/physicalTime) into the new document, which would corrupt + // the live HLC structure on the next save. + Crdt.appBaseClock, }; /// Removes resource tombstones from [oldFrameworkGraph] for subjects that are @@ -626,6 +633,81 @@ class CrdtDocumentManager { sw?.stopSection('clock'); + // Pre-compute the per-save crdt:VersionedClock snapshot once. Reused + // across both app-data and framework-data generateMetadata calls so its + // subgraph (rdf:type + hasClockEntry blank nodes) is added to + // documentTriples exactly once below, avoiding duplicate triples in the + // List buffer that would later trip cardinality assertions in + // blank-node identification. + final versionedClock = + _localDocumentMerger.buildVersionedClock(documentIri, clock); + + // --- proposal 028: appBaseClock orchestration --------------------- + // The pre-save vclk snapshot captures the document clock BEFORE this + // save advanced our own ClockEntry. It is the candidate value for + // `crdt:appBaseClock` (lazy-set, write-once). + ({IriTerm vclkIri, List triples})? preSaveVclk; + if (oldFrameworkGraph != null) { + try { + final preSaveClock = + _hlcService.getCurrentClock(oldFrameworkGraph, documentIri); + preSaveVclk = _localDocumentMerger.buildVersionedClock( + documentIri, preSaveClock); + } on StateError { + // No prior clock (raw template path); no pre-save vclk. + preSaveVclk = null; + } + } + + final existingAppBaseVclkIri = oldFrameworkGraph + ?.findTriples(subject: documentIri, predicate: Crdt.appBaseClock) + .map((t) => t.object) + .whereType() + .firstOrNull; + + // Decide the prospective implicit-default vclk to pass into the + // app-data pass. Per proposal 028 §"Save-time encoding" step 5, a + // PropertyStatement is emitted only when its vclk differs from the + // effective default. Settling the default UP FRONT lets LWW suppress + // statements consistently across changed properties in this save. + // + // * existing appBaseClock → reuse it (write-once invariant) + // * else if clock advances AND ≥1 unchanged app prop would dangle + // → commit to setting appBaseClock=preSaveVclk + // * else default == post-save docClock (D itself); every changed + // property has D == default → no PS emitted, no appBaseClock + // written. This keeps the create-and-shard-rewrite paths + // metadata-free. + // + // Shard documents are excluded from the appBaseClock optimisation: + // their entries use OR-Set / Immutable CRDTs (no per-property vclk + // stamping), so the default-vclk shortcut would never suppress a + // PropertyStatement. Writing appBaseClock on a shard would only + // bloat the framework graph AND poison `_resolveEffectiveVclkIri` + // on the remote-merge path for non-app predicates like + // `crdt:clockHash` (predicates that legitimately resolve to the + // document clock, not to any per-property vclk). + final bool isShardDocument = type == IdxShard.classIri; + final bool willSetAppBaseClock; + final IriTerm? implicitDefaultVclkIri; + if (isShardDocument) { + implicitDefaultVclkIri = versionedClock?.vclkIri; + willSetAppBaseClock = false; + } else if (existingAppBaseVclkIri != null) { + implicitDefaultVclkIri = existingAppBaseVclkIri; + willSetAppBaseClock = false; + } else if (preSaveVclk != null && + versionedClock != null && + preSaveVclk.vclkIri != versionedClock.vclkIri && + _localDocumentMerger.hasImplicitAppPropertyReference( + documentIri, oldAppData, oldFrameworkGraph, appData)) { + implicitDefaultVclkIri = preSaveVclk.vclkIri; + willSetAppBaseClock = true; + } else { + implicitDefaultVclkIri = versionedClock?.vclkIri; + willSetAppBaseClock = false; + } + final ( metadata: crdtMetadata, newBlankNodes: appBlankNodes, @@ -638,6 +720,8 @@ class CrdtDocumentManager { mergeContract, clock, appDataTypeIri: type, + vclkIri: versionedClock?.vclkIri, + implicitDefaultVclkIri: implicitDefaultVclkIri, ); sw?.stopSection('appMeta'); @@ -672,6 +756,15 @@ class CrdtDocumentManager { appBlankNodes, allShards, ); + // Apply app-data CRDT removals BEFORE constructing the framework graph + // for the second metadata pass. Causality-tracking types + // (LWW-Register) replay content-addressed sync:PropertyStatement IRIs + // across saves; their `triplesToRemove` strips the stale structural + // triples that the step-10 subgraph copy pulled in. Without this, + // frameworkGraph briefly contains duplicate rdf:type triples for the + // same PropertyStatement IRI and trips findSingleObject in the + // subsequent isFrameworkData=true pass. + crdtMetadata.triplesToRemove.forEach(documentTriples.remove); frameworkGraph = RdfGraph.fromTriples(documentTriples); final ( metadata: frameworkMetadata, @@ -686,13 +779,93 @@ class CrdtDocumentManager { clock, appDataTypeIri: type, isFrameworkData: true, + // Deliberately NOT propagating vclkIri into the framework pass. + // + // Per-property `crdt:VersionedClock` stamping (issue #50) only adds + // value where two installations may concurrently update DIFFERENT + // LWW-Register properties of the SAME logical resource and where + // document-clock tie-breaks would silently drop the uncontested + // write. That preconditions only hold for app-data subjects. + // + // The framework-data pass operates on subjects whose vclk stamping + // would be either redundant or actively harmful: + // + // * `sync:PropertyStatement` and `crdt:VersionedClock` IRIs are + // themselves the conflict-resolution infrastructure — stamping + // them recurses without semantic gain and balloons document + // size (each property emits a new statement, which in turn gets + // stamped on the next save, etc. — the set is finite because + // PropertyStatement IRIs are content-addressed, but the bloat + // is significant for documents with many predicates). + // + // * `documentIri`-subject framework predicates (`crdt:clockHash`, + // `crdt:hasClockEntry`, `crdt:createdAt`, `sync:hasStatement`, + // `sync:isGovernedBy`, `sync:managedResourceType`, + // `foaf:primaryTopic`, `idx:belongsToIndexShard`, …) are either + // derived from the document clock (so vclk comparison is + // tautological), OR-Set / immutable in their merge contract + // (so LWW tie-breaks never run), or effectively configuration + // that should not diverge across installations. + // + // * Shard-entry header properties are NOT merged document-wise: + // shard membership is recomputed on every save from the + // authoritative app-data side, so per-property vclk on entries + // would never be consulted. + // + // `LwwRegister.remoteMerge` falls back to document-clock comparison + // when no per-property vclk is present (see + // `_resolvePerPropertyClockComparison` returning null), which is + // the correct resolution path for every framework-data case above. + vclkIri: null, ); propertyChanges.addAll(frameworkMetadata.propertyChanges); documentTriples.addNodes(documentIri, SyncManagedDocument.hasStatement, frameworkMetadata.statements); - crdtMetadata.triplesToRemove.forEach(documentTriples.remove); + // Materialise the vclk subgraph exactly once when at least one CRDT + // type actually stamped a property with crdt:vclk in this save. + // Detection is reference-based (any crdt:vclk triple) rather than + // tracked per type so future causality-aware CRDT types share the + // mechanism transparently. + if (versionedClock != null && + documentTriples.any((t) => t.predicate == Crdt.vclk)) { + documentTriples.addAll(versionedClock.triples); + } + + // Lazy-emit `crdt:appBaseClock` (proposal 028). Conditions were + // pre-checked above. The pre-save vclk subgraph is materialised here + // — guarded against double-add in the (extremely rare) case where + // pre-save and post-save vclks share a clock entry IRI (they share + // the per-installation ClockEntry node identity but the vclk hash + // IRI itself differs). + if (willSetAppBaseClock && preSaveVclk != null) { + documentTriples + .add(Triple(documentIri, Crdt.appBaseClock, preSaveVclk.vclkIri)); + if (!documentTriples.any((t) => t.subject == preSaveVclk!.vclkIri)) { + documentTriples.addAll(preSaveVclk.triples); + } + } else if (existingAppBaseVclkIri != null) { + // Write-once preservation: appBaseClock and its vclk subgraph are + // not auto-copied by step 10 (excluded from the doc-level filter) + // — re-emit them here from the old framework graph. Traversal is + // bounded by `includeButDontDescend` on IriTerm/Literal so the + // `forClockEntry → ` reference is preserved as a + // leaf and does NOT pull in the live ClockEntry's outgoing edges. + documentTriples.add( + Triple(documentIri, Crdt.appBaseClock, existingAppBaseVclkIri)); + final preservedVclk = oldFrameworkGraph!.subgraph( + existingAppBaseVclkIri, + filter: (triple, depth) => switch (triple.object) { + IriTerm() || + LiteralTerm() => + TraversalDecision.includeButDontDescend, + BlankNodeTerm() => TraversalDecision.include, + }, + ); + documentTriples.addAll(preservedVclk.triples); + } + frameworkMetadata.triplesToRemove.forEach(documentTriples.remove); // DEBUG: assert no resourceIri-subject triples snuck in before appData diff --git a/packages/locorda_core/lib/src/generated/mapping_bootstrap.g.dart b/packages/locorda_core/lib/src/generated/mapping_bootstrap.g.dart index ae9c8a6c..5e5776c6 100644 --- a/packages/locorda_core/lib/src/generated/mapping_bootstrap.g.dart +++ b/packages/locorda_core/lib/src/generated/mapping_bootstrap.g.dart @@ -32,6 +32,7 @@ const List bootstrapMappings = [ [ mc:predicate crdt:maxInactivityPeriod; algo:mergeWith algo:LWW_Register; rdfs:comment "Convention: Only the installation itself should update its own inactivity threshold" ] . """, + r""" @base . @prefix rdf: . @@ -48,7 +49,7 @@ const List bootstrapMappings = [ <> a mc:DocumentMapping; # Define class mappings for framework components - mc:classMapping ( <#managed-document> <#statement> <#resource-statement> <#blank-node-mapping> ) ; + mc:classMapping ( <#managed-document> <#statement> <#property-statement> <#resource-statement> <#versioned-clock> <#blank-node-mapping> ) ; # Define predicate mappings for framework components (ordered list) mc:predicateMapping ( <#clock-mappings> <#lifecycle-mappings> <#traversal-boundaries> <#standard-rdf> ) . @@ -75,7 +76,8 @@ const List bootstrapMappings = [ # Standard mapping for predicates of Hybrid Logical Clock entries (fragment-identified nodes) <#clock-mappings> a mc:PredicateMapping; mc:rule - [ mc:predicate crdt:installationId; algo:mergeWith algo:OR_Set], + [ mc:predicate crdt:installationIri; algo:mergeWith algo:OR_Set], + [ mc:predicate crdt:forClockEntry; algo:mergeWith algo:Immutable ], [ mc:predicate crdt:hasClockEntry; algo:mergeWith algo:OR_Set ], [ mc:predicate crdt:clockHash; algo:mergeWith algo:LWW_Register ], [ mc:predicate crdt:logicalTime; algo:mergeWith algo:G_Register ], @@ -88,6 +90,30 @@ const List bootstrapMappings = [ # The resource identifier is the immutable identity of this statement [ mc:predicate sync:resource; algo:mergeWith algo:LWW_Register; mc:isIdentifying true ] . +# Merge contract for PropertyStatement used for property-level framework metadata +# (e.g. last-write versioned clock for LWW/FWW conflict resolution). +# Identified by the (sync:resource, sync:property) pair. +<#property-statement> a mc:ClassMapping; + mc:appliesToClass sync:PropertyStatement; + mc:rule + [ mc:predicate sync:resource; algo:mergeWith algo:Immutable; mc:isIdentifying true ], + [ mc:predicate sync:property; algo:mergeWith algo:Immutable; mc:isIdentifying true ], + # crdt:vclk is the last-write versioned-clock pointer. LWW here is a placeholder: + # the merger uses vector-clock domination on the referenced crdt:VersionedClock, + # falling back to max(physicalTime) within the vclk on 'concurrent'. + [ mc:predicate crdt:vclk; algo:mergeWith algo:LWW_Register ] . + +# Merge contract for VersionedClock - immutable, content-addressed HLC snapshot. +# Its IRI is a hash over the contained (forClockEntry, logicalTime) pairs, so +# value-identical vclks share an IRI and are automatically deduplicated. +<#versioned-clock> a mc:ClassMapping; + mc:appliesToClass crdt:VersionedClock; + mc:rule + # The contained clock entries are part of the content-addressed identity: + # no path identification needed for the embedded blank nodes (the whole + # vclk is Immutable, so per-entry blank-node merging never occurs). + [ mc:predicate crdt:hasClockEntry; algo:mergeWith algo:Immutable; mc:disableBlankNodePathIdentification true ] . + # Merge contract for BlankNodeMapping - framework-reserved fragments for identified blank nodes <#blank-node-mapping> a mc:ClassMapping; mc:appliesToClass sync:BlankNodeMapping; @@ -112,7 +138,14 @@ const List bootstrapMappings = [ # Standard RDF reification predicates create traversal boundaries [ mc:predicate rdf:subject; mc:stopTraversal true ], [ mc:predicate rdf:predicate; mc:stopTraversal true ], - [ mc:predicate rdf:object; mc:stopTraversal true ] . + [ mc:predicate rdf:object; mc:stopTraversal true ], + # PropertyStatement identifiers create traversal boundaries (same role as rdf:subject/predicate) + [ mc:predicate sync:resource; mc:stopTraversal true ], + [ mc:predicate sync:property; mc:stopTraversal true ], + # Versioned-clock references and their entries stay on the framework side + [ mc:predicate crdt:vclk; mc:stopTraversal true ], + [ mc:predicate crdt:forClockEntry; mc:stopTraversal true ], + [ mc:predicate crdt:hasClockEntry; mc:stopTraversal true ] . <#standard-rdf> a mc:PredicateMapping; mc:rule @@ -120,6 +153,7 @@ const List bootstrapMappings = [ [ mc:predicate rdf:first; algo:mergeWith algo:LWW_Register ], [ mc:predicate rdf:rest; algo:mergeWith algo:LWW_Register ] . """, + r""" @base . @prefix crdt: . @@ -219,6 +253,7 @@ const List bootstrapMappings = [ [ mc:predicate idx:pattern; algo:mergeWith algo:LWW_Register ], # Regex pattern (atomic within blank node) [ mc:predicate idx:replacement; algo:mergeWith algo:LWW_Register ] . # Replacement template (atomic within blank node) """, + r""" @base . @prefix crdt: . @@ -253,4 +288,5 @@ const List bootstrapMappings = [ [ mc:predicate idx:resource; algo:mergeWith algo:Immutable ], # Resource IRI [ mc:predicate crdt:clockHash; algo:mergeWith algo:LWW_Register ] . # Clock hash for change detection """, + ]; diff --git a/packages/locorda_core/lib/src/local_document_merger.dart b/packages/locorda_core/lib/src/local_document_merger.dart index 0ac4ee79..1972e8a0 100644 --- a/packages/locorda_core/lib/src/local_document_merger.dart +++ b/packages/locorda_core/lib/src/local_document_merger.dart @@ -50,6 +50,8 @@ class LocalDocumentMerger { required IriTerm appDataTypeIri, bool isFrameworkData = false, bool computeCanonicalBlankNodes = true, + IriTerm? vclkIri, + IriTerm? implicitDefaultVclkIri, }) { // 4. Detect property changes between old and new app graphs and generate CRDT metadata final appBlankNodes = computeCanonicalBlankNodes @@ -70,7 +72,9 @@ class LocalDocumentMerger { mergeContract, clock, appDataTypeIri: appDataTypeIri, - isFrameworkData: isFrameworkData); + isFrameworkData: isFrameworkData, + vclkIri: vclkIri, + implicitDefaultVclkIri: implicitDefaultVclkIri); return ( oldBlankNodes: oldAppBlankNodes, newBlankNodes: appBlankNodes, @@ -78,6 +82,65 @@ class LocalDocumentMerger { ); } + /// Pre-computes the per-save `crdt:VersionedClock` snapshot from the current + /// HLC. Returns null when the clock has no entries (raw template path). The + /// returned `(vclkIri, triples)` pair is reused across both app-data and + /// framework-data `generateMetadata` calls within one save so the vclk + /// subgraph (rdf:type + hasClockEntry blank nodes) is materialised exactly + /// once — preventing duplicate triples in the underlying `List` + /// document buffer and the subsequent cardinality violations during + /// blank-node identification. + ({IriTerm vclkIri, List triples})? buildVersionedClock( + IriTerm documentIri, CurrentCrdtClock clock) { + final entries = _extractVclkEntries(clock); + if (entries.isEmpty) return null; + return _metadataGenerator.createVersionedClock(documentIri, entries); + } + + /// Lazy-set precondition (c) of proposal 028 `crdt:appBaseClock`: + /// returns true iff at least one IRI-subject app-data `(s,p)` slot in + /// [oldAppData] is structurally unchanged in [appData] AND has no + /// existing `sync:PropertyStatement` in [oldFrameworkGraph]. Such a slot + /// would dangle once the document clock advances past the pre-save + /// snapshot — exactly the case where `appBaseClock` provides value. + /// + /// Blank-node subjects are intentionally ignored: they typically use + /// non-causality-tracking CRDT types (Immutable / OR-Set) which do not + /// emit PropertyStatements anyway, and resolving their canonical IRIs + /// here would duplicate work already performed by the app-data pass. + /// Being conservative may suppress `appBaseClock` in edge cases but + /// never produces incorrect causality. + bool hasImplicitAppPropertyReference( + IriTerm documentIri, + RdfGraph? oldAppData, + RdfGraph? oldFrameworkGraph, + RdfGraph appData, + ) { + if (oldAppData == null || oldFrameworkGraph == null) return false; + final seen = <(IriTerm, RdfPredicate)>{}; + for (final triple in oldAppData.triples) { + final subject = triple.subject; + if (subject is! IriTerm) continue; + final key = (subject, triple.predicate); + if (!seen.add(key)) continue; + final oldValues = oldAppData + .findTriples(subject: subject, predicate: triple.predicate) + .map((t) => t.object) + .toSet(); + final newValues = appData + .findTriples(subject: subject, predicate: triple.predicate) + .map((t) => t.object) + .toSet(); + if (oldValues.length != newValues.length) continue; + if (!oldValues.containsAll(newValues)) continue; + final psIri = _metadataGenerator.propertyStatementIriFor( + documentIri, subject, triple.predicate); + final hasPs = oldFrameworkGraph.findTriples(subject: psIri).isNotEmpty; + if (!hasPs) return true; + } + return false; + } + /** * For really simple cases like replacing index shards, we can avoid full CRDT merge * and just replace the relevant triples directly, generating necessary metadata. @@ -197,7 +260,9 @@ class LocalDocumentMerger { MergeContract mergeContract, CurrentCrdtClock clock, {bool isFrameworkData = false, - required IriTerm appDataTypeIri}) { + required IriTerm appDataTypeIri, + IriTerm? vclkIri, + IriTerm? implicitDefaultVclkIri}) { final isShard = appDataTypeIri == IdxShard.classIri; final statements = []; final triplesToRemove = {}; @@ -220,10 +285,40 @@ class LocalDocumentMerger { subject: oldIdentifiedSubjects.lookup(subject)! }; final context = CrdtMergeContext( - iriGenerator: _iriGenerator, metadataGenerator: _metadataGenerator); + iriGenerator: _iriGenerator, + metadataGenerator: _metadataGenerator, + vclkIri: vclkIri, + implicitDefaultVclkIri: implicitDefaultVclkIri); // Process deleted subjects - add resource tombstones for (final deletedSubject in deletedSubjects) { + // VersionedClock and PropertyStatement subjects must NOT be tombstoned + // via this mechanism. Their lifecycle is managed exclusively by the + // explicit GC in LwwRegister.localValueChange (triplesToRemove): + // + // * VersionedClock IRIs are content-addressed over the HLC snapshot, + // so they change identity on every save even when the logical + // subject hasn't changed. The old IRI is removed via triplesToRemove + // (already applied before the framework pass runs). Without this + // guard the framework pass would see the old vclk IRI in + // oldIdentifiedSubjects but not in identifiedSubjects and emit a + // crdt:deletedAt tombstone for a piece of internal infrastructure + // rather than a user-level resource. + // + // * PropertyStatement IRIs are content-addressed over (subject, + // predicate) — they are stable across saves of the same property + // and therefore never appear as "deleted" in practice. The guard + // is defensive: if one ever did (e.g. predicate removed), the + // PropertyStatement node would be unreachable anyway and does not + // warrant a tombstone. + final subjectType = oldAppGraph! + .findSingleObject(deletedSubject.subject, Rdf.type); + if (subjectType == CrdtVersionedClock.classIri || + subjectType == SyncPropertyStatement.classIri) { + _log.fine( + 'Skipping tombstone for framework infrastructure subject: ${deletedSubject.subject.debug}'); + continue; + } _log.fine('Deleted subject detected: ${deletedSubject.subject.debug} '); statements.addAll(_metadataGenerator.createResourceMetadata( documentIri, @@ -561,6 +656,34 @@ Iterable _findSubjectTombstonesToRemove( ]); } +/// Extracts a flat `(forClockEntry, logicalTime, physicalTime)` list from the +/// post-save HLC snapshot. Used as the input to `crdt:VersionedClock` IRI +/// derivation and stamping by causality-tracking CRDT types (issue #50). +List<({IriTerm forClockEntry, int logicalTime, int physicalTime})> + _extractVclkEntries(CurrentCrdtClock clock) { + final result = + <({IriTerm forClockEntry, int logicalTime, int physicalTime})>[]; + for (final entry in clock.fullClock) { + final (clockEntrySubject, entryGraph) = entry; + if (clockEntrySubject is! IriTerm) continue; + final logical = entryGraph + .findSingleObject( + clockEntrySubject, CrdtClockEntry.logicalTime) + ?.integerValue; + final physical = entryGraph + .findSingleObject( + clockEntrySubject, CrdtClockEntry.physicalTime) + ?.integerValue; + if (logical == null || physical == null) continue; + result.add(( + forClockEntry: clockEntrySubject, + logicalTime: logical, + physicalTime: physical, + )); + } + return result; +} + /// Result of CRDT metadata generation containing metadata triples and property changes class CrdtMetadataResult { final List statements; diff --git a/packages/locorda_core/lib/src/mapping/framework_iri_generator.dart b/packages/locorda_core/lib/src/mapping/framework_iri_generator.dart index e431928c..331288f6 100644 --- a/packages/locorda_core/lib/src/mapping/framework_iri_generator.dart +++ b/packages/locorda_core/lib/src/mapping/framework_iri_generator.dart @@ -57,6 +57,19 @@ class FrameworkIriGenerator { documentIri, fragmentType, RdfGraph.fromTriples(triples), labels); } + /// Generates a canonical content-addressed framework IRI from an arbitrary + /// identification graph, supporting blank-node-bearing structures via + /// caller-provided deterministic labels. Used by content-addressed + /// composite resources such as [crdt:VersionedClock], whose identity is + /// derived from a small graph of (forClockEntry, logicalTime) pairs + /// attached through embedded blank nodes. + IriTerm generateCanonicalIriFromGraph( + IriTerm documentIri, String fragmentType, RdfGraph identificationGraph, + {Map labels = const {}}) { + return _toCanonicalHashIri( + documentIri, fragmentType, identificationGraph, labels); + } + // Similar to generateCanonicalIri, but for statements IriTerm _toCanonicalHashIri(IriTerm documentIri, String type, RdfGraph graph, diff --git a/packages/locorda_core/lib/src/mapping/metadata_generator.dart b/packages/locorda_core/lib/src/mapping/metadata_generator.dart index 4d516c65..945d2335 100644 --- a/packages/locorda_core/lib/src/mapping/metadata_generator.dart +++ b/packages/locorda_core/lib/src/mapping/metadata_generator.dart @@ -38,6 +38,143 @@ class MetadataGenerator { Iterable Function(RdfSubject) createMetadataTriples) => _createPropertyValueMetadata(documentIri, subject, createMetadataTriples); + /// Creates one or more `sync:PropertyStatement` framework metadata nodes + /// for the `(subject, predicate)` slot, identified by `sync:resource` + + /// `sync:property` (and stable across saves: identical `(s, p)` ⇒ + /// identical IRI ⇒ automatic deduplication via `sync:hasStatement`'s + /// OR-Set merge). + /// + /// One node is produced per concrete IRI in [subject.localSubjectIris] + /// (identified blank nodes expand to multiple canonical IRIs). + /// + /// `createMetadataTriples` receives the freshly minted statement subject + /// (typed as `RdfSubject` so it can also be used as triple subject) and + /// returns the variable metadata for this slot — most callers will emit + /// a single `(stmt, crdt:vclk, V)` triple. + Iterable createPropertyStatement( + IriTerm documentIri, + IdTerm subject, + RdfPredicate predicate, + Iterable Function(RdfSubject) createMetadataTriples, + ) { + final expandedSubject = subject.localSubjectIris; + final predicateIri = switch (predicate) { final IriTerm iri => iri }; + + return expandedSubject.map((subj) { + final stmtIri = + _createPropertyStatementIri(documentIri, subj, predicateIri); + final identifyingTriples = [ + Triple(stmtIri, Rdf.type, SyncPropertyStatement.classIri), + Triple(stmtIri, SyncPropertyStatement.resource, subj), + Triple(stmtIri, SyncPropertyStatement.property, predicateIri), + ]; + final metadataTriples = createMetadataTriples(stmtIri).toList(); + // Note: unlike createStatement* paths, blank-node objects ARE allowed + // here — callers attach the immutable VersionedClock node via + // crdt:vclk and its per-entry blank nodes inline so they ride along + // when the PropertyStatement is materialised into the document graph. + final graph = + RdfGraph.fromTriples([...identifyingTriples, ...metadataTriples]); + return (stmtIri, graph); + }); + } + + IriTerm _createPropertyStatementIri( + IriTerm documentIri, + IriTerm subject, + IriTerm predicate, + ) { + final temporaryIdSubject = BlankNodeTerm(); + final idGraph = RdfGraph.fromTriples([ + Triple(temporaryIdSubject, SyncPropertyStatement.resource, subject), + Triple(temporaryIdSubject, SyncPropertyStatement.property, predicate), + ]); + return _frameworkIriGenerator.generateSimpleCanonicalIri( + documentIri, 'prop', idGraph.triples, + labels: {temporaryIdSubject: 'prop0'}); + } + + /// Public, deterministic IRI lookup for a `sync:PropertyStatement`, + /// content-addressed over `(subject, predicate)`. Used by causality-tracking + /// CRDT types to locate and garbage-collect stale framework metadata they + /// previously emitted for the same `(s, p)` slot. + IriTerm propertyStatementIriFor( + IriTerm documentIri, + IriTerm subject, + RdfPredicate predicate, + ) => + _createPropertyStatementIri( + documentIri, + subject, + switch (predicate) { final IriTerm iri => iri }, + ); + + /// Creates an immutable, content-addressed `crdt:VersionedClock` snapshot + /// from the document's current HLC [entries]. + /// + /// Identity hash: canonical N-Quads over the `(forClockEntry, logicalTime)` + /// pairs sorted by `forClockEntry`. `physicalTime` is preserved as an + /// annotation on each emitted entry (needed for concurrent tie-break) but + /// is excluded from the hash — consistent with `crdt:clockHash` and + /// necessary for cross-installation deduplication of identical logical + /// vectors. + /// + /// Returns the vclk IRI and the full triples to attach to the document. + /// Identical [entries] produce identical IRIs across calls, so emitting + /// the same vclk multiple times in one save (or across saves) is safe + /// under the OR-Set semantics of `sync:hasStatement`. + ({IriTerm vclkIri, List triples}) createVersionedClock( + IriTerm documentIri, + Iterable<({IriTerm forClockEntry, int logicalTime, int physicalTime})> + entries, + ) { + if (entries.isEmpty) { + throw ArgumentError('VersionedClock requires at least one entry'); + } + // Stable order by forClockEntry IRI for both hash and emitted layout. + final sorted = entries.toList() + ..sort((a, b) => a.forClockEntry.value.compareTo(b.forClockEntry.value)); + + // Build identification graph: deterministic blank-node labels per index, + // only (forClockEntry, logicalTime) per entry — physicalTime is excluded. + final idLabels = {}; + final idTriples = []; + final tmpVclk = BlankNodeTerm(); + idLabels[tmpVclk] = 'vclk0'; + for (var i = 0; i < sorted.length; i++) { + final entry = sorted[i]; + final entryBn = BlankNodeTerm(); + idLabels[entryBn] = 'vce$i'; + idTriples + ..add(Triple(tmpVclk, CrdtVersionedClock.hasClockEntry, entryBn)) + ..add(Triple(entryBn, Crdt.forClockEntry, entry.forClockEntry)) + ..add(Triple(entryBn, CrdtClockEntry.logicalTime, + LiteralTerm.integer(entry.logicalTime))); + } + final vclkIri = _frameworkIriGenerator.generateCanonicalIriFromGraph( + documentIri, 'vclk', RdfGraph.fromTriples(idTriples), + labels: idLabels); + + // Emit full triples (including physicalTime) with fresh blank nodes per + // entry. Note: the vclk subject is the content-addressed IRI; only the + // entry-level nodes remain anonymous (see <#versioned-clock> mapping: + // disableBlankNodePathIdentification = true). + final triples = [ + Triple(vclkIri, Rdf.type, CrdtVersionedClock.classIri), + ]; + for (final entry in sorted) { + final entryBn = BlankNodeTerm(); + triples + ..add(Triple(vclkIri, CrdtVersionedClock.hasClockEntry, entryBn)) + ..add(Triple(entryBn, Crdt.forClockEntry, entry.forClockEntry)) + ..add(Triple(entryBn, CrdtClockEntry.logicalTime, + LiteralTerm.integer(entry.logicalTime))) + ..add(Triple(entryBn, CrdtClockEntry.physicalTime, + LiteralTerm.integer(entry.physicalTime))); + } + return (vclkIri: vclkIri, triples: triples); + } + Iterable _createPropertyValueMetadata( IriTerm documentIri, IdTerm subject, diff --git a/packages/locorda_core/lib/src/sync/data_types.dart b/packages/locorda_core/lib/src/sync/data_types.dart index 9befbce6..fd9f3124 100644 --- a/packages/locorda_core/lib/src/sync/data_types.dart +++ b/packages/locorda_core/lib/src/sync/data_types.dart @@ -59,6 +59,40 @@ class OrganizedStatements { for (final entry in statementGraphs.entries) { final subject = entry.key; final graph = entry.value; + + // Polymorphic statement shapes attached via sync:hasStatement: + // 1. Property-level: sync:PropertyStatement with (sync:resource, sync:property) + // — keyed as SubjectPredicateMetadataStatement so per-(s,p) lookups + // (e.g. crdt:vclk for LWW resolution) succeed. + // 2. Reified rdf:Statement with rdf:subject [+ rdf:predicate [+ rdf:object]] + // — the existing shape used by OR-Set tombstones and subject-level + // deletion markers. + // Detection is shape-driven, not IRI-fragment-driven, so legacy statement + // IRIs continue to work. + final propertyResource = graph.findSingleObject( + subject, SyncPropertyStatement.resource); + final propertyPredicate = graph.findSingleObject( + subject, SyncPropertyStatement.property); + if (propertyResource != null && propertyPredicate != null) { + final realPropertyResource = + blankNodeMappings.getBlankNode(propertyResource) ?? + propertyResource; + final realKey = + MetadataStatementKey.from(realPropertyResource, propertyPredicate); + statementsByKey + .putIfAbsent(realKey, () => {}) + .add((subject, graph)); + final canonicalKeys = maybeCanonicalKeysByRealKey.putIfAbsent( + realKey, () => {}); + canonicalKeys.add( + MetadataStatementKey.from(propertyResource, propertyPredicate)); + if (propertyResource != realPropertyResource) { + canonicalKeys.add(MetadataStatementKey.from( + realPropertyResource, propertyPredicate)); + } + continue; + } + final rdfSubject = graph.findSingleObject(subject, RdfStatement.subject); if (rdfSubject is BlankNodeTerm) { @@ -493,6 +527,14 @@ class UnIdentifiedBlankNodeKey extends RdfObjectKey { } final class OrganizedGraph { + /// The IRI of the `sync:ManagedDocument` this graph represents. Used by + /// merge logic to distinguish framework-data subjects (subject == + /// documentIri) from app-data subjects (primaryTopic, nested fragments, + /// blank nodes) — relevant e.g. for the proposal 028 `crdt:appBaseClock` + /// fallback in per-property vclk resolution, which must NOT apply to + /// framework-data predicates like `crdt:clockHash` or + /// `sync:managedResourceType`. + final IriTerm documentIri; final OrganizedStatements statements; final OrganizedBlankNodeMappings blankNodeMappings; final RdfGraph fullGraph; @@ -508,6 +550,7 @@ final class OrganizedGraph { .fold(0, (prev, element) => element < prev ? element : prev); OrganizedGraph._({ + required this.documentIri, required this.statements, required this.blankNodeMappings, required this.fullGraph, @@ -582,6 +625,7 @@ final class OrganizedGraph { } return OrganizedGraph._( + documentIri: documentIri, statements: statements, blankNodeMappings: blankNodeMappings, fullGraph: document, @@ -619,27 +663,28 @@ enum ClockComparison { OrganizedGraph local, OrganizedGraph remote, ) { - // Handle empty clocks (treated as all zeros per spec) - final localIsEmpty = local.clockTimes.isEmpty; - final remoteIsEmpty = remote.clockTimes.isEmpty; + return compareClockMaps(local.clockTimes, remote.clockTimes); + } + + /// Vector-clock dominance comparison over two `clockEntryIri → (logical, physical)` + /// maps. Used both by the document-level [compareClocks] and by per-property + /// `crdt:VersionedClock` resolution in LWW conflict handling. + /// + /// Physical times are passed through but only logical times participate in + /// dominance — consistent with HLC semantics and the vclk hash design. + static ClockComparison compareClockMaps( + Map localEntries, + Map remoteEntries, + ) { + final localIsEmpty = localEntries.isEmpty; + final remoteIsEmpty = remoteEntries.isEmpty; if (localIsEmpty && remoteIsEmpty) { return ClockComparison.bothEmpty; } + if (localIsEmpty) return ClockComparison.remoteDominates; + if (remoteIsEmpty) return ClockComparison.localDominates; - if (localIsEmpty) { - return ClockComparison.remoteDominates; - } - - if (remoteIsEmpty) { - return ClockComparison.localDominates; - } - - // Build maps of installation -> (logical, physical) for comparison - final localEntries = local.clockTimes; - final remoteEntries = remote.clockTimes; - - // Get all installation IDs from both clocks final allInstallations = {...localEntries.keys, ...remoteEntries.keys}; var localGreater = false; @@ -655,19 +700,13 @@ enum ClockComparison { remoteGreater = true; } - // If both have been greater at some point, they're concurrent if (localGreater && remoteGreater) { return ClockComparison.concurrent; } } - if (localGreater) { - return ClockComparison.localDominates; - } else if (remoteGreater) { - return ClockComparison.remoteDominates; - } else { - // All logical times are equal - clocks are identical - return ClockComparison.identical; - } + if (localGreater) return ClockComparison.localDominates; + if (remoteGreater) return ClockComparison.remoteDominates; + return ClockComparison.identical; } } diff --git a/packages/locorda_core/lib/src/sync/remote_document_merger.dart b/packages/locorda_core/lib/src/sync/remote_document_merger.dart index 8c9fd5ed..e4b5b361 100644 --- a/packages/locorda_core/lib/src/sync/remote_document_merger.dart +++ b/packages/locorda_core/lib/src/sync/remote_document_merger.dart @@ -120,7 +120,10 @@ class RemoteDocumentMerger { localOGraph, remoteOGraph, mergeContract, - RemoteCrdtMergeContext(clockComparison: clockComparison), + RemoteCrdtMergeContext( + clockComparison: clockComparison, + metadataGenerator: _metadataGenerator, + ), appDataTypeIri: resourceTypeIri); _log.fine('Merged ${mergeResults.mergedTriples.length} triples '); @@ -401,7 +404,12 @@ class RemoteDocumentMerger { ...localGraph.findTriples(subject: stmtIri), ...remoteGraph.findTriples(subject: stmtIri), }; - if (detailTriples.any((t) => t.predicate == RdfStatement.subject)) { + if (detailTriples.any((t) => + // RDF reification (rdf:Statement) + t.predicate == RdfStatement.subject || + // sync:PropertyStatement (proposal 028) — identified by + // (sync:resource, sync:property) rather than rdf:subject + t.predicate == SyncPropertyStatement.resource)) { // Recoverable: detail triples exist in at least one side orphanedStatementTriples.addAll(detailTriples); } else { diff --git a/packages/locorda_core/lib/src/vocab/generated/crdt.dart b/packages/locorda_core/lib/src/vocab/generated/crdt.dart index f317d5f8..0f2b3fe4 100644 --- a/packages/locorda_core/lib/src/vocab/generated/crdt.dart +++ b/packages/locorda_core/lib/src/vocab/generated/crdt.dart @@ -36,6 +36,14 @@ class Crdt { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClientInstallation', ); + /// IRI for crdt:VersionedClock + /// + /// An immutable, content-addressed snapshot of a Hybrid Logical Clock at the moment of a specific write or merge event. Used by property- and value-level CRDT bookkeeping (e.g. via crdt:vclk on sync:PropertyStatement or rdf:Statement) to record 'when this happened' in a way that supports full vector-clock comparison (equal / dominates / dominated / concurrent). Each contained entry is anchored to the document's existing crdt:ClockEntry via crdt:forClockEntry (identity anchor) and carries its own crdt:logicalTime / crdt:physicalTime as frozen snapshot values — the referenced ClockEntry may have advanced since this snapshot was taken. The VersionedClock IRI is derived as a hash over the contained (forClockEntry, logicalTime) pairs, sorted by forClockEntry; crdt:physicalTime is carried per entry as a tie-break annotation but is NOT part of the hash (consistent with crdt:clockHash). Identical content ⇒ identical IRI ⇒ automatic deduplication across the document. + /// + static const VersionedClock = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock', + ); + /// IRI for crdt:hasClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] /// /// Links a resource to a IRI resource representing a single entry in its Hybrid Logical Clock (HLC). Each entry tracks both logical time (causality) and physical time (for intuitive tie-breaking) for one installation. @@ -48,7 +56,7 @@ class Crdt { /// IRI for crdt:installationIri [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] /// - /// IRI for a client installation within a Hybrid Logical Clock entry. + /// IRI for a client installation within a Hybrid Logical Clock entry. NOTE: usage is currently OPTIONAL and not written or read by the framework — installation identity is conveyed via the deterministic crdt:ClockEntry fragment (lcrd-clk-md5-). The property is retained in the vocabulary for future extension (e.g. enabling cross-document installation discovery) and may be populated by applications that need it. /// /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry /// @@ -56,6 +64,16 @@ class Crdt { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#installationIri', ); + /// IRI for crdt:forClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Identity anchor on a crdt:VersionedClock entry, referencing the crdt:ClockEntry this snapshot pertains to. The snapshot's own crdt:logicalTime / crdt:physicalTime are authoritative frozen values; the referenced ClockEntry may have advanced since this snapshot was taken. Used as the per-entry key for vector-clock comparison and as the only entry-identifying component of the VersionedClock content hash. + /// + /// Can be used on all classes in this vocabulary + /// + static const forClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#forClockEntry', + ); + /// IRI for crdt:logicalTime [Expects: http://www.w3.org/2001/XMLSchema#long] /// /// The logical time component of a Hybrid Logical Clock entry - a monotonically increasing counter that tracks causality relationships between operations. Provides tamper-proof causality tracking even when physical clocks are manipulated. @@ -86,6 +104,26 @@ class Crdt { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#clockHash', ); + /// IRI for crdt:vclk [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock] + /// + /// Attaches a versioned-clock snapshot (crdt:VersionedClock) to a framework metadata node such as a sync:PropertyStatement (last write of a property) or an rdf:Statement (add event of a multi-value element). Concurrent-write resolution compares the referenced vclks via vector-clock semantics (equal / dominates / dominated / concurrent); ties on 'concurrent' are broken by max(crdt:physicalTime) across the vclk's clock entries. + /// + /// Can be used on all classes in this vocabulary + /// + static const vclk = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#vclk', + ); + + /// IRI for crdt:appBaseClock [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock] + /// + /// Document-wide default crdt:VersionedClock for app properties that have no explicit sync:PropertyStatement. Causality-tracking merge rules (LWW, FWW, …) resolve a property's effective vclk as: PropertyStatement.vclk -> document.appBaseClock -> document's current HLC (docClock). Set lazily on the first save that advances the document clock while at least one app property would otherwise dangle on the previous (now superseded) docClock. Scope is app data only: framework-managed properties never use this fallback. Once set, treated as write-once within this proposal (compaction is future work). + /// + /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#ManagedDocument + /// + static const appBaseClock = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#appBaseClock', + ); + /// IRI for crdt:belongsToUser [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] /// /// Links an installation to the user identity that owns it. In Solid contexts, this would be a WebID; in other contexts, this could be any user identifier. diff --git a/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clientinstallation.dart b/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clientinstallation.dart index da9a9520..297b9f4e 100644 --- a/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clientinstallation.dart +++ b/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clientinstallation.dart @@ -38,6 +38,16 @@ class CrdtClientInstallation { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#hasClockEntry', ); + /// forClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Identity anchor on a crdt:VersionedClock entry, referencing the crdt:ClockEntry this snapshot pertains to. The snapshot's own crdt:logicalTime / crdt:physicalTime are authoritative frozen values; the referenced ClockEntry may have advanced since this snapshot was taken. Used as the per-entry key for vector-clock comparison and as the only entry-identifying component of the VersionedClock content hash. + /// + /// Can be used on all classes in this vocabulary + /// + static const forClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#forClockEntry', + ); + /// clockHash [Expects: http://www.w3.org/2001/XMLSchema#string] /// /// A pre-calculated, lightweight hash of the resource's full Hybrid Logical Clock, used for efficient change detection in indices. Hash includes only the logical time component (causality state), excluding physical time (which is merely an annotation for tie-breaking). Domain is kept general (rdfs:Resource) to allow usage in various contexts including idx:ShardEntry instances. @@ -48,6 +58,16 @@ class CrdtClientInstallation { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#clockHash', ); + /// vclk [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock] + /// + /// Attaches a versioned-clock snapshot (crdt:VersionedClock) to a framework metadata node such as a sync:PropertyStatement (last write of a property) or an rdf:Statement (add event of a multi-value element). Concurrent-write resolution compares the referenced vclks via vector-clock semantics (equal / dominates / dominated / concurrent); ties on 'concurrent' are broken by max(crdt:physicalTime) across the vclk's clock entries. + /// + /// Can be used on all classes in this vocabulary + /// + static const vclk = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#vclk', + ); + /// belongsToUser [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] /// /// Links an installation to the user identity that owns it. In Solid contexts, this would be a WebID; in other contexts, this could be any user identifier. diff --git a/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clockentry.dart b/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clockentry.dart index 7d712776..a434b72e 100644 --- a/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clockentry.dart +++ b/packages/locorda_core/lib/src/vocab/generated/crdt/classes/clockentry.dart @@ -40,7 +40,7 @@ class CrdtClockEntry { /// installationIri [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] /// - /// IRI for a client installation within a Hybrid Logical Clock entry. + /// IRI for a client installation within a Hybrid Logical Clock entry. NOTE: usage is currently OPTIONAL and not written or read by the framework — installation identity is conveyed via the deterministic crdt:ClockEntry fragment (lcrd-clk-md5-). The property is retained in the vocabulary for future extension (e.g. enabling cross-document installation discovery) and may be populated by applications that need it. /// /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry /// @@ -48,6 +48,16 @@ class CrdtClockEntry { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#installationIri', ); + /// forClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Identity anchor on a crdt:VersionedClock entry, referencing the crdt:ClockEntry this snapshot pertains to. The snapshot's own crdt:logicalTime / crdt:physicalTime are authoritative frozen values; the referenced ClockEntry may have advanced since this snapshot was taken. Used as the per-entry key for vector-clock comparison and as the only entry-identifying component of the VersionedClock content hash. + /// + /// Can be used on all classes in this vocabulary + /// + static const forClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#forClockEntry', + ); + /// logicalTime [Expects: http://www.w3.org/2001/XMLSchema#long] /// /// The logical time component of a Hybrid Logical Clock entry - a monotonically increasing counter that tracks causality relationships between operations. Provides tamper-proof causality tracking even when physical clocks are manipulated. @@ -78,6 +88,16 @@ class CrdtClockEntry { 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#clockHash', ); + /// vclk [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock] + /// + /// Attaches a versioned-clock snapshot (crdt:VersionedClock) to a framework metadata node such as a sync:PropertyStatement (last write of a property) or an rdf:Statement (add event of a multi-value element). Concurrent-write resolution compares the referenced vclks via vector-clock semantics (equal / dominates / dominated / concurrent); ties on 'concurrent' are broken by max(crdt:physicalTime) across the vclk's clock entries. + /// + /// Can be used on all classes in this vocabulary + /// + static const vclk = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#vclk', + ); + /// createdAt [Expects: http://www.w3.org/2001/XMLSchema#dateTime] /// /// Framework-managed timestamp marking when a document or installation was created/recreated. Uses OR-Set semantics to support recreation scenarios and solve zombie deletion problems. Combined with crdt:deletedAt using temporal ordering: document is deleted if max(deletedAt) > max(createdAt). Framework automatically adds creation timestamps during document creation. diff --git a/packages/locorda_core/lib/src/vocab/generated/crdt/classes/versionedclock.dart b/packages/locorda_core/lib/src/vocab/generated/crdt/classes/versionedclock.dart new file mode 100644 index 00000000..e2547e33 --- /dev/null +++ b/packages/locorda_core/lib/src/vocab/generated/crdt/classes/versionedclock.dart @@ -0,0 +1,298 @@ +// Copyright (c) 2025, Klas Kalaß +// All rights reserved. Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// GENERATED CODE - DO NOT MODIFY BY HAND +// Generated by VocabularyBuilder + +import 'package:locorda_rdf_core/core.dart'; + +/// VersionedClock class from Crdt vocabulary +/// +/// An immutable, content-addressed snapshot of a Hybrid Logical Clock at the moment of a specific write or merge event. Used by property- and value-level CRDT bookkeeping (e.g. via crdt:vclk on sync:PropertyStatement or rdf:Statement) to record 'when this happened' in a way that supports full vector-clock comparison (equal / dominates / dominated / concurrent). Each contained entry is anchored to the document's existing crdt:ClockEntry via crdt:forClockEntry (identity anchor) and carries its own crdt:logicalTime / crdt:physicalTime as frozen snapshot values — the referenced ClockEntry may have advanced since this snapshot was taken. The VersionedClock IRI is derived as a hash over the contained (forClockEntry, logicalTime) pairs, sorted by forClockEntry; crdt:physicalTime is carried per entry as a tie-break annotation but is NOT part of the hash (consistent with crdt:clockHash). Identical content ⇒ identical IRI ⇒ automatic deduplication across the document. +/// +/// Inherits from: +/// - Resource (http://www.w3.org/2000/01/rdf-schema#Resource) +/// +/// This class provides access to all properties that can be used with VersionedClock. +/// [Class Reference](https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock) +/// +/// [Vocabulary Reference](https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#) +class CrdtVersionedClock { + // Private constructor prevents instantiation + const CrdtVersionedClock._(); + + /// IRI term for the VersionedClock class + /// Use this to specify that a resource is of this type. + static const classIri = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock', + ); + + /// hasClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Links a resource to a IRI resource representing a single entry in its Hybrid Logical Clock (HLC). Each entry tracks both logical time (causality) and physical time (for intuitive tie-breaking) for one installation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const hasClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#hasClockEntry', + ); + + /// forClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Identity anchor on a crdt:VersionedClock entry, referencing the crdt:ClockEntry this snapshot pertains to. The snapshot's own crdt:logicalTime / crdt:physicalTime are authoritative frozen values; the referenced ClockEntry may have advanced since this snapshot was taken. Used as the per-entry key for vector-clock comparison and as the only entry-identifying component of the VersionedClock content hash. + /// + /// Can be used on all classes in this vocabulary + /// + static const forClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#forClockEntry', + ); + + /// clockHash [Expects: http://www.w3.org/2001/XMLSchema#string] + /// + /// A pre-calculated, lightweight hash of the resource's full Hybrid Logical Clock, used for efficient change detection in indices. Hash includes only the logical time component (causality state), excluding physical time (which is merely an annotation for tie-breaking). Domain is kept general (rdfs:Resource) to allow usage in various contexts including idx:ShardEntry instances. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const clockHash = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#clockHash', + ); + + /// vclk [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock] + /// + /// Attaches a versioned-clock snapshot (crdt:VersionedClock) to a framework metadata node such as a sync:PropertyStatement (last write of a property) or an rdf:Statement (add event of a multi-value element). Concurrent-write resolution compares the referenced vclks via vector-clock semantics (equal / dominates / dominated / concurrent); ties on 'concurrent' are broken by max(crdt:physicalTime) across the vclk's clock entries. + /// + /// Can be used on all classes in this vocabulary + /// + static const vclk = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#vclk', + ); + + /// createdAt [Expects: http://www.w3.org/2001/XMLSchema#dateTime] + /// + /// Framework-managed timestamp marking when a document or installation was created/recreated. Uses OR-Set semantics to support recreation scenarios and solve zombie deletion problems. Combined with crdt:deletedAt using temporal ordering: document is deleted if max(deletedAt) > max(createdAt). Framework automatically adds creation timestamps during document creation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const createdAt = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#createdAt', + ); + + /// deletedAt [Expects: http://www.w3.org/2001/XMLSchema#dateTime] + /// + /// Framework-managed timestamp marking when a document or property value was deleted. For documents: uses OR-Set semantics combined with crdt:createdAt for temporal lifecycle management (document deleted if max(deletedAt) > max(createdAt)), solving zombie deletion problems during recreation scenarios. For property values: simple tombstone semantics using RDF reification (value deleted if reification statement with crdt:deletedAt exists). Framework automatically manages this property by detecting deletions through state comparison - developers simply provide updated resource state and the library implementation handles tombstone creation automatically. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const deletedAt = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#deletedAt', + ); + + /// documentTombstoneRetentionPeriod [Expects: http://www.w3.org/2001/XMLSchema#duration] + /// + /// Duration to retain document tombstones (complete deleted documents) before garbage collection. Expressed as ISO 8601 duration (e.g., 'P2Y' for 2 years). Applied to storage backend configuration documents. Longer retention recommended due to high impact of zombie deletions affecting recreated documents. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const documentTombstoneRetentionPeriod = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#documentTombstoneRetentionPeriod', + ); + + /// enableDocumentTombstoneCleanup [Expects: http://www.w3.org/2001/XMLSchema#boolean] + /// + /// Boolean flag indicating whether the framework should automatically clean up document tombstones after the retention period. Applied to storage backend configuration documents. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const enableDocumentTombstoneCleanup = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#enableDocumentTombstoneCleanup', + ); + + /// propertyTombstoneRetentionPeriod [Expects: http://www.w3.org/2001/XMLSchema#duration] + /// + /// Duration to retain property tombstones (deleted values within multi-value properties) before garbage collection. Expressed as ISO 8601 duration (e.g., 'P6M' for 6 months). Applied to storage backend configuration documents. Shorter retention acceptable due to lower impact of zombie deletions. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const propertyTombstoneRetentionPeriod = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#propertyTombstoneRetentionPeriod', + ); + + /// enablePropertyTombstoneCleanup [Expects: http://www.w3.org/2001/XMLSchema#boolean] + /// + /// Boolean flag indicating whether the framework should automatically clean up property tombstones after the retention period. Applied to storage backend configuration documents. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const enablePropertyTombstoneCleanup = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#enablePropertyTombstoneCleanup', + ); + + /// type from rdf vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Class] + /// + /// The subject is an instance of a class. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfType = IriTerm( + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', + ); + + /// value from rdf vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Idiomatic property used for structured values. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfValue = IriTerm( + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#value', + ); + + /// comment from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Literal] + /// + /// A description of the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsComment = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#comment', + ); + + /// label from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Literal] + /// + /// A human-readable name for the subject. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsLabel = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#label', + ); + + /// seeAlso from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Further information about the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsSeeAlso = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#seeAlso', + ); + + /// isDefinedBy from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The definition of the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsIsDefinedBy = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#isDefinedBy', + ); + + /// member from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// A member of the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsMember = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#member', + ); + + /// annotatedProperty from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The property that determines the predicate of an annotated axiom or annotated annotation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlAnnotatedProperty = IriTerm( + 'http://www.w3.org/2002/07/owl#annotatedProperty', + ); + + /// annotatedSource from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The property that determines the subject of an annotated axiom or annotated annotation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlAnnotatedSource = IriTerm( + 'http://www.w3.org/2002/07/owl#annotatedSource', + ); + + /// annotatedTarget from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The property that determines the object of an annotated axiom or annotated annotation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlAnnotatedTarget = IriTerm( + 'http://www.w3.org/2002/07/owl#annotatedTarget', + ); + + /// deprecated from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The annotation property that indicates that a given entity has been deprecated. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlDeprecated = IriTerm( + 'http://www.w3.org/2002/07/owl#deprecated', + ); + + /// members from owl vocabulary [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#List] + /// + /// The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlMembers = IriTerm('http://www.w3.org/2002/07/owl#members'); + + /// versionInfo from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The annotation property that provides version information for an ontology or another OWL construct. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlVersionInfo = IriTerm( + 'http://www.w3.org/2002/07/owl#versionInfo', + ); + + /// abstract_ from bibo vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Literal] + /// + /// A summary of the resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const biboAbstract_ = IriTerm( + 'http://purl.org/ontology/bibo/abstract', + ); + + /// belongsToIndexShard from idx vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Links a data resource to the specific index shard it is a member of. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const idxBelongsToIndexShard = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/idx#belongsToIndexShard', + ); + + /// isShardOf from idx vocabulary [Expects: https://w3id.org/solid-crdt-sync/vocab/idx#Index] + /// + /// A back-link from a shard to the root index or partition it belongs to. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const idxIsShardOf = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/idx#isShardOf', + ); + + /// isGovernedBy from sync vocabulary [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#List] + /// + /// Links a data or index resource to an ordered list (rdf:List) of public mapping files that define its merge behavior. Documents are merged in list order with 'first wins' semantics - implementations should append only, not prepend, to avoid overriding existing definitions. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const syncIsGovernedBy = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#isGovernedBy', + ); +} diff --git a/packages/locorda_core/lib/src/vocab/generated/crdt/crdt_universal.dart b/packages/locorda_core/lib/src/vocab/generated/crdt/crdt_universal.dart new file mode 100644 index 00000000..87cf3759 --- /dev/null +++ b/packages/locorda_core/lib/src/vocab/generated/crdt/crdt_universal.dart @@ -0,0 +1,39 @@ +// Copyright (c) 2025, Klas Kalaß +// All rights reserved. Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// GENERATED CODE - DO NOT MODIFY BY HAND +// Generated by VocabularyBuilder + +import 'package:locorda_rdf_core/core.dart'; + +/// Universal Properties for the Crdt vocabulary +/// +/// Universal properties are RDF properties that have no explicitly defined domain +/// and can therefore be applied to any resource within this vocabulary's context. +/// In RDF, when a property has no rdfs:domain constraint, it can theoretically be +/// used with any subject, but best practice is to use them only within +/// the intended vocabulary context. +/// +/// This class collects all such properties from the Crdt vocabulary to make them +/// easily accessible without cluttering the class-specific property interfaces. +class CrdtUniversalProperties { + // Private constructor prevents instantiation + const CrdtUniversalProperties._(); + + /// forClockEntry [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Identity anchor on a crdt:VersionedClock entry, referencing the crdt:ClockEntry this snapshot pertains to. The snapshot's own crdt:logicalTime / crdt:physicalTime are authoritative frozen values; the referenced ClockEntry may have advanced since this snapshot was taken. Used as the per-entry key for vector-clock comparison and as the only entry-identifying component of the VersionedClock content hash. + /// + static const forClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#forClockEntry', + ); + + /// vclk [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#VersionedClock] + /// + /// Attaches a versioned-clock snapshot (crdt:VersionedClock) to a framework metadata node such as a sync:PropertyStatement (last write of a property) or an rdf:Statement (add event of a multi-value element). Concurrent-write resolution compares the referenced vclks via vector-clock semantics (equal / dominates / dominated / concurrent); ties on 'concurrent' are broken by max(crdt:physicalTime) across the vclk's clock entries. + /// + static const vclk = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#vclk', + ); +} diff --git a/packages/locorda_core/lib/src/vocab/generated/crdt/index.dart b/packages/locorda_core/lib/src/vocab/generated/crdt/index.dart index 152a7010..73ca966f 100644 --- a/packages/locorda_core/lib/src/vocab/generated/crdt/index.dart +++ b/packages/locorda_core/lib/src/vocab/generated/crdt/index.dart @@ -7,3 +7,5 @@ export 'classes/clientinstallation.dart'; export 'classes/clockentry.dart'; +export 'classes/versionedclock.dart'; +export 'crdt_universal.dart'; diff --git a/packages/locorda_core/lib/src/vocab/generated/sync.dart b/packages/locorda_core/lib/src/vocab/generated/sync.dart index 5d08a809..d0a61005 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync.dart @@ -36,6 +36,14 @@ class Sync { 'https://w3id.org/solid-crdt-sync/vocab/sync#ResourceStatement', ); + /// IRI for sync:PropertyStatement + /// + /// A statement carrying framework metadata about a (resource, property) pair within a managed document. Distinct from rdf:Statement, which identifies a specific (subject, predicate, object) triple: a PropertyStatement scopes to the property as a whole. Used by property-level CRDT bookkeeping such as the last-write versioned clock (crdt:vclk) for LWW/FWW conflict resolution. Identified by the (sync:resource, sync:property) pair. + /// + static const PropertyStatement = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#PropertyStatement', + ); + /// IRI for sync:BlankNodeMapping /// /// Represents a mapping between a canonical fragment identifier and a blank node in the document. Used for stable references to identified blank nodes across serialization boundaries. @@ -80,9 +88,9 @@ class Sync { 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', ); - /// IRI for sync:hasStatement [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement] + /// IRI for sync:hasStatement /// - /// Links a managed document to RDF reification statements that contain framework metadata such as property tombstones. This ensures all framework metadata remains connected to the document for proper framework/app data separation during graph traversal. + /// Links a managed document to framework metadata statements: RDF reified value-level statements (rdf:Statement) for property-value tombstones, sync:PropertyStatement for property-level CRDT bookkeeping (e.g. last-write versioned clocks), and sync:ResourceStatement for resource-level metadata such as resource tombstones. This keeps all framework metadata connected to the document for proper framework/app data separation during graph traversal. /// /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#ManagedDocument /// @@ -92,14 +100,24 @@ class Sync { /// IRI for sync:resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] /// - /// Points to the resource that this framework statement is about. Used in resource statements to identify which resource the metadata applies to. + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). /// - /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#ResourceStatement + /// Can be used on all classes in this vocabulary /// static const resource = IriTerm( 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', ); + /// IRI for sync:property [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#Property] + /// + /// The RDF property that a sync:PropertyStatement refers to. Together with sync:resource it identifies the (resource, property) pair the framework metadata is about. + /// + /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#PropertyStatement + /// + static const property = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#property', + ); + /// IRI for sync:hasBlankNodeMapping [Expects: https://w3id.org/solid-crdt-sync/vocab/sync#BlankNodeMapping] /// /// Links the managed document to framework-reserved fragment identifiers for identified blank nodes. diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/classes/blanknodemapping.dart b/packages/locorda_core/lib/src/vocab/generated/sync/classes/blanknodemapping.dart index 8edb8ffa..23a82868 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/classes/blanknodemapping.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/classes/blanknodemapping.dart @@ -48,6 +48,16 @@ class SyncBlankNodeMapping { 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', ); + /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). + /// + /// Can be used on all classes in this vocabulary + /// + static const resource = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', + ); + /// blankNode /// /// Links a framework-reserved fragment identifier to the actual blank node in the document. diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/classes/identificationgraph.dart b/packages/locorda_core/lib/src/vocab/generated/sync/classes/identificationgraph.dart index ba3caade..21a8653d 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/classes/identificationgraph.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/classes/identificationgraph.dart @@ -48,6 +48,16 @@ class SyncIdentificationGraph { 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', ); + /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). + /// + /// Can be used on all classes in this vocabulary + /// + static const resource = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', + ); + /// parent /// /// Links an identified blank node to its parent resource within an identification graph during canonical fragment computation. diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/classes/manageddocument.dart b/packages/locorda_core/lib/src/vocab/generated/sync/classes/manageddocument.dart index 64c54450..a68e30c8 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/classes/manageddocument.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/classes/manageddocument.dart @@ -51,9 +51,9 @@ class SyncManagedDocument { 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', ); - /// hasStatement [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement] + /// hasStatement /// - /// Links a managed document to RDF reification statements that contain framework metadata such as property tombstones. This ensures all framework metadata remains connected to the document for proper framework/app data separation during graph traversal. + /// Links a managed document to framework metadata statements: RDF reified value-level statements (rdf:Statement) for property-value tombstones, sync:PropertyStatement for property-level CRDT bookkeeping (e.g. last-write versioned clocks), and sync:ResourceStatement for resource-level metadata such as resource tombstones. This keeps all framework metadata connected to the document for proper framework/app data separation during graph traversal. /// /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#ManagedDocument /// @@ -61,6 +61,16 @@ class SyncManagedDocument { 'https://w3id.org/solid-crdt-sync/vocab/sync#hasStatement', ); + /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). + /// + /// Can be used on all classes in this vocabulary + /// + static const resource = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', + ); + /// hasBlankNodeMapping [Expects: https://w3id.org/solid-crdt-sync/vocab/sync#BlankNodeMapping] /// /// Links the managed document to framework-reserved fragment identifiers for identified blank nodes. diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/classes/propertystatement.dart b/packages/locorda_core/lib/src/vocab/generated/sync/classes/propertystatement.dart new file mode 100644 index 00000000..09439be9 --- /dev/null +++ b/packages/locorda_core/lib/src/vocab/generated/sync/classes/propertystatement.dart @@ -0,0 +1,308 @@ +// Copyright (c) 2025, Klas Kalaß +// All rights reserved. Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// GENERATED CODE - DO NOT MODIFY BY HAND +// Generated by VocabularyBuilder + +import 'package:locorda_rdf_core/core.dart'; + +/// PropertyStatement class from Sync vocabulary +/// +/// A statement carrying framework metadata about a (resource, property) pair within a managed document. Distinct from rdf:Statement, which identifies a specific (subject, predicate, object) triple: a PropertyStatement scopes to the property as a whole. Used by property-level CRDT bookkeeping such as the last-write versioned clock (crdt:vclk) for LWW/FWW conflict resolution. Identified by the (sync:resource, sync:property) pair. +/// +/// Inherits from: +/// - Resource (http://www.w3.org/2000/01/rdf-schema#Resource) +/// +/// This class provides access to all properties that can be used with PropertyStatement. +/// [Class Reference](https://w3id.org/solid-crdt-sync/vocab/sync#PropertyStatement) +/// +/// [Vocabulary Reference](https://w3id.org/solid-crdt-sync/vocab/sync#) +class SyncPropertyStatement { + // Private constructor prevents instantiation + const SyncPropertyStatement._(); + + /// IRI term for the PropertyStatement class + /// Use this to specify that a resource is of this type. + static const classIri = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#PropertyStatement', + ); + + /// isGovernedBy [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#List] + /// + /// Links a data or index resource to an ordered list (rdf:List) of public mapping files that define its merge behavior. Documents are merged in list order with 'first wins' semantics - implementations should append only, not prepend, to avoid overriding existing definitions. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const isGovernedBy = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#isGovernedBy', + ); + + /// managedResourceType [Expects: http://www.w3.org/2000/01/rdf-schema#Class] + /// + /// Identifies the semantic RDF class of the resources being managed (e.g., schema:Recipe). Used in two contexts: (1) Within solid:TypeRegistration entries where solid:forClass is sync:ManagedDocument, enabling framework-aware applications to discover containers holding specific semantic types. (2) Directly on sync:ManagedDocument instances to enable efficient garbage collection and retention policies without requiring document content fetching. + /// + /// Can be used on all classes in this vocabulary + /// + static const managedResourceType = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', + ); + + /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). + /// + /// Can be used on all classes in this vocabulary + /// + static const resource = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', + ); + + /// property [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#Property] + /// + /// The RDF property that a sync:PropertyStatement refers to. Together with sync:resource it identifies the (resource, property) pair the framework metadata is about. + /// + /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#PropertyStatement + /// + static const property = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#property', + ); + + /// type from rdf vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Class] + /// + /// The subject is an instance of a class. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfType = IriTerm( + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', + ); + + /// value from rdf vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Idiomatic property used for structured values. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfValue = IriTerm( + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#value', + ); + + /// comment from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Literal] + /// + /// A description of the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsComment = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#comment', + ); + + /// label from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Literal] + /// + /// A human-readable name for the subject. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsLabel = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#label', + ); + + /// seeAlso from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Further information about the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsSeeAlso = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#seeAlso', + ); + + /// isDefinedBy from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The definition of the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsIsDefinedBy = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#isDefinedBy', + ); + + /// member from rdfs vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// A member of the subject resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const rdfsMember = IriTerm( + 'http://www.w3.org/2000/01/rdf-schema#member', + ); + + /// annotatedProperty from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The property that determines the predicate of an annotated axiom or annotated annotation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlAnnotatedProperty = IriTerm( + 'http://www.w3.org/2002/07/owl#annotatedProperty', + ); + + /// annotatedSource from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The property that determines the subject of an annotated axiom or annotated annotation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlAnnotatedSource = IriTerm( + 'http://www.w3.org/2002/07/owl#annotatedSource', + ); + + /// annotatedTarget from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The property that determines the object of an annotated axiom or annotated annotation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlAnnotatedTarget = IriTerm( + 'http://www.w3.org/2002/07/owl#annotatedTarget', + ); + + /// deprecated from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The annotation property that indicates that a given entity has been deprecated. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlDeprecated = IriTerm( + 'http://www.w3.org/2002/07/owl#deprecated', + ); + + /// members from owl vocabulary [Expects: http://www.w3.org/1999/02/22-rdf-syntax-ns#List] + /// + /// The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlMembers = IriTerm('http://www.w3.org/2002/07/owl#members'); + + /// versionInfo from owl vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// The annotation property that provides version information for an ontology or another OWL construct. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const owlVersionInfo = IriTerm( + 'http://www.w3.org/2002/07/owl#versionInfo', + ); + + /// abstract_ from bibo vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Literal] + /// + /// A summary of the resource. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const biboAbstract_ = IriTerm( + 'http://purl.org/ontology/bibo/abstract', + ); + + /// hasClockEntry from crdt vocabulary [Expects: https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#ClockEntry] + /// + /// Links a resource to a IRI resource representing a single entry in its Hybrid Logical Clock (HLC). Each entry tracks both logical time (causality) and physical time (for intuitive tie-breaking) for one installation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtHasClockEntry = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#hasClockEntry', + ); + + /// clockHash from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#string] + /// + /// A pre-calculated, lightweight hash of the resource's full Hybrid Logical Clock, used for efficient change detection in indices. Hash includes only the logical time component (causality state), excluding physical time (which is merely an annotation for tie-breaking). Domain is kept general (rdfs:Resource) to allow usage in various contexts including idx:ShardEntry instances. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtClockHash = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#clockHash', + ); + + /// createdAt from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#dateTime] + /// + /// Framework-managed timestamp marking when a document or installation was created/recreated. Uses OR-Set semantics to support recreation scenarios and solve zombie deletion problems. Combined with crdt:deletedAt using temporal ordering: document is deleted if max(deletedAt) > max(createdAt). Framework automatically adds creation timestamps during document creation. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtCreatedAt = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#createdAt', + ); + + /// deletedAt from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#dateTime] + /// + /// Framework-managed timestamp marking when a document or property value was deleted. For documents: uses OR-Set semantics combined with crdt:createdAt for temporal lifecycle management (document deleted if max(deletedAt) > max(createdAt)), solving zombie deletion problems during recreation scenarios. For property values: simple tombstone semantics using RDF reification (value deleted if reification statement with crdt:deletedAt exists). Framework automatically manages this property by detecting deletions through state comparison - developers simply provide updated resource state and the library implementation handles tombstone creation automatically. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtDeletedAt = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#deletedAt', + ); + + /// documentTombstoneRetentionPeriod from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#duration] + /// + /// Duration to retain document tombstones (complete deleted documents) before garbage collection. Expressed as ISO 8601 duration (e.g., 'P2Y' for 2 years). Applied to storage backend configuration documents. Longer retention recommended due to high impact of zombie deletions affecting recreated documents. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtDocumentTombstoneRetentionPeriod = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#documentTombstoneRetentionPeriod', + ); + + /// enableDocumentTombstoneCleanup from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#boolean] + /// + /// Boolean flag indicating whether the framework should automatically clean up document tombstones after the retention period. Applied to storage backend configuration documents. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtEnableDocumentTombstoneCleanup = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#enableDocumentTombstoneCleanup', + ); + + /// propertyTombstoneRetentionPeriod from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#duration] + /// + /// Duration to retain property tombstones (deleted values within multi-value properties) before garbage collection. Expressed as ISO 8601 duration (e.g., 'P6M' for 6 months). Applied to storage backend configuration documents. Shorter retention acceptable due to lower impact of zombie deletions. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtPropertyTombstoneRetentionPeriod = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#propertyTombstoneRetentionPeriod', + ); + + /// enablePropertyTombstoneCleanup from crdt vocabulary [Expects: http://www.w3.org/2001/XMLSchema#boolean] + /// + /// Boolean flag indicating whether the framework should automatically clean up property tombstones after the retention period. Applied to storage backend configuration documents. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const crdtEnablePropertyTombstoneCleanup = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/crdt-mechanics#enablePropertyTombstoneCleanup', + ); + + /// belongsToIndexShard from idx vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Links a data resource to the specific index shard it is a member of. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const idxBelongsToIndexShard = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/idx#belongsToIndexShard', + ); + + /// isShardOf from idx vocabulary [Expects: https://w3id.org/solid-crdt-sync/vocab/idx#Index] + /// + /// A back-link from a shard to the root index or partition it belongs to. + /// + /// Can be used on: http://www.w3.org/2000/01/rdf-schema#Resource + /// + static const idxIsShardOf = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/idx#isShardOf', + ); +} diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/classes/resourcestatement.dart b/packages/locorda_core/lib/src/vocab/generated/sync/classes/resourcestatement.dart index c7a5f8fb..505d7160 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/classes/resourcestatement.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/classes/resourcestatement.dart @@ -50,9 +50,9 @@ class SyncResourceStatement { /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] /// - /// Points to the resource that this framework statement is about. Used in resource statements to identify which resource the metadata applies to. + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). /// - /// Can be used on: https://w3id.org/solid-crdt-sync/vocab/sync#ResourceStatement + /// Can be used on all classes in this vocabulary /// static const resource = IriTerm( 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/classes/syncfile.dart b/packages/locorda_core/lib/src/vocab/generated/sync/classes/syncfile.dart index b1fb2ef5..5fb5fc8d 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/classes/syncfile.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/classes/syncfile.dart @@ -48,6 +48,16 @@ class SyncSyncFile { 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', ); + /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). + /// + /// Can be used on all classes in this vocabulary + /// + static const resource = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', + ); + /// type from rdf vocabulary [Expects: http://www.w3.org/2000/01/rdf-schema#Class] /// /// The subject is an instance of a class. diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/index.dart b/packages/locorda_core/lib/src/vocab/generated/sync/index.dart index 7d9789c8..d2eeddfc 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/index.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/index.dart @@ -8,6 +8,7 @@ export 'classes/blanknodemapping.dart'; export 'classes/identificationgraph.dart'; export 'classes/manageddocument.dart'; +export 'classes/propertystatement.dart'; export 'classes/resourcestatement.dart'; export 'classes/syncfile.dart'; export 'sync_universal.dart'; diff --git a/packages/locorda_core/lib/src/vocab/generated/sync/sync_universal.dart b/packages/locorda_core/lib/src/vocab/generated/sync/sync_universal.dart index e87633f8..15a05339 100644 --- a/packages/locorda_core/lib/src/vocab/generated/sync/sync_universal.dart +++ b/packages/locorda_core/lib/src/vocab/generated/sync/sync_universal.dart @@ -28,4 +28,12 @@ class SyncUniversalProperties { static const managedResourceType = IriTerm( 'https://w3id.org/solid-crdt-sync/vocab/sync#managedResourceType', ); + + /// resource [Expects: http://www.w3.org/2000/01/rdf-schema#Resource] + /// + /// Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to). + /// + static const resource = IriTerm( + 'https://w3id.org/solid-crdt-sync/vocab/sync#resource', + ); } diff --git a/packages/locorda_core/test/assets/graph/all_tests.json b/packages/locorda_core/test/assets/graph/all_tests.json index 11a4bf99..cb36d3ec 100644 --- a/packages/locorda_core/test/assets/graph/all_tests.json +++ b/packages/locorda_core/test/assets/graph/all_tests.json @@ -1311,6 +1311,111 @@ } } ] + }, + { + "id": "save_43", + "title": "Concurrent LWW updates to different properties on same resource (issue #50)", + "description": "BUG #50 REGRESSION TEST: Two installations concurrently modify different LWW-Register properties of the same Recipe. Installation A changes only schema:name; installation B changes only schema:description. Without per-property crdt:VersionedClock stamping (issue #50), the concurrent document clocks would tie-break via hash and one installation's edit would be silently dropped. With the fix, each property is resolved independently via PropertyStatement.vclk (with appBaseClock fallback for the unchanged side), so BOTH edits must survive in the merged state: name='Updated by A' AND description='Updated by B'.", + "installations": [ + { + "id": "installation-a", + "config": "shared/configs/basic_config.json" + }, + { + "id": "installation-b", + "config": "shared/configs/basic_config.json" + } + ], + "steps": [ + { + "action": "save", + "installation_id": "installation-a", + "typeIri": "https://schema.org/Recipe", + "input_resource": "test_cases/save/43_concurrent_lww_different_props/00_installation-a_save/input_resource.ttl", + "action_ts": { + "save": "2024-01-01T02:00:00Z" + } + }, + { + "action": "sync", + "installation_id": "installation-a", + "action_ts": { + "sync": "2024-01-01T02:05:00Z" + }, + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage", + "remote_documents_dir": "test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote" + } + }, + { + "action": "sync", + "installation_id": "installation-b", + "action_ts": { + "sync": "2024-01-01T02:10:00Z" + }, + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage", + "remote_documents_dir": "test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote" + } + }, + { + "action": "save", + "installation_id": "installation-a", + "typeIri": "https://schema.org/Recipe", + "input_resource": "test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/input_resource.ttl", + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage" + }, + "action_ts": { + "save": "2024-01-01T03:00:00Z" + } + }, + { + "action": "save", + "installation_id": "installation-b", + "typeIri": "https://schema.org/Recipe", + "input_resource": "test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/input_resource.ttl", + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage" + }, + "action_ts": { + "save": "2024-01-01T03:30:00Z" + } + }, + { + "action": "sync", + "installation_id": "installation-a", + "action_ts": { + "sync": "2024-01-01T04:00:00Z" + }, + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage", + "remote_documents_dir": "test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote" + } + }, + { + "action": "sync", + "installation_id": "installation-b", + "action_ts": { + "sync": "2024-01-01T04:30:00Z" + }, + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage", + "remote_documents_dir": "test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote" + } + }, + { + "action": "sync", + "installation_id": "installation-a", + "action_ts": { + "sync": "2024-01-01T05:00:00Z" + }, + "expected": { + "documents_dir": "test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage", + "remote_documents_dir": "test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote" + } + } + ] } ] }, diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/02_update_lww/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/02_update_lww/expected_stored_graph.ttl index 869c66d2..fd57d477 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/02_update_lww/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/02_update_lww/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -25,3 +27,22 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . + +ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/03_orset_add/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/03_orset_add/expected_stored_graph.ttl index 6e97a433..c8ce545b 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/03_orset_add/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/03_orset_add/expected_stored_graph.ttl @@ -12,6 +12,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -25,3 +26,10 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/04_orset_remove/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/04_orset_remove/expected_stored_graph.ttl index 8bce5384..cba052b2 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/04_orset_remove/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/04_orset_remove/expected_stored_graph.ttl @@ -12,6 +12,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -31,3 +32,10 @@ ns2:lcrd-stmt-md5-da04f8c152ad75e387d7a498600b4a00 rdf:object "cocoa"; rdf:predicate schema:recipeIngredient; rdf:subject ns2:it; cm:deletedAt "2024-01-01T02:00:00.000Z"^^xsd:dateTime . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/05_multiple_properties/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/05_multiple_properties/expected_stored_graph.ttl index 50ea1da7..f5bb611a 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/05_multiple_properties/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/05_multiple_properties/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -25,3 +27,22 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . + +ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/08_update_nested/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/08_update_nested/expected_stored_graph.ttl index d1770a43..a67420c4 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/08_update_nested/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/08_update_nested/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-8f115708d07ff9082929382a97347f40, ns2:lcrd-prop-md5-0b7dda5b200f2a9d59a9bc156132108e; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -27,6 +29,30 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . +ns2:lcrd-prop-md5-0b7dda5b200f2a9d59a9bc156132108e a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:fatContent; + sync:resource ns2:nutrition . + +ns2:lcrd-prop-md5-8f115708d07ff9082929382a97347f40 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:calories; + sync:resource ns2:nutrition . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . + ns2:nutrition a schema:NutritionInformation; schema:calories "400 kcal"; schema:fatContent "20g" . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/09_remove_nested/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/09_remove_nested/expected_stored_graph.ttl index bc9044ed..bbb05a5f 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/09_remove_nested/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/09_remove_nested/expected_stored_graph.ttl @@ -12,11 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; - sync:hasStatement ns2:lcrd-stmt-md5-1b2a9046fb09a6dd5ba114df9881602a; + sync:hasStatement ns2:lcrd-stmt-md5-1b2a9046fb09a6dd5ba114df9881602a, ns2:lcrd-prop-md5-3d411ba6b8a50e21870627ace06ed8aa; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -27,5 +28,24 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . +ns2:lcrd-prop-md5-3d411ba6b8a50e21870627ace06ed8aa a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:nutrition; + sync:resource ns2:it . + ns2:lcrd-stmt-md5-1b2a9046fb09a6dd5ba114df9881602a rdf:subject ns2:nutrition; cm:deletedAt "2024-01-01T02:00:00.000Z"^^xsd:dateTime . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/10_add_nested/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/10_add_nested/expected_stored_graph.ttl index 31ff47a9..704a706c 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/10_add_nested/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/10_add_nested/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-f1e19c9f00507500f66ce6584e4e25f9, ns2:lcrd-prop-md5-8f115708d07ff9082929382a97347f40, ns2:lcrd-prop-md5-0b7dda5b200f2a9d59a9bc156132108e, ns2:lcrd-prop-md5-3d411ba6b8a50e21870627ace06ed8aa; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -27,6 +29,40 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . +ns2:lcrd-prop-md5-0b7dda5b200f2a9d59a9bc156132108e a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:fatContent; + sync:resource ns2:nutrition . + +ns2:lcrd-prop-md5-3d411ba6b8a50e21870627ace06ed8aa a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:nutrition; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-8f115708d07ff9082929382a97347f40 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:calories; + sync:resource ns2:nutrition . + +ns2:lcrd-prop-md5-f1e19c9f00507500f66ce6584e4e25f9 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property rdf:type; + sync:resource ns2:nutrition . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . + ns2:nutrition a schema:NutritionInformation; schema:calories "350 kcal"; schema:fatContent "15g" . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/11_foreign_clock_preserved/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/11_foreign_clock_preserved/expected_stored_graph.ttl index c23f64a7..002d7d80 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/11_foreign_clock_preserved/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/11_foreign_clock_preserved/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-8caa675623ff85fda7adebfbcca83c58; cm:clockHash "63c64c08464af4c552c8b66c465f07d0"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54, ns2:lcrd-clk-md5-foreign-installation-abc123; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -29,3 +31,32 @@ ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; ns2:lcrd-clk-md5-foreign-installation-abc123 cm:installationId "foreign-installation-abc123"; cm:logicalTime 5; cm:physicalTime 1704060000000 . + +ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-64d641f0204edb20811bb533165eea68; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-64d641f0204edb20811bb533165eea68 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-foreign-installation-abc123 ; + cm:logicalTime 5 ; + cm:physicalTime 1704060000000 + ] . + +ns2:lcrd-vclk-md5-8caa675623ff85fda7adebfbcca83c58 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-foreign-installation-abc123 ; + cm:logicalTime 5 ; + cm:physicalTime 1704060000000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/13_blank_node_preserved/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/13_blank_node_preserved/expected_stored_graph.ttl index ca0ddd2b..2384ff8a 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/13_blank_node_preserved/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/13_blank_node_preserved/expected_stored_graph.ttl @@ -12,11 +12,13 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31; + sync:hasStatement ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -29,6 +31,25 @@ ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31 sync:blankNode _:b1 . +ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . + _:b1 a schema:Ingredient; schema:amount "2"; schema:name "Tomato"; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/14_update_blank_node_property/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/14_update_blank_node_property/expected_stored_graph.ttl index bd77e02e..a3d2f5ec 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/14_update_blank_node_property/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/14_update_blank_node_property/expected_stored_graph.ttl @@ -12,11 +12,13 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31; + sync:hasStatement ns2:lcrd-prop-md5-7307c7e2989abedceb7547f39503edd1; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -29,6 +31,25 @@ ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31 sync:blankNode _:b1 . +ns2:lcrd-prop-md5-7307c7e2989abedceb7547f39503edd1 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:amount; + sync:resource ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31 . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . + _:b1 a schema:Ingredient; schema:amount "3"; schema:name "Tomato"; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/15_add_blank_node/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/15_add_blank_node/expected_stored_graph.ttl index e18ce66a..8f5eedfb 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/15_add_blank_node/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/15_add_blank_node/expected_stored_graph.ttl @@ -12,11 +12,13 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31, ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9; + sync:hasStatement ns2:lcrd-prop-md5-3230c1f154585375018cb313b8986302, ns2:lcrd-prop-md5-515fad1a4a85725af77d340b1ec406dc, ns2:lcrd-prop-md5-bcd64b1ce78ab3ec526812a9cbbedfe9, ns2:lcrd-prop-md5-a591ecabe71b717675a754a7cd355834; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -32,6 +34,40 @@ ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31 sync:blankNode _:b1 . ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 sync:blankNode _:b2 . +ns2:lcrd-prop-md5-3230c1f154585375018cb313b8986302 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property rdf:type; + sync:resource ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 . + +ns2:lcrd-prop-md5-515fad1a4a85725af77d340b1ec406dc a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:name; + sync:resource ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 . + +ns2:lcrd-prop-md5-a591ecabe71b717675a754a7cd355834 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:unit; + sync:resource ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 . + +ns2:lcrd-prop-md5-bcd64b1ce78ab3ec526812a9cbbedfe9 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:amount; + sync:resource ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . + _:b1 a schema:Ingredient; schema:amount "2"; schema:name "Tomato"; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/16_remove_blank_node/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/16_remove_blank_node/expected_stored_graph.ttl index 2a73acb5..a4d467b8 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/16_remove_blank_node/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/16_remove_blank_node/expected_stored_graph.ttl @@ -12,6 +12,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -43,6 +44,13 @@ ns2:lcrd-stmt-md5-b60ce8dfd7137a7fc32781730de92a52 rdf:object ns2:lcrd-ibn-md5-9 rdf:subject ; cm:deletedAt "2024-01-01T02:00:00.000Z"^^xsd:dateTime . +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + _:b1 a schema:Ingredient; schema:amount "2"; schema:name "Tomato"; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/17_update_with_property_tombstones/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/17_update_with_property_tombstones/expected_stored_graph.ttl index 11739f9f..713d4aa5 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/17_update_with_property_tombstones/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/17_update_with_property_tombstones/expected_stored_graph.ttl @@ -12,11 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; cm:clockHash "549f50a511ce9450520e552cdca63e53"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; - sync:hasStatement ns2:lcrd-stmt-md5-aabbccdd, ns2:lcrd-stmt-md5-11223344; + sync:hasStatement ns2:lcrd-stmt-md5-aabbccdd, ns2:lcrd-stmt-md5-11223344, ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4, ns2:lcrd-prop-md5-36de68d8a16041ceea7a85efdab5f48e; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -29,6 +30,16 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 3; cm:physicalTime 1704074400000 . +ns2:lcrd-prop-md5-36de68d8a16041ceea7a85efdab5f48e a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403; + sync:property schema:prepTime; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403; + sync:property schema:name; + sync:resource ns2:it . + ns2:lcrd-stmt-md5-11223344 rdf:object "PT45M"; rdf:predicate schema:cookTime; rdf:subject ns2:it; @@ -38,3 +49,17 @@ ns2:lcrd-stmt-md5-aabbccdd rdf:object "cocoa"; rdf:predicate schema:recipeIngredient; rdf:subject ns2:it; cm:deletedAt "2024-01-01T00:00:00.001Z"^^xsd:dateTime . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 3 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/18_delete_with_existing_tombstones/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/18_delete_with_existing_tombstones/expected_stored_graph.ttl index ffdb8b3a..8a26a50a 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/18_delete_with_existing_tombstones/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/18_delete_with_existing_tombstones/expected_stored_graph.ttl @@ -12,11 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; cm:clockHash "549f50a511ce9450520e552cdca63e53"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; - sync:hasStatement ns2:lcrd-stmt-md5-oldtombstone, ns2:lcrd-stmt-md5-09e4720c9aec749419ac6126e81870c7; + sync:hasStatement ns2:lcrd-stmt-md5-oldtombstone, ns2:lcrd-stmt-md5-09e4720c9aec749419ac6126e81870c7, ns2:lcrd-prop-md5-f2b43b1ac798c8963cd03f9fa4bb39c1; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -28,6 +29,11 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 3; cm:physicalTime 1704074400000 . +ns2:lcrd-prop-md5-f2b43b1ac798c8963cd03f9fa4bb39c1 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403; + sync:property schema:cookTime; + sync:resource ns2:it . + ns2:lcrd-stmt-md5-09e4720c9aec749419ac6126e81870c7 rdf:object "eggs"; rdf:predicate schema:recipeIngredient; rdf:subject ns2:it; @@ -37,3 +43,17 @@ ns2:lcrd-stmt-md5-oldtombstone rdf:object "cocoa"; rdf:predicate schema:recipeIngredient; rdf:subject ns2:it; cm:deletedAt "2024-01-01T00:00:00.001Z"^^xsd:dateTime . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 3 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/19_update_with_resource_tombstone/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/19_update_with_resource_tombstone/expected_stored_graph.ttl index e1c3f401..e80b58aa 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/19_update_with_resource_tombstone/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/19_update_with_resource_tombstone/expected_stored_graph.ttl @@ -12,11 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403; cm:clockHash "287f965265c6f8c9f28cb5f62e062d42"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; - sync:hasStatement ns2:lcrd-stmt-md5-nested-resource-tombstone, ns2:lcrd-stmt-md5-prop-tombstone; + sync:hasStatement ns2:lcrd-stmt-md5-nested-resource-tombstone, ns2:lcrd-stmt-md5-prop-tombstone, ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4, ns2:lcrd-prop-md5-f2b43b1ac798c8963cd03f9fa4bb39c1, ns2:lcrd-prop-md5-36de68d8a16041ceea7a85efdab5f48e; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -29,6 +30,21 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 4; cm:physicalTime 1704074400000 . +ns2:lcrd-prop-md5-36de68d8a16041ceea7a85efdab5f48e a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-62fff66a5427399e86bfa360711ee763; + sync:property schema:prepTime; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-8c934c148cfbdb52ad4ea7f4b363a7c4 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-62fff66a5427399e86bfa360711ee763; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-f2b43b1ac798c8963cd03f9fa4bb39c1 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-62fff66a5427399e86bfa360711ee763; + sync:property schema:cookTime; + sync:resource ns2:it . + ns2:lcrd-stmt-md5-nested-resource-tombstone rdf:subject ns2:nutrition; cm:deletedAt "2024-01-01T01:00:00.000Z"^^xsd:dateTime . @@ -36,3 +52,17 @@ ns2:lcrd-stmt-md5-prop-tombstone rdf:object "cocoa"; rdf:predicate schema:recipeIngredient; rdf:subject ns2:it; cm:deletedAt "2024-01-01T00:30:00.000Z"^^xsd:dateTime . + +ns2:lcrd-vclk-md5-5db318e3f09543a9c08bd25721313403 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 3 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-62fff66a5427399e86bfa360711ee763 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 4 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/21_non_identified_blank_node_update/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/21_non_identified_blank_node_update/expected_stored_graph.ttl index f2911b7c..89f33e92 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/21_non_identified_blank_node_update/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/21_non_identified_blank_node_update/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-3d411ba6b8a50e21870627ace06ed8aa; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -25,3 +27,22 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . + +ns2:lcrd-prop-md5-3d411ba6b8a50e21870627ace06ed8aa a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:nutrition; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/22_multiple_refs_identified_remove_one/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/22_multiple_refs_identified_remove_one/expected_stored_graph.ttl index 79ee8bef..e81a5a56 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/22_multiple_refs_identified_remove_one/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/22_multiple_refs_identified_remove_one/expected_stored_graph.ttl @@ -12,6 +12,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -53,6 +54,13 @@ ns2:lcrd-stmt-md5-cd1d2310a69f01b476c46e29bbe76ee3 rdf:object ns2:lcrd-ibn-md5-6 rdf:subject ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9; cm:deletedAt "2024-01-01T02:00:00.000Z"^^xsd:dateTime . +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + _:b1 a schema:Ingredient; schema:amount "2"; schema:name "Tomato"; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/23_multiple_refs_unidentified_remove_one/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/23_multiple_refs_unidentified_remove_one/expected_stored_graph.ttl index d291cf0d..50791443 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/23_multiple_refs_unidentified_remove_one/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/23_multiple_refs_unidentified_remove_one/expected_stored_graph.ttl @@ -12,11 +12,13 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31, ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9; + sync:hasStatement ns2:lcrd-prop-md5-d991f40dcd13aaa52994b325b0d101f1; sync:isGovernedBy (mappings:recipe-v1-unidentified mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -32,6 +34,25 @@ ns2:lcrd-ibn-md5-74f4d0cc07fa8ce00b8856defa9a0e31 sync:blankNode _:b2 . ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 sync:blankNode _:b3 . +ns2:lcrd-prop-md5-d991f40dcd13aaa52994b325b0d101f1 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:provider; + sync:resource ns2:lcrd-ibn-md5-9110880a000d224b944a75c68db15db9 . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . + _:b2 a schema:Ingredient; schema:amount "2"; schema:name "Tomato"; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/24_multiple_refs_all_unidentified_remove_one/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/24_multiple_refs_all_unidentified_remove_one/expected_stored_graph.ttl index 232727f0..f9e6b65a 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/24_multiple_refs_all_unidentified_remove_one/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/24_multiple_refs_all_unidentified_remove_one/expected_stored_graph.ttl @@ -12,10 +12,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-1010dd038cc08762e4eba91514d9338f; sync:isGovernedBy (mappings:recipe-v1-all-unidentified mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -41,3 +43,22 @@ ns2:it a schema:Recipe; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704074400000 . + +ns2:lcrd-prop-md5-1010dd038cc08762e4eba91514d9338f a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d; + sync:property schema:recipeIngredient; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704067200000 + ] . + +ns2:lcrd-vclk-md5-4558432211e2150a5239aad543210f2d a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/29_path_identified_update/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/29_path_identified_update/expected_stored_graph.ttl index e5433048..985a6f5a 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/29_path_identified_update/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/29_path_identified_update/expected_stored_graph.ttl @@ -13,11 +13,13 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-bdc93e14afd13a8e69ab6b850492e620; cm:clockHash "5e975371b43f587c767318ae04281976"; cm:createdAt "2024-01-15T10:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066; + sync:hasStatement ns2:lcrd-prop-md5-d3b338c086c2a032496f096c3d8b070d, ns2:lcrd-prop-md5-b8daf44111d8a7cdd46223b6e08db33b, ns2:lcrd-prop-md5-34bd45a845b6b81763835af170f73010; sync:isGovernedBy (mappings:category-v1); sync:managedResourceType pn:NotesCategory . @@ -30,6 +32,35 @@ ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066 sync:blankNode _:b1 . +ns2:lcrd-prop-md5-34bd45a845b6b81763835af170f73010 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a5e991fbc4e809dc0655eb3b33ae4de6; + sync:property pn:showArchived; + sync:resource ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066 . + +ns2:lcrd-prop-md5-b8daf44111d8a7cdd46223b6e08db33b a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a5e991fbc4e809dc0655eb3b33ae4de6; + sync:property pn:defaultView; + sync:resource ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066 . + +ns2:lcrd-prop-md5-d3b338c086c2a032496f096c3d8b070d a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a5e991fbc4e809dc0655eb3b33ae4de6; + sync:property pn:sortOrder; + sync:resource ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066 . + +ns2:lcrd-vclk-md5-a5e991fbc4e809dc0655eb3b33ae4de6 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1705320000000 + ] . + +ns2:lcrd-vclk-md5-bdc93e14afd13a8e69ab6b850492e620 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1705312800000 + ] . + _:b1 a pn:CategoryDisplaySettings; pn:defaultView "kanban"; pn:showArchived true; diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/30_path_identified_delete/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/30_path_identified_delete/expected_stored_graph.ttl index 9772cf26..e6e4e98d 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/30_path_identified_delete/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/30_path_identified_delete/expected_stored_graph.ttl @@ -13,11 +13,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-bdc93e14afd13a8e69ab6b850492e620; cm:clockHash "5e975371b43f587c767318ae04281976"; cm:createdAt "2024-01-15T10:00:00.000Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; - sync:hasStatement ns2:lcrd-stmt-md5-51c0aaf901155741b2ced37f43344f1d, ns2:lcrd-stmt-md5-3a9a8156aeb17b893d5b245115a50844; + sync:hasStatement ns2:lcrd-stmt-md5-51c0aaf901155741b2ced37f43344f1d, ns2:lcrd-prop-md5-85d53b918f38ff3f7bd3348653f5839d, ns2:lcrd-stmt-md5-3a9a8156aeb17b893d5b245115a50844; sync:isGovernedBy (mappings:category-v1); sync:managedResourceType pn:NotesCategory . @@ -27,6 +28,11 @@ ns2:it a pn:NotesCategory; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1705327200000 . +ns2:lcrd-prop-md5-85d53b918f38ff3f7bd3348653f5839d a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a5e991fbc4e809dc0655eb3b33ae4de6; + sync:property pn:displaySettings; + sync:resource ns2:it . + ns2:lcrd-stmt-md5-3a9a8156aeb17b893d5b245115a50844 rdf:object ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066; rdf:predicate sync:hasBlankNodeMapping; rdf:subject ; @@ -34,3 +40,17 @@ ns2:lcrd-stmt-md5-3a9a8156aeb17b893d5b245115a50844 rdf:object ns2:lcrd-ibn-md5-b ns2:lcrd-stmt-md5-51c0aaf901155741b2ced37f43344f1d rdf:subject ns2:lcrd-ibn-md5-b0f8d3e19516fa4e6e86d0f500bf3066; cm:deletedAt "2024-01-15T14:00:00.000Z"^^xsd:dateTime . + +ns2:lcrd-vclk-md5-a5e991fbc4e809dc0655eb3b33ae4de6 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 2 ; + cm:physicalTime 1705327200000 + ] . + +ns2:lcrd-vclk-md5-bdc93e14afd13a8e69ab6b850492e620 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1705312800000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/expected_stored_graph.ttl index de9a3310..b020d5b7 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/expected_stored_graph.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ ns3:lcrd-stmt-md5-1b46b76763f9b2aada3acaa14d8412f4 rdf:object "Desserts"; rdf:predicate schema:recipeCategory; rdf:subject ns3:it; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl index de9a3310..b020d5b7 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ ns3:lcrd-stmt-md5-1b46b76763f9b2aada3acaa14d8412f4 rdf:object "Desserts"; rdf:predicate schema:recipeCategory; rdf:subject ns3:it; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/remote/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/remote/Recipe/recipe123.ttl index fe8df52c..682324b9 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/remote/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/remote/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ <> a sync:ManagedDocument; foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ rdf:predicate schema:recipeCategory; rdf:subject :it; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/storage/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/storage/Recipe/recipe123.ttl index de9a3310..b020d5b7 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/storage/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/33_update_group_membership/step_03_sync/storage/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ ns3:lcrd-stmt-md5-1b46b76763f9b2aada3acaa14d8412f4 rdf:object "Desserts"; rdf:predicate schema:recipeCategory; rdf:subject ns3:it; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/expected_stored_graph.ttl index 5b857313..6429ebd6 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/expected_stored_graph.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -27,3 +28,10 @@ ns3:it a schema:Recipe; ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704081600000 . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_01_save_updated/storage/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_01_save_updated/storage/Recipe/recipe123.ttl index 5b857313..6429ebd6 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_01_save_updated/storage/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_01_save_updated/storage/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -27,3 +28,10 @@ ns3:it a schema:Recipe; ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704081600000 . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/remote/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/remote/Recipe/recipe123.ttl index 4bfa1cc9..b46407d1 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/remote/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/remote/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ <> a sync:ManagedDocument; foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -27,3 +28,10 @@ :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704081600000 . + +:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/storage/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/storage/Recipe/recipe123.ttl index 5b857313..6429ebd6 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/storage/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/34_add_group_membership/step_02_sync/storage/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -27,3 +28,10 @@ ns3:it a schema:Recipe; ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 2; cm:physicalTime 1704081600000 . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/expected_stored_graph.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/expected_stored_graph.ttl index f68328e2..4437775e 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/expected_stored_graph.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/expected_stored_graph.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ ns3:lcrd-stmt-md5-66df6bbfe8c511f7733c3351c5604d0e rdf:object ns1:shard; rdf:predicate idx:belongsToIndexShard; rdf:subject ; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl index f68328e2..4437775e 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_02_save_updated/storage/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ ns3:lcrd-stmt-md5-66df6bbfe8c511f7733c3351c5604d0e rdf:object ns1:shard; rdf:predicate idx:belongsToIndexShard; rdf:subject ; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/remote/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/remote/Recipe/recipe123.ttl index 17ee8e54..90373fee 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/remote/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/remote/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ <> a sync:ManagedDocument; foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ rdf:predicate idx:belongsToIndexShard; rdf:subject <>; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/storage/Recipe/recipe123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/storage/Recipe/recipe123.ttl index f68328e2..4437775e 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/storage/Recipe/recipe123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/35_remove_group_membership/step_03_sync/storage/Recipe/recipe123.ttl @@ -13,6 +13,7 @@ a sync:ManagedDocument; foaf:primaryTopic ns3:it; + cm:appBaseClock ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae; cm:clockHash "4d9655a766ecf28a61e3491045e7c545"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; @@ -38,3 +39,10 @@ ns3:lcrd-stmt-md5-66df6bbfe8c511f7733c3351c5604d0e rdf:object ns1:shard; rdf:predicate idx:belongsToIndexShard; rdf:subject ; cm:deletedAt "2024-01-01T04:00:00.000Z"^^xsd:dateTime . + +ns3:lcrd-vclk-md5-2e5e09e1e3733bfa6ae828514347eeae a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns3:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/42_boolean_toggle_multiple/05/storage/Task/task-123.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/42_boolean_toggle_multiple/05/storage/Task/task-123.ttl index e7a7d5b7..599bf7af 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/save/42_boolean_toggle_multiple/05/storage/Task/task-123.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/save/42_boolean_toggle_multiple/05/storage/Task/task-123.ttl @@ -13,10 +13,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-c8ed3360fa034a74caa66dafc571f184; cm:clockHash "70a44486c8f2fcb161f97e057aefe057"; cm:createdAt "2024-01-01T01:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-08e5dbf1589f323918a57a507e0c8ff8; sync:isGovernedBy (mappings:task-v1); sync:managedResourceType task:Task . @@ -27,3 +29,22 @@ ns2:it a task:Task; ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 5; cm:physicalTime 1704085200000 . + +ns2:lcrd-prop-md5-08e5dbf1589f323918a57a507e0c8ff8 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-0be66a3a397cf8e2036a13602f0c7b53; + sync:property task:completed; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-0be66a3a397cf8e2036a13602f0c7b53 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 5 ; + cm:physicalTime 1704085200000 + ] . + +ns2:lcrd-vclk-md5-c8ed3360fa034a74caa66dafc571f184 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 ; + cm:logicalTime 1 ; + cm:physicalTime 1704070800000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/00_installation-a_save/input_resource.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/00_installation-a_save/input_resource.ttl new file mode 100644 index 00000000..780ccdfd --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/00_installation-a_save/input_resource.ttl @@ -0,0 +1,6 @@ +@prefix schema: . +@prefix ex: . + +ex:it a schema:Recipe ; + schema:name "Original Name" ; + schema:description "Original Description" . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..c053b362 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..2d02402f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,36 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "b8d533544c389681c7afd39051f67f71"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if3mm10v:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..4cf61a02 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,44 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "f41b280ba13945f96a83675bc8b6942c"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if5mm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..e0bbce54 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,43 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "b3c8a56f8f70ee4b346687365ce314d0"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifbmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..4b53b9bd --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,44 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifdmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "626320842daca5664b91254eb53f4e08"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifdmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..9b9b0d03 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,37 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "80f845944c541b21be0f6894133de683"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifemm10v:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..96101e5a --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Recipe/concurrent-recipe.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :it; + cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifemm10v:shard; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Original Name" . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704074400000 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..ae50285c --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,28 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "b370f5b25f4df96cdd0f17e113575c68"; + cm:createdAt "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +:shard a idx:Shard; + idx:containsEntry :entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf if3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..c5113da2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf if5:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..ca533c2b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,50 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if1: . +@prefix if2: . +@prefix ifb: . +@prefix ifd: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "bf6908fc7bf0707d7695d53c445ead5b"; + cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "b3c8a56f8f70ee4b346687365ce314d0"; + idx:indexesClass idx:FullIndex; + idx:resource ifb:index . + +:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "626320842daca5664b91254eb53f4e08"; + idx:indexesClass idx:GroupIndex; + idx:resource ifd:index . + +:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "b8d533544c389681c7afd39051f67f71"; + idx:indexesClass cm:ClientInstallation; + idx:resource if1:index . + +:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "80f845944c541b21be0f6894133de683"; + idx:indexesClass schema:Recipe; + idx:resource ife:index . + +:entry-ce394f730640668924968eddf09c01bc cm:clockHash "f41b280ba13945f96a83675bc8b6942c"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource if2:index . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +:shard a idx:Shard; + idx:containsEntry :entry-ce394f730640668924968eddf09c01bc, :entry-a68c1c4f5dda5dbf177113200fb133a0, :entry-713129f56a309cabc970f22c7da295cf, :entry-6532e1cce2063165cab55f9425c47e0d, :entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ifb:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b883ef80 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifd: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf ifd:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..10430c05 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,28 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "b226c39d6bc1abfa0dfadbb704019ba9"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + idx:resource . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700003 . + +:shard a idx:Shard; + idx:containsEntry :entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ife:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..9436e06b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..d86b72b7 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,37 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "b8d533544c389681c7afd39051f67f71"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns3:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..60a1e2e1 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,45 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "f41b280ba13945f96a83675bc8b6942c"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns3:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns2:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..dad382c9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,44 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "b3c8a56f8f70ee4b346687365ce314d0"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns3:shard; + sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns3:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns2:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..5426f322 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,45 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "626320842daca5664b91254eb53f4e08"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns3:shard; + sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns2:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..b0e01c54 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,38 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "80f845944c541b21be0f6894133de683"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns3:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..31203283 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Original Name" . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704074400000 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..f778bf08 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,29 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:shard; + cm:clockHash "b370f5b25f4df96cdd0f17e113575c68"; + cm:createdAt "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns3:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns3:shard a idx:Shard; + idx:containsEntry ns3:entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf ns2:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..19f0fff9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..52504c08 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,50 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "bf6908fc7bf0707d7695d53c445ead5b"; + cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "b3c8a56f8f70ee4b346687365ce314d0"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "626320842daca5664b91254eb53f4e08"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "b8d533544c389681c7afd39051f67f71"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "80f845944c541b21be0f6894133de683"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "f41b280ba13945f96a83675bc8b6942c"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..188b5a14 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..626f6874 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/01_installation-a_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,29 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "b226c39d6bc1abfa0dfadbb704019ba9"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..c053b362 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..3e0b6283 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..a0425802 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,39 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T02:10:00.011Z"^^xsd:dateTime, "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if3mm10v:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..e5a9fc6a --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T02:10:00.005Z"^^xsd:dateTime, "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if5mm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..3c9de579 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,46 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T02:10:00.002Z"^^xsd:dateTime, "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifbmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..53465296 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifdmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T02:10:00.014Z"^^xsd:dateTime, "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifdmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..ee42db5e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,40 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T02:10:00.008Z"^^xsd:dateTime, "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifemm10v:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..96101e5a --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Recipe/concurrent-recipe.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :it; + cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifemm10v:shard; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Original Name" . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704074400000 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..67ab6d2f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,34 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource . + +:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +:shard a idx:Shard; + idx:containsEntry :entry-cd4d8db60f38e931e4a9394f38d91b32, :entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf if3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..c5113da2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf if5:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..ba774064 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if1: . +@prefix if2: . +@prefix ifb: . +@prefix ifd: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ifb:index . + +:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ifd:index . + +:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource if1:index . + +:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ife:index . + +:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource if2:index . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +:shard a idx:Shard; + idx:containsEntry :entry-ce394f730640668924968eddf09c01bc, :entry-a68c1c4f5dda5dbf177113200fb133a0, :entry-713129f56a309cabc970f22c7da295cf, :entry-6532e1cce2063165cab55f9425c47e0d, :entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ifb:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b883ef80 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifd: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf ifd:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..10430c05 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,28 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "b226c39d6bc1abfa0dfadbb704019ba9"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + idx:resource . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700003 . + +:shard a idx:Shard; + idx:containsEntry :entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ife:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..f18676aa --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..f382a86f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,41 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T02:10:00.011Z"^^xsd:dateTime, "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns5:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..0201b441 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T02:10:00.005Z"^^xsd:dateTime, "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns5:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..a01c8a23 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T02:10:00.002Z"^^xsd:dateTime, "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..db1a05fc --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T02:10:00.014Z"^^xsd:dateTime, "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..5e8244d1 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,42 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T02:10:00.008Z"^^xsd:dateTime, "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..31203283 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Original Name" . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704074400000 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..4f10f2f0 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,36 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns4:shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns4:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns4:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource ns2:installation . + +ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns4:shard a idx:Shard; + idx:containsEntry ns4:entry-cd4d8db60f38e931e4a9394f38d91b32, ns4:entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..1b6af0cc --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "b79e03b0bf06e344ea80ac84325d042c"; + cm:createdAt "2024-01-01T02:10:00.003Z"^^xsd:dateTime, "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..28e3d0f2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..2513374b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "874a4703cd135e4ff713eed2509e4bfd"; + cm:createdAt "2024-01-01T02:10:00.012Z"^^xsd:dateTime, "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b757745b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/02_installation-b_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,32 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "c2f1b8d22a1644355d85f6b619242afe"; + cm:createdAt "2024-01-01T02:10:00.006Z"^^xsd:dateTime, "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/input_resource.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/input_resource.ttl new file mode 100644 index 00000000..301929f3 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/input_resource.ttl @@ -0,0 +1,6 @@ +@prefix ex: . +@prefix schema: . + +ex:it a schema:Recipe ; + schema:name "Updated by A" ; + schema:description "Original Description" . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..9436e06b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..d86b72b7 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,37 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "b8d533544c389681c7afd39051f67f71"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns3:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..60a1e2e1 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,45 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "f41b280ba13945f96a83675bc8b6942c"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns3:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns2:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..dad382c9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,44 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "b3c8a56f8f70ee4b346687365ce314d0"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns3:shard; + sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns3:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns2:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..5426f322 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,45 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "626320842daca5664b91254eb53f4e08"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns3:shard; + sync:hasBlankNodeMapping ns2:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns2:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..b0e01c54 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,38 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:index; + cm:clockHash "80f845944c541b21be0f6894133de683"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns3:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns2:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..92295a76 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "cdc59e270f2037e9a96aa1b42417094a"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Updated by A" . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..f778bf08 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,29 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:shard; + cm:clockHash "b370f5b25f4df96cdd0f17e113575c68"; + cm:createdAt "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns3:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns3:shard a idx:Shard; + idx:containsEntry ns3:entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf ns2:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..19f0fff9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..52504c08 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,50 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "bf6908fc7bf0707d7695d53c445ead5b"; + cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "b3c8a56f8f70ee4b346687365ce314d0"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "626320842daca5664b91254eb53f4e08"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "b8d533544c389681c7afd39051f67f71"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "80f845944c541b21be0f6894133de683"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "f41b280ba13945f96a83675bc8b6942c"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..188b5a14 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..626f6874 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/03_installation-a_save/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,29 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "b226c39d6bc1abfa0dfadbb704019ba9"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/input_resource.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/input_resource.ttl new file mode 100644 index 00000000..bf3e80b7 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/input_resource.ttl @@ -0,0 +1,6 @@ +@prefix ex: . +@prefix schema: . + +ex:it a schema:Recipe ; + schema:name "Original Name" ; + schema:description "Updated by B" . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..f18676aa --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..f382a86f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,41 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T02:10:00.011Z"^^xsd:dateTime, "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns5:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..0201b441 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T02:10:00.005Z"^^xsd:dateTime, "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns5:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..a01c8a23 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T02:10:00.002Z"^^xsd:dateTime, "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..db1a05fc --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T02:10:00.014Z"^^xsd:dateTime, "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..5e8244d1 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,42 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T02:10:00.008Z"^^xsd:dateTime, "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..73a5f1ab --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,56 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "bcfbf2258edd9d4addcebb83a5e1e74e"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Original Name" . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704074400000 . + +ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..4f10f2f0 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,36 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns4:shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns4:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns4:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource ns2:installation . + +ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns4:shard a idx:Shard; + idx:containsEntry ns4:entry-cd4d8db60f38e931e4a9394f38d91b32, ns4:entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..1b6af0cc --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "b79e03b0bf06e344ea80ac84325d042c"; + cm:createdAt "2024-01-01T02:10:00.003Z"^^xsd:dateTime, "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..28e3d0f2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..2513374b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "874a4703cd135e4ff713eed2509e4bfd"; + cm:createdAt "2024-01-01T02:10:00.012Z"^^xsd:dateTime, "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b757745b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/04_installation-b_save/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,32 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "c2f1b8d22a1644355d85f6b619242afe"; + cm:createdAt "2024-01-01T02:10:00.006Z"^^xsd:dateTime, "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "998b90b0fb24f34fc20392d8cb3223b3"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..c053b362 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..3e0b6283 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..407ee8d8 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,39 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime, "2024-01-01T02:10:00.011Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if3mm10v:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..0e419588 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime, "2024-01-01T02:10:00.005Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if5mm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..6eacb140 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,46 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime, "2024-01-01T02:10:00.002Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifbmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..7a56cf3e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifdmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime, "2024-01-01T02:10:00.014Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifdmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..d572a083 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,40 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime, "2024-01-01T02:10:00.008Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifemm10v:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..ede32ef4 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Recipe/concurrent-recipe.ttl @@ -0,0 +1,48 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "cdc59e270f2037e9a96aa1b42417094a"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifemm10v:shard; + sync:hasStatement :lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Updated by A" . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk :lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource :it . + +:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..67ab6d2f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,34 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource . + +:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +:shard a idx:Shard; + idx:containsEntry :entry-cd4d8db60f38e931e4a9394f38d91b32, :entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf if3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..c5113da2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf if5:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..ba774064 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if1: . +@prefix if2: . +@prefix ifb: . +@prefix ifd: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ifb:index . + +:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ifd:index . + +:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource if1:index . + +:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ife:index . + +:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource if2:index . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +:shard a idx:Shard; + idx:containsEntry :entry-ce394f730640668924968eddf09c01bc, :entry-a68c1c4f5dda5dbf177113200fb133a0, :entry-713129f56a309cabc970f22c7da295cf, :entry-6532e1cce2063165cab55f9425c47e0d, :entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ifb:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b883ef80 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifd: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf ifd:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..a4214ebd --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,28 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "d29c54915361247ef18cf9e0a3ac66c3"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "cdc59e270f2037e9a96aa1b42417094a"; + idx:resource . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 3; + cm:physicalTime 1704081600003 . + +:shard a idx:Shard; + idx:containsEntry :entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ife:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..9436e06b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..673e95c5 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,41 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime, "2024-01-01T02:10:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns5:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..e53741cf --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime, "2024-01-01T02:10:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns5:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns1:installation, ns2:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..baf7b5f3 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime, "2024-01-01T02:10:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns1:installation, ns2:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..d5f27e53 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime, "2024-01-01T02:10:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns1:installation, ns2:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..3031b091 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,42 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime, "2024-01-01T02:10:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..92295a76 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "cdc59e270f2037e9a96aa1b42417094a"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Updated by A" . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..20b5665e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,36 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns4:shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T00:00:00.009Z"^^xsd:dateTime, "2024-01-01T02:10:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns4:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns4:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource ns2:installation . + +ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns4:shard a idx:Shard; + idx:containsEntry ns4:entry-5374348b61c7646c166b813fe227d5c3, ns4:entry-cd4d8db60f38e931e4a9394f38d91b32; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..19f0fff9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..28de85e2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime, "2024-01-01T02:10:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..188b5a14 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..d3d1002e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/05_installation-a_sync/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,29 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "d29c54915361247ef18cf9e0a3ac66c3"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "cdc59e270f2037e9a96aa1b42417094a"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 3; + cm:physicalTime 1704081600003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..c053b362 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..3e0b6283 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..407ee8d8 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,39 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime, "2024-01-01T02:10:00.011Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if3mm10v:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..0e419588 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime, "2024-01-01T02:10:00.005Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if5mm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..6eacb140 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,46 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime, "2024-01-01T02:10:00.002Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifbmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..7a56cf3e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifdmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime, "2024-01-01T02:10:00.014Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifdmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..d572a083 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,40 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime, "2024-01-01T02:10:00.008Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifemm10v:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..7fb47fca --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Recipe/concurrent-recipe.ttl @@ -0,0 +1,68 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifemm10v:shard; + sync:hasStatement :lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8, :lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Updated by A" . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk :lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource :it . + +:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk :lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource :it . + +:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..67ab6d2f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,34 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource . + +:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +:shard a idx:Shard; + idx:containsEntry :entry-cd4d8db60f38e931e4a9394f38d91b32, :entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf if3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..c5113da2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf if5:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..ba774064 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if1: . +@prefix if2: . +@prefix ifb: . +@prefix ifd: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ifb:index . + +:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ifd:index . + +:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource if1:index . + +:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ife:index . + +:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource if2:index . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +:shard a idx:Shard; + idx:containsEntry :entry-ce394f730640668924968eddf09c01bc, :entry-a68c1c4f5dda5dbf177113200fb133a0, :entry-713129f56a309cabc970f22c7da295cf, :entry-6532e1cce2063165cab55f9425c47e0d, :entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ifb:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b883ef80 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifd: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf ifd:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..8d1e44de --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,31 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "33a969d6d7ef83298a083abe24a9a112"; + cm:createdAt "2024-01-01T02:10:00.006Z"^^xsd:dateTime, "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + idx:resource . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704083400003 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 3; + cm:physicalTime 1704081600003 . + +:shard a idx:Shard; + idx:containsEntry :entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ife:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..f18676aa --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..f382a86f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,41 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T02:10:00.011Z"^^xsd:dateTime, "2024-01-01T00:00:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns5:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..0201b441 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T02:10:00.005Z"^^xsd:dateTime, "2024-01-01T00:00:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns5:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..a01c8a23 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T02:10:00.002Z"^^xsd:dateTime, "2024-01-01T00:00:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..db1a05fc --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T02:10:00.014Z"^^xsd:dateTime, "2024-01-01T00:00:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns2:installation, ns1:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..5e8244d1 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,42 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T02:10:00.008Z"^^xsd:dateTime, "2024-01-01T00:00:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns2:installation, ns1:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..aa1ad53e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,68 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8, ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Updated by A" . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..4f10f2f0 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,36 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns4:shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns4:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns4:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource ns2:installation . + +ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns4:shard a idx:Shard; + idx:containsEntry ns4:entry-cd4d8db60f38e931e4a9394f38d91b32, ns4:entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..1b6af0cc --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "b79e03b0bf06e344ea80ac84325d042c"; + cm:createdAt "2024-01-01T02:10:00.003Z"^^xsd:dateTime, "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..28e3d0f2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..2513374b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "874a4703cd135e4ff713eed2509e4bfd"; + cm:createdAt "2024-01-01T02:10:00.012Z"^^xsd:dateTime, "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..c2875b7b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/06_installation-b_sync_merge/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,32 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "33a969d6d7ef83298a083abe24a9a112"; + cm:createdAt "2024-01-01T02:10:00.006Z"^^xsd:dateTime, "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704083400003 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 3; + cm:physicalTime 1704081600003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..c053b362 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/ClientInstallation/installation-b.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/ClientInstallation/installation-b.ttl new file mode 100644 index 00000000..3e0b6283 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/ClientInstallation/installation-b.ttl @@ -0,0 +1,27 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :installation; + cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + cm:createdAt "2024-01-01T02:10:00.017Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard if3mm10v:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T02:10:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..407ee8d8 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,39 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime, "2024-01-01T02:10:00.011Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if3mm10v:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..0e419588 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5mm10v: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime, "2024-01-01T02:10:00.005Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard if5mm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..6eacb140 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,46 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime, "2024-01-01T02:10:00.002Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifbmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..7a56cf3e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,47 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifdmm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime, "2024-01-01T02:10:00.014Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:hasBlankNodeMapping :lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifdmm10v:shard; + idx:indexedProperty _:b1; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b1 . + +_:b1 a idx:IndexedProperty; + idx:readBy , ; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..d572a083 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,40 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifbmm10v: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime, "2024-01-01T02:10:00.008Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ifbmm10v:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +:index a idx:FullIndex; + idx:hasShard ifemm10v:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy , ; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..7fb47fca --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Recipe/concurrent-recipe.ttl @@ -0,0 +1,68 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifemm10v:shard; + sync:hasStatement :lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8, :lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Updated by A" . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk :lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource :it . + +:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk :lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource :it . + +:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..67ab6d2f --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,34 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if3: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T02:10:00.009Z"^^xsd:dateTime, "2024-01-01T00:00:00.009Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource . + +:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +:shard a idx:Shard; + idx:containsEntry :entry-cd4d8db60f38e931e4a9394f38d91b32, :entry-5374348b61c7646c166b813fe227d5c3; + idx:isShardOf if3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..c5113da2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if5: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf if5:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..ba774064 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix if1: . +@prefix if2: . +@prefix ifb: . +@prefix ifd: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T02:10:00.000Z"^^xsd:dateTime, "2024-01-01T00:00:00.000Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ifb:index . + +:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ifd:index . + +:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource if1:index . + +:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ife:index . + +:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource if2:index . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +:shard a idx:Shard; + idx:containsEntry :entry-ce394f730640668924968eddf09c01bc, :entry-a68c1c4f5dda5dbf177113200fb133a0, :entry-713129f56a309cabc970f22c7da295cf, :entry-6532e1cce2063165cab55f9425c47e0d, :entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ifb:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..b883ef80 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifd: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +:shard a idx:Shard; + idx:isShardOf ifd:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..8d1e44de --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/remote/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,31 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ife: . +@prefix mappings: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :shard; + cm:clockHash "33a969d6d7ef83298a083abe24a9a112"; + cm:createdAt "2024-01-01T02:10:00.006Z"^^xsd:dateTime, "2024-01-01T00:00:00.006Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + idx:resource . + +:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704083400003 . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 3; + cm:physicalTime 1704081600003 . + +:shard a idx:Shard; + idx:containsEntry :entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ife:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/ClientInstallation/installation-a.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/ClientInstallation/installation-a.ttl new file mode 100644 index 00000000..9436e06b --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/ClientInstallation/installation-a.ttl @@ -0,0 +1,27 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns1:installation; + cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + cm:createdAt "2024-01-01T00:00:00.017Z"^^xsd:dateTime; + cm:hasClockEntry ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns2:shard; + sync:isGovernedBy (mappings:client-installation-v1); + sync:managedResourceType cm:ClientInstallation . + +ns1:installation a cm:ClientInstallation; + cm:createdAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:lastActiveAt "2024-01-01T00:00:00.015Z"^^xsd:dateTime; + cm:maxInactivityPeriod "P6M"^^xsd:duration . + +ns1:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200016 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-388036f3_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-388036f3_index.ttl new file mode 100644 index 00000000..673e95c5 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-388036f3_index.ttl @@ -0,0 +1,41 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + cm:createdAt "2024-01-01T00:00:00.011Z"^^xsd:dateTime, "2024-01-01T02:10:00.011Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns5:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexesClass cm:ClientInstallation; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000010 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200010 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-5f68b5b7_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-5f68b5b7_index.ttl new file mode 100644 index 00000000..e53741cf --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-5f68b5b7_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "6664afb16b626f8180888fd089c9b677"; + cm:createdAt "2024-01-01T00:00:00.005Z"^^xsd:dateTime, "2024-01-01T02:10:00.005Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns5:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndexTemplate; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000004 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200004 . + +ns3:lcrd-ibn-md5-f7d7db17ed3c6b875f87c9c8c5e3894f sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns1:installation, ns2:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-bbcf09f5_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-bbcf09f5_index.ttl new file mode 100644 index 00000000..baf7b5f3 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-bbcf09f5_index.ttl @@ -0,0 +1,48 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + cm:createdAt "2024-01-01T00:00:00.002Z"^^xsd:dateTime, "2024-01-01T02:10:00.002Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns4:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:FullIndex; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000001 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200001 . + +ns3:lcrd-ibn-md5-e9b4ecd4b5364c752004aeb2ad59d79b sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns1:installation, ns2:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-d06ec919_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-d06ec919_index.ttl new file mode 100644 index 00000000..d5f27e53 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-d06ec919_index.ttl @@ -0,0 +1,49 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + cm:createdAt "2024-01-01T00:00:00.014Z"^^xsd:dateTime, "2024-01-01T02:10:00.014Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns4:shard; + sync:hasBlankNodeMapping ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexedProperty _:b2; + idx:indexesClass idx:GroupIndex; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000013 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200013 . + +ns3:lcrd-ibn-md5-3b2da558f7c6b21875e61233a806d1f6 sync:blankNode _:b2 . + +_:b2 a idx:IndexedProperty; + idx:readBy ns1:installation, ns2:installation; + idx:trackedProperty idx:indexesClass . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-e679d72f_index.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-e679d72f_index.ttl new file mode 100644 index 00000000..3031b091 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/FullIndex/index-full-e679d72f_index.ttl @@ -0,0 +1,42 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns3:index; + cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + cm:createdAt "2024-01-01T00:00:00.008Z"^^xsd:dateTime, "2024-01-01T02:10:00.008Z"^^xsd:dateTime; + cm:hasClockEntry ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns4:shard; + sync:isGovernedBy (mappings:index-v1); + sync:managedResourceType idx:FullIndex . + +ns3:index a idx:FullIndex; + idx:hasShard ns5:shard; + idx:indexesClass schema:Recipe; + idx:populationState "active"; + idx:readBy ns1:installation, ns2:installation; + idx:shardingAlgorithm [ + a idx:ModuloHashSharding ; + idx:hashAlgorithm "md5" ; + idx:numberOfShards 1 ; + idx:configVersion "1_0_0" ; + idx:autoScaleThreshold 1000 + ] . + +ns3:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704075000007 . + +ns3:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704067200007 . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Recipe/concurrent-recipe.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Recipe/concurrent-recipe.ttl new file mode 100644 index 00000000..2347e4d9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Recipe/concurrent-recipe.ttl @@ -0,0 +1,68 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798, ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Updated by A" . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..20b5665e --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-388036f3_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,36 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns4:shard; + cm:clockHash "86a02c401014ba4c533cace07bded484"; + cm:createdAt "2024-01-01T00:00:00.009Z"^^xsd:dateTime, "2024-01-01T02:10:00.009Z"^^xsd:dateTime; + cm:hasClockEntry ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns4:entry-5374348b61c7646c166b813fe227d5c3 cm:clockHash "b8c583604a46f7834bf04d5a39e00440"; + idx:resource ns1:installation . + +ns4:entry-cd4d8db60f38e931e4a9394f38d91b32 cm:clockHash "fda68c20d40503084c79579d6948d5eb"; + idx:resource ns2:installation . + +ns4:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000027 . + +ns4:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700005 . + +ns4:shard a idx:Shard; + idx:containsEntry ns4:entry-5374348b61c7646c166b813fe227d5c3, ns4:entry-cd4d8db60f38e931e4a9394f38d91b32; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..19f0fff9 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-5f68b5b7_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "20b09d19dc8be4f8a845fe329820a28f"; + cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..28de85e2 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-bbcf09f5_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,53 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . +@prefix ns6: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns6:shard; + cm:clockHash "251a526cc17b61b05734bebd1fb56d6b"; + cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime, "2024-01-01T02:10:00.000Z"^^xsd:dateTime; + cm:hasClockEntry ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns6:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "fcb3d27573fcb9b7dcdcc7851c84a671"; + idx:indexesClass idx:FullIndex; + idx:resource ns3:index . + +ns6:entry-6532e1cce2063165cab55f9425c47e0d cm:clockHash "ccc34535317a301eeb7966ec54d37ae5"; + idx:indexesClass idx:GroupIndex; + idx:resource ns4:index . + +ns6:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "484f8dad978d677a668a349bc65e4a5a"; + idx:indexesClass cm:ClientInstallation; + idx:resource ns2:index . + +ns6:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "40caadc34a0cfdcc4f8e906fe8879bcd"; + idx:indexesClass schema:Recipe; + idx:resource ns5:index . + +ns6:entry-ce394f730640668924968eddf09c01bc cm:clockHash "6664afb16b626f8180888fd089c9b677"; + idx:indexesClass idx:GroupIndexTemplate; + idx:resource ns1:index . + +ns6:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704075000019 . + +ns6:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704074700001 . + +ns6:shard a idx:Shard; + idx:containsEntry ns6:entry-ce394f730640668924968eddf09c01bc, ns6:entry-a68c1c4f5dda5dbf177113200fb133a0, ns6:entry-713129f56a309cabc970f22c7da295cf, ns6:entry-6532e1cce2063165cab55f9425c47e0d, ns6:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..188b5a14 --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-d06ec919_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,24 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "383e637b170c1b956015c0dbe9cfab8d"; + cm:createdAt "2024-01-01T00:00:00.012Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 0 . + +ns2:shard a idx:Shard; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl new file mode 100644 index 00000000..02cf21ac --- /dev/null +++ b/packages/locorda_core/test/assets/graph/test_cases/save/43_concurrent_lww_different_props/07_installation-a_sync_pull_merged/storage/Shard/index-full-e679d72f_shard-mod-md5-1-0-v1_0_0.ttl @@ -0,0 +1,32 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix rdf: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:shard; + cm:clockHash "33a969d6d7ef83298a083abe24a9a112"; + cm:createdAt "2024-01-01T00:00:00.006Z"^^xsd:dateTime, "2024-01-01T02:10:00.006Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2, ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a; + sync:isGovernedBy (mappings:shard-v1); + sync:managedResourceType idx:Shard . + +ns2:entry-1d7f2415548862471c9ea296611f9ef6 cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + idx:resource ns3:it . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 2; + cm:physicalTime 1704083400003 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 3; + cm:physicalTime 1704081600003 . + +ns2:shard a idx:Shard; + idx:containsEntry ns2:entry-1d7f2415548862471c9ea296611f9ef6; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/03_default-installation_save/storage/Recipe/chocolate-cake.ttl b/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/03_default-installation_save/storage/Recipe/chocolate-cake.ttl index 3b5d8e73..e4fa1afd 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/03_default-installation_save/storage/Recipe/chocolate-cake.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/03_default-installation_save/storage/Recipe/chocolate-cake.ttl @@ -14,10 +14,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns4:it; + cm:appBaseClock ns4:lcrd-vclk-md5-4f3377a23ab8bb8e8f7b23ec5bc16aa1; cm:clockHash "b6f3912093c56e5b2adedda259b48cf4"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; idx:belongsToIndexShard ns3:shard, ns2:shard, ns1:shard; + sync:hasStatement ns4:lcrd-prop-md5-51c73eb3003574459bf9c6f54a0bf9ce; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -35,3 +37,27 @@ ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f cm:logicalTime 1; ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 1; cm:physicalTime 1704088800000 . + +ns4:lcrd-prop-md5-51c73eb3003574459bf9c6f54a0bf9ce a sync:PropertyStatement; + cm:vclk ns4:lcrd-vclk-md5-df36cf0aec6ae7d7c1b8d437506bc40c; + sync:property schema:name; + sync:resource ns4:it . + +ns4:lcrd-vclk-md5-4f3377a23ab8bb8e8f7b23ec5bc16aa1 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns4:lcrd-vclk-md5-df36cf0aec6ae7d7c1b8d437506bc40c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ], + [ + cm:forClockEntry ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f ; + cm:logicalTime 1 ; + cm:physicalTime 1704088800000 + ] . diff --git a/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/remote/SyncFile/sync-file.trig b/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/remote/SyncFile/sync-file.trig index 86c556c9..377a2ea7 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/remote/SyncFile/sync-file.trig +++ b/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/remote/SyncFile/sync-file.trig @@ -316,10 +316,12 @@ GRAPH { GRAPH recipe:chocolate-cake { recipe:chocolate-cake a sync:ManagedDocument; foaf:primaryTopic cc:it; + cm:appBaseClock cc:lcrd-vclk-md5-4f3377a23ab8bb8e8f7b23ec5bc16aa1; cm:clockHash "b6f3912093c56e5b2adedda259b48cf4"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry cc:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, cc:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; idx:belongsToIndexShard ifemm10v:shard, igfmm10v:shard, igemm10v:shard; + sync:hasStatement cc:lcrd-prop-md5-51c73eb3003574459bf9c6f54a0bf9ce; sync:isGovernedBy (mappings1:recipe-v1); sync:managedResourceType schema:Recipe . cc:it a schema:Recipe; @@ -334,6 +336,27 @@ GRAPH recipe:chocolate-cake { cm:physicalTime 1704074400000 . cc:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 1; cm:physicalTime 1704088800000 . + cc:lcrd-prop-md5-51c73eb3003574459bf9c6f54a0bf9ce a sync:PropertyStatement; + cm:vclk cc:lcrd-vclk-md5-df36cf0aec6ae7d7c1b8d437506bc40c; + sync:property schema:name; + sync:resource cc:it . + cc:lcrd-vclk-md5-4f3377a23ab8bb8e8f7b23ec5bc16aa1 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry cc:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + cc:lcrd-vclk-md5-df36cf0aec6ae7d7c1b8d437506bc40c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry cc:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ], + [ + cm:forClockEntry cc:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f ; + cm:logicalTime 1 ; + cm:physicalTime 1704088800000 + ] . } GRAPH { diff --git a/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/storage/Recipe/chocolate-cake.ttl b/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/storage/Recipe/chocolate-cake.ttl index 3b5d8e73..e4fa1afd 100644 --- a/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/storage/Recipe/chocolate-cake.ttl +++ b/packages/locorda_core/test/assets/graph/test_cases/singlefile/02_foreign_shard_discovery/04_default-installation_sync/storage/Recipe/chocolate-cake.ttl @@ -14,10 +14,12 @@ a sync:ManagedDocument; foaf:primaryTopic ns4:it; + cm:appBaseClock ns4:lcrd-vclk-md5-4f3377a23ab8bb8e8f7b23ec5bc16aa1; cm:clockHash "b6f3912093c56e5b2adedda259b48cf4"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; cm:hasClockEntry ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; idx:belongsToIndexShard ns3:shard, ns2:shard, ns1:shard; + sync:hasStatement ns4:lcrd-prop-md5-51c73eb3003574459bf9c6f54a0bf9ce; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . @@ -35,3 +37,27 @@ ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f cm:logicalTime 1; ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 1; cm:physicalTime 1704088800000 . + +ns4:lcrd-prop-md5-51c73eb3003574459bf9c6f54a0bf9ce a sync:PropertyStatement; + cm:vclk ns4:lcrd-vclk-md5-df36cf0aec6ae7d7c1b8d437506bc40c; + sync:property schema:name; + sync:resource ns4:it . + +ns4:lcrd-vclk-md5-4f3377a23ab8bb8e8f7b23ec5bc16aa1 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns4:lcrd-vclk-md5-df36cf0aec6ae7d7c1b8d437506bc40c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ], + [ + cm:forClockEntry ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f ; + cm:logicalTime 1 ; + cm:physicalTime 1704088800000 + ] . diff --git a/packages/locorda_core/test/assets/remote_merge/all_tests.json b/packages/locorda_core/test/assets/remote_merge/all_tests.json index 15d9bcd3..c2cbcd8d 100644 --- a/packages/locorda_core/test/assets/remote_merge/all_tests.json +++ b/packages/locorda_core/test/assets/remote_merge/all_tests.json @@ -70,6 +70,14 @@ "local_graph": "test_cases/basic_merge/03_shard_orphaned_tombstones/local.ttl", "remote_graph": "test_cases/basic_merge/03_shard_orphaned_tombstones/remote.ttl", "expected_merged_graph": "test_cases/basic_merge/03_shard_orphaned_tombstones/expected.ttl" + }, + { + "id": "merge_04", + "description": "Concurrent LWW updates to different properties on same resource - both winning values must survive merge and PropertyStatements must persist (issue #50 regression)", + "document_iri": "tag:locorda.org,2025:l:aHR0cHM6Ly9zY2hlbWEub3JnL1JlY2lwZQ==:Y29uY3VycmVudC1yZWNpcGU=", + "local_graph": "test_cases/basic_merge/04_concurrent_lww_different_props/local.ttl", + "remote_graph": "test_cases/basic_merge/04_concurrent_lww_different_props/remote.ttl", + "expected_merged_graph": "test_cases/basic_merge/04_concurrent_lww_different_props/expected.ttl" } ] } diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/01_shard_of_indices-full/expected.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/01_shard_of_indices-full/expected.ttl index 9839a51a..b63b0697 100644 --- a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/01_shard_of_indices-full/expected.ttl +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/01_shard_of_indices-full/expected.ttl @@ -1,47 +1,48 @@ +@base . @prefix cm: . @prefix foaf: . @prefix idx: . @prefix mappings: . -@prefix ns1: . +@prefix ns1: . @prefix ns2: . -@prefix ns3: . -@prefix ns4: . -@prefix ns5: . +@prefix ns3: . +@prefix ns4: . +@prefix ns5: . @prefix rdf: . @prefix schema: . @prefix sync: . @prefix xsd: . a sync:ManagedDocument; - foaf:primaryTopic ns1:shard; + foaf:primaryTopic ns5:shard; cm:clockHash "29c6c1e77f5e2d14a9db71299058f2e3"; cm:createdAt "2024-01-01T00:00:00.000Z"^^xsd:dateTime; - cm:hasClockEntry ns1:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, ns1:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; + cm:hasClockEntry ns5:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, ns5:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; sync:isGovernedBy (mappings:shard-v1); sync:managedResourceType idx:Shard . -ns1:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "81ae3d8e12bbca55eb2de0c2dd465c74"; +ns5:entry-2e883124d69c377d8daff7f19ee0eaa6 cm:clockHash "81ae3d8e12bbca55eb2de0c2dd465c74"; idx:indexesClass idx:FullIndex; - idx:resource ns4:index . + idx:resource ns3:index . -ns1:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "4aa8005552dcd3ff7fc4ccb1a17be85d"; +ns5:entry-713129f56a309cabc970f22c7da295cf cm:clockHash "4aa8005552dcd3ff7fc4ccb1a17be85d"; idx:indexesClass cm:ClientInstallation; idx:resource ns2:index . -ns1:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "acfe426053c8901cd211536eabb32a84"; +ns5:entry-a68c1c4f5dda5dbf177113200fb133a0 cm:clockHash "acfe426053c8901cd211536eabb32a84"; idx:indexesClass schema:Recipe; - idx:resource ns5:index . + idx:resource ns4:index . -ns1:entry-ce394f730640668924968eddf09c01bc cm:clockHash "363d87c859a47caf5fedde545e85b125"; +ns5:entry-ce394f730640668924968eddf09c01bc cm:clockHash "363d87c859a47caf5fedde545e85b125"; idx:indexesClass idx:GroupIndexTemplate; - idx:resource ns3:index . + idx:resource ns1:index . -ns1:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f cm:logicalTime 2; +ns5:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f cm:logicalTime 2; cm:physicalTime 1704067200012 . -ns1:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 2; +ns5:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 2; cm:physicalTime 1704067200009 . -ns1:shard a idx:Shard; - idx:containsEntry ns1:entry-ce394f730640668924968eddf09c01bc, ns1:entry-713129f56a309cabc970f22c7da295cf, ns1:entry-a68c1c4f5dda5dbf177113200fb133a0, ns1:entry-2e883124d69c377d8daff7f19ee0eaa6; - idx:isShardOf ns4:index . +ns5:shard a idx:Shard; + idx:containsEntry ns5:entry-ce394f730640668924968eddf09c01bc, ns5:entry-713129f56a309cabc970f22c7da295cf, ns5:entry-a68c1c4f5dda5dbf177113200fb133a0, ns5:entry-2e883124d69c377d8daff7f19ee0eaa6; + idx:isShardOf ns3:index . diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/02_shard_of_indices-group/expected.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/02_shard_of_indices-group/expected.ttl index 41724715..a0fae19e 100644 --- a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/02_shard_of_indices-group/expected.ttl +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/02_shard_of_indices-group/expected.ttl @@ -1,38 +1,39 @@ +@base . @prefix cm: . @prefix foaf: . @prefix idx: . @prefix mappings: . -@prefix ns1: . -@prefix ns2: . -@prefix ns3: . -@prefix ns4: . +@prefix ns1: . +@prefix ns2: . +@prefix ns3: . +@prefix ns4: . @prefix rdf: . @prefix schema: . @prefix sync: . @prefix xsd: . a sync:ManagedDocument; - foaf:primaryTopic ns1:shard; + foaf:primaryTopic ns4:shard; cm:clockHash "cffc6e578ffc852738518b23b42f74e4"; cm:createdAt "2024-01-01T00:00:00.003Z"^^xsd:dateTime; - cm:hasClockEntry ns1:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, ns1:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; + cm:hasClockEntry ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f, ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f; sync:isGovernedBy (mappings:shard-v1); sync:managedResourceType idx:Shard . -ns1:entry-1e411ea3d0723c6581c8fe31e69280be cm:clockHash "d4ab002945ab1de056c0c94c4f559929"; +ns4:entry-1e411ea3d0723c6581c8fe31e69280be cm:clockHash "d4ab002945ab1de056c0c94c4f559929"; idx:indexesClass schema:Recipe; - idx:resource ns4:groupIndexTemplate . + idx:resource ns2:groupIndexTemplate . -ns1:entry-54d3e307b28129cf784975e808c31ba7 cm:clockHash "7a94ef82559a528fde56c90fdaa8d828"; +ns4:entry-54d3e307b28129cf784975e808c31ba7 cm:clockHash "7a94ef82559a528fde56c90fdaa8d828"; idx:indexesClass schema:Recipe; - idx:resource ns2:groupIndexTemplate . + idx:resource ns3:groupIndexTemplate . -ns1:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f cm:logicalTime 2; +ns4:lcrd-clk-md5-4a481c7617b289f7c4fd07cb3a10fd0f cm:logicalTime 2; cm:physicalTime 1704067200006 . -ns1:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 2; +ns4:lcrd-clk-md5-7934e73e2e637cc2115bd6d7262d680f cm:logicalTime 2; cm:physicalTime 1704067200006 . -ns1:shard a idx:Shard; - idx:containsEntry ns1:entry-54d3e307b28129cf784975e808c31ba7, ns1:entry-1e411ea3d0723c6581c8fe31e69280be; - idx:isShardOf ns3:index . +ns4:shard a idx:Shard; + idx:containsEntry ns4:entry-54d3e307b28129cf784975e808c31ba7, ns4:entry-1e411ea3d0723c6581c8fe31e69280be; + idx:isShardOf ns1:index . diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/expected.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/expected.ttl new file mode 100644 index 00000000..55fa61e4 --- /dev/null +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/expected.ttl @@ -0,0 +1,69 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "93d7ca83a264f8ffe46d184412d5d7d0"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard, ifemm10v:shard; + sync:hasStatement ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8, ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Updated by A" . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource ns2:it . + +ns2:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/local.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/local.ttl new file mode 100644 index 00000000..73a5f1ab --- /dev/null +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/local.ttl @@ -0,0 +1,56 @@ +@base . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix mappings: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + + a sync:ManagedDocument; + foaf:primaryTopic ns2:it; + cm:appBaseClock ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "bcfbf2258edd9d4addcebb83a5e1e74e"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a, ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ns1:shard; + sync:hasStatement ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +ns2:it a schema:Recipe; + schema:description "Updated by B"; + schema:name "Original Name" . + +ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a cm:logicalTime 1; + cm:physicalTime 1704079800000 . + +ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 1; + cm:physicalTime 1704074400000 . + +ns2:lcrd-prop-md5-4d4a9f6a8c37c55c31b231bb68da6dd8 a sync:PropertyStatement; + cm:vclk ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28; + sync:property schema:description; + sync:resource ns2:it . + +ns2:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . + +ns2:lcrd-vclk-md5-a62f0b723fc9c5c09dd8da6db84ada28 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry ns2:lcrd-clk-md5-328987dee5887a5d0aada0708fbb4c9a ; + cm:logicalTime 1 ; + cm:physicalTime 1704079800000 + ], + [ + cm:forClockEntry ns2:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/remote.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/remote.ttl new file mode 100644 index 00000000..d8327595 --- /dev/null +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/basic_merge/04_concurrent_lww_different_props/remote.ttl @@ -0,0 +1,48 @@ +@base . +@prefix : <#> . +@prefix cm: . +@prefix foaf: . +@prefix idx: . +@prefix ifemm10v: . +@prefix mappings: . +@prefix rdf: . +@prefix schema: . +@prefix sync: . +@prefix xsd: . + +<> a sync:ManagedDocument; + foaf:primaryTopic :it; + cm:appBaseClock :lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c; + cm:clockHash "cdc59e270f2037e9a96aa1b42417094a"; + cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; + cm:hasClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2; + idx:belongsToIndexShard ifemm10v:shard; + sync:hasStatement :lcrd-prop-md5-c22723dff3603123a5f38727b71b2798; + sync:isGovernedBy (mappings:recipe-v1); + sync:managedResourceType schema:Recipe . + +:it a schema:Recipe; + schema:description "Original Description"; + schema:name "Updated by A" . + +:lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 cm:logicalTime 2; + cm:physicalTime 1704078000000 . + +:lcrd-prop-md5-c22723dff3603123a5f38727b71b2798 a sync:PropertyStatement; + cm:vclk :lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006; + sync:property schema:name; + sync:resource :it . + +:lcrd-vclk-md5-46fe2dbd430601987e4b0d3927717006 a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 2 ; + cm:physicalTime 1704078000000 + ] . + +:lcrd-vclk-md5-6a0ec9ee6b87df981ba49f16c023af9c a cm:VersionedClock; + cm:hasClockEntry [ + cm:forClockEntry :lcrd-clk-md5-55c3351a967d14f5f816395261cebcd2 ; + cm:logicalTime 1 ; + cm:physicalTime 1704074400000 + ] . diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/01_expected.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/01_expected.ttl index 6976bf72..56b33a2a 100644 --- a/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/01_expected.ttl +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/01_expected.ttl @@ -1,26 +1,27 @@ +@base . @prefix cm: . @prefix foaf: . @prefix idx: . @prefix mappings: . -@prefix ns1: . -@prefix ns2: . +@prefix ns1: . +@prefix ns2: . @prefix rdf: . @prefix schema: . @prefix sync: . @prefix xsd: . a sync:ManagedDocument; - foaf:primaryTopic ns1:it; + foaf:primaryTopic ns2:it; cm:clockHash "d84a7998dcae796b56a5a94fe8ab9583"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; - cm:hasClockEntry ns1:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; - idx:belongsToIndexShard ns2:shard; + cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; + idx:belongsToIndexShard ns1:shard; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . -ns1:it a schema:Recipe; +ns2:it a schema:Recipe; schema:name "Chocolate Cake"; schema:recipeIngredient "flour", "sugar", "cocoa" . -ns1:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 1; +ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 1; cm:physicalTime 1704074400000 . diff --git a/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/02_expected.ttl b/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/02_expected.ttl index 063c4819..e5b09fe4 100644 --- a/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/02_expected.ttl +++ b/packages/locorda_core/test/assets/remote_merge/test_cases/idempotence/02_expected.ttl @@ -1,26 +1,27 @@ +@base . @prefix cm: . @prefix foaf: . @prefix idx: . @prefix mappings: . -@prefix ns1: . -@prefix ns2: . +@prefix ns1: . +@prefix ns2: . @prefix rdf: . @prefix schema: . @prefix sync: . @prefix xsd: . a sync:ManagedDocument; - foaf:primaryTopic ns1:it; + foaf:primaryTopic ns2:it; cm:clockHash "44100cc1839fcb991a1b226a44652219"; cm:createdAt "2024-01-01T02:00:00.001Z"^^xsd:dateTime; - cm:hasClockEntry ns1:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; - idx:belongsToIndexShard ns2:shard; + cm:hasClockEntry ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54; + idx:belongsToIndexShard ns1:shard; sync:isGovernedBy (mappings:recipe-v1); sync:managedResourceType schema:Recipe . -ns1:it a schema:Recipe; +ns2:it a schema:Recipe; schema:name "Chocolate Cake"; schema:recipeIngredient "flour", "sugar", "cocoa" . -ns1:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 1; +ns2:lcrd-clk-md5-edbd4f839a89c5a2a26e191248168e54 cm:logicalTime 1; cm:physicalTime 1704074400000 . diff --git a/packages/locorda_gdrive/test/desktop_gdrive_auth_test.dart b/packages/locorda_gdrive/test/desktop_gdrive_auth_test.dart index a909ab52..36e32ffb 100644 --- a/packages/locorda_gdrive/test/desktop_gdrive_auth_test.dart +++ b/packages/locorda_gdrive/test/desktop_gdrive_auth_test.dart @@ -1,6 +1,9 @@ +import 'dart:io'; + import 'package:flutter_test/flutter_test.dart'; -import 'package:locorda_gdrive/src/gdrive_auth.dart'; import 'package:locorda_gdrive/src/auth/desktop_gdrive_auth.dart'; +import 'package:locorda_gdrive/src/auth/gdrive_auth_shared.dart'; +import 'package:locorda_gdrive/src/gdrive_auth.dart'; import 'package:shared_preferences/shared_preferences.dart'; void main() { @@ -91,16 +94,19 @@ void main() { expect(prefs.containsKey('locorda_gdrive_user_id'), isFalse); }); - test('GDriveAuth.create returns DesktopGDriveAuth on desktop platform', + test('GDriveAuth.create returns platform-appropriate implementation', () async { - // Since our test runs on the host OS (Linux), GDriveAuth.create should return a DesktopGDriveAuth final auth = await GDriveAuth.create( clientId: clientId, clientKey: clientKey, scopes: scopes, ); - expect(auth, isA()); + if (Platform.isWindows || Platform.isLinux) { + expect(auth, isA()); + } else { + expect(auth, isA()); + } }); }); } diff --git a/proposed-changes/028-property-statements-and-versioned-clocks.md b/proposed-changes/028-property-statements-and-versioned-clocks.md new file mode 100644 index 00000000..3aabd829 --- /dev/null +++ b/proposed-changes/028-property-statements-and-versioned-clocks.md @@ -0,0 +1,413 @@ +# 028 — Property Statements and Versioned Clocks + +## Status: Proposed + +## Context + +- Fixes GitHub issue [#50 — LwwRegister concurrent merge silently loses uncontested LWW properties](https://github.com/kkalass/locorda/issues/50). +- Supersedes the property-clock approach attempted in PR #60, which was + conceptually flawed (volatile installation-keyed clock IRIs, overlapping + `changedProperty` sets, non-deterministic IRIs, `logicalTime` without + installation context). +- Builds on proposals + [001 — framework/app data separation](001-framework-app-data-separation.md), + [002 — Resource Statements](002-resource-statements.md), + [007 — Resource identity & clock structure](007-resource-identity_and_clock-structure-and-hash.md) and + [008 — Path-identified blank nodes](008-path-identified-blank-nodes.md). + +## Problem + +The current LWW merge logic resolves "concurrent" writes at **document +granularity**: a single `crdt:clockHash` per document, plus a single +document-wide `physicalTime` tie-break. When two installations concurrently +change *different* properties of the same document, the merge picks one +installation's full property snapshot as the "winner" and silently drops +the other installation's property values — even though those properties +are not in conflict. + +### Reproduction (from issue #50) + +Two installations `A` and `B` both start from the same baseline state and +both perform one local save: + +| Property | Baseline | A writes | B writes | +| --------------- | ----------- | ---------- | ------------- | +| `schema:name` | `"Old"` | `"NewA"` | (unchanged) | +| `schema:rating` | `3` | (unchanged)| `5` | + +After bidirectional sync the document should contain +`schema:name = "NewA"` AND `schema:rating = 5`. With the current +implementation, the document-level LWW tie-break picks one installation's +state wholesale and the other property silently regresses to baseline. + +### Why this happens + +LWW (and FWW, Counter, …) is semantically a **per-value** rule, but the +current bookkeeping is per-document: + +- `crdt:clockHash` summarises the entire document's HLC vector. +- `physicalTime` is one document-level number, not a per-property number. +- There is no way to express *"property `schema:name` was last modified by + vector clock V₁; property `schema:rating` by V₂"* — so the merger has no + information to merge property-by-property. + +### Why PR #60's per-property clocks were the wrong fix + +PR #60 tried to attach a `crdt:PropertyClock` to each +(installation, property) pair, reusing the `lcrd-clk-md5-` +IRI scheme. That design fails because: + +1. **Volatile identity** — those IRIs are reused for every save and + overwritten in-place, so any pointer into them ages out immediately. +2. **Overlapping `changedProperty` sets** — multiple property-clocks per + installation collide and step on each other. +3. **Meaningless `logicalTime`** — a logical time without an installation + reference cannot be compared with vector-clock semantics. +4. **Non-deterministic IRIs** — IRIs depend on save order, which breaks + content-addressing and merge determinism. + +We need a design that scales beyond LWW (to OR-Set, 2P-Set, FWW, Counter, +…) without growing per-installation state for every property. + +## Proposed Solution + +Introduce two new framework concepts: + +1. **`sync:PropertyStatement`** — a framework metadata node about a + `(subject, property)` pair, attached to the managed document via + `sync:hasStatement` (the polymorphic statement channel introduced + alongside `sync:ResourceStatement` in proposal 002). +2. **`crdt:VersionedClock` (`vclk`)** — an immutable, content-addressed + snapshot of the document's HLC at a specific save, attached to a + statement via `crdt:vclk`. + +Together, they let any CRDT rule that needs per-value or per-property +causality bookkeeping (LWW, FWW, OR-Set member tombstones, …) point at a +**shared, deduplicated** clock snapshot rather than carrying per-pair +installation vectors. + +### Three statement granularities, one channel + +All three statement types are attached via `sync:hasStatement`. Identity +is **content-derived** (proposal 008 path-identified scheme): + +| Statement type | Identifies | Identifying properties | Fragment scheme (informative) | +| ------------------------- | --------------------------- | ------------------------------------ | ----------------------------- | +| `rdf:Statement` | a specific `(s, p, o)` | `rdf:subject`, `rdf:predicate`, `rdf:object` | `lcrd-stmt-md5-` | +| `sync:PropertyStatement` | a `(s, p)` pair | `sync:resource`, `sync:property` | `lcrd-prop-md5-` | +| `sync:ResourceStatement` | a resource `s` as a whole | `sync:resource` | `lcrd-res-md5-` | + +Crucially, **`sync:PropertyStatement` is NOT a subclass of +`rdf:Statement`**. `rdf:Statement` reifies a specific triple (a single +`(s,p,o)` fact); `sync:PropertyStatement` is metadata about *the property +slot itself* irrespective of its current value(s). Conflating the two +would force every property-level metadata node to carry an arbitrary +`rdf:object`, which has no meaning for slots that are multi-valued or +currently empty. + +### Versioned Clock (`crdt:VersionedClock`) + +A `VersionedClock` is an **immutable, content-addressed HLC snapshot**. +Each entry is anchored to the document's existing `crdt:ClockEntry` IRI +via `crdt:forClockEntry` (identity anchor) and carries its own frozen +`logicalTime` / `physicalTime` values. The referenced `ClockEntry` may +advance after the snapshot is taken — the snapshot keeps the values it +was created with. + +```turtle +<#lcrd-vclk-md5-…> a crdt:VersionedClock ; + crdt:hasClockEntry + [ crdt:forClockEntry <#lcrd-clk-md5-aaa> ; + crdt:logicalTime 7 ; + crdt:physicalTime 1704074700001 ] , + [ crdt:forClockEntry <#lcrd-clk-md5-bbb> ; + crdt:logicalTime 3 ; + crdt:physicalTime 1704074700050 ] . +``` + +**Why `crdt:forClockEntry` instead of `crdt:installationIri` as the +identity anchor?** The framework currently does not write +`crdt:installationIri` onto its `ClockEntry` nodes — installation +identity is conveyed purely through the deterministic +`lcrd-clk-md5-` IRI fragment, which is +content-addressed, stable across local and remote storage, and +identical on every installation that sees the entry. Using the +`ClockEntry` IRI as the anchor therefore needs no additional triples +in the existing HLC representation and stays semantically equivalent +to an installation-keyed vector clock. `crdt:installationIri` remains +optional in the vocabulary for future cross-document discovery use +cases. + +**Hash input**: canonical N-Quads over `(forClockEntry, logicalTime)` +pairs sorted by `forClockEntry`. `physicalTime` is **annotation only** +and excluded from the hash — consistent with `crdt:clockHash`, and +necessary because physical time is observer-dependent (clock skew, machine +speed) and would otherwise produce divergent IRIs for the same logical +state. + +`physicalTime` is preserved per entry because it is needed as a +deterministic tie-breaker when two vclks are **concurrent** under +vector-clock domination (see merge semantics below). + +### Document-level base clock (`crdt:appBaseClock`) + +Naïvely emitting one `sync:PropertyStatement` + one `crdt:vclk` per +app property would bloat every document — most steady-state documents +have many properties whose effective vclk is identical (e.g. all +properties of a freshly created resource, or all properties that have +not been touched since the last save). To avoid this, the framework +lets a document declare a single document-level vclk as the **default** +for any app property whose `sync:PropertyStatement` is absent: + +```turtle +<> a sync:ManagedDocument ; + crdt:appBaseClock <#lcrd-vclk-md5-baseline> . +``` + +Any app property without an explicit `sync:PropertyStatement` is read +as if it carried `crdt:vclk = appBaseClock`. If `crdt:appBaseClock` +itself is absent, the fallback is the document's current HLC vector +(`docClock`, built from `crdt:hasClockEntry`). The three-step lookup +`PS.vclk → appBaseClock → docClock` is uniform across local reads, +save-time comparisons, and remote merges. + +**Scope: app properties only.** Framework properties never participate +in this scheme — they are stamped via the existing framework-data pass +(no PS, no vclk; the framework relies on document-wide bookkeeping for +its own state). The predicate is named `appBaseClock` to make the +boundary explicit. + +#### Why lazy initialisation matters + +If `appBaseClock` were always written, the simplest case — a freshly +created document where every app property carries the same +(post-create) docClock — would still need one extra triple plus a +full `VersionedClock` subgraph. By **only** setting `appBaseClock` +when it is actually needed, freshly created documents and documents +whose every save is a full rewrite stay maximally compact (no +PropertyStatements, no VersionedClock subgraphs, no `appBaseClock`). + +### Save-time encoding + +On each local save: + +1. Compute the **post-save** docClock `D` as usual (advance the + installation's own `ClockEntry`). +2. For each *changed* app property `(s, p)`, its effective vclk is `D`. +3. For each *unchanged* app property, its effective vclk is whatever it + was before this save: + * if an explicit `sync:PropertyStatement` exists → its `crdt:vclk`; + * else if `crdt:appBaseClock` is set → that vclk; + * else the **pre-save** docClock. +4. **Set `crdt:appBaseClock` lazily.** If all of the following hold, + set `appBaseClock` to the **pre-save** docClock snapshot (creating + the corresponding `crdt:VersionedClock` node, deduplicated by + content hash like any other vclk): + * (a) `crdt:appBaseClock` is currently absent on the document, + * (b) the pre-save docClock differs from `D` (this save advances + the clock — otherwise nothing would dangle), + * (c) at least one app property is *unchanged* by this save and + has no explicit `sync:PropertyStatement` (i.e. its implicit + reference would dangle once the docClock moves to `D`). + Once set, `appBaseClock` is **never overwritten** by this proposal. + (Future work may introduce a compaction trigger; see Open questions.) +5. Emit (or update) a `sync:PropertyStatement` `P` for `(s, p)` with + `P crdt:vclk D` **only if** `D` differs from the effective default — + that is, from `appBaseClock` when set, or from `D` itself when + `appBaseClock` is absent. In the second case `D` *is* the default, + so no PS is needed. +6. Any value-level statements the CRDT rule requires (e.g. + `rdf:Statement` tombstones for OR-Set removal) are emitted and + stamped with their own `crdt:vclk` (these are *value*-granular and + do not benefit from the appBaseClock shortcut). +7. Existing PropertyStatements whose new effective vclk now equals the + implicit default are removed via the standard LWW GC path in + `LwwRegister.localValueChange` (`triplesToRemove`) — no new GC + mechanism needed. + +All statements stamped in the same save share the same `D` (one +VersionedClock allocation per save, regardless of how many properties +changed). + +### Merge semantics + +For any algorithm that previously asked *"is the incoming value newer than +the local value?"* and broke ties on document-wide `physicalTime`, the +question is now answered per statement, using the three-step lookup +on both sides: + +``` +resolveVclk(doc, s, p) = + if exists PS(s,p) in doc with crdt:vclk V -> V + else if doc has crdt:appBaseClock V -> V + else -> doc.docClock + +local_vclk = resolveVclk(localDoc, s, p) +remote_vclk = resolveVclk(remoteDoc, s, p) + +case compareVectorClocks(local_vclk, remote_vclk) of + LocalDominates -> keep local value + RemoteDominates -> take remote value + Equal -> values agree (no-op) + Concurrent -> tie-break by max(physicalTime) across the two + vclks; on physical-time tie, fall back to a + deterministic rule (forClockEntry ordering) +``` + +The `resolveVclk` fallback is the merge-protocol change required by +the `appBaseClock` optimisation. It is **symmetric**: each side +resolves *its own* `appBaseClock`/`docClock`, independently of the +other side's choices about which properties to materialise as explicit +`PropertyStatement`s. Two installations may freely differ on whether a +given property has an explicit `PS` — the comparison still yields the +same answer, because both sides agree on the *vector content* the +implicit default represents (the pre-save docClock at the time the +property was last written or the document was first created). + +Note that `appBaseClock` is **monotone within a single installation** +(set once, never moved) and is normally the *same content* on every +installation when both have observed the document since its creation +— two installations only diverge on `appBaseClock` if one observed the +document *before* the first clock-advancing save and the other did +not. Even in that case the fallback resolution remains semantically +correct: each side resolves to a valid vclk snapshot of the document +at the time the property was last touched, and the standard vector- +clock comparison handles the rest. + +This applies symmetrically to: + +| Algorithm | Uses `crdt:vclk` on … | Decision | +| ---------------- | ---------------------------------------------------- | ------------------------------------------------------------------------ | +| LWW_Register | the property's `PropertyStatement` | Newer vclk wins | +| FWW_Register | the property's `PropertyStatement` | Older vclk wins | +| Immutable | (none — no metadata required) | Already conflict-free | +| OR_Set | per-member `rdf:Statement` (add) and tombstone (remove) | Standard OR-Set semantics; vclk only needed if causal ordering of add/remove of the same member is required | +| 2P_Set | per-member `rdf:Statement` tombstone | Once removed, stays removed (no vclk comparison needed for removal) | +| Counter | per-installation contribution `PropertyStatement` | Sum of contributions; vclk used to deduplicate replayed contributions | + +LWW is the only algorithm changed by this proposal *today*. The others +benefit from having the mechanism in place when they are implemented. + +### Garbage collection + +- **`sync:PropertyStatement`**: bounded by the merge contract — at most + one per `(subject, property)` pair declared by the schema. Removed + by the LWW GC path when its `crdt:vclk` becomes equal to the + document's effective implicit default (`appBaseClock` or `docClock`). +- **`crdt:VersionedClock`**: garbage-collected by local sweep — when no + `crdt:vclk` *and* no `crdt:appBaseClock` triple in the local graph + references a given vclk IRI, it is safe to delete. Deduplication + keeps the steady-state count small (one per distinct logical vector + ever observed locally, plus the `appBaseClock` snapshot if any). +- **`crdt:appBaseClock`**: never removed once set by this proposal + (write-once). Its target `VersionedClock` subgraph is held alive by + the `appBaseClock` reference itself. +- **`rdf:Statement` tombstones**: continue to follow existing retention + policies (proposal 002). + +## Worked example (issue #50, fixed) + +Baseline document on both installations: + +```turtle +<> a sync:ManagedDocument ; + foaf:primaryTopic <#it> ; + crdt:hasClockEntry [ … A=5, B=2 … ] ; + sync:hasStatement <#lcrd-prop-md5-name>, <#lcrd-prop-md5-rating> . + +<#it> a schema:Thing ; + schema:name "Old" ; + schema:rating 3 . + +<#lcrd-prop-md5-name> a sync:PropertyStatement ; + sync:resource <#it> ; sync:property schema:name ; + crdt:vclk <#lcrd-vclk-md5-baseline> . + +<#lcrd-prop-md5-rating> a sync:PropertyStatement ; + sync:resource <#it> ; sync:property schema:rating ; + crdt:vclk <#lcrd-vclk-md5-baseline> . +``` + +After A writes `schema:name = "NewA"` (HLC → A=6, B=2) and B *independently* +writes `schema:rating = 5` (HLC → A=5, B=3): + +| Property | Local A vclk | Local B vclk | After cross-merge | +| --------------- | ------------ | ------------ | --------------------------------------- | +| `schema:name` | A=6,B=2 | A=5,B=2 | A dominates ⇒ `"NewA"` | +| `schema:rating` | A=5,B=2 | A=5,B=3 | B dominates ⇒ `5` | + +Both values survive, because the merger compares per-property vclks +instead of a single document-wide tie-break. + +## Vocabulary additions + +Added to `spec/vocabularies/crdt-mechanics.ttl`: + +- `crdt:appBaseClock` — optional, functional property on + `sync:ManagedDocument` with range `crdt:VersionedClock`. Provides the + document-wide default vclk for app properties that have no explicit + `sync:PropertyStatement`. Domain restricted to `sync:ManagedDocument` + to make the framework-only scope discoverable from the vocabulary. + +No changes to `sync:PropertyStatement` or `crdt:VersionedClock` beyond +what earlier sections of this proposal already introduce. + +## Implementation impact + +- `RemoteDocumentMerger` / `LocalDocumentMerger`: replace document-wide + `physicalTime` tie-break with the `resolveVclk` per-property + comparison (helper added in `crdt/vector_clock.dart`). When + generating a save, emit one shared `VersionedClock` node + one + `PropertyStatement` per changed property whose effective vclk differs + from the implicit default; on the first clock-advancing save that + leaves at least one app property implicit, also write + `crdt:appBaseClock` referencing the pre-save docClock snapshot. +- `crdt_document_manager`: extend the save pipeline to populate + `sync:hasStatement` with `PropertyStatement`s for mutated properties + (subject to the implicit-default check), reusing existing + `sync:ResourceStatement` plumbing. +- Tests: add a new save-scenario asset reproducing issue #50, plus + symmetric `update_…` scenarios and an explicit + `appBaseClock`-emission scenario (first incremental edit after + creation). Existing asset + `test_cases/save/38_concurrent_lww_per_property/` will be renamed for + consistency with the `all_tests.json` index. +- Generated bootstrap (`mapping_bootstrap.g.dart`) is regenerated from + the new mapping additions in `spec/mappings/core-v1.ttl`. + +No public API change. No on-the-wire breaking change beyond the new +optional `sync:hasStatement` and `crdt:appBaseClock` triples (older +readers ignore them, consistent with the existing framework/app +separation contract). + +## Open questions / explicit non-goals + +- **Counter semantics**: included in the applicability table for + completeness; concrete encoding deferred until a Counter rule is added. +- **`PropertyStatement` for nested blank nodes**: identity uses the + canonical IRI of the subject (proposal 008). No special handling + required at this layer. +- **Migration**: pre-existing documents without `PropertyStatement`s or + `appBaseClock` continue to work; readers treat "no PS, no + appBaseClock" as the document's current docClock (the legacy + semantics), so the behavioural change is monotone (concurrent + uncontested writes start being preserved; no previously preserved + write is lost). +- **`appBaseClock` compaction**: `appBaseClock` is currently + write-once. A future optimisation could move it forward when a save + effectively rewrites every app property (making every explicit + PropertyStatement collapsible into a new shared default), but the + detection rule and merge implications need careful design and are + out of scope here. +- **Shards and "all properties always at docClock" documents**: shard + documents are a degenerate case where the shard subject's only + property (`rdf:type idx:Shard`) is effectively immutable and every + save rewrites the entries collectively. The lazy-set rule in + step (4) of *Save-time encoding* (condition (c): "at least one app + property is unchanged and has no explicit PS") is designed so that + `appBaseClock` is never set on such documents in the first place, + but the per-entry properties may still produce `PropertyStatement`s + under the current rules. A follow-up proposal will revisit shard + encoding once this proposal lands, to evaluate whether shard entries + should bypass per-property statementing entirely (treating the entire + shard payload as a single immutable-per-save unit). diff --git a/spec/mappings/core-v1.ttl b/spec/mappings/core-v1.ttl index b0ef4e8c..4f9dc6b9 100644 --- a/spec/mappings/core-v1.ttl +++ b/spec/mappings/core-v1.ttl @@ -13,7 +13,7 @@ <> a mc:DocumentMapping; # Define class mappings for framework components - mc:classMapping ( <#managed-document> <#statement> <#resource-statement> <#blank-node-mapping> ) ; + mc:classMapping ( <#managed-document> <#statement> <#property-statement> <#resource-statement> <#versioned-clock> <#blank-node-mapping> ) ; # Define predicate mappings for framework components (ordered list) mc:predicateMapping ( <#clock-mappings> <#lifecycle-mappings> <#traversal-boundaries> <#standard-rdf> ) . @@ -40,7 +40,8 @@ # Standard mapping for predicates of Hybrid Logical Clock entries (fragment-identified nodes) <#clock-mappings> a mc:PredicateMapping; mc:rule - [ mc:predicate crdt:installationId; algo:mergeWith algo:OR_Set], + [ mc:predicate crdt:installationIri; algo:mergeWith algo:OR_Set], + [ mc:predicate crdt:forClockEntry; algo:mergeWith algo:Immutable ], [ mc:predicate crdt:hasClockEntry; algo:mergeWith algo:OR_Set ], [ mc:predicate crdt:clockHash; algo:mergeWith algo:LWW_Register ], [ mc:predicate crdt:logicalTime; algo:mergeWith algo:G_Register ], @@ -53,6 +54,30 @@ # The resource identifier is the immutable identity of this statement [ mc:predicate sync:resource; algo:mergeWith algo:LWW_Register; mc:isIdentifying true ] . +# Merge contract for PropertyStatement used for property-level framework metadata +# (e.g. last-write versioned clock for LWW/FWW conflict resolution). +# Identified by the (sync:resource, sync:property) pair. +<#property-statement> a mc:ClassMapping; + mc:appliesToClass sync:PropertyStatement; + mc:rule + [ mc:predicate sync:resource; algo:mergeWith algo:Immutable; mc:isIdentifying true ], + [ mc:predicate sync:property; algo:mergeWith algo:Immutable; mc:isIdentifying true ], + # crdt:vclk is the last-write versioned-clock pointer. LWW here is a placeholder: + # the merger uses vector-clock domination on the referenced crdt:VersionedClock, + # falling back to max(physicalTime) within the vclk on 'concurrent'. + [ mc:predicate crdt:vclk; algo:mergeWith algo:LWW_Register ] . + +# Merge contract for VersionedClock - immutable, content-addressed HLC snapshot. +# Its IRI is a hash over the contained (forClockEntry, logicalTime) pairs, so +# value-identical vclks share an IRI and are automatically deduplicated. +<#versioned-clock> a mc:ClassMapping; + mc:appliesToClass crdt:VersionedClock; + mc:rule + # The contained clock entries are part of the content-addressed identity: + # no path identification needed for the embedded blank nodes (the whole + # vclk is Immutable, so per-entry blank-node merging never occurs). + [ mc:predicate crdt:hasClockEntry; algo:mergeWith algo:Immutable; mc:disableBlankNodePathIdentification true ] . + # Merge contract for BlankNodeMapping - framework-reserved fragments for identified blank nodes <#blank-node-mapping> a mc:ClassMapping; mc:appliesToClass sync:BlankNodeMapping; @@ -77,7 +102,14 @@ # Standard RDF reification predicates create traversal boundaries [ mc:predicate rdf:subject; mc:stopTraversal true ], [ mc:predicate rdf:predicate; mc:stopTraversal true ], - [ mc:predicate rdf:object; mc:stopTraversal true ] . + [ mc:predicate rdf:object; mc:stopTraversal true ], + # PropertyStatement identifiers create traversal boundaries (same role as rdf:subject/predicate) + [ mc:predicate sync:resource; mc:stopTraversal true ], + [ mc:predicate sync:property; mc:stopTraversal true ], + # Versioned-clock references and their entries stay on the framework side + [ mc:predicate crdt:vclk; mc:stopTraversal true ], + [ mc:predicate crdt:forClockEntry; mc:stopTraversal true ], + [ mc:predicate crdt:hasClockEntry; mc:stopTraversal true ] . <#standard-rdf> a mc:PredicateMapping; mc:rule diff --git a/spec/vocabularies/crdt-mechanics.ttl b/spec/vocabularies/crdt-mechanics.ttl index 45fddc71..c6fdfe4b 100644 --- a/spec/vocabularies/crdt-mechanics.ttl +++ b/spec/vocabularies/crdt-mechanics.ttl @@ -4,6 +4,7 @@ @prefix xsd: . @prefix crdt: . @prefix solid: . +@prefix sync: . # --- Ontology Definition --- @@ -21,6 +22,10 @@ crdt:ClientInstallation a rdfs:Class; rdfs:label "Client Installation"; rdfs:comment "A unique installation of a CRDT-enabled application, providing traceability and identity for Hybrid Logical Clock entries across the distributed system." . +crdt:VersionedClock a rdfs:Class; + rdfs:label "Versioned Clock"; + rdfs:comment "An immutable, content-addressed snapshot of a Hybrid Logical Clock at the moment of a specific write or merge event. Used by property- and value-level CRDT bookkeeping (e.g. via crdt:vclk on sync:PropertyStatement or rdf:Statement) to record 'when this happened' in a way that supports full vector-clock comparison (equal / dominates / dominated / concurrent). Each contained entry is anchored to the document's existing crdt:ClockEntry via crdt:forClockEntry (identity anchor) and carries its own crdt:logicalTime / crdt:physicalTime as frozen snapshot values — the referenced ClockEntry may have advanced since this snapshot was taken. The VersionedClock IRI is derived as a hash over the contained (forClockEntry, logicalTime) pairs, sorted by forClockEntry; crdt:physicalTime is carried per entry as a tie-break annotation but is NOT part of the hash (consistent with crdt:clockHash). Identical content ⇒ identical IRI ⇒ automatic deduplication across the document." . + # --- Hybrid Logical Clock Properties --- crdt:hasClockEntry a rdf:Property; @@ -31,10 +36,15 @@ crdt:hasClockEntry a rdf:Property; crdt:installationIri a rdf:Property; rdfs:label "installation IRI"; - rdfs:comment "IRI for a client installation within a Hybrid Logical Clock entry. "; + rdfs:comment "IRI for a client installation within a Hybrid Logical Clock entry. NOTE: usage is currently OPTIONAL and not written or read by the framework — installation identity is conveyed via the deterministic crdt:ClockEntry fragment (lcrd-clk-md5-). The property is retained in the vocabulary for future extension (e.g. enabling cross-document installation discovery) and may be populated by applications that need it."; rdfs:domain crdt:ClockEntry; rdfs:range rdfs:Resource . # Should be an IRI +crdt:forClockEntry a rdf:Property; + rdfs:label "for clock entry"; + rdfs:comment "Identity anchor on a crdt:VersionedClock entry, referencing the crdt:ClockEntry this snapshot pertains to. The snapshot's own crdt:logicalTime / crdt:physicalTime are authoritative frozen values; the referenced ClockEntry may have advanced since this snapshot was taken. Used as the per-entry key for vector-clock comparison and as the only entry-identifying component of the VersionedClock content hash."; + rdfs:range crdt:ClockEntry . + crdt:logicalTime a rdf:Property; rdfs:label "logical time"; rdfs:comment "The logical time component of a Hybrid Logical Clock entry - a monotonically increasing counter that tracks causality relationships between operations. Provides tamper-proof causality tracking even when physical clocks are manipulated."; @@ -53,6 +63,17 @@ crdt:clockHash a rdf:Property; rdfs:domain rdfs:Resource; rdfs:range xsd:string . +crdt:vclk a rdf:Property; + rdfs:label "versioned clock"; + rdfs:comment "Attaches a versioned-clock snapshot (crdt:VersionedClock) to a framework metadata node such as a sync:PropertyStatement (last write of a property) or an rdf:Statement (add event of a multi-value element). Concurrent-write resolution compares the referenced vclks via vector-clock semantics (equal / dominates / dominated / concurrent); ties on 'concurrent' are broken by max(crdt:physicalTime) across the vclk's clock entries."; + rdfs:range crdt:VersionedClock . + +crdt:appBaseClock a rdf:Property; + rdfs:label "app base clock"; + rdfs:comment "Document-wide default crdt:VersionedClock for app properties that have no explicit sync:PropertyStatement. Causality-tracking merge rules (LWW, FWW, …) resolve a property's effective vclk as: PropertyStatement.vclk -> document.appBaseClock -> document's current HLC (docClock). Set lazily on the first save that advances the document clock while at least one app property would otherwise dangle on the previous (now superseded) docClock. Scope is app data only: framework-managed properties never use this fallback. Once set, treated as write-once within this proposal (compaction is future work)."; + rdfs:domain sync:ManagedDocument; + rdfs:range crdt:VersionedClock . + # --- Installation Management Properties --- crdt:belongsToUser a rdf:Property; diff --git a/spec/vocabularies/sync.ttl b/spec/vocabularies/sync.ttl index 26d5e860..3b88468a 100644 --- a/spec/vocabularies/sync.ttl +++ b/spec/vocabularies/sync.ttl @@ -21,6 +21,10 @@ sync:ResourceStatement a rdfs:Class; rdfs:label "Resource Statement"; rdfs:comment "A statement containing framework metadata about a specific resource within a managed document. Used for resource-level concerns like deletion tombstones while maintaining clean separation from application data." . +sync:PropertyStatement a rdfs:Class; + rdfs:label "Property Statement"; + rdfs:comment "A statement carrying framework metadata about a (resource, property) pair within a managed document. Distinct from rdf:Statement, which identifies a specific (subject, predicate, object) triple: a PropertyStatement scopes to the property as a whole. Used by property-level CRDT bookkeeping such as the last-write versioned clock (crdt:vclk) for LWW/FWW conflict resolution. Identified by the (sync:resource, sync:property) pair." . + sync:BlankNodeMapping a rdfs:Class; rdfs:label "Blank Node Mapping"; rdfs:comment "Represents a mapping between a canonical fragment identifier and a blank node in the document. Used for stable references to identified blank nodes across serialization boundaries." . @@ -49,16 +53,24 @@ sync:managedResourceType a rdf:Property; sync:hasStatement a rdf:Property; rdfs:label "has statement"; - rdfs:comment "Links a managed document to RDF reification statements that contain framework metadata such as property tombstones. This ensures all framework metadata remains connected to the document for proper framework/app data separation during graph traversal."; + rdfs:comment "Links a managed document to framework metadata statements: RDF reified value-level statements (rdf:Statement) for property-value tombstones, sync:PropertyStatement for property-level CRDT bookkeeping (e.g. last-write versioned clocks), and sync:ResourceStatement for resource-level metadata such as resource tombstones. This keeps all framework metadata connected to the document for proper framework/app data separation during graph traversal."; rdfs:domain sync:ManagedDocument; - rdfs:range rdf:Statement . + rdfs:range [ a owl:Class; + owl:unionOf ( rdf:Statement sync:PropertyStatement sync:ResourceStatement ) ] . sync:resource a rdf:Property; rdfs:label "resource"; - rdfs:comment "Points to the resource that this framework statement is about. Used in resource statements to identify which resource the metadata applies to."; - rdfs:domain sync:ResourceStatement; + rdfs:comment "Points to the resource that this framework statement is about. Used in sync:ResourceStatement (the resource the metadata applies to) and in sync:PropertyStatement (the resource whose property the metadata applies to)."; + rdfs:domain [ a owl:Class; + owl:unionOf ( sync:ResourceStatement sync:PropertyStatement ) ]; rdfs:range rdfs:Resource . +sync:property a rdf:Property; + rdfs:label "property"; + rdfs:comment "The RDF property that a sync:PropertyStatement refers to. Together with sync:resource it identifies the (resource, property) pair the framework metadata is about."; + rdfs:domain sync:PropertyStatement; + rdfs:range rdf:Property . + sync:hasBlankNodeMapping a rdf:Property; rdfs:label "has blank node mapping"; rdfs:comment "Links the managed document to framework-reserved fragment identifiers for identified blank nodes.";