org.topbraid.spreadsheets.mapper
Class AbstractMapEngine
java.lang.Object
org.topbraid.spreadsheets.util.SpreadsheetUtil
org.topbraid.spreadsheets.mapper.AbstractMapEngine
- All Implemented Interfaces:
- IMapConstants, ISpreadsheetEngine
- Direct Known Subclasses:
- SpreadsheetMapEngine
public abstract class AbstractMapEngine
- extends SpreadsheetUtil
- implements ISpreadsheetEngine, IMapConstants
| Fields inherited from interface org.topbraid.spreadsheets.IMapConstants |
CELL, CLASSSEPARATOR, COLUMN, COMMA, EMPTY, NULLRESOURCE, OBJECT, PREDICATE, QUOTE, RESOURCE, ROW, SUBJECT |
|
Constructor Summary |
AbstractMapEngine(Spreadsheet spreadsheet,
com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource config,
java.lang.String subjectLoc,
java.lang.String predicateLoc,
java.lang.String objectLoc)
Initializes a spreadsheet map engine. |
|
Method Summary |
void |
addStatement(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object)
|
void |
appendStatementInfo(java.lang.String intro,
com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object)
|
protected void |
checkHeadAndInputTypes(java.lang.Object item,
java.lang.Object inputType,
java.lang.Object headType)
|
protected com.hp.hpl.jena.datatypes.RDFDatatype |
getDatatypeResource(com.hp.hpl.jena.rdf.model.Resource resource)
|
com.hp.hpl.jena.graph.Graph |
getGraph()
|
java.util.Map |
getOrderMap()
|
java.util.Map |
getPendingResources()
|
com.hp.hpl.jena.rdf.model.Resource |
getResourceWithModel(com.hp.hpl.jena.rdf.model.Resource item)
|
protected java.lang.Object |
getSuperType(RCKey rcKey)
|
java.util.Map |
getSuperTypes()
|
void |
guessOrderMap(java.lang.String subjectLoc,
java.lang.String predicateLoc,
java.lang.String objectLoc)
|
protected void |
processPendingSet(com.hp.hpl.jena.rdf.model.Model model,
RCKey rcKey,
java.lang.Object superType)
|
protected void |
processType(RCKeyEnh rcKeyEnh,
java.lang.Object item,
com.hp.hpl.jena.rdf.model.Model model)
|
protected void |
processType(RCKeyEnh rcKeyEnh,
java.lang.Object item,
java.lang.Object inputType)
|
void |
run(org.eclipse.core.runtime.IProgressMonitor monitor)
Processes the spreadsheet. |
void |
runReally(org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
runReally(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model,
java.io.PrintWriter pw)
|
void |
setModel(com.hp.hpl.jena.rdf.model.Model model)
|
void |
setOrderMap(java.lang.String subjectLoc,
java.lang.String predicateLoc,
java.lang.String objectLoc)
Set up subject, predicate and object locations with the constants COLUMN, ROW, CELL |
void |
setPredicate(com.hp.hpl.jena.rdf.model.Property property,
java.lang.String location,
int domainPos,
int rangePos)
|
protected void |
setWarning(java.lang.String string,
java.lang.Exception e)
|
void |
updateClassResources(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model)
|
protected void |
updateGlobalData(com.hp.hpl.jena.rdf.model.Model model,
java.util.Map positionMap)
|
protected void |
updateGlobalInstanceData(java.lang.Object updateData,
java.lang.String location,
int i,
com.hp.hpl.jena.rdf.model.Model model)
|
protected void |
updateGlobalPredicateData(com.hp.hpl.jena.rdf.model.Property property,
java.lang.String location,
int domainPos,
int rangePos)
|
void |
updatePendingResources(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model)
|
void |
updateResources(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model)
|
| Methods inherited from class org.topbraid.spreadsheets.util.SpreadsheetUtil |
addProperty, addProperty, getClassNames, getCommasplitItems, getExistingFile, getExistingFileSource, getExistingResource, getExistingURL, getImportMessage, getInverse, getInverse, getItem, getItem, getItem, getItem, getItem, getItems, getItems, getItems, getOrderedPropertyColumns, getOrderedPropertyColumns, getPropertyDetails, getResource, getResource, getResource, getResourceByName, getSchema, getSetElement, getSpreadsheetFromSource, getSpreedsheetFromURL, getTypesOfLabel, getUnsurroundedString, getURIFlex, guessClass, guessClass, guessClass, isColumnNameChecked, isSpreadsheetEmpty, isSurroundedWith, mapObject, mapResource, mapResource, parseLiteral, putSetElement, unionURIs |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractMapEngine
public AbstractMapEngine(Spreadsheet spreadsheet,
com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource config,
java.lang.String subjectLoc,
java.lang.String predicateLoc,
java.lang.String objectLoc)
- Initializes a spreadsheet map engine. The current available constants for subjectLoc,
predicateLoc and objectLoc are IMapConstants.COLUMN, IMapConstants.ROW and IMapConstants.CELL.
- Parameters:
spreadsheet - - cannot be nulloptions - - cannot be nullsubjectLoc - predicateLoc - objectLoc -
guessOrderMap
public void guessOrderMap(java.lang.String subjectLoc,
java.lang.String predicateLoc,
java.lang.String objectLoc)
throws java.lang.Exception
- Throws:
java.lang.Exception
getOrderMap
public java.util.Map getOrderMap()
getSuperTypes
public java.util.Map getSuperTypes()
getPendingResources
public java.util.Map getPendingResources()
setModel
public void setModel(com.hp.hpl.jena.rdf.model.Model model)
setOrderMap
public void setOrderMap(java.lang.String subjectLoc,
java.lang.String predicateLoc,
java.lang.String objectLoc)
- Set up subject, predicate and object locations with the constants COLUMN, ROW, CELL
- Parameters:
subjectLoc - - subject locationpredicateLoc - - predicate locationobjectLoc - - object location
run
public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
throws java.io.IOException,
java.lang.InterruptedException
- Description copied from interface:
ISpreadsheetEngine
- Processes the spreadsheet.
- Specified by:
run in interface ISpreadsheetEngine
- Throws:
java.io.IOException
java.lang.InterruptedException
runReally
public void runReally(org.eclipse.core.runtime.IProgressMonitor monitor)
throws java.lang.Exception
- Throws:
java.lang.Exception
runReally
public void runReally(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model,
java.io.PrintWriter pw)
throws java.lang.Exception
- Throws:
java.lang.Exception
updatePendingResources
public void updatePendingResources(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model)
throws java.lang.Exception
- Throws:
java.lang.Exception
getSuperType
protected java.lang.Object getSuperType(RCKey rcKey)
processPendingSet
protected void processPendingSet(com.hp.hpl.jena.rdf.model.Model model,
RCKey rcKey,
java.lang.Object superType)
throws java.lang.Exception
- Throws:
java.lang.Exception
addStatement
public void addStatement(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object)
appendStatementInfo
public void appendStatementInfo(java.lang.String intro,
com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object)
getDatatypeResource
protected com.hp.hpl.jena.datatypes.RDFDatatype getDatatypeResource(com.hp.hpl.jena.rdf.model.Resource resource)
updateClassResources
public void updateClassResources(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model)
throws java.lang.Exception
- Throws:
java.lang.Exception
updateResources
public void updateResources(org.eclipse.core.runtime.IProgressMonitor monitor,
com.hp.hpl.jena.rdf.model.Model model)
throws java.lang.Exception
- Throws:
java.lang.Exception
updateGlobalData
protected void updateGlobalData(com.hp.hpl.jena.rdf.model.Model model,
java.util.Map positionMap)
throws java.lang.Exception
- Throws:
java.lang.Exception
updateGlobalPredicateData
protected void updateGlobalPredicateData(com.hp.hpl.jena.rdf.model.Property property,
java.lang.String location,
int domainPos,
int rangePos)
throws java.lang.Exception
- Throws:
java.lang.Exception
setPredicate
public void setPredicate(com.hp.hpl.jena.rdf.model.Property property,
java.lang.String location,
int domainPos,
int rangePos)
updateGlobalInstanceData
protected void updateGlobalInstanceData(java.lang.Object updateData,
java.lang.String location,
int i,
com.hp.hpl.jena.rdf.model.Model model)
throws java.lang.Exception
- Throws:
java.lang.Exception
processType
protected void processType(RCKeyEnh rcKeyEnh,
java.lang.Object item,
java.lang.Object inputType)
throws java.lang.Exception
- Throws:
java.lang.Exception
checkHeadAndInputTypes
protected void checkHeadAndInputTypes(java.lang.Object item,
java.lang.Object inputType,
java.lang.Object headType)
processType
protected void processType(RCKeyEnh rcKeyEnh,
java.lang.Object item,
com.hp.hpl.jena.rdf.model.Model model)
throws java.lang.Exception
- Throws:
java.lang.Exception
getResourceWithModel
public com.hp.hpl.jena.rdf.model.Resource getResourceWithModel(com.hp.hpl.jena.rdf.model.Resource item)
setWarning
protected void setWarning(java.lang.String string,
java.lang.Exception e)
getGraph
public com.hp.hpl.jena.graph.Graph getGraph()
- Specified by:
getGraph in interface ISpreadsheetEngine
- Returns:
- the result graph