--- a/src/net/timbusproject/context/converter/OWLExport.java
+++ b/src/net/timbusproject/context/converter/OWLExport.java
@@ -97,8 +97,7 @@
System.out.println(owlExportProperties);
System.out.println("------------------------------\n");
} catch (Exception e) {
- System.err.println("\nCould not load OWL Export properties, tried file with name '" + propertiesFileName
- + "'.");
+ System.err.println("\nCould not load OWL Export properties, tried file with name '" + propertiesFileName + "'.");
e.printStackTrace();
// default: using the TIMBUS scenarios URL
@@ -127,8 +126,8 @@
}
/** subtypes of the relation "access" */
- public static final String[] relationAccessTypes = { "hasAccessTypeWrite", "hasAccessTypeRead",
- "hasAccessTypeAccess", "hasAccessTypeRead_Write" };
+ public static final String[] relationAccessTypes = { "hasAccessTypeWrite", "hasAccessTypeRead", "hasAccessTypeAccess",
+ "hasAccessTypeRead_Write" };
/** the default property names */
public static final String DEFAULT_PROPERTY = "association";
@@ -143,9 +142,8 @@
public static final String SCENARIOS_PREFIX = owlExportProperties.getProperty(KEY_SCENARIOS_URL);
/** The types of folders in Archi */
- public static final FolderType[] FOLDER_TYPES = { FolderType.BUSINESS, FolderType.APPLICATION,
- FolderType.TECHNOLOGY, FolderType.MOTIVATION, FolderType.IMPLEMENTATION_MIGRATION, FolderType.CONNECTORS,
- FolderType.RELATIONS };
+ public static final FolderType[] FOLDER_TYPES = { FolderType.BUSINESS, FolderType.APPLICATION, FolderType.TECHNOLOGY,
+ FolderType.MOTIVATION, FolderType.IMPLEMENTATION_MIGRATION, FolderType.CONNECTORS, FolderType.RELATIONS };
public static void exportToOwl(IArchimateModel model, File file) throws IOException {
exportToOwl(model, file, getDefaultIRI(file));
@@ -211,11 +209,10 @@
propertyName = relationAccessTypes[accesstype];
}
- OWLObjectProperty property = df.getOWLObjectProperty(IRI.create(TIMBUS_DIO_URL + "#"
- + propertyName));
-
- OWLObjectPropertyAssertionAxiom objectPropertyAssertion = df
- .getOWLObjectPropertyAssertionAxiom(property, source, object);
+ OWLObjectProperty property = df.getOWLObjectProperty(IRI.create(TIMBUS_DIO_URL + "#" + propertyName));
+
+ OWLObjectPropertyAssertionAxiom objectPropertyAssertion = df.getOWLObjectPropertyAssertionAxiom(property, source,
+ object);
manager.applyChange(new AddAxiom(ontology, objectPropertyAssertion));
} else { // write individuals (and data properties)
@@ -228,8 +225,8 @@
// add an rdfs:label property as annotation
String labelName = formatString(Util.replaceSpecialWhiteSpace(element.getName()));
OWLAnnotation annotation = df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral(labelName));
- OWLAnnotationAssertionAxiom annotationAssertionAxiom = df.getOWLAnnotationAssertionAxiom(
- indiv.getIRI(), annotation);
+ OWLAnnotationAssertionAxiom annotationAssertionAxiom = df
+ .getOWLAnnotationAssertionAxiom(indiv.getIRI(), annotation);
manager.applyChange(new AddAxiom(ontology, annotationAssertionAxiom));
// add a class expression
@@ -239,12 +236,11 @@
if (!element.getProperties().isEmpty()) { // add data properties
for (IProperty eProperty : element.getProperties()) {
- OWLDataProperty property = df.getOWLDataProperty(IRI.create(TIMBUS_DIO_URL + "#"
- + eProperty.getKey()));
+ OWLDataProperty property = df.getOWLDataProperty(IRI.create(TIMBUS_DIO_URL + "#" + eProperty.getKey()));
OWLLiteral owlLiteral = df.getOWLLiteral(eProperty.getValue(),
OWL2DatatypeImpl.getDatatype(OWL2Datatype.RDF_PLAIN_LITERAL));
- OWLDataPropertyAssertionAxiom dataPropertyAssertion = df
- .getOWLDataPropertyAssertionAxiom(property, indiv, owlLiteral, emptyAnnotations);
+ OWLDataPropertyAssertionAxiom dataPropertyAssertion = df.getOWLDataPropertyAssertionAxiom(property, indiv,
+ owlLiteral, emptyAnnotations);
manager.applyChange(new AddAxiom(ontology, dataPropertyAssertion));
}
}
@@ -264,10 +260,9 @@
}
/**
- * Returns a valid IRI fragment - according to
- * http://sourceforge.net/p/owlapi/mailman/owlapi-developer/thread/CAHYxBS
- * -dW+FUFLDPZOtbFL1tROZH8W0QmLu8ye9W5L-kCcMPVA@mail.gmail.com/, it must not start with a number, which is however
- * what Archi generates as IDs...
+ * Returns a valid IRI fragment - according to http://sourceforge.net/p/owlapi/mailman/owlapi-developer/thread/CAHYxBS
+ * -dW+FUFLDPZOtbFL1tROZH8W0QmLu8ye9W5L-kCcMPVA@mail.gmail.com/, it must not start with a number, which is however what Archi generates
+ * as IDs...
*/
private static String getOWLIRIFragment(IArchimateElement element) {
return "i" + element.getId();
@@ -321,8 +316,7 @@
}
/** Exports the layout of a model to a CSV separated file */
- public static boolean exportLayout(File layoutFile, String defaultIRI, ArchimateDiagramModel view)
- throws FileNotFoundException {
+ public static boolean exportLayout(File layoutFile, String defaultIRI, ArchimateDiagramModel view) throws FileNotFoundException {
if (view != null) {
EList<IDiagramModelObject> children = view.getChildren();
@@ -373,31 +367,29 @@
return new File(file.getAbsolutePath() + ".layout.csv");
}
- private static void exportChildrenLayout(EList<IDiagramModelObject> children, HashMap<String, String> iriNameMap,
- int x, int y, ArrayList<String> export, String iriPrefix) {
+ private static void exportChildrenLayout(EList<IDiagramModelObject> children, HashMap<String, String> iriNameMap, int x, int y,
+ ArrayList<String> export, String iriPrefix) {
for (IDiagramModelObject diagramModelObject : children) {
int coordX = x + diagramModelObject.getBounds().getX();
int coordY = y + diagramModelObject.getBounds().getY();
if (diagramModelObject instanceof DiagramModelGroup) {
- exportChildrenLayout(((DiagramModelGroup) diagramModelObject).getChildren(), iriNameMap, coordX,
- coordY, export, iriPrefix);
+ exportChildrenLayout(((DiagramModelGroup) diagramModelObject).getChildren(), iriNameMap, coordX, coordY, export, iriPrefix);
} else {
String elementName = diagramModelObject.getId();
if (diagramModelObject instanceof DiagramModelArchimateObject) {
- elementName = getOWLIRIFragment(((DiagramModelArchimateObject) diagramModelObject)
- .getArchimateElement());
- }
- StringBuilder sb = new StringBuilder(iriPrefix).append("#").append(elementName).append("\t")
- .append(coordX).append("\t").append(coordY);
+ elementName = getOWLIRIFragment(((DiagramModelArchimateObject) diagramModelObject).getArchimateElement());
+ }
+ StringBuilder sb = new StringBuilder(iriPrefix).append("#").append(elementName).append("\t").append(coordX).append("\t")
+ .append(coordY);
if (diagramModelObject instanceof DiagramModelArchimateObject
&& ((DiagramModelArchimateObject) diagramModelObject).getChildren() != null
&& ((DiagramModelArchimateObject) diagramModelObject).getChildren().size() > 0) {
sb.append("\t").append(diagramModelObject.getBounds().getWidth()).append("\t")
.append(diagramModelObject.getBounds().getHeight());
- exportChildrenLayout(((DiagramModelArchimateObject) diagramModelObject).getChildren(), iriNameMap,
- coordX, coordY, export, iriPrefix);
+ exportChildrenLayout(((DiagramModelArchimateObject) diagramModelObject).getChildren(), iriNameMap, coordX, coordY,
+ export, iriPrefix);
}
export.add(sb.toString());
iriNameMap.put(sb.toString(), diagramModelObject.getName());