public class ImportXmi extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
XPATH_TO_XMI_ASSOCIATIONS |
static String |
XPATH_TO_XMI_CLASSES |
static String |
XPATH_TO_XMI_DATATYPE |
static String |
XPATH_TO_XMI_GENERALIZATIONS |
| Constructor and Description |
|---|
ImportXmi(String weaverUrl,
String datasetId)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
createWeaverAnnotations(List<com.jcabi.xml.XML> associations)
Loop trough xmi-associations and map them to weaver as annotations
|
void |
createWeaverDataset() |
void |
createWeaverGeneralizations(List<com.jcabi.xml.XML> generalizations)
Loop trough xmi-associations and map them to weaver as annotations
|
void |
createWeaverIndividuals()
Save the name of an xmi-class as weaver individual
|
List<com.jcabi.xml.XML> |
getAssociationsWithAttribute(List<com.jcabi.xml.XML> associations,
String attributeName)
Returns a list with XML Association Nodes which have a specific attribute
|
com.weaverplatform.sdk.Entity |
getDataset() |
String |
getDatasetId() |
InputStream |
getInputStream() |
com.weaverplatform.sdk.Weaver |
getWeaver() |
String |
getWeaverUrl() |
void |
mapXmiClasses()
Creates two hashMaps from all xmi Classes
|
List<com.jcabi.xml.XML> |
queryXPath(String query) |
void |
readFromFile(String path) |
void |
readFromInputStream(InputStream inputStream) |
void |
readFromResources(String path) |
void |
run()
The start method with custom operations on this class
|
void |
setInputStream(InputStream inputStream) |
String |
toFormattedString(InputStream contents)
Decorator method for toString(inputstream)
The inputstream content string is replaced by a regex and then returned as string
|
com.weaverplatform.sdk.Entity |
toWeaverAnnotation(HashMap<String,Object> attributes,
String id)
Creates an Weaver Annotation
|
void |
toWeaverGeneralization(String subType,
String superType)
Creates an Weaver Individual
|
com.weaverplatform.sdk.Entity |
toWeaverIndividual(HashMap<String,Object> attributes,
String individualId)
Creates an Weaver Individual
|
public static final String XPATH_TO_XMI_CLASSES
public static final String XPATH_TO_XMI_ASSOCIATIONS
public static final String XPATH_TO_XMI_GENERALIZATIONS
public static final String XPATH_TO_XMI_DATATYPE
public void readFromInputStream(InputStream inputStream)
public void readFromFile(String path)
public void readFromResources(String path)
public void run()
throws IOException
IOException - Not foundpublic void createWeaverDataset()
public String toFormattedString(InputStream contents) throws IOException
contents - IOExceptionpublic void createWeaverGeneralizations(List<com.jcabi.xml.XML> generalizations)
generalizations - public void createWeaverAnnotations(List<com.jcabi.xml.XML> associations)
associations - public List<com.jcabi.xml.XML> getAssociationsWithAttribute(List<com.jcabi.xml.XML> associations, String attributeName)
associations - attributeName - public void createWeaverIndividuals()
public void mapXmiClasses()
public void toWeaverGeneralization(String subType, String superType)
subType - superType - public com.weaverplatform.sdk.Entity toWeaverIndividual(HashMap<String,Object> attributes, String individualId)
attributes - individualId - public com.weaverplatform.sdk.Entity toWeaverAnnotation(HashMap<String,Object> attributes, String id)
attributes - id - public com.weaverplatform.sdk.Weaver getWeaver()
public String getWeaverUrl()
public String getDatasetId()
public com.weaverplatform.sdk.Entity getDataset()
public InputStream getInputStream()
public void setInputStream(InputStream inputStream)
Copyright © 2016. All rights reserved.