Mercurial > hg > duomoOWLProject
comparison src/de/mpiwg/dwinter/duomo/lexdump/LexOWLTransformer.java @ 1:0fa29ab5e5e0
minor
author | dwinter |
---|---|
date | Thu, 03 Feb 2011 14:05:52 +0100 |
parents | fb3f3df002df |
children | 273164f81926 |
comparison
equal
deleted
inserted
replaced
0:fb3f3df002df | 1:0fa29ab5e5e0 |
---|---|
1 package de.mpiwg.dwinter.duomo.lexdump; | 1 package de.mpiwg.dwinter.duomo.lexdump; |
2 | 2 |
3 import java.io.File; | |
4 import java.io.FileWriter; | |
3 import java.io.IOException; | 5 import java.io.IOException; |
4 import java.net.URI; | 6 import java.net.URI; |
5 import java.net.URISyntaxException; | 7 import java.net.URISyntaxException; |
6 import java.net.URLEncoder; | 8 import java.net.URLEncoder; |
7 import java.util.Collection; | 9 import java.util.Collection; |
38 import edu.stanford.smi.protegex.owl.model.impl.AbstractOWLQuantifierRestriction; | 40 import edu.stanford.smi.protegex.owl.model.impl.AbstractOWLQuantifierRestriction; |
39 import edu.stanford.smi.protegex.owl.model.impl.DefaultOWLUnionClass; | 41 import edu.stanford.smi.protegex.owl.model.impl.DefaultOWLUnionClass; |
40 | 42 |
41 public class LexOWLTransformer { | 43 public class LexOWLTransformer { |
42 private Logger logger = Logger.getRootLogger(); | 44 private Logger logger = Logger.getRootLogger(); |
45 private FileWriter missing; | |
43 private OWLImporter owlDoc; | 46 private OWLImporter owlDoc; |
44 private LexDumpImporter lexDoc; | 47 private LexDumpImporter lexDoc; |
45 private Map<String, OWLIndividual> individualIds = new HashMap<String, OWLIndividual>(); // speichere | 48 private Map<String, OWLIndividual> individualIds = new HashMap<String, OWLIndividual>(); // speichere |
46 // ids | 49 // ids |
47 // fuer | 50 // fuer |
48 // weitere | 51 // weitere |
49 // Verwendung | 52 // Verwendung |
50 | 53 |
51 public LexOWLTransformer(OWLImporter owlDoc, LexDumpImporter lexDoc) { | 54 public LexOWLTransformer(OWLImporter owlDoc, LexDumpImporter lexDoc) throws IOException { |
52 this.owlDoc = owlDoc; | 55 this.owlDoc = owlDoc; |
53 this.lexDoc = lexDoc; | 56 this.lexDoc = lexDoc; |
57 missing = new FileWriter(new File("/tmp/missing.out","w")); | |
54 } | 58 } |
55 | 59 |
56 /** | 60 /** |
57 * @param args | 61 * @param args |
58 * @throws Exception | 62 * @throws Exception |
309 if (!subjPointer.equals("")) { | 313 if (!subjPointer.equals("")) { |
310 subjInd = toClass.createOWLIndividual(null); | 314 subjInd = toClass.createOWLIndividual(null); |
311 OWLIndividual ind = individualIds.get(subjPointer); | 315 OWLIndividual ind = individualIds.get(subjPointer); |
312 if (ind == null) { | 316 if (ind == null) { |
313 logger.debug("target ID does not exist:" + subjPointer); | 317 logger.debug("target ID does not exist:" + subjPointer); |
318 try { | |
319 missing.write("target ID does not exist:" + subjPointer+"\n"); | |
320 } catch (IOException e) { | |
321 // TODO Auto-generated catch block | |
322 e.printStackTrace(); | |
323 } | |
314 } else { | 324 } else { |
315 owlDoc.setProperty(subjInd, "has_NameOrRoleFromIndex", ind); | 325 owlDoc.setProperty(subjInd, "has_NameOrRoleFromIndex", ind); |
316 } | 326 } |
317 } | 327 } |
318 | 328 |