changeset 2:273164f81926

bug in transformer handleroles
author dwinter
date Thu, 03 Feb 2011 16:08:06 +0100
parents 0fa29ab5e5e0
children d9fd32ecae24
files protege.properties src/de/mpiwg/dwinter/duomo/lexdump/LexOWLTransformer.java src/de/mpiwg/dwinter/duomo/lexdump/OWLImporter.java
diffstat 3 files changed, 9 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/protege.properties	Thu Feb 03 14:05:52 2011 +0100
+++ b/protege.properties	Thu Feb 03 16:08:06 2011 +0100
@@ -1,5 +1,5 @@
 #Protege Properties
-#Thu Feb 03 10:05:31 CET 2011
+#Thu Feb 03 16:04:20 CET 2011
+SwitchableClassDefinitionType=edu.stanford.smi.protegex.owl.ui.cls.LogicClassDefinitionWidgetType
 history.projects.reopen=file\:/Users/dwinter/Documents/Projekte/Diss%20-%20data-mining/eclipseWorkspace/de.mpiwg.dwinter.duomo/examples/newspaper/newspaper.pprj,file\:/Users/dwinter/Documents/Projekte/Diss%20-%20data-mining/eclipseWorkspace/de.mpiwg.dwinter.duomo/examples/sqwrl/SQWRLExamples.pprj,file\:/Users/dwinter/Documents/Projekte/Diss%20-%20data-mining/eclipseWorkspace/de.mpiwg.dwinter.duomo/examples/pizza/pizza.owl.pprj
-SwitchableClassDefinitionType=edu.stanford.smi.protegex.owl.ui.cls.LogicClassDefinitionWidgetType
 OntURIBase=http\://www.owl-ontologies.com
--- 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;
 	}
--- a/src/de/mpiwg/dwinter/duomo/lexdump/OWLImporter.java	Thu Feb 03 14:05:52 2011 +0100
+++ b/src/de/mpiwg/dwinter/duomo/lexdump/OWLImporter.java	Thu Feb 03 16:08:06 2011 +0100
@@ -310,6 +310,6 @@
 			setProperty(ind, "crm:P48_has_preferred_identifier",
 			identifier);
 		}
-		return null;
+		return ind;
 	}
 }