[dna-issues] [JBoss JIRA] Created: (DNA-378) XML Graph Importer should support importing multi-valued properties

Randall Hauch (JIRA) jira-events at lists.jboss.org
Thu Apr 23 11:17:41 EDT 2009


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