Mercurial > hg > openmind
annotate src/main/java/org/mpi/openmind/repository/utils/OM4StreamWriter.java @ 86:d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 05 Feb 2018 20:06:38 +0100 |
parents | 90f9a1c45b15 |
children | 8005f7011975 |
rev | line source |
---|---|
1 | 1 package org.mpi.openmind.repository.utils; |
2 | |
3 import java.io.FileOutputStream; | |
4 import java.io.IOException; | |
5 import java.io.OutputStreamWriter; | |
6 import java.text.DecimalFormat; | |
7 import java.util.ArrayList; | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
8 import java.util.HashMap; |
1 | 9 import java.util.List; |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
10 import java.util.Map; |
1 | 11 |
29 | 12 import javax.xml.stream.XMLOutputFactory; |
13 import javax.xml.stream.XMLStreamException; | |
14 import javax.xml.stream.XMLStreamWriter; | |
1 | 15 |
16 import org.apache.commons.lang.StringUtils; | |
17 import org.apache.log4j.Logger; | |
18 import org.mpi.openmind.repository.bo.Attribute; | |
19 import org.mpi.openmind.repository.bo.Entity; | |
20 import org.mpi.openmind.repository.bo.Node; | |
21 import org.mpi.openmind.repository.bo.Relation; | |
22 import org.mpi.openmind.repository.services.PersistenceService; | |
23 | |
31 | 24 /** |
25 * Export all entities and relations and definitions to XML. | |
26 * | |
75 | 27 * Saves (content) entities and relations (i.e. assertions) and definitions |
31 | 28 * (i.e. definition entities and relations) in separate files. |
29 * | |
30 * @author jurzua, casties | |
31 * | |
32 */ | |
1 | 33 public class OM4StreamWriter { |
34 | |
29 | 35 private static Logger logger = Logger.getLogger(OM4StreamWriter.class); |
36 | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
37 private static final int itemsPerPage = 500; |
77 | 38 |
39 /** Include normalized own-values. */ | |
78 | 40 public static boolean includeNormalizations = true; |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
41 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
42 /** key for entity count in attribute counts map */ |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
43 private static final String ENT_KEY = "<entity-count>"; |
29 | 44 |
45 /** | |
46 * Return the object's string representation or "null" if its null. | |
47 * | |
48 * @param s | |
49 * @return | |
50 */ | |
31 | 51 private static String defaultString(Object s) { |
29 | 52 if (s == null) { |
53 return "null"; | |
54 } else { | |
55 return s.toString(); | |
56 } | |
57 } | |
58 | |
59 | |
75 | 60 /** |
61 * Saves all content Entities with their Attributes and Relations in a XML file with the given fileName. | |
62 * | |
63 * @param fileName | |
64 * @param ps | |
65 */ | |
29 | 66 public static void backupEntities(String fileName, PersistenceService ps) { |
78 | 67 writeEntsAndRels(fileName, ps, Node.TYPE_ABOX, includeNormalizations); |
29 | 68 } |
69 | |
75 | 70 /** |
71 * Saves all definitions in a XML file with the given fileName. | |
72 * | |
73 * @param fileName | |
74 * @param ps | |
75 */ | |
29 | 76 public static void backupDefinitions(String fileName, PersistenceService ps) { |
78 | 77 writeEntsAndRels(fileName, ps, Node.TYPE_TBOX, false); |
29 | 78 } |
79 | |
80 /** | |
81 * Writes all entities of the given type and their relations to the XML file at fileName. | |
82 * | |
75 | 83 * Type is either TYPE_TBOX or TYPE_ABOX. |
84 * | |
29 | 85 * @param fileName |
86 * @param ps | |
75 | 87 * @param type |
29 | 88 */ |
78 | 89 private static void writeEntsAndRels(String fileName, PersistenceService ps, String type, boolean includeNorm) { |
29 | 90 OutputStreamWriter out; |
91 try { | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
92 // statistics collection Maps |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
93 Map<String, Map<String, Long>> entStats = new HashMap<String, Map<String, Long>>(); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
94 Map<String, Map<String, Long>> relStats = new HashMap<String, Map<String, Long>>(); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
95 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
96 // setup xml writer |
29 | 97 FileOutputStream fileOut = new FileOutputStream(fileName); |
98 out = new OutputStreamWriter(fileOut, "UTF-8"); | |
99 XMLOutputFactory factory = XMLOutputFactory.newInstance(); | |
100 XMLStreamWriter writer = factory.createXMLStreamWriter(out); | |
101 | |
102 int entitiesCount = 0; | |
103 | |
104 writer.writeStartDocument("UTF-8", "1.0"); | |
105 | |
106 if (type.equals(Node.TYPE_ABOX)) { | |
107 writer.writeStartElement(XMLUtil.OPENMIND_DATA); | |
82
90f9a1c45b15
small change to xml format.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
79
diff
changeset
|
108 writer.writeAttribute("version", "4.6"); |
75 | 109 // get number of content Entities |
29 | 110 entitiesCount = ps.getEntityCount(null).intValue(); |
111 } else { | |
112 writer.writeStartElement(XMLUtil.META_DATA); | |
82
90f9a1c45b15
small change to xml format.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
79
diff
changeset
|
113 writer.writeAttribute("version", "4.6"); |
75 | 114 // get number of definition Entities |
29 | 115 entitiesCount = ps.getEntityCount(Node.TYPE_TBOX).intValue(); |
116 } | |
117 | |
118 int numberOfPages = entitiesCount / itemsPerPage; | |
119 // debug: int numberOfPages = 1; | |
120 int counter = 0; | |
121 long start = System.currentTimeMillis(); | |
122 DecimalFormat df = new DecimalFormat("#.##"); | |
1 | 123 |
75 | 124 // list of Relations (filled from Entities) |
29 | 125 List<Relation> relList = new ArrayList<Relation>(); |
126 | |
127 /* | |
128 * write entities | |
129 */ | |
130 writer.writeStartElement((type.equals(Node.TYPE_TBOX)) ? XMLUtil.DEFINITIONS : XMLUtil.ENTITIES); | |
82
90f9a1c45b15
small change to xml format.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
79
diff
changeset
|
131 writer.writeAttribute("count", Integer.toString(entitiesCount)); |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
132 // iterate database by pages |
29 | 133 for (int currentPage = 0; currentPage <= numberOfPages; currentPage++) { |
134 int startRecord = currentPage * itemsPerPage; | |
135 List<Entity> entities; | |
136 | |
137 if (type.equals(Node.TYPE_ABOX)) { | |
75 | 138 // get page of content Entities |
29 | 139 entities = ps.getEntityPage(null, startRecord, itemsPerPage); |
140 } else { | |
75 | 141 // get page of definition Entities |
29 | 142 entities = ps.getEntityPage(Node.TYPE_TBOX, startRecord, itemsPerPage); |
143 } | |
144 | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
145 // iterate entities |
29 | 146 for (Entity ent : entities) { |
75 | 147 // write entity to XML |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
148 writeEntity(ent, writer, ps, includeNorm, entStats); |
29 | 149 // add (source)relations to list |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
150 List<Relation> rels = ent.getSourceRelations(); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
151 relList.addAll(rels); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
152 // update stats for relations |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
153 Map<String, Long> entRelStats = entStats.get(ent.getObjectClass()); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
154 for (Relation rel: rels) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
155 // update source relations |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
156 updateRelStats(rel, true, entRelStats); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
157 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
158 for (Relation rel: ent.getTargetRelations()) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
159 // update target relations |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
160 updateRelStats(rel, false, entRelStats); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
161 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
162 // count entities |
29 | 163 counter++; |
164 } | |
165 | |
166 long runtime = System.currentTimeMillis() - start; | |
167 double percent = ((double) counter / (double) entitiesCount) * 100.0; | |
168 logger.debug("(" + df.format(percent) + "%) \t[" + counter + "/" + entitiesCount + "]\t"); | |
169 logger.debug("Speed[ents/s]: " + df.format((double) counter / ((double) runtime / 1000))); | |
170 writer.flush(); | |
171 } | |
172 writer.writeEndElement(); | |
173 | |
174 /* | |
175 * write relations (from list) | |
176 */ | |
177 writer.writeStartElement(XMLUtil.RELATIONS); | |
82
90f9a1c45b15
small change to xml format.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
79
diff
changeset
|
178 writer.writeAttribute("count", Integer.toString(relList.size())); |
29 | 179 for (Relation rel : relList) { |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
180 writeRelation(rel, writer, includeNorm, relStats); |
29 | 181 } |
182 writer.writeEndElement(); | |
183 | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
184 /* |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
185 * write statistics |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
186 */ |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
187 // entity stats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
188 writeStats(XMLUtil.ENTITY_STATS, XMLUtil.ENTITY, entStats, writer); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
189 // relation stats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
190 writeStats(XMLUtil.RELATION_STATS, XMLUtil.RELATION, relStats, writer); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
191 |
29 | 192 // end file. |
193 writer.writeEndElement(); | |
194 | |
195 writer.flush(); | |
196 writer.close(); | |
197 | |
198 logger.info("END Stream Writer"); | |
199 } catch (IOException e) { | |
75 | 200 logger.error(e); |
29 | 201 } catch (XMLStreamException e) { |
75 | 202 logger.error(e); |
29 | 203 } |
204 } | |
1 | 205 |
29 | 206 /** |
207 * Write OpenMind relation to XML. | |
208 * | |
209 * @param rel | |
210 * @param writer | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
211 * @param relStats |
29 | 212 * @throws XMLStreamException |
213 */ | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
214 private static void writeRelation(Relation rel, XMLStreamWriter writer, boolean includeNorm, |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
215 Map<String, Map<String, Long>> relStats) throws XMLStreamException { |
29 | 216 writer.writeStartElement(XMLUtil.RELATION); |
217 | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
218 // update stats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
219 Map<String, Long> attStats = updateNodeStats(rel, relStats); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
220 |
29 | 221 /* |
222 * write XML-attributes | |
223 */ | |
224 writer.writeAttribute(XMLUtil.OBJECT_CLASS, defaultString(rel.getObjectClass())); | |
225 writer.writeAttribute(XMLUtil.ID, defaultString(rel.getId())); | |
226 writer.writeAttribute(XMLUtil.ROW_ID, defaultString(rel.getRowId())); | |
75 | 227 if (StringUtils.isNotEmpty(rel.getContentType())) { |
29 | 228 writer.writeAttribute(XMLUtil.CONTENT_TYPE, rel.getContentType()); |
75 | 229 } |
29 | 230 writer.writeAttribute(XMLUtil.RELATION_SOURCE_ID, defaultString(rel.getSourceId())); |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
231 writer.writeAttribute(XMLUtil.RELATION_SOURCE, defaultString(rel.getSourceObjectClass())); |
29 | 232 writer.writeAttribute(XMLUtil.RELATION_TARGET_ID, defaultString(rel.getTargetId())); |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
233 writer.writeAttribute(XMLUtil.RELATION_TARGET, defaultString(rel.getTargetObjectClass())); |
29 | 234 writer.writeAttribute(XMLUtil.VERSION, defaultString(rel.getVersion())); |
235 writer.writeAttribute(XMLUtil.MODIFICATION_TIME, defaultString(rel.getModificationTime())); | |
75 | 236 if (rel.getUser() != null) { |
29 | 237 writer.writeAttribute(XMLUtil.USER, rel.getUser()); |
75 | 238 } |
239 if (rel.getIsPublic()) { | |
29 | 240 writer.writeAttribute(XMLUtil.PUBLIC, "true"); |
75 | 241 } |
29 | 242 |
243 /* | |
244 * write OpenMind attributes of this relation as XML tags | |
245 */ | |
246 if (rel.getAttributes().size() > 0) { | |
247 writer.writeStartElement(XMLUtil.ATTRIBUTES); | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
248 for (Attribute att : rel.getAttributes()) { |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
249 // update stats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
250 updateAttStats(att, attStats); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
251 // write xml |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
252 writeAttribute(att, writer, includeNorm); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
253 } |
29 | 254 writer.writeEndElement(); |
255 } | |
1 | 256 |
29 | 257 /* |
258 * write own value as content | |
259 */ | |
75 | 260 if (StringUtils.isNotEmpty(rel.getOwnValue())) { |
29 | 261 writer.writeCharacters(rel.getOwnValue()); |
75 | 262 } |
29 | 263 |
264 writer.writeEndElement(); | |
265 } | |
266 | |
267 /** | |
268 * Write OpenMind entity to XML. | |
269 * | |
270 * @param entity | |
271 * @param writer | |
272 * @param ps | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
273 * @param entStats |
29 | 274 * @throws XMLStreamException |
275 */ | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
276 private static void writeEntity(Entity entity, XMLStreamWriter writer, PersistenceService ps, boolean includeNorm, |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
277 Map<String, Map<String, Long>> entStats) |
29 | 278 throws XMLStreamException { |
1 | 279 |
29 | 280 writer.writeStartElement((entity.getType().equals(Node.TYPE_TBOX)) ? XMLUtil.DEFINITION : XMLUtil.ENTITY); |
281 | |
282 if (entity.isLightweight()) { | |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
283 // make sure we have all attributes and relations |
29 | 284 entity = ps.getEntityContent(entity); |
285 } | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
286 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
287 // update stats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
288 Map<String, Long> attStats = updateNodeStats(entity, entStats); |
29 | 289 |
290 /* | |
291 * write XML attributes | |
292 */ | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
293 writer.writeAttribute(XMLUtil.OBJECT_CLASS, defaultString(entity.getObjectClass())); |
29 | 294 writer.writeAttribute(XMLUtil.ID, defaultString(entity.getId())); |
295 writer.writeAttribute(XMLUtil.ROW_ID, defaultString(entity.getRowId())); | |
75 | 296 if (StringUtils.isNotEmpty(entity.getContentType())) { |
29 | 297 writer.writeAttribute(XMLUtil.CONTENT_TYPE, entity.getContentType()); |
75 | 298 } |
29 | 299 writer.writeAttribute(XMLUtil.VERSION, defaultString(entity.getVersion())); |
300 writer.writeAttribute(XMLUtil.MODIFICATION_TIME, defaultString(entity.getModificationTime())); | |
75 | 301 if (entity.getUser() != null) { |
29 | 302 writer.writeAttribute(XMLUtil.USER, entity.getUser()); |
75 | 303 } |
304 if (entity.getIsPublic()) { | |
29 | 305 writer.writeAttribute(XMLUtil.PUBLIC, "true"); |
75 | 306 } |
1 | 307 |
29 | 308 /* |
309 * write OpenMind attributes of this entity as XML tags | |
310 */ | |
311 if (entity.getAttributes().size() > 0) { | |
312 writer.writeStartElement(XMLUtil.ATTRIBUTES); | |
313 for (Attribute att : entity.getAttributes()) { | |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
314 // update stats |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
315 updateAttStats(att, attStats); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
316 // write xml |
78 | 317 writeAttribute(att, writer, includeNorm); |
29 | 318 } |
319 writer.writeEndElement(); | |
320 } | |
321 | |
322 /* | |
323 * write own value | |
324 */ | |
77 | 325 String ov = entity.getOwnValue(); |
326 if (StringUtils.isNotEmpty(ov)) { | |
327 writer.writeCharacters(ov); | |
328 String nov = entity.getNormalizedOwnValue(); | |
329 if (includeNorm && StringUtils.isNotEmpty(nov) && !ov.equals(nov)) { | |
330 // write normalized value | |
331 writer.writeStartElement(XMLUtil.NORMALIZED); | |
332 writer.writeCharacters(nov); | |
333 writer.writeEndElement(); | |
334 } | |
75 | 335 } |
29 | 336 |
337 writer.writeEndElement(); | |
338 } | |
339 | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
340 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
341 private static void writeAttribute(Attribute att, XMLStreamWriter writer, boolean includeNorm) throws XMLStreamException { |
29 | 342 writer.writeStartElement(XMLUtil.ATTRIBUTE); |
343 | |
344 /* | |
345 * write XML attributes | |
346 */ | |
347 writer.writeAttribute(XMLUtil.ATTRIBUTE_NAME, defaultString(att.getName())); | |
348 writer.writeAttribute(XMLUtil.ID, defaultString(att.getId())); | |
349 writer.writeAttribute(XMLUtil.ROW_ID, defaultString(att.getRowId())); | |
350 writer.writeAttribute(XMLUtil.CONTENT_TYPE, defaultString(att.getContentType())); | |
351 writer.writeAttribute(XMLUtil.VERSION, defaultString(att.getVersion())); | |
352 writer.writeAttribute(XMLUtil.MODIFICATION_TIME, defaultString(att.getModificationTime())); | |
75 | 353 if (att.getUser() != null) { |
29 | 354 writer.writeAttribute(XMLUtil.USER, att.getUser()); |
75 | 355 } |
356 if (att.getIsPublic()) { | |
29 | 357 writer.writeAttribute(XMLUtil.PUBLIC, "true"); |
75 | 358 } |
359 | |
29 | 360 /* |
361 * write value as content | |
362 */ | |
77 | 363 String ov = att.getValue(); |
364 if (StringUtils.isNotEmpty(ov)) { | |
365 writer.writeCharacters(ov); | |
366 String nov = att.getNormalizedOwnValue(); | |
367 if (includeNorm && StringUtils.isNotEmpty(nov) && !ov.equals(nov)) { | |
368 // write normalized value | |
369 writer.writeStartElement(XMLUtil.NORMALIZED); | |
370 writer.writeCharacters(nov); | |
371 writer.writeEndElement(); | |
372 } | |
75 | 373 } |
1 | 374 |
29 | 375 writer.writeEndElement(); |
376 } | |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
377 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
378 |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
379 private static void writeStats(String statsTag, String entryTag, Map<String, Map<String, Long>> nodeStats, |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
380 XMLStreamWriter writer) throws XMLStreamException { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
381 // write stats tag |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
382 writer.writeStartElement(statsTag); |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
383 |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
384 for (String nodeType : nodeStats.keySet()) { |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
385 Map<String, Long> attStats = nodeStats.get(nodeType); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
386 Long nodeCnt = attStats.get(ENT_KEY); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
387 // write tag for entity/attribute |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
388 writer.writeStartElement(entryTag); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
389 writer.writeAttribute(XMLUtil.OBJECT_CLASS, (nodeType == null) ? "null" : nodeType); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
390 writer.writeAttribute(XMLUtil.COUNT, nodeCnt.toString()); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
391 |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
392 // write attributes |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
393 for (String attName : attStats.keySet()) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
394 // skip ENT_KEY |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
395 if (attName.equals(ENT_KEY)) |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
396 continue; |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
397 if (attName.contains("[")) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
398 // write relation tag |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
399 writer.writeStartElement(XMLUtil.RELATION); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
400 } else { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
401 // write attribute tag |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
402 writer.writeStartElement(XMLUtil.ATTRIBUTE); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
403 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
404 writer.writeAttribute(XMLUtil.ATTRIBUTE_NAME, attName); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
405 Long attCnt = attStats.get(attName); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
406 writer.writeAttribute(XMLUtil.COUNT, attCnt.toString()); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
407 writer.writeEndElement(); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
408 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
409 // end of entity/attribute tag |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
410 writer.writeEndElement(); |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
411 } |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
412 // end of stats tag |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
413 writer.writeEndElement(); |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
414 } |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
415 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
416 /** |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
417 * @param objectClass |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
418 * @param entStats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
419 * @return |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
420 */ |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
421 protected static Map<String, Long> updateNodeStats(Node ent, Map<String, Map<String, Long>> entStats) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
422 String objectClass = ent.getObjectClass(); |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
423 Map<String, Long> attStats = entStats.get(objectClass); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
424 if (attStats == null) { |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
425 // create new attribute stats entry |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
426 attStats = new HashMap<String, Long>(); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
427 // add key to count entities |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
428 attStats.put(ENT_KEY, 1l); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
429 // add to map |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
430 entStats.put(objectClass, attStats); |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
431 } else { |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
432 // increment entity count |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
433 Long entCnt = attStats.get(ENT_KEY); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
434 attStats.put(ENT_KEY, entCnt + 1); |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
435 } |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
436 return attStats; |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
437 } |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
438 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
439 /** |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
440 * @param att |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
441 * @param attStats |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
442 */ |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
443 protected static void updateAttStats(Attribute att, Map<String, Long> attStats) { |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
444 String attName = att.getName(); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
445 Long cnt = attStats.get(attName); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
446 if (cnt == null) { |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
447 attStats.put(attName, 1l); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
448 } else { |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
449 attStats.put(attName, cnt + 1); |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
450 } |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
451 } |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
452 |
86
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
453 /** |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
454 * Update relation statistics. |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
455 * |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
456 * Relation stats are saved like attribute stats but with "[entity-type]" before |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
457 * or after the relation name. |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
458 * |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
459 * @param rel |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
460 * @param relStats |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
461 */ |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
462 protected static void updateRelStats(Relation rel, boolean isSrcRel, Map<String, Long> relStats) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
463 String relName = rel.getObjectClass(); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
464 if (isSrcRel) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
465 relName = relName + "[" + rel.getTargetObjectClass() + "]"; |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
466 } else { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
467 relName = "[" + rel.getSourceObjectClass() + "]" + relName; |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
468 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
469 Long cnt = relStats.get(relName); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
470 if (cnt == null) { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
471 relStats.put(relName, 1l); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
472 } else { |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
473 relStats.put(relName, cnt + 1); |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
474 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
475 } |
d4b456623d43
Updated XML export. Saves relation source-type and target-type. Expanded statistics with per-entity-type relation counts.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
82
diff
changeset
|
476 |
79
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
477 |
b0aebac0780a
put statistics about number of entities, relations and attributes in xml dump.
casties
parents:
78
diff
changeset
|
478 |
1 | 479 } |