Skip to content

serialization doesn't break out type/value #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
justin2004 opened this issue Jan 3, 2024 · 0 comments
Open

serialization doesn't break out type/value #132

justin2004 opened this issue Jan 3, 2024 · 0 comments

Comments

@justin2004
Copy link

justin2004 commented Jan 3, 2024

$ 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"
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant