@@ -63,7 +63,7 @@ const blogConfig = globalConfig.includeTypes(['Article']);
6363
6464// Use configurations
6565const result = createJsonLdBuilder ()
66- .applyConfig (homeConfig )
66+ .mergeConfig (homeConfig . getConfig () )
6767 .excludeIds ([' runtime:override' ]) // Runtime overrides
6868 .build ({ prettyPrint: true });
6969```
@@ -122,7 +122,7 @@ const config = createJsonLdConfig()
122122Creates a new builder that extends the configuration builder with graph processing capabilities.
123123
124124``` typescript
125- const builder = createJsonLdBuilder ().baseGraph (graph ).applyConfig (config );
125+ const builder = createJsonLdBuilder ().baseGraph (graph ).mergeConfig (config );
126126```
127127
128128### Configuration Methods
@@ -149,6 +149,37 @@ All methods are inherited by the builder from the configuration builder:
149149- ` .clearSubgraph() ` - Clear subgraphRoots
150150- ` .clearAll() ` - Clear entire configuration (except baseGraph)
151151
152+ #### Configuration Merging
153+
154+ - ` .mergeConfig(config: JsonLdConfig) ` - Merge with another complete configuration
155+ - ` .mergeFilters(filters: JsonLdFilterOptions) ` - Merge only the filters part of another configuration
156+
157+ ** Available in both config builder and main builder** - These methods work the same way in both classes.
158+
159+ ``` typescript
160+ // Config builder usage
161+ const baseConfig = createJsonLdConfig ().includeTypes ([' Person' ]);
162+ const otherConfig = createJsonLdConfig ()
163+ .includeTypes ([' Organization' ])
164+ .excludeIds ([' test' ])
165+ .getConfig ();
166+ const merged = baseConfig .mergeConfig (otherConfig );
167+ // Result: includeTypes: ['Person', 'Organization'], excludeIds: ['test']
168+
169+ // Main builder usage (processes graph immediately)
170+ const result = createJsonLdBuilder ()
171+ .baseGraph (graph )
172+ .includeTypes ([' Person' ])
173+ .mergeConfig (otherConfig )
174+ .build ({ prettyPrint: true });
175+
176+ // Merge only filters
177+ const baseConfig = createJsonLdConfig ().includeTypes ([' Person' ]).addEntities ([entity ]);
178+ const otherFilters = { includeTypes: [' Organization' ], maxEntities: 10 };
179+ const merged = baseConfig .mergeFilters (otherFilters );
180+ // Result: includeTypes: ['Person', 'Organization'], maxEntities: 10, additionalEntities preserved
181+ ```
182+
152183#### Property Filtering
153184
154185- ` .filterPropertiesByIds(entityIds, rule) ` - Filter properties for specific entity IDs
@@ -175,7 +206,6 @@ All methods are inherited by the builder from the configuration builder:
175206
176207#### Builder-Only Methods
177208
178- - ` .applyConfig(config: JsonLdConfig) ` - Apply a pre-built configuration
179209- ` .getCurrentGraph() ` - Get the current graph state
180210- ` .build(options?: BuildOptions) ` - Build the final JSON-LD output
181211
0 commit comments