jsonresults
A Serializer for SPARQL results in JSON:
http://www.w3.org/TR/rdf-sparql-json-res/
Bits and pieces borrowed from: http://projects.bigasterisk.com/sparqlhttp/
Authors: Drew Perttula, Gunnar Aastrand Grimnes
Classes:
-
JSONResult– -
JSONResultParser–Parses SPARQL JSON results into a Result object.
-
JSONResultSerializer–Serializes SPARQL results to JSON format.
Functions:
-
parseJsonTerm–rdflib object (Literal, URIRef, BNode) for the given json-format dict.
-
termToJSON–
JSONResult
Bases: Result
Attributes:
Source code in rdflib/plugins/sparql/results/jsonresults.py
JSONResultParser
Bases: ResultParser
Parses SPARQL JSON results into a Result object.
Methods:
-
parse–
parse
parse(source: IO, content_type: Optional[str] = None) -> Result
Source code in rdflib/plugins/sparql/results/jsonresults.py
JSONResultSerializer
JSONResultSerializer(result: Result)
Bases: ResultSerializer
Serializes SPARQL results to JSON format.
Methods:
Source code in rdflib/plugins/sparql/results/jsonresults.py
serialize
Source code in rdflib/plugins/sparql/results/jsonresults.py
parseJsonTerm
parseJsonTerm(d: Dict[str, str]) -> Identifier
rdflib object (Literal, URIRef, BNode) for the given json-format dict.
input is like:
{ 'type': 'uri', 'value': 'http://famegame.com/2006/01/username' }
{ 'type': 'literal', 'value': 'drewp' }
Source code in rdflib/plugins/sparql/results/jsonresults.py
termToJSON
termToJSON(self: JSONResultSerializer, term: Optional[Identifier]) -> Optional[Dict[str, str]]