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 2021/12/02 09:45:53 UTC

[GitHub] [incubator-age] afidegnum opened a new issue #151: Can you add support for other field types for vertexes?

afidegnum opened a new issue #151:
URL: https://github.com/apache/incubator-age/issues/151


   this didn't work out for me 
   
   `CREATE (n:Person {name: 'top_node', attrib: {myclass: 'id'}})`
   
   neither a list of attributes. `CREATE (n:Person {name: 'Joe', attrib: [{myclass: '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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-age] pdpotter commented on issue #151: Can you add support for other field types for vertexes?

Posted by GitBox <gi...@apache.org>.
pdpotter commented on issue #151:
URL: https://github.com/apache/incubator-age/issues/151#issuecomment-984475898


   Can you explain in more detail what doesn't work out for you? I do get expected results with your queries:
   
   ```
   SELECT * FROM ag_catalog.cypher('test_graph', $$CREATE (n:Person {name: 'top_node', attrib: {myclass: 'id'}}) return n$$) as (n agtype);
   
                                                             n                                                          
   ---------------------------------------------------------------------------------------------------------------------
    {"id": 844424930131970, "label": "Person", "properties": {"name": "top_node", "attrib": {"myclass": "id"}}}::vertex
   (1 row)
   ```
   
   ```
   SELECT * FROM ag_catalog.cypher('test_graph', $$CREATE (n:person {name: 'Joe', attrib: [{myclass: 'id'}]}) return n$$) as (n agtype);
                                                           n                                                         
   ------------------------------------------------------------------------------------------------------------------
    {"id": 844424930131971, "label": "person", "properties": {"name": "Joe", "attrib": [{"myclass": "id"}]}}::vertex
   (1 row)
   ```
   
   ```
   SELECT * FROM ag_catalog.cypher('test_graph', $$MATCH (n:person) return n.name, n.attrib$$) as (name agtype, attrib agtype);
       name    |       attrib        
   ------------+---------------------
    "top_node" | {"myclass": "id"}
    "Joe"      | [{"myclass": "id"}]
   (2 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] [incubator-age] afidegnum edited a comment on issue #151: Can you add support for other field types for vertexes?

Posted by GitBox <gi...@apache.org>.
afidegnum edited a comment on issue #151:
URL: https://github.com/apache/incubator-age/issues/151#issuecomment-984501702


   ```
   def node_tree(parentid , element):
       if parentid:
          x = {key:value for (key,value) in element.attrib.items()}
          print(x)
       for child in element.iterchildren():
            node_tree(element, child)
   
   x = dom_tree.getroot()
   node_tree(None, x)
   ```
   returns 
   ```
   {}
   {'charset': 'UTF-8'}
   {}
   {}
   {'class': 'menu'}
   {'class': 'itm'}
   {'class': 'itm'}
   {'class': 'itm'}
   {}
   {'id': 'idone', 'class': 'classone'}
   {}
   {'class': 'listing'}
   {'class': 'item1'}
   {'class': 'item2'}
   {'class': 'item3'}
   {'id': 'innerone'}
   {}
   {'id': 'innertwo'}
   {}
   {'id': 'second', 'class': 'below'}
   {'class': 'inner'}
   {}
   {}
   {}
   ```
   however i have a syntax error 
   
   ```
   
   SqlExcutionError: ("Excution ERR[can't adapt type 'dict'](SELECT * from cypher('text_test', $$ CREATE (t:node {tag: %s, %s} ) RETURN id(t) $$) as (v agtype);)", ProgrammingError("can't adapt type 'dict'"))
   
   
                                                                ^
   ```
   I'm using https://github.com/rhizome-ai/apache-age-python


-- 
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] [incubator-age] afidegnum commented on issue #151: Can you add support for other field types for vertexes?

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #151:
URL: https://github.com/apache/incubator-age/issues/151#issuecomment-984501702


   ```
   def node_tree(parentid , element):
       if parentid:
          x = {key:value for (key,value) in element.attrib.items()}
          print(x)
       for child in element.iterchildren():
            node_tree(element, child)
   
   x = dom_tree.getroot()
   node_tree(None, x)
   ```
   returns 
   ```
   {}
   {'charset': 'UTF-8'}
   {}
   {}
   {'class': 'menu'}
   {'class': 'itm'}
   {'class': 'itm'}
   {'class': 'itm'}
   {}
   {'id': 'idone', 'class': 'classone'}
   {}
   {'class': 'listing'}
   {'class': 'item1'}
   {'class': 'item2'}
   {'class': 'item3'}
   {'id': 'innerone'}
   {}
   {'id': 'innertwo'}
   {}
   {'id': 'second', 'class': 'below'}
   {'class': 'inner'}
   {}
   {}
   {}
   ```
   however i have a syntax error 
   
   ```
   SyntaxError: syntax error at or near "'lang: en'"
   LINE 1: ...pher('text_test', $$ CREATE (t:node {tag: 'html', 'lang: en'...
                                                                ^
   ```
   I'm using https://github.com/rhizome-ai/apache-age-python


-- 
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] [incubator-age] joefagan commented on issue #151: Can you add support for other field types for vertexes?

Posted by GitBox <gi...@apache.org>.
joefagan commented on issue #151:
URL: https://github.com/apache/incubator-age/issues/151#issuecomment-986829184


   @afidegnum 
   It would be great if you submit self-contained code snippets to see your problem.
   Creating code from scratch, to try to replicate what you might be doing is time consuming and we may be missing your issues as we have seen a couple of times. IE we didn't catch what the problem with your code is.


-- 
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] [incubator-age] pdpotter commented on issue #151: Can you add support for other field types for vertexes?

Posted by GitBox <gi...@apache.org>.
pdpotter commented on issue #151:
URL: https://github.com/apache/incubator-age/issues/151#issuecomment-984512682


   It's difficult to analyze your issue without a complete minimal reproducible example, but I think your issue might be more related to https://github.com/rhizome-ai/apache-age-python than to this repository.
   
   Please provide the complete code of an example (as minimal as possible) to reproduce your issue.


-- 
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