From: Alex Sadleir Date: Fri, 28 Mar 2014 06:23:39 +0000 Subject: add todo X-Git-Url: http://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=2b0076ed5247f230a823dfd53e50b26851c6fbde --- add todo --- --- a/admin/neo4jimporter/.idea/workspace.xml +++ b/admin/neo4jimporter/.idea/workspace.xml @@ -3,6 +3,7 @@ + @@ -79,10 +80,23 @@ - - + + + + + + + + + + + + + + + @@ -413,7 +427,7 @@ - + @@ -424,7 +438,7 @@ - + @@ -473,6 +487,19 @@ + + + + + + + + + + + + + @@ -491,6 +518,19 @@ + + + + + + + + + + + + + @@ -509,6 +549,19 @@ + + + + + + + + + + + + + @@ -525,11 +578,7 @@ - - - - - + @@ -537,11 +586,7 @@ - - - - - + @@ -555,10 +600,23 @@ - - + + + + + + + + + + + + + + + --- a/admin/neo4jimporter/src/main/java/StAXSample.java +++ b/admin/neo4jimporter/src/main/java/StAXSample.java @@ -92,10 +92,23 @@ processAgencyFunction(r); } else if (hasStartTagName(e, "AGENCY_STATUS")) { processAgencyStatus(r); + /* TODO + Unhandled tag: AGENCY_NOTE content: + +Unhandled tag: NOTE_AGENCY_NO content:CA 4886 +Unhandled tag: NOTE_TYPE content:Archivists note +Unhandled tag: NOTE content:null +Unhandled tag: head content: + +Unexpected character 'C' (code 67) in start tag Expected a quote + at [row,col,system-id]: [1093387,18,"agency-sample.xml"] + */ } else if (hasStartTagName(e, "AGENCY_NO")) { previousAgency.put("agency_no", getCharacters(r)); } else if (hasStartTagName(e, "TITLE")) { - previousAgency.put("name", getCharacters(r)); + String title = getCharacters(r); + previousAgency.put("name", title); + previousAgency.put("label", title); } else if (hasStartTagName(e, "START_DATE")) { previousAgency.put("start_date", getCharacters(r)); } else if (hasStartTagName(e, "START_DATE_QUAL")) { @@ -139,6 +152,9 @@ agencyFullVersion.put(properties.get("agency_no").toString(), true); } agencyIDs.put(properties.get("agency_no").toString(), agencyID); + //if (agencyID % 10 == 0) { + System.out.println("Agency #"+agencyID); + //} return agencyID; } else { long agencyID = agencyIDs.get(properties.get("agency_no").toString()); @@ -154,6 +170,7 @@ if (locationIDs.get(locationName) == null) { HashMap properties = new HashMap< String,Object > (); properties.put("name", locationName); + properties.put("label", locationName); long locationID = inserter.createNode(properties, locationLabel); locationIDs.put(locationName, locationID); return locationID; @@ -165,6 +182,7 @@ if (functionIDs.get(functionName) == null) { HashMap properties = new HashMap< String,Object > (); properties.put("name", functionName); + properties.put("label", functionName); long functionID = inserter.createNode(properties, functionLabel); functionIDs.put(functionName, functionID); return functionID; @@ -176,6 +194,7 @@ if (statusIDs.get(statusName) == null) { HashMap properties = new HashMap< String,Object > (); properties.put("name", statusName); + properties.put("label", statusName); long statusID = inserter.createNode(properties, statusLabel); statusIDs.put(statusName, statusID); return statusID; @@ -215,7 +234,7 @@ if (e.isEndElement()) { if (hasEndTagName(e, "AGENCY_LINK")) { - //System.out.println("Finished processing link: Name = " + name + "; of = " + of + "; date = " + date); + //System.out.println("Finished processing link: type = " + link_type+ "; from = " + agency_from_no + "; to = " + agency_to_no); long agencyFromID, agencyToID; Map agencyFromProperties = new HashMap(); agencyFromProperties.put("agency_no",agency_from_no); @@ -262,7 +281,7 @@ } if (e.isEndElement()) { if (hasEndTagName(e, "AGENCY_LOCATION")) { - System.out.println("Finished processing location: Name = " + name + "; of = " + of + "; date = " + date); + //System.out.println("Finished processing location: Name = " + name + "; of = " + of + "; date = " + date); long locationID, agencyID; locationID = getLocation(name); Map agencyProperties = new HashMap(); @@ -297,7 +316,7 @@ } if (e.isEndElement()) { if (hasEndTagName(e, "AGENCY_STATUS")) { - System.out.println("Finished processing status: Status = " + status + "; of = " + of + "; date = " + date); + //System.out.println("Finished processing status: Status = " + status + "; of = " + of + "; date = " + date); long statusID, agencyID; statusID = getStatus(status); Map agencyProperties = new HashMap(); @@ -395,3 +414,4 @@ } +