Skip to content

serialization doesn't break out type/value #132

Description

@justin2004
$ cat /tmp/q2.rq 
PREFIX wds: <http://www.wikidata.org/entity/statement/>
select *                 
where {
  # wds:Q23-21309B07-59CA-4703-A191-D8CD4E7B3FBF ?p ?o .
wds:Q183-a03c757b-464a-b91f-f37f-b2207b057a66 ?p ?o .
}

curl -u USER:PASS -X PUT "http://localhost:8080/basil" -H "X-Basil-Endpoint: https://query.wikidata.org/sparql" -T /tmp/q2.rq

$ curl 'http://localhost:8080/basil/qxw322338379/api.json' | jq .       
{                                                                                                                                              
  "vars": [                                                            
    "p",                                                                                                                                       
    "o"                                                                
  ],       
  "items": [             
    {                                                                                                                                          
      "p": "http://wikiba.se/ontology#rank",                                                                                                   
      "o": "http://wikiba.se/ontology#NormalRank"
    },
    {
      "p": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
      "o": "http://wikiba.se/ontology#BestRank"
    },
    {
      "p": "http://www.wikidata.org/prop/statement/P8988",
      "o": "osm&id=276"
    }
  ]
}

while jena (and graphDB, etc.) does this:

$ ~/Downloads/apache-jena-4.10.0/bin/rsparql --results=json --service https://query.wikidata.org/sparql --query /tmp/q2.rq 
{ "head": {
    "vars": [ "p" , "o" ]
  } ,
  "results": {
    "bindings": [
      { 
        "p": { "type": "uri" , "value": "http://wikiba.se/ontology#rank" } ,
        "o": { "type": "uri" , "value": "http://wikiba.se/ontology#NormalRank" }
      } ,
      { 
        "p": { "type": "uri" , "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" } ,
        "o": { "type": "uri" , "value": "http://wikiba.se/ontology#BestRank" }
      } ,
      { 
        "p": { "type": "uri" , "value": "http://www.wikidata.org/prop/statement/P8988" } ,
        "o": { "type": "literal" , "value": "osm&id=276" }
      }
    ]
  }
}

the way basil currently does it it makes it harder to just get the value.
e.g.

{ ... "some_number":"1029^^http://www.w3.org/2001/XMLSchema#integer" ... }

while jena does:

        "some_number" : {
          "datatype" : "http://www.w3.org/2001/XMLSchema#integer",
          "type" : "literal",
          "value" : "1029"
        }

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