Skip to content

Datatype fields in SPARQL results are only allowed in typed-literals and not in literals. #23

@bnouwt

Description

@bnouwt

Hi, in the JSON SPARQL results below (that were received from the SPARQL endpoint), the datatype are only allowed to occur in entries where "type": "typed-literal" (see JSON SPARQL result spec).

Apart from issue #22, this issue is about there not being any typed-literal entries. So, the solution could be to always (and only) return JSON with typed-literal instead of literal when a datatype field is present.

{
  "head": {
    "vars": [
      "s",
      "p",
      "o"
    ]
  },
  "results": {
    "bindings": [
      {
        "p": {
          "type": "uri",
          "value": "http://example.org/mainPersonsInvolved",
          "datatype": null
        },
        "o": {
          "type": "uri",
          "value": "https://tno.nl/Neil_Armstrong",
          "datatype": null
        }
      },
      {
        "p": {
          "type": "uri",
          "value": "http://example.org/hasOccurredAt",
          "datatype": null
        },
        "o": {
          "type": "literal",
          "value": "1969-07-20T20:05:00+00:00",
          "datatype": "http://www.w3.org/2001/XMLSchema#dateTime"
        }
      },
      {
        "p": {
          "type": "uri",
          "value": "http://example.org/hasNumberOfPeople",
          "datatype": null
        },
        "o": {
          "type": "literal",
          "value": "500",
          "datatype": "http://www.w3.org/2001/XMLSchema#integer"
        }
      }
    ]
  }
}
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions