本文整理了Java中edu.isi.karma.rep.Worksheet.getTitle()
方法的一些代码示例,展示了Worksheet.getTitle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Worksheet.getTitle()
方法的具体详情如下:
包路径:edu.isi.karma.rep.Worksheet
类名称:Worksheet
方法名:getTitle
暂无
代码示例来源:origin: usc-isi-i2/Web-Karma
public JsonImport(Object json, RepFactory repFactory, Worksheet wk, Workspace workspace,
int maxNumLines) {
super(repFactory, wk);
this.json = json;
this.workspace = workspace;
this.maxNumLines = maxNumLines;
this.worksheetName = wk.getTitle();
this.encoding = "UTF-8";
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public JsonImport(File json, RepFactory repFactory, Worksheet wk, Workspace workspace,
int maxNumLines, JSONArray columnsJson) {
super(repFactory, wk);
FileObject fo = new FileObject(json, "UTF-8");
this.json = fo;
this.workspace = workspace;
this.maxNumLines = maxNumLines;
this.columnsJson = columnsJson;
this.worksheetName = wk.getTitle();
this.encoding = "UTF-8";
}
代码示例来源:origin: usc-isi-i2/Web-Karma
protected String formatWorsheetId(Workspace workspace, String worksheetId) {
return worksheetId + " ("
+ workspace.getWorksheet(worksheetId).getTitle() + ")";
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public String publishJSON(String json) {
String outputFile = worksheet.getTitle() + ".json";
try {
Writer outUTF8=null;
try {
outUTF8 = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(ContextParametersRegistry.getInstance().getDefault().getParameterValue(ContextParameter.JSON_PUBLISH_DIR) +outputFile), "UTF8"));
outUTF8.append(json);
outUTF8.flush();
outUTF8.close();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
logger.info("JSON file exported. Location: " + outputFile);
return outputFile;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
private void addLogicalSource(KR2RMLMapping mapping, Worksheet worksheet, Resource mappingRes, URI trMapUri)
throws RepositoryException {
// Add the Logical table information
BNode logTableBNode = f.createBNode();
con.add(logTableBNode, repoURIs.get(Uris.RR_TABLENAME_URI), f.createLiteral(worksheet.getTitle()));
con.add(logTableBNode, RDF.TYPE, repoURIs.get(Uris.RR_LOGICAL_TABLE_CLASS_URI));
con.add(logTableBNode, repoURIs.get(Uris.KM_IS_PART_OF_MAPPING_URI), mappingRes);
con.add(mappingRes, repoURIs.get(Uris.KM_HAS_LOGICAL_TABLE_URI), logTableBNode);
con.add(trMapUri, repoURIs.get(Uris.RR_LOGICAL_TABLE_URI), logTableBNode);
}
代码示例来源:origin: usc-isi-i2/Web-Karma
PrintWriter fileWriter = new PrintWriter(f);
fileWriter.println("# " + worksheet.getTitle());
代码示例来源:origin: usc-isi-i2/Web-Karma
public void generateWorksheetListJson(String prefix, PrintWriter pw) {
pw.println(prefix + "{");
String newPref = prefix + " ";
pw.println(newPref
+ JSONUtil.json(WorksheetListUpdate.JsonKeys.worksheetId, this.getWorksheetId()));
pw.println(newPref
+ JSONUtil.json(WorksheetListUpdate.JsonKeys.isUpToDate, upToDate));
pw.println(newPref
+ JSONUtil.json(WorksheetListUpdate.JsonKeys.isCollapsed, collapsed));
pw.println(newPref
+ JSONUtil.json(WorksheetListUpdate.JsonKeys.encoding,
worksheet.getEncoding()));
pw.println(newPref
+ JSONUtil.jsonLast(WorksheetListUpdate.JsonKeys.title,
worksheet.getTitle()));
pw.println(prefix + "}");
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
protected UpdateContainer savePreset(Workspace workspace, final Worksheet wsht) throws FileNotFoundException {
final ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId());
final String jsonFileName = workspace.getCommandPreferencesId() + wsht.getId() + "-" +
wsht.getTitle().replaceAll("\\.", "_") + "-preset"+".json";
final String jsonFileLocalPath = contextParameters.getParameterValue(ContextParameter.JSON_PUBLISH_DIR) +
jsonFileName;
PrintWriter printWriter = new PrintWriter(jsonFileLocalPath);
printWriter.println(new JSONArray(columnsJson).toString(4));
printWriter.close();
return new UpdateContainer(new AbstractUpdate() {
@Override
public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) {
JSONObject outputObject = new JSONObject();
try {
outputObject.put(JsonKeys.updateType.name(),
"PublishPresetUpdate");
outputObject.put(JsonKeys.fileUrl.name(),
contextParameters.getParameterValue(ContextParameter.JSON_PUBLISH_RELATIVE_DIR) + jsonFileName);
outputObject.put(JsonKeys.worksheetId.name(),
wsht.getId());
pw.println(outputObject.toString(4));
} catch (JSONException e) {
logger.error("Error occured while generating JSON!");
}
}
});
}
代码示例来源:origin: usc-isi-i2/Web-Karma
String ns = Namespaces.KARMA;
autoOntology.setNsPrefix("karma", ns);
OntClass topClass = autoOntology.createClass( ns + worksheet.getTitle().replaceAll(" ", "_")); // replace blank spaces with undrscore
for (HNode hNode : sortedLeafHNodes){
DatatypeProperty dp = autoOntology.createDatatypeProperty(ns+hNode.getColumnName().trim().replaceAll(" ", "_"));
代码示例来源:origin: usc-isi-i2/Web-Karma
String title = worksheet.getTitle();
title = title.replace(".", "_");
this.graphUriTobeValidated = "http://localhost.com/worksheets/"+title;
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public UpdateContainer doIt(Workspace workspace) throws CommandException {
Worksheet worksheet = workspace.getWorksheet(worksheetId);
final String wkName = worksheet.getTitle();
代码示例来源:origin: usc-isi-i2/Web-Karma
public String publishMDB(String csvFileName) throws FileNotFoundException {
final ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId());
String outputFile = "publish/MDB/" + worksheet.getTitle() + ".mdb";
logger.info("MDB file exported. Location:"
+ outputFile);
db = Database.create(new File(contextParameters.getParameterValue(ContextParameter.USER_DIRECTORY_PATH)+outputFile));
TableBuilder tb = new TableBuilder(worksheet.getTitle().replaceAll("\\.", "_"));
db,worksheet.getTitle().replaceAll("\\.", "_"), ",",'\"',_filter,true);
} catch (IOException e) {
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public String getHistoryFilepath(String worksheetId) {
final ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId());
Worksheet worksheet = workspace.getWorksheet(worksheetId);
String modelFilename = workspace.getCommandPreferencesId() + worksheetId + "-" +
worksheet.getTitle() + "-auto-model.ttl";
String modelFileLocalPath = contextParameters.getParameterValue(
ContextParameter.R2RML_USER_DIR) + modelFilename;
return modelFileLocalPath;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public File SaveSpatialData() throws Exception {
String spatialDataFolder = new RandomGUID().toString();
String fileName = worksheet.getTitle();
fileName = fileName.substring(0, fileName.length() - 4);
zippedSpatialDataFolderAndName = spatialDataFolder + "/" + fileName
+ ".zip";
ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId());
spatialDataFolder = contextParameters
.getParameterValue(ContextParameter.USER_DIRECTORY_PATH)
+ "publish/SpatialData/" + spatialDataFolder + "/";
File dir = new File(spatialDataFolder);
dir.mkdir();
File kml = publishKML(spatialDataFolder, fileName);
if (pointFeatureHNodeId != ""
|| (pointFeatureLatHNodeId != "" && pointFeatureLonHNodeId != ""))
saveShapefile(pointFeatureList, spatialDataFolder, fileName
+ "_point");
if (lineFeatureHNodeId != "")
saveShapefile(lineFeatureList, spatialDataFolder, fileName
+ "_line");
if (polygonFeatureHNodeId != "")
saveShapefile(polygonFeatureList, spatialDataFolder, fileName
+ "_polygon");
saveSpatialDataToZip(spatialDataFolder, fileName);
return kml;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
Value srcNameVal = f.createLiteral(worksheet.getTitle());
con.add(mappingRes, repoURIs.get(Uris.KM_SOURCE_NAME_URI), srcNameVal);
代码示例来源:origin: usc-isi-i2/Web-Karma
public String SaveSpatialDataAndReturnKMLString() throws Exception {
String spatialDataFolder = new RandomGUID().toString();
String fileName = worksheet.getTitle();
fileName = fileName.substring(0, fileName.length() - 4);
zippedSpatialDataFolderAndName = spatialDataFolder + "/" + fileName
+ ".zip";
ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId());
spatialDataFolder = contextParameters
.getParameterValue(ContextParameter.USER_DIRECTORY_PATH)
+ "publish/SpatialData/" + spatialDataFolder + "/";
File dir = new File(spatialDataFolder);
dir.mkdir();
File kml = publishKML(spatialDataFolder, fileName);
if (pointFeatureHNodeId != ""
|| (pointFeatureLatHNodeId != "" && pointFeatureLonHNodeId != ""))
saveShapefile(pointFeatureList, spatialDataFolder, fileName
+ "_point");
if (lineFeatureHNodeId != "")
saveShapefile(lineFeatureList, spatialDataFolder, fileName
+ "_line");
if (polygonFeatureHNodeId != "")
saveShapefile(polygonFeatureList, spatialDataFolder, fileName
+ "_polygon");
saveSpatialDataToZip(spatialDataFolder, fileName);
return fileToString(kml);
}
代码示例来源:origin: usc-isi-i2/Web-Karma
worksheet.getTitle().replaceAll("\\.", "_") + "-export"+".csv";
final String modelFileLocalPath = contextParameters.getParameterValue(ContextParameter.CSV_PUBLISH_DIR) +
csvFileName;
代码示例来源:origin: usc-isi-i2/Web-Karma
private Worksheet groupByTopLevel(Worksheet oldws, Workspace workspace, List<String> hnodeIDs, List<HNode> keyhnodes, List<HNode> valuehnodes, RepFactory factory) {
SuperSelection selection = getSuperSelection(oldws);
Worksheet newws = factory.createWorksheet("GroupBy: " + oldws.getTitle(), workspace, oldws.getEncoding());
newws.getMetadataContainer().getWorksheetProperties().setPropertyValue(Property.sourceType, oldws.getMetadataContainer().getWorksheetProperties().getPropertyValue(Property.sourceType));
HTable newht = newws.getHeaders();
代码示例来源:origin: usc-isi-i2/Web-Karma
private JSONArray extractHistoryFromModel(Workspace workspace, UpdateContainer uc)
throws RepositoryException, RDFParseException, IOException, JSONException, KarmaException {
if(r2rmlModelFile != null) {
Worksheet ws = workspace.getFactory().getWorksheet(worksheetId);
R2RMLMappingIdentifier id = new R2RMLMappingIdentifier(ws.getTitle(), r2rmlModelFile);
WorksheetR2RMLJenaModelParser parser = new WorksheetR2RMLJenaModelParser(id);
KR2RMLMapping mapping = parser.parse();
KR2RMLVersion version = mapping.getVersion();
if(version.compareTo(KR2RMLVersion.current) < 0)
{
uc.add(new InfoUpdate("Model version is " + version.toString() + ". Current version is " + KR2RMLVersion.current.toString() + ". Please publish it again."));
}
return mapping.getWorksheetHistory();
} else {
uc.add(new ErrorUpdate("Model could not be found"));
return new JSONArray();
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
Property.graphLabel, worksheet.getTitle());
graphLabel = worksheet.getTitle();
worksheet.getMetadataContainer().getWorksheetProperties().setPropertyValue(
Property.graphName, WorksheetProperties.createDefaultGraphName(graphLabel));
内容来源于网络,如有侵权,请联系作者删除!