Revision 49580
Added by Sandro La Bruzzo over 6 years ago
PMFResolverParser.java | ||
---|---|---|
29 | 29 |
final VTDNav vn = vg.getNav(); |
30 | 30 |
final AutoPilot ap = new AutoPilot(vn); |
31 | 31 |
|
32 |
ap.declareXPathNameSpace("dri", "http://www.driver-repository.eu/namespace/dri"); |
|
33 | 32 |
|
34 |
final String resolvedDate = VtdUtilityParser.getSingleValue(ap, vn, "//dri:resolvedDate"); |
|
33 |
|
|
34 |
final String resolvedDate = VtdUtilityParser.getSingleValue(ap, vn, "//*[local-name()='resolvedDate']"); |
|
35 | 35 |
parsedObject.setResolvedDate(resolvedDate); |
36 | 36 |
|
37 |
ap.declareXPathNameSpace("oaf", "http://namespace.dnet.eu/oaf"); |
|
38 |
final List<Node> pid = VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//oaf:pid", Arrays.asList("type")); |
|
39 | 37 |
|
38 |
final List<Node> pid = VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//*[local-name()='pid']", Arrays.asList("type")); |
|
39 |
|
|
40 | 40 |
if (extractIdentifier(parsedObject, pid)) return null; |
41 | 41 |
|
42 | 42 |
List<Node> collectedFromNodes = |
43 |
VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//oaf:collectedFrom", Arrays.asList("name", "id", "mode", "completionStatus"));
|
|
43 |
VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//*[local-name()='collectedFrom']", Arrays.asList("name", "id", "mode", "completionStatus"));
|
|
44 | 44 |
|
45 | 45 |
final List<ObjectProvenance> provenances = new ArrayList<>(); |
46 | 46 |
|
... | ... | |
56 | 56 |
} |
57 | 57 |
|
58 | 58 |
parsedObject.setDatasourceProvenance(provenances); |
59 |
parsedObject.setCompletionStatus(VtdUtilityParser.getSingleValue(ap, vn, "//oaf:completionStatus"));
|
|
59 |
parsedObject.setCompletionStatus(VtdUtilityParser.getSingleValue(ap, vn, "//*[local-name()='completionStatus']"));
|
|
60 | 60 |
|
61 | 61 |
List<Node> relatedIdentifiers = |
62 |
VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//oaf:relatedIdentifier",
|
|
62 |
VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//*[local-name()='relatedIdentifier']",
|
|
63 | 63 |
Arrays.asList("relatedIdentifierType", "relationType", "entityType", "inverseRelationType")); |
64 | 64 |
|
65 | 65 |
if (relatedIdentifiers != null && relatedIdentifiers.size() > 0) { |
... | ... | |
93 | 93 |
parsedObject.setRelations(relations); |
94 | 94 |
} |
95 | 95 |
|
96 |
ap.declareXPathNameSpace("dc", "http://purl.org/dc/elements/1.1/"); |
|
97 |
final List<String> authorsNode = VtdUtilityParser.getTextValue(ap, vn, "//dc:creator");
|
|
96 |
|
|
97 |
final List<String> authorsNode = VtdUtilityParser.getTextValue(ap, vn, "//*[local-name()='creator']");
|
|
98 | 98 |
parsedObject.setAuthors(authorsNode); |
99 |
parsedObject.setTitles(VtdUtilityParser.getTextValue(ap, vn, "//dc:title"));
|
|
99 |
parsedObject.setTitles(VtdUtilityParser.getTextValue(ap, vn, "//*[local-name()='title']"));
|
|
100 | 100 |
|
101 |
parsedObject.setDescription(VtdUtilityParser.getSingleValue(ap, vn, "//dc:description"));
|
|
102 |
parsedObject.setDate(VtdUtilityParser.getSingleValue(ap, vn, "//dc:date"));
|
|
103 |
List<Node> subjects = VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//dc:subject", Arrays.asList("scheme"));
|
|
101 |
parsedObject.setDescription(VtdUtilityParser.getSingleValue(ap, vn, "//*[local-name()='description']"));
|
|
102 |
parsedObject.setDate(VtdUtilityParser.getSingleValue(ap, vn, "//*[local-name()='date']"));
|
|
103 |
List<Node> subjects = VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//*[local-name()='subject']", Arrays.asList("scheme"));
|
|
104 | 104 |
extractSubject(parsedObject, subjects); |
105 | 105 |
|
106 | 106 |
|
107 |
setType(parsedObject, VtdUtilityParser.getSingleValue(ap, vn, "//dc:type"));
|
|
107 |
setType(parsedObject, VtdUtilityParser.getSingleValue(ap, vn, "//*[local-name()='type']"));
|
|
108 | 108 |
|
109 | 109 |
return parsedObject; |
110 | 110 |
} catch (Throwable e) { |
Also available in: Unified diff
Changed Crossref to use dump on mongoDB