-
Hi everyone, I have RDF files in XML format that contain GML snippets like this:
As they come from various sources and in various degrees of well-formedness, I have to preprocess them anyway. However, I struggle with the {MYSTERY} part. I tried different combinations:
My current workaround is explicitly setting the datatype in the code via
As I'm expecting different datatypes here (GeoJSON, WKT), this workaround is possible but tedious, seems inelegant and easily broken. Is there another solution? I'm using Apache Jena 5.1.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @dodinh, Q1. RDF/XML doesn't have a way to say "parse as structured XML and set the datatype to this URI". Q2. The body of the property which has Q3. That's a bug, it should be an error. I've raised an issue for this #2669. In Jena4 it correctly causes a parse error. So the two choices are:
The first means the input file needs changing which is not ideal. The second way is to feed the parser output into a |
Beta Was this translation helpful? Give feedback.
Hi @dodinh,
Q1.
rdf:parseType="Literal"
RDF/XML doesn't have a way to say "parse as structured XML and set the datatype to this URI".
You may also notice the lexical form of the RDF literal produced includes a
xmlns:gml=
declaration.This is part of RDF/XML parsing to produce a valid
rdf:XMLLiteral
. To be valid, it must have must be a standalone XML fragement and have namespace declarations.Q2.
rdf:datatype="http://www.opengis.net/ont/geosparql#gmlLiteral"
The body of the property which has
rdf:datatype
is the lexical form for the literal. It has to be a simple string with any XML characters escaped e.g.<
. Structured XML is not accepted.Q3.
rdf:parseType=
rdf:datatype=
That's a bug,…