Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/ConceptImporter.java |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | out.info("storing category redirect "+rcName+" -> "+redir); |
272 | 272 | storeAlias(analyzerPage, rcId); |
273 | 273 | } else { |
274 | | - int conceptId = store.storeAbout(rcId, name); |
| 274 | + int conceptId = store.storeAbout(rcId, rcName, name); |
275 | 275 | |
276 | 276 | List<WikiTextAnalyzer.WikiLink> links = analyzerPage.getLinks(); |
277 | 277 | linkTracker.step(links.size()); |
— | — | @@ -477,7 +477,7 @@ |
478 | 478 | String tgtConcept = link.getPage().toString(); |
479 | 479 | |
480 | 480 | if (!name.equals(tgtConcept)) { |
481 | | - conceptId = store.storeAbout(rcId, name); |
| 481 | + conceptId = store.storeAbout(rcId, rcName, name); |
482 | 482 | storeConceptAlias(rcId, conceptId, name, -1, tgtConcept, AliasScope.REDIRECT); |
483 | 483 | } else { |
484 | 484 | out.debug("skipping redirect to category with the same name"); |
— | — | @@ -491,7 +491,7 @@ |
492 | 492 | warn(rcId, "bad redirect (self-link)", "page "+name, null); |
493 | 493 | } |
494 | 494 | else { |
495 | | - conceptId = store.storeAbout(rcId, name); |
| 495 | + conceptId = store.storeAbout(rcId, rcName, name); |
496 | 496 | storePageTerms(rcId, analyzerPage.getTitleTerms(), -1, link.getPage().toString(), ExtractionRule.TERM_FROM_REDIRECT ); |
497 | 497 | storeConceptAlias(rcId, conceptId, name, -1, link.getPage().toString(), AliasScope.REDIRECT); |
498 | 498 | |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java |
— | — | @@ -303,7 +303,7 @@ |
304 | 304 | */ |
305 | 305 | public int storeResourceAbout(String name, ResourceType ptype, Date time, int conceptId, String conceptName) throws PersistenceException { |
306 | 306 | int rcId = storeResource(name, ptype, time); |
307 | | - storeAbout(rcId, conceptId, conceptName); |
| 307 | + storeAbout(rcId, name, conceptId, conceptName); |
308 | 308 | return rcId; |
309 | 309 | } |
310 | 310 | |
— | — | @@ -355,7 +355,7 @@ |
356 | 356 | id = conceptInserter.getLastId(); |
357 | 357 | } |
358 | 358 | |
359 | | - if (rcId>=0) storeAbout(rcId, id, name); |
| 359 | + if (rcId>=0) storeAbout(rcId, name, id, name); //XXX: really here? do prior to calling this method?! |
360 | 360 | |
361 | 361 | return id; |
362 | 362 | } catch (SQLException e) { |
— | — | @@ -484,14 +484,14 @@ |
485 | 485 | /** |
486 | 486 | * @see de.brightbyte.wikiword.store.builder.LocalConceptStoreBuilder#storeAbout(int, String) |
487 | 487 | */ |
488 | | - public int storeAbout(int rcId, String conceptName) throws PersistenceException { |
489 | | - return storeAbout(rcId, -1, conceptName); |
| 488 | + public int storeAbout(int rcId, String rcName, String conceptName) throws PersistenceException { |
| 489 | + return storeAbout(rcId, rcName, -1, conceptName); |
490 | 490 | } |
491 | 491 | |
492 | 492 | /** |
493 | 493 | * @see de.brightbyte.wikiword.store.builder.LocalConceptStoreBuilder#storeAbout(int, int, String) |
494 | 494 | */ |
495 | | - public int storeAbout(int rcId, int concept, String conceptName) throws PersistenceException { |
| 495 | + public int storeAbout(int rcId, String rcName, int concept, String conceptName) throws PersistenceException { |
496 | 496 | try { |
497 | 497 | if (rcId<0) throw new IllegalArgumentException("bad resource id "+rcId); |
498 | 498 | conceptName = checkName(rcId, conceptName, "concept name (resource #{0})", rcId); |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/LocalConceptStoreBuilder.java |
— | — | @@ -55,11 +55,11 @@ |
56 | 56 | throws PersistenceException; |
57 | 57 | |
58 | 58 | /* returns concept ID, of known; -1 otherwise */ |
59 | | - public abstract int storeAbout(int resource, String conceptName) |
| 59 | + public abstract int storeAbout(int resource, String rcName, String conceptName) |
60 | 60 | throws PersistenceException; |
61 | 61 | |
62 | 62 | /* returns concept ID, of known; -1 otherwise */ |
63 | | - public abstract int storeAbout(int resource, int concept, String conceptName) |
| 63 | + public abstract int storeAbout(int resource, String rcName, int concept, String conceptName) |
64 | 64 | throws PersistenceException; |
65 | 65 | |
66 | 66 | //public abstract void storeConceptReference(int rcId, int source, |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DebugLocalConceptStoreBuilder.java |
— | — | @@ -509,7 +509,7 @@ |
510 | 510 | |
511 | 511 | public int storeResourceAbout(String name, ResourceType ptype, Date time, int conceptId, String conceptName) { |
512 | 512 | int resourceId = storeResource(name, ptype, time); |
513 | | - storeAbout(resourceId, conceptId, conceptName); |
| 513 | + storeAbout(resourceId, name, conceptId, conceptName); |
514 | 514 | return resourceId; |
515 | 515 | } |
516 | 516 | |
— | — | @@ -712,13 +712,13 @@ |
713 | 713 | return 0; |
714 | 714 | } |
715 | 715 | |
716 | | - public int storeAbout(int resource, String conceptName) { |
717 | | - trace("+ storeAbout: resource = "+resource+", conceptName = "+conceptName); |
| 716 | + public int storeAbout(int resource, String rcName, String conceptName) { |
| 717 | + trace("+ storeAbout: resource = "+resource+", resourceName = "+rcName+", conceptName = "+conceptName); |
718 | 718 | return -1; |
719 | 719 | } |
720 | 720 | |
721 | | - public int storeAbout(int resource, int concept, String conceptName) { |
722 | | - trace("+ storeAbout: resource = "+resource+", concept = "+concept+", conceptName = "+conceptName); |
| 721 | + public int storeAbout(int resource, String rcName, int concept, String conceptName) { |
| 722 | + trace("+ storeAbout: resource = "+resource+", resourceName = "+rcName+", concept = "+concept+", conceptName = "+conceptName); |
723 | 723 | return -1; |
724 | 724 | } |
725 | 725 | |
Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/schema/LocalConceptStoreSchema.java |
— | — | @@ -104,6 +104,7 @@ |
105 | 105 | aboutTable = new RelationTable(this, "about", getDefaultTableAttributes()); |
106 | 106 | //aliasTable.addField( new DatabaseField(this, "id", "INT", "AUTO_INCREMENT", false, KeyType.PRIMARY) ); |
107 | 107 | aboutTable.addField( new ReferenceField(this, "resource", "INT", null, true, null, "resource", "id", null ) ); |
| 108 | + aboutTable.addField( new ReferenceField(this, "resource_name", getTextType(255), null, true, KeyType.INDEX, "resource", "name", null ) ); |
108 | 109 | aboutTable.addField( new ReferenceField(this, "concept", "INT", null, false, KeyType.INDEX, "concept", "id", null ) ); |
109 | 110 | aboutTable.addField( new ReferenceField(this, "concept_name", getTextType(255), null, true, KeyType.INDEX, "concept", "name", null ) ); |
110 | 111 | aboutTable.addKey( new DatabaseKey(this, KeyType.PRIMARY, "about", new String[] {"resource", "concept"}) ); |