# Edge property example error

**URL:** https://community.stardog.com/t/edge-property-example-error/2561
**Category:** Support
**Created:** [July 3, 2020, 4:59pm UTC](https://community.stardog.com/t/edge-property-example-error/2561 "2020-07-03T16:59:11Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)
#### Post date: [July 3, 2020, 4:59pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/1 "2020-07-03T16:59:11Z")

</div>

I am looking at this blog post [Property Graphs meet Stardog | Stardog](https://www.stardog.com/blog/property-graphs-meet-stardog/)  
and would like to write these triples to a database:

```auto
:Alice :worksFor {:role :CEO ;  
                  :since 2010 ;
                  :probability 0.8 ;
                  :source <http://example.com/news>} :ACME ;
       :birthDate {:probability 0.2} "1972-01-01"^^xsd:date ;
       :nationality {:source <http://example.org/Alice>} :USA . 

```

However I am getting this error when executing:

```auto
QE0PE2: com.complexible.stardog.plan.eval.ExecutionException: Encountered " <PNAME_LN> ":Alice "" at line 1, column 1.
Was expecting one of:
    <EOF> 
    ";" ...
    <HINT> ...

```

any idea?

---

<div class="post-metadata">

### Author: ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)
#### Post date: [July 3, 2020, 5:15pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/2 "2020-07-03T17:15:55Z")

</div>

Never mind - I have created a new database with `edge.properties=true - and adding the above ttl worked.

Two more questions:

1. When I go to visualize Alice node I see worksFor edge but no edge properties can be displayed. Do you plan to add this?
2. When I "Run to File" the visualization and export it to JSON-LD I don't get any edge properties.
3. Do you plan to make edge properties exportable and importable to and from JSON-LD?

Here is the exported JSON-LD - and no edge properties:

```auto
[ {
  "@id" : "http://api.stardog.com/Alice",
  "http://api.stardog.com/birthDate" : [ {
    "@type" : "http://www.w3.org/2001/XMLSchema#date",
    "@value" : "1972-01-01"
  } ],
  "http://api.stardog.com/nationality" : [ {
    "@id" : "http://api.stardog.com/USA"
  } ],
  "http://api.stardog.com/worksFor" : [ {
    "@id" : "http://api.stardog.com/ACME"
  } ]
} ]

```

---

<div class="post-metadata">

### Author: ![pavel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pavel/32/18_2.png) [@pavel](https://community.stardog.com/u/pavel)
#### Post date: [July 3, 2020, 5:40pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/3 "2020-07-03T17:40:51Z")

</div>

Hi Radu,

Our JSON-LD parsers and serialisers already support edge properties. That's easy to verify by running something like

```auto
construct { << :Alice ?p ?o >> ?ep ?epv } {
  << :Alice ?p ?o >> ?ep ?epv
}

```

you'll see the returned edge properties (eg. in Studio, which uses JSON-LD exclusively at this time). And you'll even see the edge properties in the viz, if you visualise that. You'd need to additionally toggle "Literals as nodes" in the Options menu in the bottom right corner.

What you observe isn't a JSON-LD, viz, or even Studio limitation, it's simply that `DESCRIBE` queries (used explicitly or implicitly) don't yet return edge properties. And yes, there's a ticket to resolve that (also, Stardog allows users add custom DESCRIBE strategies: [stardog-examples/examples/describe at develop · stardog-union/stardog-examples · GitHub](https://github.com/stardog-union/stardog-examples/tree/develop/examples/describe)).

Best,  
Pavel

---

<div class="post-metadata">

### Author: ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)
#### Post date: [July 3, 2020, 7:42pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/4 "2020-07-03T19:42:49Z")

</div>

Pavel - thank you for your response.

I can see edge properties visualization in Studio.

And I was able to export the following JSON-LD:

```auto
[ {
  "@id" : {
    "@id" : "http://api.stardog.com/Alice",
    "http://api.stardog.com/birthDate" : {
      "@value" : "1972-01-01",
      "@type" : "http://www.w3.org/2001/XMLSchema#date"
    }
  },
  "http://api.stardog.com/probability" : [ {
    "@type" : "http://www.w3.org/2001/XMLSchema#decimal",
    "@value" : "0.2"
  } ]
}, {
  "@id" : {
    "@id" : "http://api.stardog.com/Alice",
    "http://api.stardog.com/nationality" : {
      "@id" : "http://api.stardog.com/USA"
    }
  },
  "http://api.stardog.com/source" : [ {
    "@id" : "http://example.org/Alice"
  } ]
}, {
  "@id" : {
    "@id" : "http://api.stardog.com/Alice",
    "http://api.stardog.com/worksFor" : {
      "@id" : "http://api.stardog.com/ACME"
    }
  },
  "http://api.stardog.com/probability" : [ {
    "@type" : "http://www.w3.org/2001/XMLSchema#decimal",
    "@value" : "0.8"
  } ],
  "http://api.stardog.com/role" : [ {
    "@id" : "http://api.stardog.com/CEO"
  } ],
  "http://api.stardog.com/since" : [ {
    "@type" : "http://www.w3.org/2001/XMLSchema#integer",
    "@value" : "2010"
  } ],
  "http://api.stardog.com/source" : [ {
    "@id" : "http://example.com/news"
  } ]
} ]

```

However when I try to import the json LD via HTTP POST api call I get the following error:

```auto
400 {"message":"Could not parse JSONLD: invalid @id value: value of @id must be a string","code":"QEIVR2"} b'{"message":"Could not parse JSONLD: invalid @id value: value of @id must be a string","code":"QEIVR2"}'
400

```

---

<div class="post-metadata">

### Author: ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)
#### Post date: [July 7, 2020, 4:06pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/5 "2020-07-07T16:06:24Z")

</div>

@pavel thanks for trying to help over this long weekend.

What I really need is an example of JSON-LD that can imported demonstrating how to add edge properties.

- Can you please provide such an example?

Thanks,  
Radu

---

<div class="post-metadata">

### Author: ![pavel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pavel/32/18_2.png) [@pavel](https://community.stardog.com/u/pavel)
#### Post date: [July 8, 2020, 12:04pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/6 "2020-07-08T12:04:54Z")

</div>

Radu,

My apologies for the delay on this. Indeed I confirm that the JSON-LD parser has issues with edge properties at the moment. I created an issue # 9301 for this and we intend to look into it ASAP.

Thanks for bringing this up,  
Pavel

---

<div class="post-metadata">

### Author: ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)
#### Post date: [July 8, 2020, 12:26pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/7 "2020-07-08T12:26:29Z")

</div>

Thank you @pavel - looking forward to the fix

---

<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: [July 22, 2020, 12:26pm UTC](https://community.stardog.com/t/edge-property-example-error/2561/8 "2020-07-22T12:26:33Z")

</div>

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