public String getObjectId() { return tm.getObjectId(); }
public static String toString(String impl, TopicMapIF topicmap) { String id = UNASSIGNED; try { if (topicmap.getTopicMap() != null) id = topicmap.getObjectId(); return "[" + impl + ", " + id + "]"; } catch (Throwable t) { return "[" + impl + ", " + topicmap.getObjectId() + "!]"; } }
private String getSQL() { String sql = (String)parameters.get("sql"); if (sql == null) { String queryName = (String)parameters.get("queryName"); if (queryName == null) queryName = predicateName; String queryFile = (String)parameters.get("queryFile"); if (queryFile == null) queryFile = "RDBMSSearcher.props"; try { Properties props = PropertyUtils.loadPropertiesFromClassPath(queryFile); sql = props.getProperty(queryName); } catch (IOException e) { throw new OntopiaRuntimeException(e); } if (sql == null) throw new OntopiaRuntimeException("Query with name '" + queryName + "' not found in " + queryFile + "."); } sql = StringUtils.replace(sql, "${topicmap}", topicmap.getObjectId().substring(1)); sql = StringUtils.replace(sql, "${term}", "?"); return sql; }
@Override public void run() { topicmap.addItemIdentifier(URILocator.create("x:source-locator")); this.objectId = topicmap.getObjectId(); } });
public void testTypeConflict2() throws InvalidQueryException, IOException { load("family2.ltm"); findNothing(OPT_TYPECHECK_OFF + "topic-name(@" + topicmap.getObjectId() + ", $BN)?"); }
RDBMSTopicMapStore store = new RDBMSTopicMapStore(propfile, topicMapId); TopicMapIF tm = store.getTopicMap(); String id = tm.getObjectId(); try { Map stats = Stats.getStatistics(store.getTopicMap());
public TMObjectIFHandle(TMObjectIF o) { this.objectId = o.getObjectId(); TopicMapIF tm = o.getTopicMap(); this.topicmapId = tm.getObjectId(); TopicMapReferenceIF ref = tm.getStore().getReference(); if (ref != null) this.referenceId = ref.getId(); }
@Override public void run() { topicmap.removeItemIdentifier(URILocator.create("x:source-locator")); this.objectId = topicmap.getObjectId(); } });
RDBMSTopicMapStore store = new RDBMSTopicMapStore(propfile, topicMapId); TopicMapIF tm = store.getTopicMap(); String id = tm.getObjectId();
protected long importTopicMap(URL filename) throws IOException { // import sample topic map TopicMapStoreIF store = new RDBMSTopicMapStore(); // don't use storage TopicMapReaderIF importer = ImportExportUtils.getReader(filename.toString()); importer.importInto(store.getTopicMap()); long topicmap_id = Long.parseLong(store.getTopicMap().getObjectId().substring(1)); store.commit(); store.close(); return topicmap_id; }
protected long importTopicMap(String filename) throws IOException { // import sample topic map TopicMapStoreIF store = new RDBMSTopicMapStore(); // don't use storage TopicMapReaderIF importer = ImportExportUtils.getReader(filename); importer.importInto(store.getTopicMap()); long topicmap_id = Long.parseLong(store.getTopicMap().getObjectId().substring(1)); store.commit(); store.close(); return topicmap_id; }
((XTMTopicMapReader)importer).setFollowTopicRefs(false); System.out.println("Importing " + filename + " into " + tm.getObjectId()); long start = System.currentTimeMillis();
addMatch(matches, "OBJECT", topicmap, "ID", topicmap.getObjectId());
if (reifier == null) { LocatorIF srcloc = ctx.getBaseLocator().resolveAbsolute("#" + topicmap.getObjectId()); reifier = ctx.getBuilder().makeTopic(); topicmap.setReifier(reifier);
@Override protected void canonicalize(URL infile, File outfile) throws IOException { // Import document TopicMapStoreIF store1 = new RDBMSTopicMapStore(); TopicMapIF source1 = store1.getTopicMap(); // Get hold of topic map id long topicmap_id = Long.parseLong(source1.getObjectId().substring(1)); XTMTopicMapReader reader = new XTMTopicMapReader(infile); reader.setValidation(false); reader.importInto(source1); store1.commit(); store1.close(); // Canonicalize document TopicMapStoreIF store2 = new RDBMSTopicMapStore(topicmap_id); TopicMapIF source2 = store2.getTopicMap(); CanonicalTopicMapWriter cwriter = new CanonicalTopicMapWriter(outfile); cwriter.setBaseLocator(new URILocator(infile)); cwriter.write(source2); store2.delete(true); //! store2.close(); }
try { source1 = store1.getTopicMap(); topicmap_id1 = Long.parseLong(source1.getObjectId().substring(1)); new XTMTopicMapReader(TestFileUtils.getTestInputURL(in)).importInto(source1); store1.commit(); try { source2 = store2.getTopicMap(); topicmap_id2 = Long.parseLong(source2.getObjectId().substring(1)); new XTMTopicMapReader(TestFileUtils.getTestInputURL(in2)).importInto(source2); store2.commit();
long topicmap_id1 = Long.parseLong(source1.getObjectId().substring(1)); long topicmap_id3 = Long.parseLong(source3.getObjectId().substring(1));
long tmid = Long.parseLong(tmA.getObjectId().substring(1));
long tmid = Long.parseLong(tmA.getObjectId().substring(1));
TopicMapReaderIF importer = new XTMTopicMapReader(file); importer.importInto(tm); long topicmap_id = Long.parseLong(tm.getObjectId().substring(1)); store.commit(); store.close();