@@ -13,7 +13,8 @@ Key features:
1313
1414- ** Versioned document store** with full change history
1515- ** Real-time collaboration** with conflict detection
16- - ** Claims-based document schema** supporting 11+ claim types (identifiers, text, relations, amounts, time, files, etc.)
16+ - ** Claims-based document schema** supporting 12 claim types (identifiers, strings, HTML, amounts, time, links,
17+ references, etc.)
1718- ** Adaptive search UI** that automatically adjusts to data and provides relevant filters
1819- ** Multi-site support** with separate schemas and indices per site
1920
@@ -162,56 +163,64 @@ Manages append-only logs for real-time collaboration sessions.
162163- Pagination (max 5000 operations per page)
163164- PostgreSQL-backed with JSONB columns
164165
165- ** PeerDB usage** : Tracks document editing sessions with conflict detection.
166+ ** PeerDB usage** : Tracks document edit sessions with conflict detection.
166167
167168#### 3. ** Document Schema** (` document/ ` )
168169
169- Claims-based document system supporting 11 claim types:
170+ Claims-based document system supporting 12 claim types:
170171
171172- ** IdentifierClaim** : External IDs (e.g., Wikidata Q-IDs)
172- - ** TextClaim** : Rich text with HTML in multiple languages
173173- ** StringClaim** : Plain text strings
174- - ** RelationClaim** : Relationships to other documents
175- - ** AmountClaim/AmountRangeClaim** : Numeric values with units
176- - ** TimeClaim/TimeRangeClaim** : Timestamps and time ranges
177- - ** FileClaim** : File references
178- - ** ReferenceClaim** : URL references
179- - ** NoValueClaim/UnknownValueClaim** : Missing data markers
174+ - ** HTMLClaim** : Rich text with HTML
175+ - ** AmountClaim** : Numeric values with precision
176+ - ** AmountIntervalClaim** : Numeric intervals with bounds
177+ - ** TimeClaim** : Timestamps with precision
178+ - ** TimeIntervalClaim** : Time intervals with bounds
179+ - ** LinkClaim** : URL/IRI links
180+ - ** ReferenceClaim** : Relationships to other documents
181+ - ** HasClaim** : Property-only claim (can hold nested claims via sub-claims)
182+ - ** NoneClaim** : Explicitly states no value exists
183+ - ** UnknownClaim** : Value exists but is unknown
180184
181185** Core structure** :
182186
183187``` go
184188type D struct {
185- CoreDocument // ID (22-char identifier), Score, Scores
186- Mnemonic // Human-readable identifier
187- Claims // ClaimTypes (collections of claims)
189+ CoreDocument // ID (22-char identifier), Base (base for computing ID)
190+ Claims // *ClaimTypes (collections of claims)
191+ }
192+
193+ type CoreClaim struct {
194+ ID identifier.Identifier
195+ Confidence Confidence // float64 in [-1, 1]
196+ Sub *ClaimTypes // optional sub-claims
188197}
189198```
190199
191200** Important patterns** :
192201
193202- Use the Visitor pattern to traverse/manipulate claims
194- - Claims reference properties (also documents) via ` prop.id `
195- - Built-in classes and properties defined in ` core/ ` (NAME, etc.)
203+ - Claims reference properties (also documents) via ` Prop `
204+ - Each claim embeds ` CoreClaim ` with ID, Confidence, and optional Sub-claims
205+ - Built-in classes and properties defined in ` core/ ` (NAME, DESCRIPTION, etc.)
196206
197207#### 4. ** Search** (` search/search.go ` )
198208
199209Elasticsearch query builder with session-based filtering.
200210
201211** Filter types** :
202212
203- - ` RelFilter ` : Filter by relation claims
213+ - ` RefFilter ` : Filter by reference claims
204214- ` AmountFilter ` : Filter by numeric ranges
205215- ` TimeFilter ` : Filter by time ranges
206- - ` StringFilter ` : Text search on string/text claims
207216
208217** Limits** : Max 1000 search results per query
209218
210219#### 5. ** Storage** (` storage/storage.go ` )
211220
212221Chunked file upload management with begin/append/end lifecycle.
213222
214- #### 6. ** ES Bridge** (` internal/es /bridge.go ` )
223+ #### 6. ** ES Bridge** (` internal/search /bridge.go ` )
215224
216225Listens to Store changesets and synchronizes to Elasticsearch using bulk indexing.
217226
@@ -293,6 +302,6 @@ Single PeerDB instance can serve multiple sites:
293302
294303# ## ElasticSearch Index
295304
296- - Index configuration generated in internal/mapping package
305+ - Index configuration generated in internal/search package
297306- Auto-created on first run if missing
298307- Run `./peerdb populate` to initialize with core PeerDB properties
0 commit comments