# Documentation for JSON / binary query result format extensions for edge properties

**URL:** https://community.stardog.com/t/documentation-for-json-binary-query-result-format-extensions-for-edge-properties/2622
**Category:** Support
**Created:** [July 31, 2020, 1:05am UTC](https://community.stardog.com/t/documentation-for-json-binary-query-result-format-extensions-for-edge-properties/2622 "2020-07-31T01:05:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ABrokenJester](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/abrokenjester/32/764_2.png) [@ABrokenJester](https://community.stardog.com/u/ABrokenJester)
#### Post date: [July 31, 2020, 1:05am UTC](https://community.stardog.com/t/documentation-for-json-binary-query-result-format-extensions-for-edge-properties/2622/1 "2020-07-31T01:05:09Z")

</div>

Hi there,

In the Stardog documentation it is mentioned that Stardog supports SELECT query results involving edge properties:

> SPARQL SELECT query results with edge properties can be sent over in the XML, binary, and JSON format (content types `application/sparql-results+xml` , `application/x-binary-rdf-results-table` , and `application/sparql-results+json` , respectively).

Is there any documentation available or do you have any examples of how you extended these syntax formats to deal with edge property bindings?

---

<div class="post-metadata">

### Author: ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)
#### Post date: [July 31, 2020, 7:19pm UTC](https://community.stardog.com/t/documentation-for-json-binary-query-result-format-extensions-for-edge-properties/2622/2 "2020-07-31T19:19:15Z")

</div>

Hi Jeen,

We don't have documentation about these details but let me briefly describe them here with some examples.

For XML and JSON, we introduced an additional `statement` value type with required `s`, `p`, `o` fields and an optional `g` field. Binding a variable `x` to a statement would look like this in JSON:

```auto
{
        "p": {
          "type": "uri",
          "value": "http://api.stardog.com/date"
        },
        "s": {
          "type": "statement",
          "s": {
            "type": "uri",
            "value": "http://api.stardog.com/Alice"
          },
          "p": {
            "type": "uri",
            "value": "http://api.stardog.com/knows"
          },
          "o": {
            "type": "uri",
            "value": "http://api.stardog.com/Bob"
          }
        },

```

and like this in XML:

```auto
<binding name='x'>
    <statement>
        <s>
            <uri>http://api.stardog.com/Alice</uri>
        </s>
        <p>
            <uri>http://api.stardog.com/knows</uri>
        </p>
        <o>
            <uri>http://api.stardog.com/Bob</uri>
        </o>
    </statement>
</binding>

```

For the binary results, there is an additional `STATEMENT_RECORD_MARKER = 10` to indicate the RDF value is a statement. SPO components are serialized without any markers between them followed by either a `DEFAULT_GRAPH_RECORD_MARKER = 1` or `NAMED_GRAPH_RECORD_MARKER = 2`(latter is followed by an RDF resource).

Best,  
Evren

---

<div class="post-metadata">

### Author: ![ABrokenJester](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/abrokenjester/32/764_2.png) [@ABrokenJester](https://community.stardog.com/u/ABrokenJester)
#### Post date: [August 1, 2020, 1:09am UTC](https://community.stardog.com/t/documentation-for-json-binary-query-result-format-extensions-for-edge-properties/2622/4 "2020-08-01T01:09:36Z")

</div>

Thanks so much Evren, exactly what I needed!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)
#### Post date: [August 15, 2020, 1:09am UTC](https://community.stardog.com/t/documentation-for-json-binary-query-result-format-extensions-for-edge-properties/2622/5 "2020-08-15T01:09:36Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
