You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/12/21 17:59:56 UTC
[GitHub] [age] MatheusFarias03 opened a new issue, #401: Why does returning the properties of an edge does not work but a vertex does?
MatheusFarias03 opened a new issue, #401:
URL: https://github.com/apache/age/issues/401
I have a graph where the vertices are labeled as "Person" and "Film":
```
v
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"id": 844424930131971, "label": "Person", "properties": {"name": "Sean", "bornIn": "Santa Monica", "surname": "Astin", "occupation": "Actor"}}::vertex
{"id": 844424930131970, "label": "Person", "properties": {"name": "Wil", "bornIn": "Burbank", "surname": "Wheaton", "occupation": "Actor"}}::vertex
{"id": 844424930131969, "label": "Person", "properties": {"name": "Rob", "bornIn": "New York", "surname": "Reiner", "occupation": "Actor"}}::vertex
{"id": 844424930131972, "label": "Person", "properties": {"name": "Billy", "bornIn": "Glasgow", "surname": "Boyd", "occupation": "Actor"}}::vertex
{"id": 1125899906842625, "label": "Film", "properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "releaseDate": "2001-12-10", "runningTimeMin": 178}}::vertex
{"id": 1125899906842626, "label": "Film", "properties": {"title": "The Goonies", "releaseDate": "1985-06-07", "runningTimeMin": 114}}::vertex
{"id": 1125899906842627, "label": "Film", "properties": {"title": "Stand By Me", "releaseDate": "1986-08-22", "runningTimeMin": 89}}::vertex
```
And the edges are as follows: (start_id is related to a vertex labeled as "Person" and the end_id to a "Film")
```
e
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"id": 1688849860263937, "label": "DIRECTED", "end_id": 1125899906842627, "start_id": 844424930131969, "properties": {}}::edge
{"id": 1407374883553281, "label": "ACTED_IN", "end_id": 1125899906842625, "start_id": 844424930131972, "properties": {"actingRole": "Peregrin Pippin Took"}}::edge
{"id": 1407374883553282, "label": "ACTED_IN", "end_id": 1125899906842625, "start_id": 844424930131971, "properties": {"actingRole": "Samwise Gamgee"}}::edge
{"id": 1407374883553283, "label": "ACTED_IN", "end_id": 1125899906842626, "start_id": 844424930131971, "properties": {"actingRole": "Michael Walsh"}}::edge
{"id": 1407374883553284, "label": "ACTED_IN", "end_id": 1125899906842627, "start_id": 844424930131970, "properties": {"actingRole": "Gordie Lachance"}}::edge
```
When I type the following query, all the names of the vertices with label "Person" are shown:
```sql
SELECT * FROM cypher('demo', $$
MATCH (p:Person)-[e]-(f:Film)
RETURN p.name $$) as (name agtype);
```
```
name
---------
"Rob"
"Billy"
"Sean"
"Sean"
"Wil"
(5 rows)
```
But when I do the same thing with an edge, it returns nothing, just blank rows:
```sql
SELECT * FROM cypher('demo', $$
MATCH (p:Person)-[e:ACTED_IN]-(f:Film)
RETURN e.start_id $$) as (start_id agtype);
```
```
start_id
----------
(4 rows)
```
Why does it show only blank spaces and not the respective id?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [age] imranzaheer612 commented on issue #401: Why does returning the properties of an edge does not work but a vertex does?
Posted by GitBox <gi...@apache.org>.
imranzaheer612 commented on issue #401:
URL: https://github.com/apache/age/issues/401#issuecomment-1361940709
You are not returning a property but the `id` of the node. In order to get the `id` for a node use the built in function.
```bash
select * from cypher('demo_graph', $$ MATCH (n:Person)-[e:BORNIN]-(b:Country) RETURN id(e) $$) as (e agtype);
```
```
e
------------------
1407374883553281
1407374883553282
1407374883553283
1407374883553284
1407374883553285
1407374883553286
1407374883553287
(7 rows)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [age] MatheusFarias03 closed issue #401: Why does returning the properties of an edge does not work but a vertex does?
Posted by GitBox <gi...@apache.org>.
MatheusFarias03 closed issue #401: Why does returning the properties of an edge does not work but a vertex does?
URL: https://github.com/apache/age/issues/401
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [age] MatheusFarias03 commented on issue #401: Why does returning the properties of an edge does not work but a vertex does?
Posted by GitBox <gi...@apache.org>.
MatheusFarias03 commented on issue #401:
URL: https://github.com/apache/age/issues/401#issuecomment-1361990055
What if I want a property? In my example I have the "actingRole" inside properties
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org