File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed
Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -449,10 +449,33 @@ func (p *TripleAggregateToWikiPageConverter) Run() {
449449 _ , valueStr := p .convertUriToWikiTitle (tr .Obj .String (), valueUriType , resourceIndex )
450450
451451 if tr .Pred .String () == typePropertyURI || tr .Pred .String () == subClassPropertyURI {
452- page .AddCategory (valueStr )
452+
453+ catExists := false
454+ for _ , existingCat := range page .Categories {
455+ if valueStr == existingCat {
456+ catExists = true
457+ break
458+ }
459+ }
460+
461+ if ! catExists {
462+ page .AddCategory (valueStr )
463+ }
464+
453465 } else {
454- fact := NewFact (propertyStr , valueStr )
455- page .AddFact (fact )
466+
467+ factExists := false
468+ for _ , existingFact := range page .Facts {
469+ if propertyStr == existingFact .Property && valueStr == existingFact .Value {
470+ factExists = true
471+ break
472+ }
473+ }
474+
475+ if ! factExists {
476+ fact := NewFact (propertyStr , valueStr )
477+ page .AddFact (fact )
478+ }
456479 }
457480 }
458481
You can’t perform that action at this time.
0 commit comments