diff src/de/mpiwg/dwinter/duomo/lexdump/LexOWLTransformer.java @ 2:273164f81926

bug in transformer handleroles
author dwinter
date Thu, 03 Feb 2011 16:08:06 +0100
parents 0fa29ab5e5e0
children d9fd32ecae24
line wrap: on
line diff
--- a/src/de/mpiwg/dwinter/duomo/lexdump/LexOWLTransformer.java	Thu Feb 03 14:05:52 2011 +0100
+++ b/src/de/mpiwg/dwinter/duomo/lexdump/LexOWLTransformer.java	Thu Feb 03 16:08:06 2011 +0100
@@ -54,7 +54,7 @@
 	public LexOWLTransformer(OWLImporter owlDoc, LexDumpImporter lexDoc) throws IOException {
 		this.owlDoc = owlDoc;
 		this.lexDoc = lexDoc;
-		missing = new FileWriter(new File("/tmp/missing.out","w"));
+		missing = new FileWriter(new File("/tmp/missing.out"));
 	}
 
 	/**
@@ -206,9 +206,9 @@
 				if (!name.equals("") && !role.equals("")) {
 					recordNamesRoles = handleNameWithRole(recordInd, name, role);
 				} else if (!role.equals("")) {
-					recordNamesRoles = handleRole(recordInd, role);
+					recordNamesRoles = createOrGetRole(role);
 				} else if (!name.equals("")) {
-					recordNamesRoles = handleName(recordInd, name);
+					recordNamesRoles = createOrGetName(name);
 				}
 
 				if (recordNamesRoles != null) {
@@ -401,25 +401,7 @@
 		return toClass;
 	}
 
-	private OWLIndividual handleRole(OWLIndividual recordInd, String role) {
-		OWLIndividual roleInd = owlDoc.getIndividualByReadableId(
-				"IndicesRoles", role);
-		if (roleInd == null) {
-			roleInd = createRole(role);
-		}
-
-		return roleInd;
-	}
-
-	private OWLIndividual handleName(OWLIndividual recordInd, String name) {
-		OWLIndividual nameInd = owlDoc.getIndividualByReadableId(
-				"IndicesNames", name);
-		if (nameInd == null) {
-			nameInd = createRole(name);
-		}
-
-		return nameInd;
-	}
+	
 
 	private OWLIndividual handleNameWithRole(OWLIndividual recordInd,
 			String name, String role) {
@@ -436,7 +418,7 @@
 		OWLIndividual roleInd = owlDoc.getIndividualByReadableId(
 				"IndicesRoles", role);
 		if (roleInd == null) {
-			roleInd = createRole(role);
+			roleInd = createOrGetRole(role);
 			createNewNameWithRole = true; // role existierte nicht dann kann
 											// auch NameWithRole nicht
 											// existierten.
@@ -503,7 +485,7 @@
 		return nameInd;
 	}
 
-	private OWLIndividual createRole(String name) {
+	private OWLIndividual createOrGetRole(String name) {
 		OWLIndividual roleInd = owlDoc.createOrGetInstanceWithIdentifier("IndicesRoles","IdentifierRoles",name);
 		return roleInd;
 	}