[dna-issues] [JBoss JIRA] Commented: (DNA-378) XML Graph Importer should support importing multi-valued properties
Brian Carothers (JIRA)
jira-events at lists.jboss.org
Sat Apr 25 07:31:46 EDT 2009
[ https://jira.jboss.org/jira/browse/DNA-378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12464488#action_12464488 ]
Brian Carothers commented on DNA-378:
-------------------------------------
It's the same limitation that JCR importing imposes.
You did hit on the key reason - there doesn't seem to be a way to add a property to an existing node through the Graph API. One can never create a node until one reaches the corresponding end tag. In the pathological case, that means that you're basically building a DOM tree in memory before you commit anything to the graph. It's not debilitating, but it is suboptimal.
I'm happy to proceed any of the 3 ways (only accept properties before child nodes, build the graph in memory prior to committing it, wait for -379 and 0.5). Please just let me know what you prefer.
Thanks!
> XML Graph Importer should support importing multi-valued properties
> --------------------------------------------------------------------
>
> Key: DNA-378
> URL: https://jira.jboss.org/jira/browse/DNA-378
> Project: DNA
> Issue Type: Feature Request
> Components: API, Graph
> Reporter: Randall Hauch
> Fix For: 0.4
>
>
> The XML handler used in the Graph importer (that is, org.jboss.dna.graph.xml.XmlHandler) does not currently support producing multi-valued properties. This is a fairly substantial limitation.
> The current XML handler simply maps an XML element to a graph node and an XML attribute to a property. There is no such thing as multi-valued XML attributes, so another mapping has to be used for multi-valued properties. Since a graph node does not directly hold any values (rather, it holds properties that have the values), and the XML handler currently ignores all XML character content (e.g., <element>this is character content</element>), it is fairly logical to conclude that a child XML element with character content should be mapped to a property. If there is a "jcr:name" attribute, then this attribute's value would be used to determine the property name (meaning the element's name could be anything); otherwise, the child element's name would be the property name.
> This would also address the shortcoming of XML attribute values not being able to (easily) have any character content, since such property values could be placed in a child element.
> Here's an example:
> <cars>
> <car jcr:name="Mini">
> <jcr:description>This is a description that would be stored as a property on the 'Mini' node</jcr:description>
> <property jcr:name="summary">This is the value of the 'summary' property on the 'Mini' node</property>
> </car>
> </cars>
> I'm not sure how easy it is to change the XmlHandler to behave this way, since under certain situations it may require postponing the creation of a node since it is unknown when processing a "startElement" method that the element has character content. However, I believe that it is worth any additional complexity to make the XML more intuitive and natural.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list