Skip to content

Commit b5330e7

Browse files
committed
Improve JSON examples formatting
1 parent 15b48da commit b5330e7

File tree

1 file changed

+85
-119
lines changed

1 file changed

+85
-119
lines changed

spec/index.html

Lines changed: 85 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -462,15 +462,15 @@

"bindings"

462462
<p>A variable does not appear in an array element if it is not bound in that particular query solution.p>
463463
<p>The order of elements in the bindings array reflects the order, if any, of the query solution sequence.p>
464464
<pre class="json">"bindings" : [
465-
{
466-
"a" : { ... } ,
467-
"b" : { ... }
468-
} ,
469-
{
470-
"a" : { ... } ,
471-
"b" : { ... }
472-
}
473-
]pre>
465+
{
466+
"a" : { ... } ,
467+
"b" : { ... }
468+
} ,
469+
{
470+
"a" : { ... } ,
471+
"b" : { ... }
472+
}
473+
]pre>
474474
<p>If the query returns no solutions, an empty array is used.p>
475475
<pre class="json">"bindings" : []pre>
476476
section>
@@ -538,121 +538,87 @@

Examples

538538
<section id="example-bindings">
539539
<h2>Variable Binding Results Examplesh2>
540540
<p>The following JSON is a serialization of the XML document <a class="reference" href="https://www.w3.org/2009/sparql/xml-results/output.srx">output.srxa>:p>
541-
<pre class="json">{
542-
"head": {
543-
"link": [
544-
"http://www.w3.org/TR/rdf-sparql-XMLres/example.rq"
545-
],
546-
"vars": [
547-
"x",
548-
"hpage",
549-
"name",
550-
"mbox",
551-
"age",
552-
"blurb",
553-
"friend"
554-
]
555-
},
556-
"results": {
557-
"bindings": [
558-
{
559-
"x" : { "type": "bnode", "value": "r1" },
560-
561-
"hpage" : { "type": "uri", "value": "http://work.example.org/alice/" },
562-
563-
"name" : { "type": "literal", "value": "Alice" } ,
564-
565-
"mbox" : { "type": "literal", "value": "" } ,
566-
567-
"blurb" : {
568-
"datatype": "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",
569-
"type": "literal",
570-
"value": "<p xmlns=\"http://www.w3.org/1999/xhtml\">My name is <b>alice</b></p>"
571-
},
572-
573-
"friend" : { "type": "bnode", "value": "r2" }
574-
},
575-
{
576-
"x" : { "type": "bnode", "value": "r2" },
577-
578-
"hpage" : { "type": "uri", "value": "http://work.example.org/bob/" },
579-
580-
"name" : { "type": "literal", "value": "Bob", "xml:lang": "en" },
581-
582-
"mbox" : { "type": "uri", "value": "mailto:[email protected]" },
583-
584-
"friend" : { "type": "bnode", "value": "r1" }
585-
}
586-
]
587-
}
588-
}pre>
541+
<pre class="json">
542+
543+
{
544+
"head": {
545+
"link": [ "http://www.w3.org/TR/rdf-sparql-XMLres/example.rq" ],
546+
"vars": [
547+
"x",
548+
"hpage",
549+
"name",
550+
"mbox",
551+
"age",
552+
"blurb",
553+
"friend"
554+
]
555+
},
556+
"results": {
557+
"bindings": [
558+
{
559+
"x": { "type": "bnode", "value": "r1" },
560+
"hpage": { "type": "uri", "value": "http://work.example.org/alice/" },
561+
"name": { "type": "literal", "value": "Alice" },
562+
"mbox": { "type": "literal", "value": "" },
563+
"blurb": {
564+
"datatype": "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",
565+
"type": "literal",
566+
"value": "<p xmlns=\"http://www.w3.org/1999/xhtml\">My name is <b>alice</b></p>"
567+
},
568+
"friend": { "type": "bnode", "value": "r2" }
569+
},
570+
{
571+
"x": { "type": "bnode", "value": "r2" },
572+
"hpage": { "type": "uri", "value": "http://work.example.org/bob/" },
573+
"name": { "type": "literal", "value": "Bob", "xml:lang": "en" },
574+
"mbox": { "type": "uri", "value": "mailto:[email protected]" },
575+
"friend": { "type": "bnode", "value": "r1" }
576+
}
577+
]
578+
}
579+
}
580+
pre>
589581
section>
590582
<section id="example-bindings-quoted">
591583
<h2>Variable Binding Results Examples with Quoted Triplesh2>
592584
<p>The following JSON is a serialization of the XML document <a class="reference" href="https://www.w3.org/2009/sparql/xml-results/output-quoted.srx">output-quoted.srxa> that contains quoted triples:p>
593585
<pre class="json">{
594-
"head": {
595-
"link": [
596-
"http://www.w3.org/TR/rdf-sparql-XMLres/example-quoted.rq"
597-
],
598-
"vars": [
599-
"x",
600-
"name",
601-
"quoted"
602-
]
603-
},
604-
"results": {
605-
"bindings": [
606-
{
607-
"x" : { "type": "bnode", "value": "r1" },
608-
609-
"name" : { "type": "literal", "value": "Alice" } ,
610-
611-
"quoted" : {
612-
"type": "triple",
613-
"value": {
614-
"subject": {
615-
"type": "uri",
616-
"value": "http://example.org/alice"
617-
},
618-
"predicate": {
619-
"type": "uri",
620-
"value": "http://example.org/name"
621-
},
622-
"object": {
623-
"type": "literal",
624-
"value": "Alice",
625-
"datatype": "http://www.w3.org/2001/XMLSchema#string"
626-
}
627-
}
628-
}
629-
},
630-
{
631-
"x" : { "type": "bnode", "value": "r2" },
632-
633-
"name" : { "type": "literal", "value": "Bob", "xml:lang": "en" },
634-
635-
"quoted" : {
636-
"type": "triple",
637-
"value": {
638-
"subject": {
639-
"type": "uri",
640-
"value": "http://example.org/bob"
641-
},
642-
"predicate": {
643-
"type": "uri",
644-
"value": "http://example.org/name"
645-
},
646-
"object": {
647-
"type": "literal",
648-
"value": "Bob",
649-
"datatype": "http://www.w3.org/2001/XMLSchema#string"
650-
}
651-
}
652-
}
653-
}
654-
]
655-
}
586+
"head": {
587+
"link": [ "http://www.w3.org/TR/rdf-sparql-XMLres/example-quoted.rq" ],
588+
"vars": [
589+
"x",
590+
"name",
591+
"quoted"
592+
]
593+
},
594+
"results": {
595+
"bindings": [
596+
{
597+
"x": { "type": "bnode", "value": "r1" },
598+
"name": { "type": "literal", "value": "Alice" },
599+
"quoted": {
600+
"type": "triple",
601+
"value": {
602+
"subject": { "type": "uri", "value": "http://example.org/alice" },
603+
"predicate": { "type": "uri", "value": "http://example.org/name" },
604+
"object": { "type": "literal", "value": "Alice", "datatype": "http://www.w3.org/2001/XMLSchema#string" }
605+
}
606+
}
607+
},
608+
{
609+
"x": { "type": "bnode", "value": "r2" },
610+
"name": { "type": "literal", "value": "Bob", "xml:lang": "en" },
611+
"quoted": {
612+
"type": "triple",
613+
"value": {
614+
"subject": { "type": "uri", "value": "http://example.org/bob" },
615+
"predicate": { "type": "uri", "value": "http://example.org/name" },
616+
"object": { "type": "literal", "value": "Bob", "datatype": "http://www.w3.org/2001/XMLSchema#string" }
617+
}
618+
}
619+
}
620+
]
621+
}
656622
}pre>
657623
section>
658624
section>

0 commit comments

Comments
 (0)