jimjonesbr / lod4wfs

Server application for publishing Geographic Linked Open Datasets via Web Feature Services.
MIT License
13 stars 7 forks source link

All non-geo values are interpreted as strings #22

Closed mgskjaeveland closed 8 years ago

mgskjaeveland commented 8 years ago

All non-geo values in the SPARQL query are treated by QGIS as string. Is there a way to copy the datatype from the SPARQL result set to the feature set?

Have tried the following in AdapterLOD4WFS, however I don't know the correct encoding of the datatype in the XML format.

Element elementAttribute = document.createElement(layerPrefix + ":" + predicateWithoutPrefix);

RDFNode solnNode = soln.get("?"+predicateWithoutPrefix);

  if (solnNode.isLiteral()) {
    Literal solnLiteral = solnNode.asLiteral();
    elementAttribute.setAttribute("type", solnLiteral.getDatatypeURI());
    elementAttribute.appendChild(document.createCDATASection(solnLiteral.getLexicalForm()));
  } else {
       elementAttribute.appendChild(document.createCDATASection(solnNode.toString()));
  }
currentGeometryElement.appendChild(elementAttribute);
jimjonesbr commented 8 years ago

Bug solved in the DescribeFeatureType request. Data types are now stored in the .sparql files when the feature is created via the Web Interface.

Set to closed.