IBM GraphDB: Create a Vertex with LIST Cardinality
Date: 2016-08-05 |
**PROBLEM: **I’m using IBM’s Graph DB on Blue Mix, but I’ve been running into some issues. I’ve created a vertex called tags
that has LIST
cardinality, meaning it should be able to hold multiple values (including duplicates). However, when I try to POST a vertex with multiple values, I keep getting the error:
{"code":"BadRequestError","message":"property 'tags' with meta properties need to have a 'val'"}
What gives? How do I get my vertex with LIST to hold multiple values?
**Solution: **This solution applies to vertices of cardinality LIST and SET. Essentially, the error is occurring because [currently], GraphDB doesn’t support mapping lists to LIST properties using the API.
So, using the API you should:
- Create a vertex, without the LIST property
- Update the vertex with a value under the LIST property - Iterate until you have posted all of the values that are associated with the LIST property
GIST
[[https://gist.github.com/SIRHAMY/316faa9bd51d9b2d34cedf65ffb57f44](https://gist.github.com/SIRHAMY/316faa9bd51d9b2d34cedf65ffb57f44)]Sources:
Want more like this?
The best / easiest way to support my work is by subscribing for future updates and sharing with your network.