Skip to content

Commit

Permalink
removing jena non-compliant attribute during harvesting
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimnielandt authored and fxprunayre committed Nov 25, 2024
1 parent 97bdd7b commit 7ba4d47
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.apache.jena.riot.Lang;
import org.apache.jena.riot.RDFDataMgr;
import org.fao.geonet.Constants;
import org.fao.geonet.constants.Geonet;
import org.fao.geonet.domain.ISODate;
import org.fao.geonet.domain.Pair;
import org.fao.geonet.utils.Log;
Expand Down Expand Up @@ -81,6 +82,9 @@ public static HashMap<String, Element> getAllUuids(String feedUrl) throws Except
public static HashMap<String, Element> getAllUuids(Element feed) throws Exception {
Element rdfDocument = checkForMissingRdfAbout(feed);

// if xsi:schemaLocation is present on the rdf:RDF element Jena fails to parse the Element.
rdfDocument.removeAttribute("schemaLocation", Geonet.Namespaces.XSI);

Model model = ModelFactory.createMemModelMaker().createDefaultModel();
RDFDataMgr.read(model,
IOUtils.toInputStream(Xml.getString(rdfDocument), StandardCharsets.UTF_8),
Expand Down

0 comments on commit 7ba4d47

Please sign in to comment.