本文整理了Java中edu.isi.karma.rep.Worksheet.getSemanticTypes()
方法的一些代码示例,展示了Worksheet.getSemanticTypes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Worksheet.getSemanticTypes()
方法的具体详情如下:
包路径:edu.isi.karma.rep.Worksheet
类名称:Worksheet
方法名:getSemanticTypes
暂无
代码示例来源:origin: usc-isi-i2/Web-Karma
public void saveAlignment(Alignment alignment, JSONArray history, String modelFilename, boolean onlyHistory) throws Exception {
long start = System.currentTimeMillis();
String workspaceId = AlignmentManager.Instance().getWorkspaceId(alignment);
String worksheetId = AlignmentManager.Instance().getWorksheetId(alignment);
Worksheet worksheet = workspace.getWorksheet(worksheetId);
if(modelFilename == null && worksheet != null) {
modelFilename = getHistoryFilepath(worksheetId);
}
long end1 = System.currentTimeMillis();
logger.info("Time to get alignment info for saving: " + (end1-start) + "msec");
// Generate the KR2RML data structures for the RDF generation
if (worksheet != null)
alignmentMappingGenerator = new KR2RMLMappingGenerator(workspace, worksheet, alignment,
worksheet.getSemanticTypes(), prefix, namespace, false, history, onlyHistory);
long end2 = System.currentTimeMillis();
logger.info("Time to generate mappings:" + (end2-end1) + "msec");
// Write the model
if (modelFilename != null && !modelFilename.trim().isEmpty())
writeModel(workspace, workspace.getOntologyManager(), alignmentMappingGenerator, worksheet, modelFilename);
logger.info("Alignment for " + workspaceId + ":" + worksheetId + " saved to file: " + modelFilename);
long end3 = System.currentTimeMillis();
logger.info("Time to write to file:" + (end3-end2) + "msec");
}
代码示例来源:origin: usc-isi-i2/Web-Karma
for (SemanticType type : worksheet.getSemanticTypes().getListOfTypes()) {
modeledColumnTable.put(type.getHNodeId(),"");
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public void generateJson(String prefix, PrintWriter pw,
VWorkspace vWorkspace) {
VWorksheet vWorksheet = vWorkspace.getViewFactory().getVWorksheetByWorksheetId(worksheetId);
try {
JSONObject response = new JSONObject();
response.put(JsonKeys.worksheetId.name(), worksheetId);
response.put(AbstractUpdate.GenericJsonKeys.updateType.name(),
this.getClass().getSimpleName());
Worksheet wk = vWorksheet.getWorksheet();
List<VHNode> viewHeaders = vWorksheet.getHeaderViewNodes();
JSONArray columns = getColumnsJsonArray(viewHeaders, wk.getSemanticTypes());
response.put(JsonKeys.columns.name(), columns);
pw.println(response.toString());
if (deleteAfterGenerate) {
vWorkspace.getWorkspace().getFactory().removeWorksheet(wk.getId(), vWorkspace.getWorkspace().getCommandHistory());
vWorkspace.getViewFactory().removeWorksheet(wk.getId());
}
} catch (JSONException e) {
e.printStackTrace();
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
worksheet.getSemanticTypes().addType(type);
代码示例来源:origin: usc-isi-i2/Web-Karma
type = new SemanticType(hNodeId, typeName, domainName, domainId,
false, Origin.User, 1.00);
worksheet.getSemanticTypes().addType(type);
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public UpdateContainer undoIt(Workspace workspace) {
UpdateContainer c = new UpdateContainer();
Worksheet worksheet = workspace.getWorksheet(worksheetId);
if (oldType == null) {
worksheet.getSemanticTypes().unassignColumnSemanticType(hNodeId);
} else {
worksheet.getSemanticTypes().setType(oldType);
worksheet.getSemanticTypes().addSynonymTypesForHNodeId(hNodeId, oldSynonymTypes);
}
// Replace the current alignment with the old alignment
String alignmentId = AlignmentManager.Instance().constructAlignmentId(workspace.getId(), worksheetId);
AlignmentManager.Instance().addAlignmentToMap(alignmentId, oldAlignment);
oldAlignment.setGraph(oldGraph);
// Get the alignment update if any
try {
c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace));
} catch (Exception e) {
logger.error("Error occured while unsetting the semantic type!", e);
return new UpdateContainer(new ErrorUpdate(
"Error occured while unsetting the semantic type!"));
}
return c;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public UpdateContainer undoIt(Workspace workspace) {
UpdateContainer c = new UpdateContainer();
Worksheet worksheet = workspace.getWorksheet(worksheetId);
if (oldType == null) {
worksheet.getSemanticTypes().unassignColumnSemanticType(hNodeId);
} else {
worksheet.getSemanticTypes().setType(oldType);
worksheet.getSemanticTypes().addSynonymTypesForHNodeId(
hNodeId, oldSynonymTypes);
}
// Replace the current alignment with the old alignment
String alignmentId = AlignmentManager.Instance().constructAlignmentId(
workspace.getId(), worksheetId);
AlignmentManager.Instance()
.addAlignmentToMap(alignmentId, oldAlignment);
oldAlignment.setGraph(oldGraph);
// Get the alignment update if any
try {
c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace));
} catch (Exception e) {
logger.error("Error occured while unsetting the semantic type!", e);
return new UpdateContainer(new ErrorUpdate(
"Error occured while unsetting the semantic type!"));
}
return c;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
worksheet.getSemanticTypes(), prefix, namespace, true);
代码示例来源:origin: usc-isi-i2/Web-Karma
for (SemanticType type : worksheet.getSemanticTypes().getListOfTypes()) {
modeledColumnTable.put(type.getHNodeId(),"");
代码示例来源:origin: usc-isi-i2/Web-Karma
boolean latFound = false;
boolean lngFound = false;
for (SemanticType type : worksheet.getSemanticTypes().getListOfTypes()) {
if (type.getType().getUri().equals(SRID_PROPERTY)
&& type.getDomain().getUri().equals(SRID_CLASS)){
for (SemanticType type : worksheet.getSemanticTypes().getListOfTypes()) {
代码示例来源:origin: usc-isi-i2/Web-Karma
mappingGen = new KR2RMLMappingGenerator(
workspace, worksheet, alignment,
worksheet.getSemanticTypes(), rdfPrefix, rdfNamespace,
false);
} catch (KarmaException e)
代码示例来源:origin: usc-isi-i2/Web-Karma
private void prepareFeatureSchema() {
List<String> spatialHNodeIds = new ArrayList<>();
for (SemanticType type : worksheet.getSemanticTypes().getListOfTypes()) {
if (kmlLabelHNodeId == "") {
for (SemanticType synonymType : worksheet
.getSemanticTypes()
.getSynonymTypesForHNodeId(kmlCategoryHNodeId)
.getSynonyms()) {
if (kmlCategoryHNodeId == "") {
for (SemanticType synonymType : worksheet
.getSemanticTypes()
.getSynonymTypesForHNodeId(kmlLabelHNodeId)
.getSynonyms()) {
代码示例来源:origin: usc-isi-i2/Web-Karma
mappingGen = new KR2RMLMappingGenerator(workspace, worksheet,
alignment, worksheet.getSemanticTypes(), "s", graphUri,
false);
代码示例来源:origin: usc-isi-i2/Web-Karma
mappingGen = new KR2RMLMappingGenerator(
workspace, worksheet, alignment,
worksheet.getSemanticTypes(), rdfPrefix, rdfNamespace,
false);
} catch (KarmaException e)
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public UpdateContainer undoIt(Workspace workspace) {
Worksheet worksheet = workspace.getWorksheet(worksheetId);
// Add the old SemanticType object if it is not null
SemanticTypes types = worksheet.getSemanticTypes();
if (oldSemanticTypes != null) {
types.setType(oldSemanticTypes);
}
// Update the container
UpdateContainer c = new UpdateContainer();
// Update with old alignment
String alignmentId = AlignmentManager.Instance().constructAlignmentId(workspace.getId(), worksheetId);
AlignmentManager.Instance().addAlignmentToMap(alignmentId, oldAlignment);
oldAlignment.setGraph(oldGraph);
try {
c.add(new SemanticTypesUpdate(worksheet, worksheetId));
c.add(new AlignmentSVGVisualizationUpdate(worksheetId));
} catch (Exception e) {
logger.error("Error occured during undo of unassigning the semantic type!", e);
return new UpdateContainer(new ErrorUpdate("Error occured during undo of unassigning the semantic type!"));
}
return c;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
worksheet.getSemanticTypes().addType(type);
saveSemanticTypesInformation(worksheet, workspace, worksheet.getSemanticTypes().getListOfTypes());
代码示例来源:origin: usc-isi-i2/Web-Karma
Workspace workspace = vWorkspace.getWorkspace();
alignment = AlignmentManager.Instance().getAlignment(workspace.getId(), worksheetId);
SemanticTypes types = worksheet.getSemanticTypes();
Map<String, ColumnNode> hNodeIdTocolumnNodeMap = createColumnNodeMap();
代码示例来源:origin: usc-isi-i2/Web-Karma
Worksheet worksheet = workspace.getWorksheet(worksheetId);
SemanticTypes types = worksheet.getSemanticTypes();
oldSemanticTypes = types.getSemanticTypeForHNodeId(hNodeId);
HashMap<String, SemanticType> semanticIdMap = new HashMap<>();
代码示例来源:origin: usc-isi-i2/Web-Karma
worksheet.getSemanticTypes().unassignColumnSemanticType(hNodeId);
List<SemanticType> suggestedSemanticTypes =
new SemanticTypeUtil().getColumnSemanticSuggestions(workspace, worksheet, cn, 4, selection);
saveSemanticTypesInformation(worksheet, workspace, worksheet.getSemanticTypes().getListOfTypes());
代码示例来源:origin: usc-isi-i2/Web-Karma
saveSemanticTypesInformation(worksheet, workspace, worksheet.getSemanticTypes().getListOfTypes());
c.append(this.computeAlignmentAndSemanticTypesAndCreateUpdates(workspace));
内容来源于网络,如有侵权,请联系作者删除!