本文整理汇总了Java中org.rdfhdt.hdt.hdt.HDTManager.mapIndexedHDT方法的典型用法代码示例。如果您正苦于以下问题:Java HDTManager.mapIndexedHDT方法的具体用法?Java HDTManager.mapIndexedHDT怎么用?Java HDTManager.mapIndexedHDT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rdfhdt.hdt.hdt.HDTManager
的用法示例。
在下文中一共展示了HDTManager.mapIndexedHDT方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createModel
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
@Override
protected Model createModel(String dbId) {
Model model = null;
try {
File hdtFile = getHDTPath(dbId).toFile();
if (hdtFile.exists()) {
boolean useIdx = useIndex(dbId);
String hdtFilePathStr = hdtFile.getAbsolutePath();
logger.info(marker, "Loading '{}', useIndex={}", hdtFilePathStr, useIdx);
HDT hdt = useIdx ? HDTManager.mapIndexedHDT(hdtFilePathStr, null) : HDTManager.loadHDT(hdtFilePathStr, null);
HDTGraph graph = new HDTGraph(hdt);
model = ModelFactory.createModelForGraph(graph);
return model;
}
throw new FileNotFoundException("HDT file not found: '" + hdtFile + "'");
} catch (Exception e) {
throw new StarGraphException(e);
}
finally {
if (model == null) {
logger.error(marker, "No Graph Model instantiated for {}", dbId);
}
}
}
示例2: LimayeGroundtruthAnnotationParser
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public LimayeGroundtruthAnnotationParser(Table table) {
this.table = table;
this.cellAnnotation = false;
this.columnAnnotation = false;
this.columnNr = 0;
this.column = -1;
this.row = -1;
this.currentValue = new StringBuilder();
HDT hdt = null;
HDT hdt_l = null;
// HDT hdt_d = null;
try {
hdt = HDTManager.mapIndexedHDT(REDIRECTS, null);
hdt_l = HDTManager.mapIndexedHDT(LABELS, null);
// hdt_d = HDTManager.mapIndexedHDT(TYPES, null);
} catch (IOException e) {
e.printStackTrace();
}
HDTGraph graph = new HDTGraph(hdt);
m = ModelFactory.createModelForGraph(graph);
// graph = new HDTGraph(hdt_d);
// m_d = ModelFactory.createModelForGraph(graph);
graph = new HDTGraph(hdt_l);
m_l = ModelFactory.createModelForGraph(graph);
}
示例3: main
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public static void main(String[] args) {
HDT hdt = null;
try {
hdt = HDTManager.mapIndexedHDT(TYPES, null);
} catch (IOException e) {
e.printStackTrace();
}
HDTGraph graph = new HDTGraph(hdt);
Model m = ModelFactory.createModelForGraph(graph);
StmtIterator iter = m.listStatements();
HashMap<String, Integer> hash = new HashMap<String, Integer>();
int number = 0;
while (iter.hasNext()) {
if (number % 50000 == 0) {
System.out.println("Processed Entries: " + number);
}
Statement stmt = iter.next();
RDFNode object = stmt.getObject();
String s = null;
s = object.asResource().getURI();
hash.put(s, 0);
number++;
}
System.out.println("Anzahl an Typen: " +hash.size());
}
示例4: load
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
void load(String hdtDump){
try {
hdt = HDTManager.mapIndexedHDT(hdtDump, null);
} catch (IOException e) {
e.printStackTrace();
}
}
示例5: MainEvaluation
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public MainEvaluation(String maindir) {
File maind = new File(maindir);
HDT redirectsHDT;
try {
redirectsHDT = HDTManager.mapIndexedHDT("/home/quh/dbpedia_redirects.hdt", null);
final HDTGraph redirectsHDTgraph = new HDTGraph(redirectsHDT);
this.redirects = ModelFactory.createModelForGraph(redirectsHDTgraph);
} catch (IOException e) {
e.printStackTrace();
}
evaluate(maind);
}
示例6: CreateDBPediaIndex
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
CreateDBPediaIndex() {
super();
this.LABELS = new HashMap<String, HashSet<String>>();
this.UNIQUELABELSTRINGS = new HashMap<String, HashSet<String>>();
this.OCCURRENCES = new HashMap<String, HashMap<String, Integer>>();
this.relationmap = new HashMap<String, LinkedList<String>>();
this.pattymap = new HashMap<String, LinkedList<String>>();
this.pattyfreebasemap = new HashMap<String, LinkedList<String>>();
this.evidencemap = new HashMap<String, HashSet<String>>();
HDT labelhdt;
HDT shortdeschdt;
HDT longdeschdt;
try {
labelhdt = HDTManager.mapIndexedHDT(LABELHDT, null);
shortdeschdt = HDTManager.mapIndexedHDT(SHORTDESCHDT, null);
longdeschdt = HDTManager.mapIndexedHDT(LONGDESCHDT, null);
final HDTGraph labelhdtgraph = new HDTGraph(labelhdt);
final HDTGraph shortdeschdtgraph = new HDTGraph(shortdeschdt);
final HDTGraph longdeschdtgraph = new HDTGraph(longdeschdt);
this.labelmodel = ModelFactory.createModelForGraph(labelhdtgraph);
this.shortdescmodel = ModelFactory
.createModelForGraph(shortdeschdtgraph);
this.longdescmodel = ModelFactory
.createModelForGraph(longdeschdtgraph);
} catch (IOException e) {
e.printStackTrace();
}
this.counter = 0;
}
示例7: Test1
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public Test1() {
HDT mappingbasedproperties;
try {
mappingbasedproperties = HDTManager.mapIndexedHDT(
MAPPINGPROPERTIESHDT, null);
final HDTGraph instancemappingtypesgraph = new HDTGraph(
mappingbasedproperties);
this.mappingbasedproperties = ModelFactory
.createModelForGraph(instancemappingtypesgraph);
} catch (IOException e) {
e.printStackTrace();
}
}
示例8: HDTGraph
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public HDTGraph(String hdtFile) throws IOException {
this.rawGraph = HDTManager.mapIndexedHDT(hdtFile, null);
this.weLoaded=true;
populateInternal();
}
示例9: action
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public void action() {
HDT hdt = null;
HDT hdt_l = null;
HDT hdt_d = null;
Model m = null;
Model m_l = null;
Model m_d = null;
try {
hdt = HDTManager.mapIndexedHDT(REDIRECTS, null);
hdt_l = HDTManager.mapIndexedHDT(LABELS, null);
// hdt_d = HDTManager.mapIndexedHDT(TYPES, null);
} catch (IOException e) {
e.printStackTrace();
}
HDTGraph graph = new HDTGraph(hdt);
m = ModelFactory.createModelForGraph(graph);
graph = new HDTGraph(hdt_l);
m_l = ModelFactory.createModelForGraph(graph);
File file = new File("/home/quh/Arbeitsfläche/Table Disambiguation Data sets/LimayeAll/all_tables_raw(regen)/");
File[] f = file.listFiles();
int cellsOverall = 0;
int cellsAnnotated = 0;
for (int u = 0; u < f.length; u++) {
// System.out.println(f[u].getAbsolutePath());
StartEvaluationTableEntities eval = new StartEvaluationTableEntities();
String sourcePath = f[u].getAbsolutePath();
Table t = eval.readTable(f[u].getAbsolutePath(), m, m_l, m_d);
if (t != null) {
int cols = t.getNumberofColumns();
for (int i = 0; i < cols; i++) {
Column col = t.getColumn(i);
List<Cell> cellL = col.getCellList();
List<String> types = col.getMajorTypes();
cellsOverall++;
// if(types != null && types.size() > 0) {
// cellsAnnotated++;
// }
for (Cell c : cellL) {
cellsOverall++;
if (c.getGt() != null && !c.getGt().equalsIgnoreCase("")) {
cellsAnnotated++;
}
}
}
System.out.println("Zellen insgesamt: " + cellsOverall + " Zellen annotiert: " + cellsAnnotated);
// Query each column separately
for (int i = 0; i < t.getNumberofColumns(); i++) {
Column column = t.getColumn(i);
List<EntityDisambiguationDPO> request_dpo = eval.transformInRequestFormat(column);
String topic = column.getHeader();
List<Response> l = queryService(request_dpo, topic);
setDisambiguatedColumn(t, i, l);
}
StartEvaluationTableEntities.evaluateResults(t);
}
}
System.out.println("Insgesamt: " + sum + " davon richtig: " + correct);
}
示例10: CreateDBpediaIndexV2
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
public CreateDBpediaIndexV2() {
super();
this.relationmap = new HashMap<String, LinkedList<String>>();
this.pattymap = new HashMap<String, LinkedList<String>>();
this.pattyfreebasemap = new HashMap<String, LinkedList<String>>();
this.OCCURRENCES = new HashMap<String, HashMap<String, Integer>>();
this.LABELS = new HashMap<String, HashSet<String>>();
this.UNIQUELABELSTRINGS = new HashMap<String, HashSet<String>>();
this.DBPEDIAGRAPHINLINKS = new HashMap<String, Integer>();
this.evidences = new HashMap<String, String>();
this.teams = new HashSet<String>();
this.urlentitymapping = new HashMap<String, String>();
this.entities = new HashSet<String>();
this.counter = 0;
HDT labelhdt;
HDT shortdeschdt;
HDT longdeschdt;
HDT mappingbasedproperties;
HDT instancemappingtypeshdt;
try {
labelhdt = HDTManager.mapIndexedHDT(LABELHDT, null);
shortdeschdt = HDTManager.mapIndexedHDT(SHORTDESCHDT, null);
longdeschdt = HDTManager.mapIndexedHDT(LONGDESCHDT, null);
mappingbasedproperties = HDTManager.mapIndexedHDT(PERSONDATAHDT, null);
instancemappingtypeshdt = HDTManager.mapIndexedHDT(INSTANCEMAPPINGTYPES, null);
final HDTGraph labelhdtgraph = new HDTGraph(labelhdt);
final HDTGraph shortdeschdtgraph = new HDTGraph(shortdeschdt);
final HDTGraph longdeschdtgraph = new HDTGraph(longdeschdt);
final HDTGraph instancepersondata = new HDTGraph(mappingbasedproperties);
final HDTGraph instancemappingtypesgraph = new HDTGraph(instancemappingtypeshdt);
this.labelmodel = ModelFactory.createModelForGraph(labelhdtgraph);
this.shortdescmodel = ModelFactory.createModelForGraph(shortdeschdtgraph);
this.longdescmodel = ModelFactory.createModelForGraph(longdeschdtgraph);
this.persondata = ModelFactory.createModelForGraph(instancepersondata);
this.instancemappingtypes = ModelFactory.createModelForGraph(instancemappingtypesgraph);
} catch (IOException e) {
e.printStackTrace();
}
}
示例11: HdtBasedRequestProcessorForTPFs
import org.rdfhdt.hdt.hdt.HDTManager; //导入方法依赖的package包/类
/**
* Creates the request processor.
*
* @param hdtFile the HDT datafile
* @throws IOException if the file cannot be loaded
*/
public HdtBasedRequestProcessorForTPFs( String hdtFile ) throws IOException
{
datasource = HDTManager.mapIndexedHDT( hdtFile, null ); // listener=null
dictionary = new NodeDictionary( datasource.getDictionary() );
}